/* Vestoday screen kit — tokens from the Vestoday design system (ds/vestoday/tokens.json) + shared components.
   Root of every phone artboard: <div class="vt" dir="rtl"> (add "dark" for the dark theme). */

.vt {
  --bg-canvas: #F6F5F3; --bg-surface: #FFFFFF; --bg-raised: #FFFFFF; --bg-item-tile: #EFEDEA; --bg-inverse: #15161A;
  --text-primary: #15161A; --text-secondary: #4E5059; --text-tertiary: #666872; --text-inverse: #F6F5F3;
  --border-subtle: #E6E4E0; --border-default: #CFCCC6; --border-strong: #7E7B76;
  --brand: #4A1F3D; --brand-pressed: #36152C; --on-brand: #FFFFFF; --brand-subtle: #F2E8EF;
  --accent: #56704F; --accent-subtle: #E5ECE1; --ai-processing: #8A5A00;
  --success: #2E6B4A; --success-subtle: #E2EFE7; --warning: #8A5A00; --warning-subtle: #F6EBD6;
  --danger: #A3302F; --danger-subtle: #F6E1E0; --info: #2B5A8C; --info-subtle: #E2EAF4;
  --scrim: rgba(21,22,26,0.40);
  --elevation-1: 0 1px 2px rgba(21,22,26,0.06), 0 1px 1px rgba(21,22,26,0.04);
  --elevation-2: 0 8px 24px rgba(21,22,26,0.08);
  --elevation-3: 0 16px 40px rgba(21,22,26,0.14);
  --font-display: "Bodoni Moda", "Amiri", Didot, Georgia, serif;
  --font-display-ar: "Amiri", "Noto Naskh Arabic", serif;
  --font-sans: "Readex Pro", "Noto Sans Arabic", "Segoe UI", system-ui, sans-serif;
  position: relative; overflow: hidden; box-sizing: border-box;
  display: flex; flex-direction: column;
  background: var(--bg-canvas); color: var(--text-primary);
  font-family: var(--font-sans); font-size: 16px; line-height: 26px;
  font-variant-numeric: tabular-nums;
}
.vt.dark {
  --bg-canvas: #121318; --bg-surface: #1A1C22; --bg-raised: #23262D; --bg-item-tile: #24272E; --bg-inverse: #F1EFEC;
  --text-primary: #F1EFEC; --text-secondary: #B4B3B8; --text-tertiary: #8E8E95; --text-inverse: #15161A;
  --border-subtle: #2A2D35; --border-default: #3B3F48; --border-strong: #7A7E88;
  --brand: #D9A8C7; --brand-pressed: #C690B4; --on-brand: #2A0F22; --brand-subtle: #2F2029;
  --accent: #A8BFA0; --accent-subtle: #243022; --ai-processing: #E8B04A;
  --success: #7CC8A0; --success-subtle: #1C2E24; --warning: #E8B04A; --warning-subtle: #33281A;
  --danger: #F08A84; --danger-subtle: #3A1F1F; --info: #8DB8E8; --info-subtle: #1D2836;
  --scrim: rgba(0,0,0,0.60);
  --elevation-1: 0 1px 2px rgba(0,0,0,0.50);
  --elevation-2: 0 8px 24px rgba(0,0,0,0.55);
  --elevation-3: 0 16px 40px rgba(0,0,0,0.65);
}
.vt *, .vt *::before, .vt *::after { box-sizing: border-box; }
.vt h1, .vt h2, .vt h3, .vt p { margin: 0; }
.vt svg { flex-shrink: 0; }
.vt button, .vt a, .vt input, .vt textarea, .vt select { font: inherit; color: inherit; }
.vt a { text-decoration: none; }

/* ---------- type ---------- */
.t-display { font-family: var(--font-display); font-weight: 500; font-size: 40px; line-height: 48px; }
.t-display-ar { font-family: var(--font-display-ar); font-weight: 700; font-size: 36px; line-height: 52px; }
.t-h1 { font-family: var(--font-display-ar); font-weight: 700; font-size: 28px; line-height: 40px; }
.t-title2 { font-size: 22px; line-height: 30px; font-weight: 600; }
.t-title3 { font-size: 18px; line-height: 26px; font-weight: 600; }
.t-body { font-size: 16px; line-height: 26px; }
.t-strong { font-weight: 500; }
.t-sm { font-size: 14px; line-height: 22px; }
.t-cap { font-size: 12px; line-height: 18px; font-weight: 500; }
.t-over { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.c-2 { color: var(--text-secondary); } .c-3 { color: var(--text-tertiary); } .c-brand { color: var(--brand); }
.c-accent { color: var(--accent); } .c-danger { color: var(--danger); } .c-success { color: var(--success); }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- layout ---------- */
.vt-top { padding: 54px 16px 8px; display: flex; align-items: center; gap: 8px; min-height: 108px; }
.vt-top .grow { flex: 1; min-width: 0; }
.vt-body { flex: 1; min-height: 0; overflow: hidden; padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-3 { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.col-3 { display: flex; flex-direction: column; gap: 12px; }
.col-4 { display: flex; flex-direction: column; gap: 16px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sec-head .link { font-size: 14px; color: var(--brand); font-weight: 500; }
.divider { height: 1px; background: var(--border-subtle); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; background: transparent; font-size: 16px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-secondary { background: var(--bg-surface); border-color: var(--border-strong); color: var(--text-primary); }
.btn-tertiary { color: var(--brand); padding: 0 12px; }
.btn-danger { background: var(--danger); color: #FFFFFF; }
.vt.dark .btn-danger { color: #2A0F0F; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--text-primary); cursor: pointer; }
.icon-btn.filled { background: var(--bg-surface); box-shadow: var(--elevation-1); }
.focus { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-secondary); }
.input { height: 48px; border: 1px solid var(--border-default); border-radius: 8px; background: var(--bg-surface); padding: 0 14px; display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--text-primary); width: 100%; }
.input.focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-subtle); }
.input.error { border-color: var(--danger); }
.input .ph { color: var(--text-tertiary); }
.help { font-size: 12px; line-height: 18px; color: var(--text-tertiary); }
.help.err { color: var(--danger); }
.otp { display: flex; gap: 8px; direction: ltr; justify-content: center; }
.otp span { width: 46px; height: 56px; border: 1px solid var(--border-default); border-radius: 8px; background: var(--bg-surface); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600; }
.otp span.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-subtle); }
.search { height: 44px; border-radius: 999px; background: var(--bg-surface); border: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--text-tertiary); font-size: 15px; }
.toggle { width: 48px; height: 28px; border-radius: 999px; background: var(--border-default); position: relative; flex-shrink: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 999px; background: #FFFFFF; box-shadow: var(--elevation-1); }
.toggle.on { background: var(--brand); }
.toggle.on::after { inset-inline-start: 23px; }
.vt.dark .toggle.on::after { background: var(--on-brand); }
.check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--bg-surface); }
.check.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.radio { width: 22px; height: 22px; border-radius: 999px; border: 1.5px solid var(--border-strong); flex-shrink: 0; position: relative; }
.radio.on { border-color: var(--brand); }
.radio.on::after { content: ""; position: absolute; inset: 4px; border-radius: 999px; background: var(--brand); }
.slider { position: relative; height: 4px; border-radius: 999px; background: var(--border-default); }
.slider .fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: var(--brand); }
.slider .knob { position: absolute; top: -10px; width: 24px; height: 24px; border-radius: 999px; background: var(--bg-surface); border: 2px solid var(--brand); box-shadow: var(--elevation-1); }

/* ---------- chips, badges ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow: hidden; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-default); background: var(--bg-surface); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--text-primary); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip.soft { background: var(--brand-subtle); border-color: transparent; color: var(--brand); }
.chip .x { opacity: .7; }
.badge { height: 22px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.badge-proc { background: var(--warning-subtle); color: var(--ai-processing); }
.badge-review { background: var(--brand-subtle); color: var(--brand); }
.badge-ok { background: var(--success-subtle); color: var(--success); }
.badge-err { background: var(--danger-subtle); color: var(--danger); }
.badge-info { background: var(--info-subtle); color: var(--info); }
.badge-neutral { background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.badge-dark { background: var(--bg-inverse); color: var(--text-inverse); }
.dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; display: inline-block; }
.src-ai { font-size: 11px; font-weight: 600; color: var(--brand); display: inline-flex; align-items: center; gap: 4px; }
.src-user { font-size: 11px; font-weight: 600; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- item tiles ---------- */
.tile { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; background: var(--bg-item-tile); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile img { width: 84%; height: 84%; object-fit: contain; }
.tile .tl { position: absolute; top: 6px; inset-inline-start: 6px; }
.tile .tr { position: absolute; top: 6px; inset-inline-end: 6px; }
.tile .bl { position: absolute; bottom: 6px; inset-inline-start: 6px; }
.tile.sel { outline: 2.5px solid var(--brand); outline-offset: -2.5px; }
.tile.dim img { opacity: .45; filter: grayscale(.4); }
.tile.proc img { opacity: .55; }
.tile .pin { width: 26px; height: 26px; border-radius: 999px; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; }
.item-cap { display: flex; flex-direction: column; gap: 0; padding-top: 6px; }
.item-cap .n { font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-cap .m { font-size: 12px; line-height: 16px; color: var(--text-tertiary); }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.g4 .tile, .g5 .tile { border-radius: 8px; }
.hscroll { display: flex; gap: 12px; overflow: hidden; }
.hscroll > * { flex: 0 0 auto; }

/* ---------- cards ---------- */
.card { background: var(--bg-surface); border-radius: 20px; padding: 16px; box-shadow: var(--elevation-1); display: flex; flex-direction: column; gap: 12px; }
.card.flat { box-shadow: none; border: 1px solid var(--border-subtle); }
.card.hero { box-shadow: var(--elevation-2); padding: 20px; gap: 16px; }
.card.soft { background: var(--brand-subtle); box-shadow: none; }
.card.sage { background: var(--accent-subtle); box-shadow: none; }

/* outfit flat lay: 2 columns, tall start column */
.lay { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lay .tile { border-radius: 12px; }
.lay .tall { grid-row: span 2; aspect-ratio: auto; }
.outfit-actions { display: flex; gap: 8px; align-items: center; }
.weather { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--accent-subtle); color: var(--accent); font-size: 13px; font-weight: 600; }
.reason { font-size: 14px; line-height: 22px; color: var(--text-secondary); }

/* ---------- lists ---------- */
.list { background: var(--bg-surface); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; }
.li { min-height: 56px; padding: 10px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border-subtle); }
.li:last-child { border-bottom: 0; }
.li .lead { width: 36px; height: 36px; border-radius: 10px; background: var(--bg-canvas); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); flex-shrink: 0; }
.li .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.li .txt .s { font-size: 13px; line-height: 18px; color: var(--text-tertiary); }
.li .end { color: var(--text-tertiary); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.li-head { padding: 0 4px 6px; font-size: 13px; font-weight: 600; color: var(--text-tertiary); }

/* attribute rows (item detail/edit) */
.attr { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.attr:last-child { border-bottom: 0; }
.attr .k { width: 84px; flex-shrink: 0; font-size: 14px; color: var(--text-tertiary); }
.attr .v { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.sw { width: 16px; height: 16px; border-radius: 999px; border: 1px solid var(--border-default); display: inline-block; flex-shrink: 0; }

/* ---------- nav ---------- */
.vt-nav { height: 86px; padding: 6px 8px 26px; background: var(--bg-surface); border-top: 1px solid var(--border-subtle); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; flex-shrink: 0; }
.vt-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; line-height: 14px; font-weight: 500; color: var(--text-tertiary); }
.vt-nav a.on { color: var(--brand); }
.vt-nav .add { width: 52px; height: 52px; border-radius: 999px; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; margin: 0 auto; box-shadow: var(--elevation-2); }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.tabs span { flex: 1; height: 36px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.tabs span.on { background: var(--brand); color: var(--on-brand); }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 999px; background: var(--border-default); }
.steps i.on { background: var(--brand); }

/* ---------- sheets & overlays ---------- */
.scrim { position: absolute; inset: 0; background: var(--scrim); }
.sheet { position: absolute; inset-inline: 0; bottom: 0; background: var(--bg-raised); border-radius: 24px 24px 0 0; box-shadow: var(--elevation-3); padding: 10px 16px 34px; display: flex; flex-direction: column; gap: 16px; }
.sheet .grab { width: 40px; height: 4px; border-radius: 999px; background: var(--border-default); margin: 0 auto 4px; }
.toast { position: absolute; inset-inline: 16px; bottom: 104px; background: var(--bg-inverse); color: var(--text-inverse); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; font-size: 14px; box-shadow: var(--elevation-3); }
.toast .act { margin-inline-start: auto; font-weight: 600; color: var(--text-inverse); text-decoration: underline; }

/* ---------- notes ---------- */
.note { border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 22px; }
.note-info { background: var(--info-subtle); color: var(--text-primary); }
.note-info svg { color: var(--info); }
.note-warn { background: var(--warning-subtle); }
.note-warn svg { color: var(--warning); }
.note-err { background: var(--danger-subtle); }
.note-err svg { color: var(--danger); }
.note-ok { background: var(--success-subtle); }
.note-ok svg { color: var(--success); }
.bar { height: 8px; border-radius: 999px; background: var(--border-subtle); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.bar.warn i { background: var(--warning); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 24px 16px; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .wd { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-tertiary); padding-bottom: 4px; }
.cal .d { aspect-ratio: 1 / 1.3; border-radius: 10px; background: var(--bg-surface); display: flex; flex-direction: column; align-items: center; padding-top: 4px; gap: 2px; font-size: 12px; font-weight: 500; position: relative; overflow: hidden; }
.cal .d.out { background: transparent; color: var(--text-tertiary); }
.cal .d.today { outline: 2px solid var(--brand); outline-offset: -2px; color: var(--brand); font-weight: 700; }
.cal .d img { width: 70%; height: auto; }
.cal .d .mk { position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 999px; }
.cal .d .mk.worn { background: var(--success); }
.cal .d .mk.plan { background: var(--brand); }

/* ---------- chat ---------- */
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 24px; }
.bubble.me { align-self: flex-start; background: var(--brand); color: var(--on-brand); border-start-start-radius: 6px; }
.bubble.ai { align-self: flex-end; background: var(--bg-surface); box-shadow: var(--elevation-1); border-start-end-radius: 6px; }
.persona { width: 40px; height: 40px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 18px; font-weight: 500; flex-shrink: 0; }
.p-leo { background: #1F2A44; color: #F1EFEC; }
.p-suzy { background: #E9C9DD; color: #4A1F3D; }
.p-jax { background: #15161A; color: #E8B04A; }
.p-clara { background: #4A1F3D; color: #F2E8EF; }

/* ---------- stats ---------- */
.stat { background: var(--bg-surface); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.stat .num { font-size: 26px; line-height: 32px; font-weight: 600; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.hb { display: grid; grid-template-columns: 84px minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 13px; }
.hb .track { height: 10px; border-radius: 999px; background: var(--border-subtle); overflow: hidden; }
.hb .track i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }

/* ---------- web ---------- */
.web { width: 100%; }
.rail { width: 88px; flex-shrink: 0; background: var(--bg-surface); border-inline-end: 1px solid var(--border-subtle); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 0; }
.rail a { width: 64px; padding: 8px 0; border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--text-tertiary); }
.rail a.on { background: var(--brand-subtle); color: var(--brand); }

.local-test-ribbon{position:fixed;top:0;right:0;z-index:1000;background:#ffe69b;color:#332700;font:10px/1.6 system-ui;padding:1px 7px;border-radius:0 0 0 6px;pointer-events:none}

#app[aria-busy="true"]::before{content:"";position:fixed;top:env(safe-area-inset-top,0px);inset-inline:0;height:3px;background:var(--brand,#794d75);z-index:9999;animation:vt-route-loading 1s ease-in-out infinite;pointer-events:none}
@keyframes vt-route-loading{0%,100%{opacity:.35}50%{opacity:1}}
@media(prefers-reduced-motion:reduce){#app[aria-busy="true"]::before{animation:none}}
