/* DeLeon Style Studio — prototype styles */
:root {
  --bg: #F5EFE6; --surface: #FFFCF7; --surface-2: #EFE6DA; --ink: #231915; --muted: #6F635A;
  --line: #E2D6C7; --accent: #6B1E2B; --accent-ink: #FFFFFF; --accent-soft: #F3E3E1; --gold: #A9823F;
  --ok: #2F6B45; --ok-soft: #E2EFE5; --warn: #8A5A12; --warn-soft: #F7EAD3; --danger: #A12C2C;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(35,25,21,.06), 0 8px 24px rgba(35,25,21,.06);
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino', Georgia, serif;
  --tabbar-h: 68px; --side-w: 236px;
  color-scheme: light;
}
[data-theme="forest"] {
  --bg: #F1F0E8; --surface: #FCFBF6; --surface-2: #E6E5D8; --ink: #18211B; --muted: #5C645D;
  --line: #D8D7C8; --accent: #24402F; --accent-soft: #E0E9DF; --gold: #A4823A;
}
[data-theme="ink"] {
  --bg: #F3F0EB; --surface: #FDFCFA; --surface-2: #E8E3DB; --ink: #161B26; --muted: #5D6270;
  --line: #DCD5CA; --accent: #1F2C4A; --accent-soft: #E1E5EE; --gold: #B48A57;
}
[data-theme="evening"] {
  --bg: #17120F; --surface: #221B17; --surface-2: #2C231E; --ink: #F2E9DF; --muted: #B4A89D;
  --line: #3B3029; --accent: #D08A63; --accent-ink: #1A120E; --accent-soft: #3A2A21; --gold: #C9A35A;
  --ok: #8CC59F; --ok-soft: #22332A; --warn: #E2B66A; --warn-soft: #3A2E1C; --danger: #F08A8A;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 var(--sans); overflow-x: hidden; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: .005em; }
h1 { font-size: clamp(2rem, 6vw, 2.75rem); }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 .6em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { left: 8px; }
.loading { padding: 40px 0; color: var(--muted); }
.muted { color: var(--muted); }
.fine { font-size: .875rem; color: var(--muted); }
.eyebrow { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; }

/* ---------- Layout ---------- */
main {
  padding: 18px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
  max-width: 1180px; margin: 0 auto; outline: none;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; line-height: 1; flex: 1; min-width: 0; text-decoration: none; color: var(--ink); }
.brand small { display: block; font-family: var(--sans); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 4px; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(0,0,0,.05);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; border: 0; background: none; border-radius: 14px; cursor: pointer;
  color: var(--muted); font-size: .8rem; font-weight: 600; text-decoration: none;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
body.nav-menu .tabbar { display: none; }
body.nav-menu main { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

.sidebar { display: none; }
@media (min-width: 760px) {
  .topbar, .tabbar { display: none !important; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 10;
    padding: 26px 14px 18px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
  }
  .sidebar .brand { flex: 0; padding: 0 10px 22px; font-size: 1.6rem; }
  .side-link {
    display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px;
    border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 500;
  }
  .side-link svg { width: 22px; height: 22px; color: var(--muted); }
  .side-link:hover { background: var(--surface-2); }
  .side-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .side-link[aria-current="page"] svg { color: var(--accent); }
  .side-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 18px; }
  main { margin-left: var(--side-w); padding: 34px 32px 48px; max-width: none; }
  main > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
  body.nav-menu main { padding-bottom: 48px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .98rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; flex: none;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 6px 0 18px; }
.page-head > div { min-width: 0; }
.page-head p.muted { margin: 8px 0 0; max-width: 60ch; }

/* ---------- Cards / panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel h3 { margin-bottom: 10px; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap;
  background: var(--warn-soft); color: var(--ink); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; font-size: .95rem;
}
.notice > span { flex: 1 1 220px; }
.notice .btn { min-height: 44px; }

/* Studio */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 26px 22px; margin-bottom: 18px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--gold) 40%, transparent), transparent 55%),
    linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000));
  color: #FFF8EF;
}
[data-theme="evening"] .hero { color: #1A120E; }
.hero h1 { color: inherit; }
.hero .eyebrow { color: inherit; opacity: .8; }
.hero p { opacity: .9; max-width: 52ch; margin: 10px 0 0; }
.studio-grid { display: grid; gap: 16px; }
@media (min-width: 1100px) { .studio-grid { grid-template-columns: 1.35fr 1fr; align-items: start; } }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.quick button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left;
  min-height: 92px; padding: 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600;
}
.quick button svg { width: 24px; height: 24px; color: var(--accent); }
.quick button:hover { border-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; border: 0; text-align: left; cursor: pointer; min-height: 72px; }
.stat strong { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1; }
.stat span { font-size: .85rem; color: var(--muted); }
.att-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.att {
  width: 100%; display: flex; gap: 12px; align-items: center; text-align: left;
  min-height: 60px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); cursor: pointer;
}
.att .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; }
.att.urgent .dot { background: var(--danger); }
.att b { display: block; font-weight: 600; }
.att small { color: var(--muted); display: block; }
.att .chev { margin-left: auto; color: var(--muted); flex: none; width: 18px; height: 18px; }
.status-line { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; padding: 6px 12px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); margin-bottom: 10px; }
.status-line.ok { background: var(--ok-soft); color: var(--ok); }
.status-line::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- Filters ---------- */
.toolbar { display: grid; gap: 12px; margin-bottom: 16px; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; min-height: 50px; padding: 0 16px 0 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.seg button { min-height: 44px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--muted); padding: 0 6px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: .9rem; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tag { display: inline-block; font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); margin: 0 4px 4px 0; }

/* ---------- Grid cards ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 158px), 1fr)); }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; } }
.card {
  display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.card .body { padding: 10px 12px 14px; display: grid; gap: 2px; min-width: 0; }
.card .name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.card .meta { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.card .badges { margin-top: 6px; }
.thumb { aspect-ratio: 4 / 5; background: var(--surface-2); position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.swatch {
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.07) 0 2px, transparent 2px 6px),
    radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.22), transparent 60%),
    var(--sw, #9b8a78);
}
.swatch span {
  font-family: var(--serif); font-size: 2.4rem; font-weight: 600; color: rgba(255,255,255,.92);
  width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,.14); border: 1px solid rgba(255,255,255,.35);
}
.swatch.light span { color: rgba(35,25,21,.75); background: rgba(255,255,255,.35); border-color: rgba(35,25,21,.15); }
.thumb .corner { position: absolute; left: 8px; top: 8px; }

/* Compact density */
body.density-compact .grid { grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 760px) { body.density-compact .grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
body.density-compact .card { flex-direction: row; align-items: center; border-radius: 14px; }
body.density-compact .card .thumb { width: 76px; flex: none; aspect-ratio: 1; }
body.density-compact .card .swatch span { width: 40px; height: 40px; font-size: 1.4rem; }
body.density-compact .card .body { padding: 10px 14px; }

/* Lists (purchases, stores) */
.rows { display: grid; gap: 10px; }
.row-card {
  display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-height: 72px;
}
.row-card .thumb { width: 56px; aspect-ratio: 1; border-radius: 12px; flex: none; }
.row-card .thumb.swatch span { width: 34px; height: 34px; font-size: 1.2rem; }
.row-card .grow { flex: 1; min-width: 0; }
.row-card b { display: block; overflow-wrap: anywhere; }
.row-card small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.row-card .end { text-align: right; flex: none; display: grid; gap: 4px; justify-items: end; }
.group-title { font-family: var(--serif); font-size: 1.35rem; margin: 22px 0 10px; display: flex; align-items: baseline; gap: 10px; }
.group-title span { font-family: var(--sans); font-size: .85rem; color: var(--muted); }

/* Badges */
.badge { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin: 0 4px 4px 0; }
.badge.sample { background: #2b2b2b; color: #fff; }
[data-theme="evening"] .badge.sample { background: #F2E9DF; color: #17120F; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

.empty { text-align: center; padding: 36px 16px; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

/* ---------- Dialog / sheets ---------- */
dialog.sheet {
  border: 0; padding: 0; color: var(--ink); background: var(--surface);
  width: 100%; max-width: 100%; max-height: 92vh; max-height: 92dvh; margin: auto 0 0 0;
  border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.2); overflow: auto; overscroll-behavior: contain;
}
dialog.sheet::backdrop { background: rgba(20,14,11,.45); }
@media (min-width: 760px) {
  dialog.sheet { width: min(640px, calc(100vw - 48px)); margin: auto; border-radius: 22px; max-height: 88vh; }
}
.sheet-inner { padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; position: sticky; top: 0; background: var(--surface); padding: 16px 18px 10px; z-index: 2; border-bottom: 1px solid var(--line); }
.sheet-head h2 { overflow-wrap: anywhere; padding-top: 6px; }
.detail-photo { width: 100%; max-height: 420px; object-fit: contain; background: var(--surface-2); border-radius: 16px; }
.detail-swatch { height: 160px; border-radius: 16px; }
.facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 14px 0; }
.facts div { display: grid; grid-template-columns: minmax(100px, 38%) 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .92rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions .btn { flex: 1 1 150px; }
.menu-list { display: grid; gap: 8px; }
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--bg); text-decoration: none; color: var(--ink); font-weight: 600; text-align: left; cursor: pointer; width: 100%;
}
.menu-list svg { width: 22px; height: 22px; color: var(--accent); }
.menu-list small { display: block; font-weight: 400; color: var(--muted); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px 18px 0; }
.field { grid-column: span 2; display: grid; gap: 6px; min-width: 0; }
.field.half { grid-column: span 1; }
@media (max-width: 359px) { .field.half { grid-column: span 2; } }
.field label, .field .label { font-weight: 600; font-size: .95rem; }
.req { font-weight: 500; font-size: .78rem; color: var(--muted); margin-left: 4px; }
.field input:not([type=file]), .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  font-size: 1rem;
}
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { color: var(--muted); font-size: .85rem; }
.err { color: var(--danger); font-size: .88rem; margin: 0; min-height: 0; }
.err:empty { display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.form-err { padding: 10px 18px 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 18px; position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); margin-top: 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.form-actions .btn { flex: 1 1 0; max-width: 220px; }
.photo-field .photo-drop {
  border: 1.5px dashed var(--line); border-radius: 16px; min-height: 140px; display: grid; place-items: center; overflow: hidden; background: var(--bg);
}
.photo-field .photo-drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.photo-field .photo-drop img { max-height: 280px; width: 100%; object-fit: contain; }
.photo-empty { color: var(--muted); padding: 20px; text-align: center; font-size: .95rem; }
.photo-row { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-row .btn { flex: 1 1 160px; }
.file-btn { position: relative; }

/* ---------- Quiz ---------- */
.quiz { padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); margin: 10px 0 18px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }
.quiz h2 { font-size: 1.75rem; margin-bottom: 6px; }
.options { display: grid; gap: 10px; margin: 16px 0; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; min-height: 64px; padding: 12px 16px;
  border: 1.5px solid var(--line); border-radius: 16px; background: var(--bg); cursor: pointer;
}
.option strong { display: block; }
.option small { display: block; color: var(--muted); font-size: .88rem; }
.option.on { border-color: var(--accent); background: var(--accent-soft); }
.option .tick { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; }
.option.on .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.option .tick svg { width: 16px; height: 16px; }
.opt-sw { width: 40px; height: 40px; border-radius: 12px; flex: none; border: 1px solid rgba(0,0,0,.1); }
.other-box textarea { width: 100%; min-height: 80px; border-radius: 12px; border: 1px solid var(--line); padding: 10px 14px; background: var(--surface); }
.quiz-actions { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; }
.quiz-actions .btn { padding: 0 10px; }
.answers { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.answers li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.answers li > div { min-width: 0; }
.answers b { display: block; font-size: .92rem; }
.answers span { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.answers .btn { min-height: 44px; flex: none; }

.setup-nudge {
  position: fixed; z-index: 15; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom));
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--ink); color: var(--bg); border-radius: 18px; padding: 14px 14px 14px 18px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.setup-nudge > div { flex: 1 1 100%; }
.setup-nudge .btn { flex: 1 1 0; }
@media (min-width: 520px) { .setup-nudge > div { flex: 1 1 200px; } .setup-nudge .btn { flex: 0 0 auto; } }
.setup-nudge b { display: block; }
.setup-nudge small { opacity: .8; }
.setup-nudge .btn.primary { background: var(--bg); color: var(--ink); }
.setup-nudge .btn.ghost { color: var(--bg); border-color: rgba(255,255,255,.3); }
body.nav-menu .setup-nudge { bottom: calc(14px + env(safe-area-inset-bottom)); }
@media (min-width: 760px) { .setup-nudge { left: calc(var(--side-w) + 24px); right: auto; max-width: 560px; bottom: 24px; } }

/* Toast */
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); z-index: 100; display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
@media (min-width: 760px) { #toast { bottom: 24px; } }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow); font-size: .95rem; pointer-events: auto; }
.toast.error { background: var(--danger); color: #fff; }

/* Profile */
.pref-list { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }
.two-col { display: grid; gap: 16px; }
@media (min-width: 1000px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } .two-col .panel + .panel { margin-top: 0; } }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.kv div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.kv dt { font-size: .8rem; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.code-box { width: 100%; min-height: 240px; font: .85rem/1.45 ui-monospace, Menlo, monospace; border-radius: 12px; border: 1px solid var(--line); padding: 12px; background: var(--bg); }

/* Stylist */
.steps { margin: 6px 0 0; padding-left: 1.3em; display: grid; gap: 6px; }
.steps li::marker { font-family: var(--serif); font-weight: 700; color: var(--accent); }
.req-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.req-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  min-height: 76px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
}
.req-card:hover { border-color: var(--accent); }
.req-card > svg:first-child { width: 26px; height: 26px; color: var(--accent); flex: none; }
.req-card b { display: block; font-size: 1.02rem; }
.req-card small { display: block; color: var(--muted); }
.req-card .chev { margin-left: auto; width: 18px; height: 18px; color: var(--muted); flex: none; }
.answer-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 8px; max-height: 50vh; overflow: auto; }
details.preview { margin-top: 14px; }
details.preview summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--muted); }

/* Cloud sign-in */
body.signed-out .sidebar, body.signed-out .topbar, body.signed-out .tabbar { display: none; }
body.signed-out main { margin: 0 auto; }
.signin { max-width: 420px; margin: 12vh auto 0; padding: 28px 22px; }
.signin h1 { margin: 4px 0 8px; }
.signin form { display: grid; gap: 10px; margin-top: 14px; }
.signin input { font-size: 1.1rem; }
.signin .actions { margin-top: 14px; }
.signin .err { margin-top: 12px; }
.signin .status-line { margin-top: 12px; border-radius: 12px; }
