/* =============================================================================
 * forms.css — Azimzadeh light Forms surface (WH-CI-001 paper-faithful)
 * -----------------------------------------------------------------------------
 * Merges Ali's paper-sheet design with the live iPad components:
 *   app top-nav (switch forms + lang + logout) · Tom Select search ·
 *   signature pads · camera capture · carpet repeater · validation.
 * Brand tokens come from brand.css. Physical left/right are written as LOGICAL
 * properties so the SAME sheet renders correctly in BOTH FA (RTL) and EN (LTR).
 * ===========================================================================*/

*{ box-sizing:border-box; }

/* root-level guard against sub-pixel horizontal scroll (body overflow doesn't
   propagate to the viewport; the root element does) */
html{ overflow-x:hidden; }

/* ---- App shell --------------------------------------------------------- */
.form-body{
  margin:0;
  background:var(--brand-bg);
  color:var(--brand-ink);
  font-family:var(--brand-font);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  display:flex;
  flex-direction:column;
  min-height:100vh;
  min-height:100dvh;   /* the phone's visible height, not the one behind its toolbars */
}
/* THE BODY CLIPS, IT DOES NOT HIDE (2026-09-30). It said `overflow-x:hidden`, and with the same on
   <html> the body's overflow no longer passes to the viewport — so `hidden` made BODY the scroll
   container. One that never scrolls: the window does. Every `position:sticky` inside it therefore
   stuck to a box that never moved, which is why the Save / Complete bar (forms_v2.css .fv-actions)
   sat at the end of a phone-length form and never at the bottom of the screen — on the iPad too.
   Measured: at 390x844 scrolled to 1200, the bar was at y=3517.
   `clip` cuts the same sideways sliver and makes no scroll container (Safari 16+, Chrome 90+).
   An older browser skips this rule and keeps the <html> guard above — which is the viewport's own
   `hidden`, so nothing scrolls sideways there either; only the extra body-level clip is missing. */
@supports (overflow-x:clip){
  .form-body{ overflow-x:clip; }
}

/* Top nav — the reception iPad chrome: switch forms, language, sign out. */
.form-header{ background:var(--brand-surface); border-block-end:1px solid var(--brand-border); box-shadow:var(--brand-shadow); }
.form-header__inner{
  max-width:880px; margin-inline:auto; padding:var(--space-3) var(--space-4);
  display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); flex-wrap:wrap;
}
.form-brand{ display:inline-flex; align-items:center; text-decoration:none; }
.form-brand__logo{ height:34px; width:auto; display:block; }

.form-nav{ display:flex; align-items:center; gap:var(--space-2); flex-wrap:wrap; }
/* 44px: the smallest finger target iOS and Android both ask for (it was 40). */
.form-nav__link{
  display:inline-flex; align-items:center; min-height:44px; padding-inline:var(--space-4);
  border-radius:999px; border:1px solid transparent; font-weight:600; color:var(--brand-muted); text-decoration:none;
}
.form-nav__link:hover{ color:var(--brand-primary); }
.form-nav__link.is-active{ color:var(--brand-primary); background:var(--brand-primary-050); border-color:var(--brand-border); }
.form-nav__link:focus-visible{ outline:none; box-shadow:0 0 0 3px var(--brand-focus); }

.form-header__actions{ display:inline-flex; align-items:center; gap:var(--space-2); }
.lang-toggle{
  appearance:none; border:1px solid var(--brand-border); background:var(--brand-surface); color:var(--brand-ink);
  font:inherit; font-weight:600; min-height:44px; padding-inline:var(--space-4); border-radius:999px; cursor:pointer;
}
.lang-toggle:hover{ border-color:var(--brand-primary); color:var(--brand-primary); }
.lang-toggle:focus-visible{ outline:none; box-shadow:0 0 0 3px var(--brand-focus); }
.form-logout{ color:var(--brand-danger); }
.form-logout:hover{ border-color:var(--brand-danger); color:var(--brand-danger); }
@media (max-width:560px){ .form-nav{ order:3; flex-basis:100%; justify-content:center; } }

.form-main{ flex:1 0 auto; width:100%; padding:var(--space-5) var(--space-4); }
.form-footer{ text-align:center; padding:var(--space-3) var(--space-4); color:var(--brand-muted); font-size:12px; }

/* =============================================================================
 * THE SHEET — Ali's paper-faithful WH-CI-001 design
 * ===========================================================================*/
.sheet{
  width:820px; max-width:100%; margin:0 auto;
  background:var(--brand-surface);
  border:1px solid #d9cdbb; border-radius:16px;
  box-shadow:var(--brand-shadow);
  padding:26px 30px 18px; position:relative;
}
.sheet::before{
  content:""; position:absolute; inset:6px;
  border:1px solid #efe7da; border-radius:11px; pointer-events:none;
}

/* ---- Header ---- */
.head{ display:flex; align-items:center; gap:16px; }
.head .badge-col{ display:flex; flex-direction:column; align-items:center; gap:10px; flex:none; }
.code-badge{
  background:var(--brand-primary); color:#fff;
  font-family:var(--font-en-body); font-weight:700; font-size:15px; letter-spacing:.06em;
  padding:6px 14px; border-radius:7px;
}
.head-mark{ width:62px; height:62px; border-radius:50%; background:var(--brand-primary-050); display:grid; place-items:center; color:var(--brand-primary); }
.head-mark svg{ width:34px; height:34px; }

.head .titles{ flex:1; text-align:center; }
.head .titles h1{ margin:0; font-family:var(--brand-font-display); font-weight:700; font-size:30px; color:var(--brand-primary); line-height:1.2; }
.head .titles .sub{ margin-block-start:4px; font-size:16px; color:var(--brand-muted); font-weight:500; }

/* Typeset logo — always LTR English. */
.logo{ flex:none; text-align:end; direction:ltr; padding-block-start:2px; }
.logo .name{ font-family:var(--font-en-display); font-weight:700; font-size:34px; color:var(--brand-primary); line-height:.9; letter-spacing:.01em; }
.logo .name .drop{ font-size:40px; line-height:0; }
.logo .tagline{ font-family:var(--font-en-body); font-weight:600; font-size:14px; letter-spacing:.22em; color:#2a2a2a; margin-block-start:6px; }
.logo .since{ display:flex; align-items:center; gap:8px; margin-block-start:7px; font-family:var(--font-en-body); font-size:10px; font-weight:600; letter-spacing:.18em; color:var(--brand-muted); }
.logo .since::before, .logo .since::after{ content:""; height:1px; flex:1; background:#cbbfae; }

/* ---- Ornamental divider ---- */
.divider{ display:flex; align-items:center; gap:10px; margin:16px 4px 18px; }
.divider .line{ flex:1; height:2px; border-radius:2px; background:linear-gradient(90deg,transparent,var(--brand-accent) 14%,var(--brand-accent) 86%,transparent); }
.divider .gem{ width:9px; height:9px; transform:rotate(45deg); background:var(--brand-accent); flex:none; }
.divider .gem-c{ width:18px; height:18px; transform:rotate(45deg); border:2px solid var(--brand-primary); display:grid; place-items:center; flex:none; }
.divider .gem-c::after{ content:""; width:7px; height:7px; background:var(--brand-accent); }

/* ---- Pledge banner ---- */
.banner{ display:flex; align-items:center; gap:16px; background:var(--brand-primary-050); border:1px solid #ecdcd8; border-radius:12px; padding:14px 18px; margin-block-end:18px; }
.banner .ico{ flex:none; color:var(--brand-primary); width:42px; height:42px; display:grid; place-items:center; }
.banner .ico svg{ width:36px; height:36px; }
.banner p{ margin:0; font-size:15.5px; color:#3a2422; font-weight:500; text-align:start; }

/* ---- Section primitives ---- */
.row2{ display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-block-end:16px; }
.box{ border:1px solid var(--brand-border); border-radius:12px; padding:14px 16px 16px; background:#fff; }
.box--mb{ margin-block-end:16px; }
.sec-head{ display:flex; align-items:center; gap:10px; margin-block-end:12px; }
.sec-head .ico{ flex:none; width:34px; height:34px; border-radius:50%; border:1.5px solid var(--brand-accent); background:#fff; color:var(--brand-primary); display:grid; place-items:center; }
.sec-head .ico svg{ width:18px; height:18px; }
.sec-head h2{ flex:1; margin:0; text-align:start; font-size:18px; font-weight:700; color:var(--brand-primary); }

/* ---- Underline fields ---- */
.field{ display:flex; align-items:flex-end; gap:8px; margin-block-end:14px; }
.field:last-child{ margin-block-end:2px; }
.field .lbl{ flex:none; font-size:14px; color:#2a2a2a; font-weight:500; white-space:nowrap; }
.field .lbl .req{ color:var(--brand-danger); margin-inline-start:2px; }
.field .colon{ flex:none; color:#2a2a2a; }
.field .uline{
  flex:1; min-width:0;
  border:none; border-block-end:1px solid #2b2b2b; background:transparent;
  height:26px; font-family:inherit; font-size:15px; color:var(--brand-ink);
  text-align:start; padding:0 2px;
}
.field .uline:focus{ outline:none; border-block-end-color:var(--brand-primary); }
.field.has-error .uline{ border-block-end-color:var(--brand-danger); }
.field__hint{ flex-basis:100%; color:var(--brand-muted); font-size:12px; margin-block-start:2px; }
.lookup-row{ display:block; }
.lookup-status{ font-size:13px; min-height:18px; }
.lookup-status--found{ color:var(--brand-success); }
.lookup-status--new{ color:var(--brand-primary); }
.lookup-status--busy{ color:var(--brand-muted); }

/* a Tom Select that fills its field row (nationality) */
.field > .ts-wrapper{ flex:1 1 auto; min-width:0; }

/* phone: compact country picker (shows "+971") + national number, inline */
.phone-group{ flex:1 1 auto; display:flex; gap:8px; align-items:flex-end; min-width:0; }
.phone-group > .phone-country,
.phone-group > .ts-wrapper{ flex:0 0 auto; width:104px; min-width:0; }
.phone-group > [data-phone-input]{ flex:1 1 auto; min-width:0; }

/* name row: compact Title dropdown + the (autocompleting) name field, inline */
.name-group{ flex:1 1 auto; display:flex; gap:8px; align-items:flex-end; min-width:0; }
.name-group > .title-select{ flex:0 0 auto; width:74px; }
.name-group > [data-customer-search],
.name-group > .ts-wrapper{ flex:1 1 auto; min-width:0; }
.title-select{
  border:none; border-block-end:1px solid #2b2b2b; background:transparent;
  height:26px; font-family:inherit; font-size:15px; color:var(--brand-ink); padding:0 2px;
}
.title-select:focus{ outline:none; border-block-end-color:var(--brand-primary); }
/* customer-autocomplete option: "Title Name" over the phone. Forced LTR + start-
   aligned because the name/phone are Latin — keeps it clean inside the RTL sheet
   and lets it wrap instead of clipping. */
.ts-dropdown .ac-opt{ direction:ltr; text-align:start; white-space:normal; }
.ts-dropdown .ac-name{ color:var(--brand-ink); }
.ts-dropdown .ac-title{ color:var(--brand-primary); font-weight:600; }
.ts-dropdown .ac-phone{ color:var(--brand-muted); font-size:12.5px; margin-block-start:1px; }
/* In RTL the popup must anchor to the field's RIGHT edge (Tom Select defaults to
   left:0, so a min-width'd dropdown spills out the wrong side). */
html[dir="rtl"] .ts-dropdown{ left:auto; right:0; }

/* ---- Carpet table (repeater renders <tr class="carpet-item"> rows) ---- */
.tbl-wrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:10px; border:1px solid var(--brand-border); }
table.carpet{ width:100%; min-width:560px; border-collapse:collapse; font-size:14px; table-layout:fixed; }
table.carpet .col-desc{ width:auto; }
table.carpet th{
  background:var(--brand-primary-050); color:var(--brand-primary); font-weight:700; font-size:13px;
  padding:9px 8px; border-block-end:1px solid #e6d6d2; border-inline-start:1px solid #efe1de;
  vertical-align:middle; line-height:1.3;
}
table.carpet th:first-child{ border-inline-start:none; }
table.carpet td{ padding:0; border-block-end:1px dashed #e7c9c4; border-inline-start:1px solid #f0e7df; vertical-align:middle; }
table.carpet tr:last-child td{ border-block-end:none; }
table.carpet td:first-child{ border-inline-start:none; }
table.carpet .col-idx{ width:46px; text-align:center; color:var(--brand-primary); font-weight:700; }
table.carpet .col-cnt{ width:64px; }
table.carpet .col-val{ width:104px; }
table.carpet .col-clr{ width:84px; }
table.carpet .col-dim{ width:84px; }
table.carpet .col-act{ width:38px; }
table.carpet input{ width:100%; height:34px; border:none; background:transparent; font-family:inherit; font-size:14px; text-align:center; color:var(--brand-ink); padding:0 6px; }
table.carpet input:focus{ outline:none; background:var(--brand-primary-050); }
/* description auto-wraps + auto-grows (field-sizing where supported) */
table.carpet td textarea{ width:100%; min-height:34px; border:none; background:transparent; font-family:inherit; font-size:14px; color:var(--brand-ink); text-align:start; padding:7px 8px; resize:none; line-height:1.45; field-sizing:content; }
table.carpet td textarea:focus{ outline:none; background:var(--brand-primary-050); }
.row-remove{
  appearance:none; border:none; background:transparent; color:var(--brand-danger);
  font-size:18px; line-height:1; width:34px; height:34px; cursor:pointer; border-radius:6px;
}
.row-remove:hover{ background:#fbeeec; }
.carpet-item:only-child .row-remove{ visibility:hidden; }

/* ---- Checkbox grids ---- */
.chk-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px 18px; }
.chk{ display:flex; align-items:center; gap:8px; font-size:14px; color:#2a2a2a; cursor:pointer; min-height:26px; }
.chk .txt{ flex:1; text-align:start; }
.chk input[type=checkbox],
.chk input[type=radio]{
  appearance:none; -webkit-appearance:none; flex:none; width:18px; height:18px; margin:0;
  border:1.5px solid #b9b0a4; background:#fff; cursor:pointer; position:relative;
}
.chk input[type=checkbox]{ border-radius:4px; }
.chk input[type=radio]{ border-radius:50%; }
.chk input:checked{ background:var(--brand-primary); border-color:var(--brand-primary); }
.chk input[type=checkbox]:checked::after{ content:""; position:absolute; inset-inline-start:5px; inset-block-start:1px; width:5px; height:10px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
.chk input[type=radio]:checked::after{ content:""; position:absolute; inset-inline-start:4px; inset-block-start:4px; width:6px; height:6px; border-radius:50%; background:#fff; }
.chk:focus-within input{ box-shadow:0 0 0 3px var(--brand-focus); }
.chk.span2{ grid-column:1 / -1; }
.chk-other{ display:flex; align-items:flex-end; gap:6px; }
.chk-other .uline{ flex:1; min-width:0; border:none; border-block-end:1px solid #2b2b2b; background:transparent; height:24px; font:inherit; font-size:14px; color:var(--brand-ink); text-align:start; padding:0 2px; }
.chk-other .uline:focus{ outline:none; border-block-end-color:var(--brand-primary); }

/* ---- Section 6 — condition notes ---- */
.notes{ display:flex; flex-direction:column; gap:10px; padding-block-start:4px; }
.notes .dline{ border:none; border-block-end:1.5px dotted #b9b0a4; background:transparent; min-height:48px; width:100%; font-family:inherit; font-size:15px; color:var(--brand-ink); text-align:start; resize:vertical; padding:4px 2px; line-height:1.6; }
.notes .dline:focus{ outline:none; border-block-end-color:var(--brand-primary); }

/* ---- Section 7 — photos ---- */
.images-head{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.images-head .opts{ display:flex; align-items:center; gap:28px; }
.photos{ display:flex; flex-direction:column; gap:var(--space-3); margin-block-start:12px; }
.photo-add{ align-self:flex-start; }
.photo-input{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.photo-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:var(--space-3); }
.photo{ position:relative; aspect-ratio:1 / 1; border:1px solid var(--brand-border); border-radius:var(--brand-radius-sm); overflow:hidden; background:var(--brand-bg); }
.photo__img{ width:100%; height:100%; object-fit:cover; display:block; }
/* A 44px TARGET WITH A 28px LOOK (2026-09-30). A 28px × in the corner of a 90px tile is how the
   wrong photo gets removed on a phone. The button is the full 44px square in the corner; the dark
   disc is only painted, 28px across its centre, so the tile looks as it did. */
.photo__remove{ position:absolute; inset-block-start:0; inset-inline-end:0; inline-size:44px; block-size:44px; border:none; border-radius:999px; background:radial-gradient(circle, rgba(0,0,0,.55) 13.5px, transparent 14.5px); color:#fff; font-size:16px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.photo__status{ position:absolute; inset-block-end:0; inset-inline:0; font-size:11px; text-align:center; padding:2px; background:rgba(0,0,0,.5); color:#fff; }
.photo--uploading .photo__img{ opacity:.5; }
.photo--error{ border-color:var(--brand-danger); }
.photos-empty{ color:var(--brand-muted); font-size:14px; padding:var(--space-3); text-align:center; border:1px dashed var(--brand-border); border-radius:var(--brand-radius-sm); }

/* ---- Section 8 — confirmation + signatures ---- */
.confirm-text{ margin:0 0 16px; font-size:15px; color:#3a2422; font-weight:500; text-align:start; line-height:1.7; }
.sign-grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.sign-box{ border:1px solid var(--brand-border); border-radius:12px; padding:14px 16px 10px; }
.sign-box .sign-title{ text-align:center; font-weight:700; color:var(--brand-primary); font-size:15px; margin-block-end:14px; }
.sign-box .field{ margin-block-end:14px; }

/* signature pad (canvas) sits where the "امضاء" line was */
.sigpad{ display:flex; flex-direction:column; gap:6px; margin-block-end:12px; }
.sigpad__label{ font-size:14px; color:#2a2a2a; font-weight:500; }
.sigpad__label .req{ color:var(--brand-danger); margin-inline-start:2px; }
.sigpad__frame{ position:relative; border:1.5px dashed var(--brand-border); border-radius:var(--brand-radius-sm); background:#fff; touch-action:none; }
.sigpad__frame.is-signed{ border-style:solid; border-color:var(--brand-primary); }
/* taller pad → comfortable finger/stylus signing on iPad (signature_pad.resize()
   in the constructor + on window-resize refits the backing store to this box). */
.sigpad__canvas{ display:block; width:100%; height:175px; border-radius:var(--brand-radius-sm); }
.sigpad__hint{ position:absolute; inset-block-start:50%; inset-inline-start:50%; transform:translate(-50%,-50%); color:var(--brand-muted); pointer-events:none; font-size:13px; }
html[dir="rtl"] .sigpad__hint{ transform:translate(50%,-50%); }
.sigpad__frame.is-signed .sigpad__hint,
.sigpad__frame.has-ink .sigpad__hint{ display:none; }
.sigpad__bar{ display:flex; justify-content:flex-end; }

/* ---- Footer ---- */
.foot{ margin-block-start:18px; }
.foot .foot-divider{ display:flex; align-items:center; gap:12px; margin-block-end:10px; }
.foot .foot-divider .line{ flex:1; height:0; border-block-start:2px dashed #d8c6a8; border-radius:2px; }
.foot .foot-divider .dot{ width:7px; height:7px; transform:rotate(45deg); background:var(--brand-accent); flex:none; }
.foot .hand{ width:46px; height:46px; border-radius:50%; background:var(--brand-primary); display:grid; place-items:center; color:#fff; flex:none; }
.foot .hand svg{ width:26px; height:26px; }
.foot .thanks{ text-align:center; }
.foot .thanks .t1{ font-size:14px; color:var(--brand-accent); font-weight:600; margin-block-end:2px; }
.foot .thanks .t2{ font-size:18px; color:var(--brand-primary); font-weight:700; }

/* =============================================================================
 * Buttons / alerts / utilities
 * ===========================================================================*/
.btn{ appearance:none; display:inline-flex; align-items:center; justify-content:center; gap:var(--space-2); min-height:var(--control-min-h); padding-inline:var(--space-5); font:inherit; font-weight:700; border-radius:var(--brand-radius-sm); border:1px solid transparent; cursor:pointer; text-decoration:none; line-height:1; }
.btn:focus-visible{ outline:none; box-shadow:0 0 0 3px var(--brand-focus); }
.btn:disabled{ opacity:.55; cursor:not-allowed; }
.btn--primary{ background:var(--brand-primary); color:#fff; }
.btn--primary:hover:not(:disabled){ background:var(--brand-primary-600); }
.btn--ghost{ background:var(--brand-surface); color:var(--brand-ink); border-color:var(--brand-border); }
.btn--ghost:hover:not(:disabled){ border-color:var(--brand-primary); color:var(--brand-primary); }
.btn--sm{ min-height:38px; padding-inline:var(--space-3); font-size:14px; }
.btn--lg{ min-height:56px; font-size:18px; }
.btn-row{ display:flex; gap:var(--space-3); flex-wrap:wrap; margin-block-start:var(--space-4); }
.btn-row--end{ justify-content:flex-end; }

.alert{ padding:var(--space-3) var(--space-4); border-radius:var(--brand-radius-sm); border:1px solid var(--brand-border); margin-block-end:var(--space-4); font-size:15px; }
.alert--error{ color:var(--brand-danger); border-color:var(--brand-danger); background:#fbeeec; }
.alert--success{ color:var(--brand-success); border-color:var(--brand-success); background:#eaf4ea; }

.u-mt-2{ margin-block-start:var(--space-2); }
.u-mt-4{ margin-block-start:var(--space-4); }
[hidden]{ display:none !important; }

/* =============================================================================
 * Success page
 * ===========================================================================*/
.success{ text-align:center; max-width:480px; margin-inline:auto; padding-block:var(--space-6); }
.success__icon{ inline-size:72px; block-size:72px; margin-inline:auto; border-radius:999px; background:#eaf4ea; color:var(--brand-success); display:flex; align-items:center; justify-content:center; font-size:36px; margin-block-end:var(--space-4); }
.success__title{ font-size:22px; font-weight:700; margin:0 0 var(--space-2); font-family:var(--brand-font-display); color:var(--brand-primary); }
.success__ref{ font-size:20px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--brand-primary); background:var(--brand-primary-050); display:inline-block; padding:var(--space-2) var(--space-4); border-radius:var(--brand-radius-sm); margin-block:var(--space-3); }
.success__actions{ display:flex; flex-direction:column; gap:var(--space-3); margin-block-start:var(--space-5); }

/* =============================================================================
 * Tom Select — styled as an UNDERLINE control to match the paper fields.
 * The dropdown still renders in <body> (dropdownParent) so it floats above
 * the sheet/cards instead of being clipped.
 * ===========================================================================*/
.ts-wrapper{ width:100%; }
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control{
  min-height:26px; padding:0 18px 2px 2px;
  font-size:15px; color:var(--brand-ink);
  background:transparent; border:none; border-block-end:1px solid #2b2b2b; border-radius:0; box-shadow:none;
  overflow:hidden;  /* clip Tom Select's off-screen search input (no page-wide horizontal scroll) */
}
.ts-wrapper.single .ts-control > .item{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
/* Tom Select parks the RESTING single-select input at `left:-10000px` (its
   `.input-hidden` state). With our `.ts-control{overflow:hidden}` that clips
   cleanly in LTR, but in RTL the overflow container scrolls to that far-left
   content and drags the SELECTED ITEM off-screen (the "+971" country code
   rendered blank in Persian). Hide it in place instead — 1px + transparent —
   so the item stays visible both directions. Scoped to `.input-hidden`, so the
   active/typing state (where the input must be full-width) is untouched. */
.ts-wrapper.input-hidden .ts-control > input{ left:auto; right:auto; width:1px; min-width:0; padding:0; }
.ts-wrapper.focus .ts-control{ box-shadow:none; border-block-end-color:var(--brand-primary); }
.ts-wrapper.disabled .ts-control{ color:var(--brand-muted); }
.ts-control, .ts-control input, .ts-control .item{ color:var(--brand-ink); font-size:15px; }
.ts-control input::placeholder{ color:var(--brand-muted); opacity:1; }
.field.has-error .ts-control{ border-block-end-color:var(--brand-danger); }
/* caret recolour + RTL flip */
.ts-wrapper.single .ts-control:after{ border-color:var(--brand-muted) transparent transparent; }
html[dir="rtl"] .ts-wrapper.single .ts-control{ padding:0 2px 2px 18px; }
html[dir="rtl"] .ts-wrapper.single .ts-control:after{ right:auto; left:2px; }

.ts-dropdown{ border:1px solid var(--brand-border); border-radius:var(--brand-radius-sm); box-shadow:var(--brand-shadow); background:var(--brand-surface); color:var(--brand-ink); margin-block-start:4px; z-index:1000; min-width:240px; max-width:92vw; }
.ts-dropdown .option{ padding:10px var(--space-3); font-size:15px; text-align:start; white-space:nowrap; }
.ts-dropdown .option[data-value=""]{ display:none; }
.ts-dropdown .active{ background:var(--brand-primary-050); color:var(--brand-primary); }
.ts-dropdown .create, .ts-dropdown .no-results{ padding:10px var(--space-3); color:var(--brand-muted); }
.ts-dropdown .create strong{ color:var(--brand-primary); }

/* =============================================================================
 * Light add-ons (Flatpickr date picker · char counter)
 * ===========================================================================*/
/* live character counter (charcount.js) */
.char-count{ font-size:12px; color:var(--brand-muted); text-align:end; margin-block-start:4px; }
.char-count--full{ color:var(--brand-danger); }

/* a faint divider between the country picker and the national number */
.phone-group > .phone-country,
.phone-group > .ts-wrapper{ border-inline-end:1px solid var(--brand-border); padding-inline-end:6px; }

/* Flatpickr — brand-matched calendar (the input itself stays a .uline) */
.flatpickr-calendar{ font-family:var(--brand-font); border-radius:var(--brand-radius-sm); box-shadow:var(--brand-shadow); border:1px solid var(--brand-border); }
.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after{ border-block-end-color:var(--brand-surface); }
.flatpickr-months .flatpickr-month, .flatpickr-current-month input.cur-year, .flatpickr-monthDropdown-months{ color:var(--brand-primary); font-weight:700; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month{ color:var(--brand-primary); fill:var(--brand-primary); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg{ fill:var(--brand-primary-600); }
span.flatpickr-weekday{ color:var(--brand-muted); font-weight:700; }
.flatpickr-day{ color:var(--brand-ink); border-radius:8px; }
.flatpickr-day:hover, .flatpickr-day:focus{ background:var(--brand-primary-050); border-color:var(--brand-primary-050); }
.flatpickr-day.today{ border-color:var(--brand-accent); }
.flatpickr-day.today:hover{ background:var(--brand-accent); color:#fff; border-color:var(--brand-accent); }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus{ background:var(--brand-primary); border-color:var(--brand-primary); color:#fff; }
.flatpickr-day.flatpickr-disabled{ color:var(--brand-border); }

/* =============================================================================
 * PDF / print-ready static variant  (forms/intake_pdf.html → WeasyPrint)
 * -----------------------------------------------------------------------------
 * A filled, read-only WH-CI-001 that REUSES every .sheet/.box/.field/.chk/
 * .carpet/.sigpad rule above, so the PDF is visually identical to the live
 * intake form. Only difference: interactive controls (inputs, Tom Select,
 * Flatpickr, signature canvas) are swapped for their static rendering below.
 * Scoped to .pdf-render so it also previews correctly on screen; WeasyPrint
 * additionally applies the @media print block that follows.
 * ===========================================================================*/
.pdf-render{ background:#fff; }
.pdf-render.form-body{ min-height:0; display:block; }   /* no full-viewport stretch */
.pdf-render .form-main{ padding:0; }
.pdf-render .sheet{ box-shadow:none; }

/* static underline value — mirrors `.field .uline` but as read-only text */
.uline--static{
  flex:1; min-width:0; display:block;
  border:none; border-block-end:1px solid #2b2b2b; background:transparent;
  min-height:26px; line-height:24px; padding:0 2px;
  font-family:inherit; font-size:15px; color:var(--brand-ink); text-align:start;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* static check / radio glyphs — reproduce the form's custom-styled inputs
   WITHOUT a real <input> (WeasyPrint doesn't render pseudo-elements on the
   replaced <input> element, so a checked box would render empty). These spans
   match `.chk input[type=checkbox]` + `:checked::after` exactly. */
.cbox,.rbox{
  flex:none; display:inline-block; inline-size:18px; block-size:18px; margin:0;
  border:1.5px solid #b9b0a4; background:#fff; position:relative; vertical-align:middle;
}
.cbox{ border-radius:4px; }
.rbox{ border-radius:50%; }
.cbox.on,.rbox.on{ background:var(--brand-primary); border-color:var(--brand-primary); }
.cbox.on::after{ content:""; position:absolute; inset-inline-start:5px; inset-block-start:1px;
  inline-size:5px; block-size:10px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
.rbox.on::after{ content:""; position:absolute; inset-inline-start:4px; inset-block-start:4px;
  inline-size:6px; block-size:6px; border-radius:50%; background:#fff; }
.chk--static{ cursor:default; }

/* static carpet cells hold text (no inputs) — match the input padding/size */
table.carpet.carpet--static td{ padding:8px; font-size:14px; text-align:center; color:var(--brand-ink); }
table.carpet.carpet--static td.col-desc{ text-align:start; white-space:pre-wrap; }
table.carpet.carpet--static td.col-idx{ color:var(--brand-primary); font-weight:700; }
table.carpet.carpet--static td.empty{ text-align:center; color:var(--brand-muted); padding:12px; }

/* static condition-notes block (div, not textarea) */
.dline--static{ display:block; white-space:pre-wrap; }

/* static signature — the captured signature image sits where the canvas was */
.sigpad--static .sigpad__frame{ min-block-size:110px; display:flex; align-items:center; justify-content:center; padding:6px; }
.sigpad__img{ display:block; max-inline-size:100%; max-block-size:100px; }

/* -----------------------------------------------------------------------------
 * PDF LAYOUT HARDENING — WeasyPrint's CSS Grid + nested Flexbox are incomplete,
 * so the multi-item checkbox lists / photos / Yes-No radios collapse & OVERLAP in
 * the generated PDF. Re-lay them with inline-block (renders identically in
 * Chromium + WeasyPrint) + add page-break rules so sections don't split. Scoped
 * to .pdf-render so the live form is untouched.
 * ---------------------------------------------------------------------------*/
/* keep whole sections together across page breaks */
.pdf-render .box, .pdf-render .banner, .pdf-render .sign-box{ break-inside:avoid; }
.pdf-render table.carpet thead{ display:table-header-group; }   /* repeat header if it spills */
.pdf-render table.carpet tr{ break-inside:avoid; }

/* §3/§4 + §7 sign boxes → TABLE so the two side-by-side cards are EQUAL HEIGHT
   (inline-block can't equalise). border-spacing gives the gap between the cards;
   the widened table + negative margin pull the OUTER edges back in line with the
   full-width boxes above/below (so every card's left/right edges match). */
.pdf-render .row2{ display:table; table-layout:fixed; border-collapse:separate;
  border-spacing:18px 0; width:calc(100% + 36px); margin-inline:-18px; break-inside:avoid; }
/* sign-grid is nested INSIDE the §7 card, so it just fills that card (no negative
   margin, else it overflows the card's right edge) with a gap between the cells. */
.pdf-render .sign-grid{ display:table; table-layout:fixed; border-collapse:separate;
  border-spacing:14px 0; width:100%; break-inside:avoid; }
.pdf-render .row2 > .box, .pdf-render .sign-grid > .sign-box{ display:table-cell; width:50%;
  vertical-align:top; box-sizing:border-box; font-size:15px; }

/* §4/§5 checkbox lists → inline-block 2-col, non-flex rows (box-first labels) */
.pdf-render .chk-grid{ display:block; font-size:0; }
.pdf-render .chk-grid > .chk{ display:inline-block; width:50%; vertical-align:top; box-sizing:border-box;
  font-size:12.5px; line-height:1.5; min-height:0; padding-inline-end:6px; margin-block-end:5px; break-inside:avoid; }
.pdf-render .chk-grid > .chk.span2{ width:100%; }
.pdf-render .chk{ display:block; }
.pdf-render .chk .txt{ display:inline; flex:none; }
.pdf-render .chk .cbox, .pdf-render .chk .rbox{ width:14px; height:14px; margin:0 6px 0 0; vertical-align:-2px; }
html[dir="rtl"] .pdf-render .chk .cbox, html[dir="rtl"] .pdf-render .chk .rbox{ margin:0 0 0 6px; }
.pdf-render .chk .cbox.on::after{ inset-inline-start:4px; inset-block-start:1px; width:4px; height:8px; }
.pdf-render .chk .rbox.on::after{ inset-inline-start:4px; inset-block-start:4px; width:4px; height:4px; }
.pdf-render .chk-other{ display:block; }
.pdf-render .chk-other .uline--static{ display:inline-block; width:auto; min-width:110px; vertical-align:middle; }

/* §7 "Photos taken?" header + Yes/No inline (non-flex) */
.pdf-render .images-head{ display:block; }
.pdf-render .images-head .opts{ display:inline-block; margin-inline-start:14px; }
.pdf-render .images-head .opts .chk{ display:inline-block; width:auto; margin:0 18px 0 0; }

/* §7 photos → 2 per row at real aspect (not cropped), compact so pages stay few */
.pdf-render .photo-grid{ display:block; font-size:0; margin-block-start:6px; }
.pdf-render .photo-grid > .photo{ display:inline-block; width:48%; margin-inline-end:4%; margin-block-end:8px; vertical-align:top;
  box-sizing:border-box; aspect-ratio:auto; background:transparent; border:1px solid var(--brand-border);
  border-radius:6px; overflow:hidden; break-inside:avoid; }
.pdf-render .photo-grid > .photo:nth-child(2n){ margin-inline-end:0; }
.pdf-render .photo__img{ width:100%; height:auto; max-block-size:none; object-fit:contain; display:block; }

/* -----------------------------------------------------------------------------
 * PDF ICON / ORNAMENT CENTERING — WeasyPrint has NO CSS Grid, so the icon
 * circles' `display:grid; place-items:center` drops the glyph into the TOP-LEFT
 * corner; and it can't flex-GROW, so the gem/hand divider lines (flex:1) collapse
 * to zero and the ornaments pile up. Center each glyph with absolute + transform
 * (transform IS supported — the gems already rotate) and give the divider lines an
 * explicit width. Centering uses PHYSICAL top/left (symmetric → correct in both
 * LTR & RTL; logical inset would mis-place it under RTL). .pdf-render only → the
 * live iPad form keeps its flex/grid untouched.
 * ---------------------------------------------------------------------------*/
.pdf-render .sec-head .ico,
.pdf-render .banner .ico,
.pdf-render .foot .hand,
.pdf-render .divider .gem-c{ position:relative; }
.pdf-render .sec-head .ico > svg,
.pdf-render .banner .ico > svg,
.pdf-render .foot .hand > svg,
.pdf-render .divider .gem-c::after{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); margin:0;
}

/* §-header ROW — WeasyPrint's `.sec-head` flex `align-items:center` breaks and
   drops the icon circle into the TOP-LEFT with the title offset below it. Lay the
   icon + title out as one vertically-centred line with inline-block. (Banner icon
   + text laid out the same so the shield sits on the text, not above it.) */
.pdf-render .sec-head{ display:block; }
.pdf-render .sec-head .ico{ display:inline-block; vertical-align:middle; }
.pdf-render .sec-head h2{ display:inline-block; width:auto; vertical-align:middle; margin:0; margin-inline-start:10px; }
.pdf-render .banner{ display:table; width:100%; }
.pdf-render .banner .ico{ display:table-cell; width:42px; vertical-align:middle; }
.pdf-render .banner p{ display:table-cell; vertical-align:middle; padding-inline-start:14px; }

/* ornamental dividers (top + footer): the flex-grow lines collapse in WeasyPrint
   → lay the row out inline-block, centered, with explicit line widths. */
.pdf-render .divider,
.pdf-render .foot .foot-divider{ display:block; text-align:center; font-size:0; }
.pdf-render .divider > *,
.pdf-render .foot .foot-divider > *{ display:inline-block; vertical-align:middle; }
.pdf-render .divider .line,
.pdf-render .foot .foot-divider .line{ width:38%; }
.pdf-render .divider .gem, .pdf-render .divider .gem-c,
.pdf-render .foot .foot-divider .dot{ margin:0 5px; }

/* -----------------------------------------------------------------------------
 * PDF visual polish — (a) more air BETWEEN the section cards (they read cramped)
 * and (b) a clear label/value hierarchy: bold, quiet-warm-gray labels vs normal,
 * dark values. .pdf-render only → the live iPad form keeps its spacing/weights.
 * ---------------------------------------------------------------------------*/
/* Header letterhead — brand wordmark on the LEADING side (inline-block order flips
   with dir → left in LTR, right in RTL) + the title & a one-line "receipt-no · date"
   meta on the trailing side. Inline-block (not flex) lays out reliably in WeasyPrint;
   font-size:0 kills the inter-block whitespace; both logo dims set (SVG is viewBox-
   only, 3799×1198 ≈ 3.17:1, so WeasyPrint needn't infer intrinsic size). */
/* Header stack: brand wordmark centred ALONE → the gem divider → the title +
   one-line "receipt-no · date" meta centred below. (SVG is viewBox-only
   3799×1198 ≈ 3.17:1 → set both dims so WeasyPrint needn't infer intrinsic size.) */
.pdf-render .head{ display:block; text-align:center; }
.pdf-render .head__logo{ display:block; width:170px; height:54px; margin:0 auto; }
.pdf-render .head .divider{ margin-block:16px; }
.pdf-render .head .titles{ text-align:center; }
.pdf-render .head .titles h1{ margin:0; }
.pdf-render .head .titles .sub--meta{ margin-block-start:4px; }

.pdf-render .box--mb,
.pdf-render .row2{ margin-block-end:44px; }
.pdf-render .banner{ margin-block-end:40px; }
.pdf-render .box{ padding:16px 18px 18px; }   /* a touch more internal breathing room */
.pdf-render .field{ margin-block-end:12px; }
.pdf-render .field .lbl,
.pdf-render .field .colon{ font-weight:700; color:#6b5b56; }
.pdf-render .uline--static{ font-weight:400; color:var(--brand-ink); }

/* =============================================================================
 * Print + responsive
 * ===========================================================================*/
@media print{
  .form-header, .form-footer, .btn-row, .photo-add{ display:none !important; }
  body{ background:#fff; }
  .form-main{ padding:0; }
  .sheet{ box-shadow:none; border-color:#cbbfae; width:auto; }
  @page{ size:A4; margin:10mm; }
}
@media (max-width:768px){ .form-main{ padding:var(--space-4) var(--space-3); } .sheet{ padding:20px 16px 14px; } }
@media (max-width:640px){
  .row2, .sign-grid{ grid-template-columns:1fr; }
  .head{ flex-wrap:wrap; justify-content:center; text-align:center; }
  .head .titles{ order:-1; flex-basis:100%; }
  .logo{ text-align:center; }
  .logo .since{ justify-content:center; }
}
/* phone & smaller: stack each field (label over input); the carpet table
   reflows from columns to per-row cards so it stays usable on any device. */
@media (max-width:560px){
  .field{ flex-wrap:wrap; align-items:flex-start; gap:4px; }
  .field .colon{ display:none; }
  .field .lbl{ flex-basis:100%; }
  .field .uline,
  .field .phone-group,
  .field > .ts-wrapper{ flex-basis:100%; width:100%; }
  .phone-group > .phone-country,
  .phone-group > .ts-wrapper{ width:96px; }

  .tbl-wrap{ overflow-x:visible; border:none; border-radius:0; }
  table.carpet{ min-width:0; }
  table.carpet thead{ display:none; }
  table.carpet tbody, table.carpet tr, table.carpet td{ display:block; width:100%; }
  table.carpet tr.carpet-item{ border:1px solid var(--brand-border); border-radius:10px; margin-block-end:10px; padding:6px 12px 10px; background:#fff; }
  table.carpet td{ border:none !important; height:auto; display:flex; align-items:center; gap:10px; padding:7px 0; }
  table.carpet td:not(.col-act){ border-block-end:1px dashed #efe1de !important; }
  table.carpet td::before{ content:attr(data-label); flex:0 0 42%; color:var(--brand-muted); font-size:13px; font-weight:600; text-align:start; }
  table.carpet td.col-act{ justify-content:flex-end; padding-block-start:2px; }
  table.carpet td.col-act::before{ content:none; }
  table.carpet .col-idx, table.carpet .col-dim, table.carpet .col-clr, table.carpet .col-cnt, table.carpet .col-val, table.carpet .col-desc{ width:auto; min-width:0; }
  table.carpet td.col-idx{ font-weight:600; color:var(--brand-primary); }
  table.carpet input, table.carpet td textarea{ flex:1; height:auto; text-align:start; padding:4px 0; }
}
@media (max-width:420px){ .chk-grid{ grid-template-columns:1fr; } .btn-row{ flex-direction:column; } .btn-row .btn{ width:100%; } }
@media (prefers-reduced-motion: reduce){ *{ scroll-behavior:auto !important; } }

/* =============================================================================
 * THE INSTALLED APP (2026-09-30) — what every forms screen needs once it runs
 * as an app on a phone: the account menu, the sign-in-again dialog, the PDF
 * viewer, and no way into the Metronic panel. All four sit OVER the page
 * (absolute / fixed), so none of them moves a list when it appears.
 * ===========================================================================*/

/* ── the installed app never opens the panel (critic B10) ──
   A link into /panel is drawn only for a back-office account, and carries `data-panel-link`.
   Inside the app the panel is the desktop application with no address bar to come back from:
   buttons into it are not drawn (`hide`), the logo stops being a link. Two signals, as pwa.js
   reads them: display-mode (Chrome, Safari) and html.is-app, which _pwa_head.html sets before the
   first paint from iOS's own navigator.standalone. Hidden from the first paint, so nothing shifts. */
@media (display-mode: standalone){
  [data-panel-link="hide"]{ display:none !important; }
  a[data-panel-link]{ pointer-events:none; cursor:default; }
}
html.is-app [data-panel-link="hide"]{ display:none !important; }
html.is-app a[data-panel-link]{ pointer-events:none; cursor:default; }

/* ── the account menu (forms/_account_menu.html) ──
   One 44px round button in the topbar; the menu drops OVER the page below it. */
.fo-account{ position:relative; flex:0 0 auto; }
.fo-account > summary{ list-style:none; display:inline-flex; align-items:center; justify-content:center;
  inline-size:44px; block-size:44px; border-radius:999px; cursor:pointer;
  border:1px solid var(--brand-border); background:var(--brand-paper); color:var(--brand-muted);
  -webkit-tap-highlight-color:transparent; }
.fo-account > summary::-webkit-details-marker{ display:none; }
.fo-account > summary::marker{ content:""; }
.fo-account > summary:hover,
.fo-account[open] > summary{ color:var(--brand-primary); border-color:var(--brand-primary); }
.fo-account > summary:focus-visible{ outline:none; box-shadow:0 0 0 3px var(--brand-focus); }
.fo-account > summary svg{ inline-size:22px; block-size:22px; fill:none; stroke:currentColor;
  stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.fo-account__menu{ position:absolute; z-index:60; inset-block-start:calc(100% + 8px); inset-inline-end:0;
  min-inline-size:236px; max-inline-size:calc(100vw - 24px);
  display:flex; flex-direction:column; gap:2px; padding:8px;
  background:var(--brand-paper); border:1px solid var(--brand-border); border-radius:14px;
  box-shadow:0 2px 6px rgba(82,1,0,.06), 0 16px 40px rgba(82,1,0,.14); }
.fo-account__who{ margin:0; padding:10px 12px 12px; font-size:15px; line-height:1.35; color:var(--brand-muted);
  border-block-end:1px solid var(--brand-border); margin-block-end:4px; overflow-wrap:anywhere; }
.fo-account__who strong{ display:block; color:var(--brand-ink); font-size:17px; }
.fo-account__item{ appearance:none; display:flex; align-items:center; gap:12px; inline-size:100%;
  min-block-size:48px; padding:0 12px; border:0; border-radius:10px; background:transparent;
  font:inherit; font-size:17px; font-weight:600; color:var(--brand-ink); text-align:start; cursor:pointer; }
.fo-account__item:hover{ background:var(--brand-primary-050); color:var(--brand-primary); }
.fo-account__item:focus-visible{ outline:none; box-shadow:0 0 0 3px var(--brand-focus); }
.fo-account__item:disabled{ opacity:.55; cursor:not-allowed; }
.fo-account__item svg{ flex:0 0 auto; inline-size:20px; block-size:20px; fill:none; stroke:currentColor;
  stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.fo-account__item--out{ color:var(--brand-danger); }
.fo-account__item--out:hover{ background:#fbeeec; color:var(--brand-danger); }
/* Notifications on this phone (forms/push_menu.js): the switch in the installed app, the way to
   install it everywhere else — decided by CSS before the first paint, never by a script later. */
.fo-account__push{ display:none; }
.fo-account__push-install{ text-decoration:none; }
html.is-app .fo-account__push{ display:flex; flex-direction:column; gap:2px; }
html.is-app .fo-account__push-install{ display:none; }
@media (display-mode: standalone){
  .fo-account__push{ display:flex; flex-direction:column; gap:2px; }
  .fo-account__push-install{ display:none; }
}
.fo-account__push-label{ flex:1 1 auto; min-inline-size:0; }
.fo-account__push-state{ flex:0 0 auto; margin-inline-start:auto; font-size:15px; font-weight:700;
  color:var(--brand-muted); }
.fo-account__push-toggle[aria-pressed="true"] .fo-account__push-state{ color:var(--brand-primary); }
.fo-account__item--sub{ min-block-size:44px; padding-inline-start:44px; font-size:16px; font-weight:500; }
.fo-account__note{ margin:0; padding:2px 12px 10px; font-size:15px; line-height:1.45;
  color:var(--brand-muted); overflow-wrap:anywhere; }
.fo-account__note.is-error{ color:var(--brand-danger); }

/* ── sign in again (forms/reauth.js) ──
   Roomy and never cut off: on an iPad a dialog whose last button is below the fold reads as
   finished. The overlay scrolls (it, not the page), the card is centred when it fits. */
.fo-dialog{ position:fixed; inset:0; z-index:2147483100; display:flex; align-items:flex-start; justify-content:center;
  padding-block:max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-bottom, 0px));
  padding-inline:max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  background:rgba(26,26,26,.46); overflow-y:auto !important; -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain; }
.fo-dialog__card{ inline-size:100%; max-inline-size:460px; margin-block:auto;
  display:flex; flex-direction:column; gap:14px; padding:28px 24px 24px;
  background:var(--brand-paper); color:var(--brand-ink); border-radius:18px;
  box-shadow:0 20px 60px rgba(0,0,0,.28); font-family:var(--brand-font); }
.fo-dialog__title{ margin:0; font-family:var(--brand-font-display); font-weight:400; font-size:26px; color:var(--brand-primary); }
.fo-dialog__text{ margin:0; font-size:17px; line-height:1.55; color:var(--brand-muted); }
.fo-dialog__form{ display:flex; flex-direction:column; gap:14px; margin:0; }
.fo-dialog__field{ display:flex; flex-direction:column; gap:6px; }
.fo-dialog__label{ font-size:16px; font-weight:600; color:#3d3a36; }
/* 17px: iOS zooms the page into any box under 16px when it is focused. */
.fo-dialog__input{ box-sizing:border-box; inline-size:100%; min-block-size:54px; padding:0 16px;
  font:inherit; font-size:17px; color:var(--brand-ink); background:#f9f4ec;
  border:1px solid var(--brand-border); border-radius:12px; }
.fo-dialog__input:focus{ outline:none; border-color:var(--brand-primary); box-shadow:0 0 0 3px var(--brand-focus); background:#fff; }
.fo-dialog__error{ margin:0; min-block-size:1.5em; font-size:16px; line-height:1.5; color:var(--brand-danger); }
.fo-dialog__actions{ display:flex; flex-wrap:wrap; gap:12px; }
.fo-dialog__actions .btn{ flex:1 1 120px; }
/* The unfinished intake's line (forms/draft.js): who, how many carpets, when — read first. */
.fo-dialog__lead{ color:var(--brand-ink); font-weight:600; overflow-wrap:anywhere; }
.fo-dialog__sep{ color:var(--brand-muted); font-weight:400; }
.fo-dialog__actions--wide .btn{ flex-basis:190px; }

/* ── a PDF inside the app (forms/pdf_view.js) ── */
.fo-pdf{ position:fixed; inset:0; z-index:2147482000; display:flex; flex-direction:column;
  background:var(--brand-bg); font-family:var(--brand-font); }
.fo-pdf__bar{ flex:0 0 auto; display:flex; align-items:center; gap:10px;
  padding-block:max(10px, env(safe-area-inset-top, 0px)) 10px;
  padding-inline:max(12px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  background:var(--brand-paper); border-block-end:1px solid var(--brand-border); }
.fo-pdf__bar .btn{ flex:0 0 auto; min-height:44px; padding-inline:16px; font-size:16px; white-space:nowrap; }
.fo-pdf__title{ flex:1 1 auto; min-inline-size:0; font-weight:700; color:var(--brand-primary);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fo-pdf__body{ position:relative; flex:1 1 auto; min-block-size:0; overflow:auto;
  -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  padding-block-end:env(safe-area-inset-bottom, 0px); }
.fo-pdf__frame{ display:block; inline-size:100%; block-size:100%; border:0; background:#fff; }
.fo-pdf__note{ margin:0; padding:32px 20px; text-align:center; font-size:17px; line-height:1.5; color:var(--brand-muted); }
@media (max-width:420px){
  .fo-pdf__title{ display:none; }                       /* the two buttons need the row */
  .fo-pdf__bar{ justify-content:space-between; }
}
[dir=rtl] .fo-account__item--out svg{ transform:scaleX(-1); }   /* the arrow points out of the page's own end */
