/* Chefpreneur Dashboard: warm, culinary-editorial. Themes via custom properties. */

/* ---------- Tokens: light (default) ---------- */
:root, [data-theme="light"] {
  --bg: #f5efe4;
  --bg-2: #efe6d5;
  --surface: #fffcf6;
  --surface-2: #f7f0e3;
  --panel: #ebe0cb;
  --text: #1c1813;
  --text-2: #3d352a;
  --muted: #6c6152;
  --border: rgba(74, 55, 25, .14);
  --border-strong: rgba(74, 55, 25, .26);
  --gold: #8a6116;            /* deep gold for text/icons on light (AA on cream) */
  --gold-1: #8f6420; --gold-2: #c9a14e; --gold-3: #7a5419;
  --gold-soft: rgba(166, 120, 40, .12);
  --on-gold: #1a1307;
  --btn-grad: linear-gradient(135deg, #c39343 0%, #e9cb83 50%, #b8873a 100%);
  --shadow: 0 1px 2px rgba(60, 40, 10, .05), 0 12px 32px -12px rgba(60, 40, 10, .18);
  --ring: rgba(138, 97, 22, .38);
  --grain-opacity: .35;
  --glow: radial-gradient(1200px 600px at 85% -10%, rgba(201, 161, 78, .18), transparent 60%);
  --show-light: inline-block; --show-dark: none;

  --st-ns-bg: #ece5d8; --st-ns-fg: #5b5244; --st-ns-dot: #a39883;
  --st-ip-bg: #e3ecf1; --st-ip-fg: #2b5268; --st-ip-dot: #3f7896;
  --st-aw-bg: #f6e7c4; --st-aw-fg: #6e4b0c; --st-aw-dot: #b8862b;
  --st-ap-bg: #e2ecdf; --st-ap-fg: #2f5a32; --st-ap-dot: #4f8a52;
  --st-cr-bg: #f5e0da; --st-cr-fg: #8a3423; --st-cr-dot: #c0553d;
  color-scheme: light;
}

/* ---------- Tokens: dark ---------- */
[data-theme="dark"] {
  --bg: #0d0c0a;
  --bg-2: #13110e;
  --surface: #17150f;
  --surface-2: #1e1b15;
  --panel: #090807;
  --text: #f4ede0;
  --text-2: #ddd3c2;
  --muted: #a89d8b;
  --border: rgba(212, 175, 106, .13);
  --border-strong: rgba(212, 175, 106, .26);
  --gold: #dcbb72;
  --gold-1: #b88a3c; --gold-2: #f1d892; --gold-3: #a77a2e;
  --gold-soft: rgba(220, 187, 114, .1);
  --on-gold: #17110a;
  --btn-grad: var(--gold-grad);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 40px -18px rgba(0, 0, 0, .8);
  --ring: rgba(220, 187, 114, .45);
  --grain-opacity: .5;
  --glow: radial-gradient(1100px 560px at 85% -10%, rgba(220, 187, 114, .12), transparent 60%);
  --show-light: none; --show-dark: inline-block;

  --st-ns-bg: #24211b; --st-ns-fg: #c4b9a6; --st-ns-dot: #7d7466;
  --st-ip-bg: #182630; --st-ip-fg: #9fc6dc; --st-ip-dot: #5b9fc4;
  --st-aw-bg: #302613; --st-aw-fg: #f0d48e; --st-aw-dot: #dcb562;
  --st-ap-bg: #18261a; --st-ap-fg: #a8d4a6; --st-ap-dot: #6cb06b;
  --st-cr-bg: #331a15; --st-cr-fg: #f0a998; --st-cr-dot: #d9694f;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0d0c0a; --bg-2: #13110e; --surface: #17150f; --surface-2: #1e1b15; --panel: #090807;
    --text: #f4ede0; --text-2: #ddd3c2; --muted: #a89d8b;
    --border: rgba(212, 175, 106, .13); --border-strong: rgba(212, 175, 106, .26);
    --gold: #dcbb72; --gold-1: #b88a3c; --gold-2: #f1d892; --gold-3: #a77a2e;
    --gold-soft: rgba(220, 187, 114, .1); --on-gold: #17110a; --btn-grad: var(--gold-grad);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 40px -18px rgba(0, 0, 0, .8);
    --ring: rgba(220, 187, 114, .45); --grain-opacity: .5;
    --glow: radial-gradient(1100px 560px at 85% -10%, rgba(220, 187, 114, .12), transparent 60%);
    --show-light: none; --show-dark: inline-block;
    --st-ns-bg: #24211b; --st-ns-fg: #c4b9a6; --st-ns-dot: #7d7466;
    --st-ip-bg: #182630; --st-ip-fg: #9fc6dc; --st-ip-dot: #5b9fc4;
    --st-aw-bg: #302613; --st-aw-fg: #f0d48e; --st-aw-dot: #dcb562;
    --st-ap-bg: #18261a; --st-ap-fg: #a8d4a6; --st-ap-dot: #6cb06b;
    --st-cr-bg: #331a15; --st-cr-fg: #f0a998; --st-cr-dot: #d9694f;
    color-scheme: dark;
  }
}

:root {
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gold-grad: linear-gradient(135deg, var(--gold-1) 0%, var(--gold-2) 48%, var(--gold-3) 100%);
  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .42 0 0 0 0 .3 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 400 15px/1.55 var(--sans);
  color: var(--text);
  background: var(--glow), var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: var(--grain); opacity: var(--grain-opacity);
}
body > * { position: relative; z-index: 1; }
.theme-anim, .theme-anim * { transition: background-color .35s ease, color .35s ease, border-color .35s ease !important; }
img, svg { display: block; max-width: 100%; }
a { color: var(--gold); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
p { margin: 0; }

.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.eyebrow {
  font: 600 11.5px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px;
}
.display {
  font-family: var(--serif); font-weight: 400; font-optical-sizing: auto;
  font-size: clamp(40px, 5.2vw, 68px); line-height: 1.02; letter-spacing: -.02em; margin: 0;
}
.display em { font-style: italic; font-weight: 400; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .05em; }
.display--md { font-size: clamp(34px, 4.4vw, 54px); }
.title { font: 500 24px/1.2 var(--serif); letter-spacing: -.01em; margin: 0 0 6px; }
.title--sm { font-size: 20px; }
.lede { font-size: 17px; color: var(--text-2); max-width: 30ch; margin-top: 22px; line-height: 1.6; }

/* ---------- Logo (swaps per theme) ---------- */
.logo { display: inline-flex; align-items: center; }
.logo__img { height: auto; }
.logo__img--light { display: var(--show-light); }
.logo__img--dark { display: var(--show-dark); }
.logo--lg .logo__img { width: 220px; }
.logo--sm .logo__img { width: 152px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 15px/1 var(--sans); letter-spacing: .01em; text-decoration: none;
  padding: 15px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
.btn--gold {
  color: var(--on-gold); background: var(--btn-grad); background-size: 160% 160%; background-position: 0% 50%;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 10px 24px -12px rgba(150, 105, 30, .8);
}
.btn--gold:hover { background-position: 100% 50%; transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 14px 28px -12px rgba(150, 105, 30, .9); }
.btn--gold:active { transform: translateY(0); }
.btn--gold .i { transition: transform .2s ease; }
.btn--gold:hover .i { transform: translateX(3px); }
.btn--ghost { color: var(--text-2); background: transparent; border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--gold); color: var(--text); background: var(--gold-soft); }
.btn--sm { padding: 9px 14px; font-size: 13.5px; gap: 8px; }
.btn--sm .i { width: 16px; height: 16px; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 999px; display: inline-grid; place-items: center;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold); transform: rotate(-12deg); }
.theme-toggle .i-sun { display: var(--show-dark); }
.theme-toggle .i-moon { display: var(--show-light); }

.form { display: grid; gap: 16px; margin-top: 26px; }
.field { display: grid; gap: 8px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input {
  width: 100%; font: 400 15.5px/1.4 var(--sans); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 13px 15px; transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.input:hover { border-color: var(--gold); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--ring); background: var(--surface); }
.form .btn { margin-top: 8px; width: 100%; }

.notice { margin-top: 18px; padding: 12px 14px; border-radius: 12px; font-size: 14px; border: 1px solid; }
.notice--error { background: var(--st-cr-bg); color: var(--st-cr-fg); border-color: color-mix(in srgb, var(--st-cr-dot) 40%, transparent); }
.notice--ok { background: var(--st-ap-bg); color: var(--st-ap-fg); border-color: color-mix(in srgb, var(--st-ap-dot) 40%, transparent); }
.help { margin-top: 22px; font-size: 13.5px; color: var(--muted); text-align: center; }
.link-quiet { color: var(--muted); font-size: 13.5px; text-decoration: none; }
.link-quiet:hover { color: var(--gold); text-decoration: underline; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 28px;
}
.card--flush { padding: 0; overflow: hidden; }

/* ---------- Auth (split) ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth__brand {
  position: relative; overflow: hidden; background: var(--panel);
  border-right: 1px solid var(--border);
}
.auth__brand::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(700px 420px at 20% 110%, color-mix(in srgb, var(--gold-2) 22%, transparent), transparent 65%),
    radial-gradient(500px 300px at 100% 0%, color-mix(in srgb, var(--gold-1) 16%, transparent), transparent 70%);
}
.auth__brand::after { /* fine gold hairline frame echoing the logo's bracket */
  content: ""; position: absolute; inset: 28px; border: 1px solid var(--border-strong); border-radius: 26px; pointer-events: none;
  -webkit-mask: linear-gradient(135deg, #000 0 18%, transparent 18% 82%, #000 82%); mask: linear-gradient(135deg, #000 0 18%, transparent 18% 82%, #000 82%);
}
.auth__brand-inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 64px 72px; gap: 48px; }
.auth__pitch { max-width: 520px; }
.auth__foot { font-size: 12.5px; letter-spacing: .04em; color: var(--muted); }
.auth__panel { display: flex; flex-direction: column; padding: 28px 40px 48px; }
.auth__top { display: flex; justify-content: flex-end; align-items: center; gap: 18px; }
.auth__card { width: 100%; max-width: 420px; margin: auto; padding: 40px 36px; }
.auth__mobile-logo { display: none; margin-bottom: 28px; }

/* ---------- App shell ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.2) blur(12px); -webkit-backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.topbar__brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.topbar__tag { font: 600 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 999px; }
.topbar__actions { display: flex; align-items: center; gap: 12px; }
.topbar__actions form { margin: 0; }
.topbar__who { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-right: 4px; }

.page { padding-top: 56px; padding-bottom: 96px; }
.hero { margin-bottom: 40px; }
.hero__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; }
.hero__company { font: italic 400 20px/1.3 var(--serif); color: var(--text-2); }
.hero__lede { margin-top: 14px; font-size: 16px; }

.tier {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 12px; border-radius: 999px;
  font: 600 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  color: var(--gold); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
}
.tier::before { content: ""; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: var(--gold-grad); }
.tier--build_launch_grow, .tier--custom { color: var(--on-gold); background: var(--gold-grad); border-color: transparent; }
.tier--build_launch_grow::before, .tier--custom::before { background: var(--on-gold); }

.grid--summary { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.progress { display: flex; align-items: center; gap: 30px; }
.ring { width: 132px; height: 132px; flex: none; transform: rotate(-90deg); }
.ring text { transform: rotate(90deg); transform-origin: 60px 60px; text-anchor: middle; fill: var(--text); }
.ring__track { fill: none; stroke: var(--surface-2); stroke-width: 9; }
.ring__bar { fill: none; stroke: url(#goldg); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.ring__pct { font: 500 28px var(--serif); }
.ring__lbl { font: 600 9px var(--sans); letter-spacing: .16em; text-transform: uppercase; fill: var(--muted) !important; }
.legend { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; font-size: 13.5px; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: 9px; }
.legend b { margin-left: auto; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.attention { display: flex; flex-direction: column; justify-content: center; }
.attention__big { font: 400 64px/1 var(--serif); margin: -4px 0 10px; color: var(--muted); }
.attention--on { border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: linear-gradient(160deg, var(--gold-soft), transparent 70%), var(--surface); }
.attention--on .attention__big { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.section { margin-top: 56px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.section__head .title { margin: 0; font-size: 28px; }

/* ---------- Status pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px;
  font: 500 12.5px/1 var(--sans); white-space: nowrap;
  background: var(--pill-bg); color: var(--pill-fg);
}
.pill__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pill-dot); flex: none; }
.pill--not_started { --pill-bg: var(--st-ns-bg); --pill-fg: var(--st-ns-fg); --pill-dot: var(--st-ns-dot); }
.pill--in_progress { --pill-bg: var(--st-ip-bg); --pill-fg: var(--st-ip-fg); --pill-dot: var(--st-ip-dot); }
.pill--awaiting_approval { --pill-bg: var(--st-aw-bg); --pill-fg: var(--st-aw-fg); --pill-dot: var(--st-aw-dot); }
.pill--approved { --pill-bg: var(--st-ap-bg); --pill-fg: var(--st-ap-fg); --pill-dot: var(--st-ap-dot); }
.pill--changes_requested { --pill-bg: var(--st-cr-bg); --pill-fg: var(--st-cr-fg); --pill-dot: var(--st-cr-dot); }
.pill--awaiting_approval .pill__dot { box-shadow: 0 0 0 0 var(--pill-dot); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pill-dot) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Task timeline ---------- */
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.task {
  position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 22px 24px 22px 18px; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.task:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.task--awaiting_approval { border-color: color-mix(in srgb, var(--gold) 50%, transparent); background: linear-gradient(100deg, var(--gold-soft), transparent 55%), var(--surface); }
.task--awaiting_approval::before { content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--gold-grad); }
.task__num { font: 400 26px/1 var(--serif); color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.task--approved .task__num { color: var(--st-ap-dot); }
.task--awaiting_approval .task__num { color: var(--gold); }
.task__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.task__title { font: 500 19px/1.3 var(--serif); margin: 0; letter-spacing: -.005em; }
.task--approved .task__title { color: var(--text-2); }
.task__desc { color: var(--muted); margin-top: 6px; max-width: 64ch; }
.task__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; font-size: 13.5px; color: var(--text-2); }
.task__meta span { display: inline-flex; align-items: center; gap: 7px; }
.task__meta .i { width: 16px; height: 16px; color: var(--muted); }
.task__meta em { font-style: normal; color: var(--muted); }
.is-overdue { color: var(--st-cr-fg) !important; font-weight: 500; }

.empty { text-align: center; padding: 64px 24px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface); }
.empty .i { width: 56px; height: 56px; margin: 0 auto 18px; color: var(--gold); stroke-width: 1.2; }
.empty .muted { max-width: 44ch; margin: 6px auto 0; }

/* ---------- Team ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 22px 24px; }
.stat__num { font: 400 44px/1 var(--serif); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.stat--gold { border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: linear-gradient(160deg, var(--gold-soft), transparent 70%), var(--surface); }
.stat--gold .stat__num { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat--alert .stat__num { color: var(--st-cr-fg); }

.chef-head, .chef-row { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1.3fr 1.3fr; gap: 20px; align-items: center; }
.chef-head { padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--surface-2); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 600; }
.chef-list { list-style: none; margin: 0; padding: 0; }
.chef-row { padding: 20px 24px; border-bottom: 1px solid var(--border); transition: background-color .2s ease; }
.chef-row:last-child { border-bottom: 0; }
.chef-row:hover { background: var(--gold-soft); }
.chef-row__who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.chef-row__name { font: 500 17px/1.25 var(--serif); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 500 18px var(--serif); color: var(--on-gold); background: var(--gold-grad); }
.chef-row__flags { display: flex; flex-wrap: wrap; gap: 6px; }
.chef-row__next { color: var(--text-2); display: grid; gap: 3px; }
.chef-row__next-title { font-weight: 500; color: var(--text); }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 8px; border: 1px solid var(--border); }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--gold-grad); }

/* ---------- Simple pages ---------- */
.simple { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.simple__card { max-width: 420px; text-align: center; display: grid; gap: 14px; justify-items: center; padding: 40px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth__mobile-logo { display: inline-flex; }
  .auth__panel { min-height: 100vh; padding: 20px 20px 40px; }
  .grid--summary { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chef-head { display: none; }
  .chef-row { grid-template-columns: 1fr auto; gap: 14px; }
  .chef-row__progress, .chef-row__flags, .chef-row__next { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 18px; }
  .topbar__who { display: none; }
  .topbar__actions .btn span { display: none; }
  .logo--sm .logo__img { width: 116px; }
  .topbar__tag { display: none; }
  .page { padding-top: 36px; }
  .card { padding: 22px; }
  .auth__card { padding: 30px 22px; }
  .progress { flex-direction: column; align-items: flex-start; gap: 20px; }
  .legend { grid-template-columns: 1fr; }
  .task { grid-template-columns: 1fr; padding: 20px; }
  .task__num { font-size: 15px; }
  .stat__num { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.help a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.help a:hover { opacity: .85; }

.subtitle { font: italic 400 clamp(18px, 2vw, 22px)/1.35 var(--serif); color: var(--gold); letter-spacing: .01em; margin: 22px 0 0; padding-left: 14px; border-left: 1px solid var(--gold); }
.subtitle + .lede { margin-top: 20px; }

/* ---------- Navigation ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nav { display: flex; align-items: center; gap: 4px; margin-right: auto; margin-left: 28px; }
.nav__item {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s ease, background-color .2s ease;
}
.nav__item .i { width: 17px; height: 17px; }
.nav__item:hover { color: var(--text); background: var(--gold-soft); }
.nav__item.is-active { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav__item.is-active .i { color: var(--gold); }
.nav__badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  font: 600 11px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--on-gold); background: var(--btn-grad);
  box-shadow: 0 2px 8px -2px rgba(150, 105, 30, .6);
}

/* ---------- Message the team card ---------- */
.msg-card { display: flex; align-items: center; gap: 18px; margin-top: 20px; padding: 20px 24px; text-decoration: none; color: inherit; transition: border-color .2s ease, transform .2s ease; }
.msg-card:hover { border-color: color-mix(in srgb, var(--gold) 50%, transparent); transform: translateY(-1px); }
.msg-card__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--gold-soft); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.msg-card__icon .i { width: 22px; height: 22px; }
.msg-card__text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.msg-card__text .title { margin: 0; }
.msg-card__go { color: var(--gold); transition: transform .2s ease; }
.msg-card:hover .msg-card__go { transform: translateX(3px); }
.attention a { color: var(--gold); font-weight: 500; }

/* ---------- Inbox ---------- */
.page--narrow { max-width: 880px; }
.hero--compact { margin-bottom: 26px; }
.display--sm { font-size: clamp(30px, 3.6vw, 42px); }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 28px; }
.tabs__item { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; }
.tabs__item:hover { color: var(--text); }
.tabs__item.is-active { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.inbox-group { margin-bottom: 30px; }
.inbox-group__title { font: 600 11.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
.inbox-group__title .muted { letter-spacing: 0; text-transform: none; font-weight: 400; }
.thread-list { list-style: none; margin: 0; padding: 0; }
.thread-list > li + li { border-top: 1px solid var(--border); }
.thread-list__empty { padding: 20px 24px; }
.thread-row { display: flex; align-items: center; gap: 16px; padding: 16px 22px; text-decoration: none; color: inherit; transition: background-color .2s ease; }
.thread-row:hover { background: var(--gold-soft); }
.thread-row__main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.thread-row__top { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.thread-row__title { font: 500 17px/1.25 var(--serif); white-space: nowrap; }
.thread-row__sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-row__preview { font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-row__side { display: grid; justify-items: end; gap: 6px; flex: none; }
.thread-row.is-unread .thread-row__title { font-weight: 600; }
.thread-row.is-unread .thread-row__preview { color: var(--text); font-weight: 500; }
.thread-row.is-unread .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold); }
.avatar--hash { background: var(--surface-2); color: var(--gold); border: 1px solid var(--border-strong); font-family: var(--sans); font-weight: 600; }

/* ---------- Thread ---------- */
.page--thread { padding-top: 36px; padding-bottom: 48px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 18px; }
.back-link:hover { color: var(--gold); }
.thread-head { margin-bottom: 22px; }
.thread-head__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.thread { display: flex; flex-direction: column; }
.msgs { list-style: none; margin: 0; padding: 28px 28px 12px; display: flex; flex-direction: column; gap: 18px; min-height: 260px; }
.msgs__empty { margin: auto; text-align: center; padding: 40px 12px; max-width: 40ch; }
.msgs__empty .i { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--gold); stroke-width: 1.3; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(78%, 560px); }
.msg--mine { align-self: flex-end; align-items: flex-end; }
.msg__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 0 4px 6px; }
.msg__name { color: var(--text-2); font-weight: 600; }
.msg__role { color: var(--gold); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.msg__bubble {
  padding: 12px 16px; border-radius: 18px 18px 18px 6px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.msg--mine .msg__bubble { border-radius: 18px 18px 6px 18px; background: var(--btn-grad); color: var(--on-gold); border-color: transparent; box-shadow: 0 8px 20px -14px rgba(150, 105, 30, .9); }
.msg--new { animation: msg-in .35s ease both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.compose { position: sticky; bottom: 0; display: grid; gap: 10px; padding: 16px 20px 18px; margin-top: 12px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.compose__input { resize: none; min-height: 52px; max-height: 260px; }
.compose__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compose__error { margin: 0; }
.compose button[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* ---------- Roles ---------- */
.roles__scroll { overflow-x: auto; }
.roles__table { width: 100%; border-collapse: collapse; }
.roles__table th, .roles__table td { padding: 16px 22px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.roles__table thead th { background: var(--surface-2); vertical-align: bottom; }
.roles__table thead th span, .roles__table tbody th span { display: block; }
.roles__perm, .roles__role { font-weight: 600; color: var(--text); font-size: 14px; }
.roles__table td { text-align: center; }
.roles__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; }
.check { position: relative; display: inline-grid; place-items: center; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.check__box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border-strong); background: var(--surface); transition: background-color .15s ease, border-color .15s ease; }
.check input:checked + .check__box { background: var(--btn-grad); border-color: transparent; }
.check input:checked + .check__box::after { content: ""; display: block; width: 6px; height: 11px; margin: 3px auto 0; border: solid var(--on-gold); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check input:focus-visible + .check__box { outline: 2px solid var(--gold); outline-offset: 2px; }
.check input:disabled + .check__box { opacity: .55; }

@media (max-width: 980px) {
  .nav { margin-left: 12px; }
}
@media (max-width: 760px) {
  .nav__label { display: none; }
  .nav__item { padding: 9px 10px; }
  .nav { margin-left: 4px; gap: 2px; }
}
@media (max-width: 620px) {
  .topbar__inner { gap: 8px; }
  .msgs { padding: 20px 14px 8px; }
  .msg { max-width: 88%; }
  .compose { padding: 12px 12px 14px; }
  .compose__hint { display: none; }
  .thread-row { padding: 14px 16px; gap: 12px; }
  .thread-row__top { flex-direction: column; gap: 2px; }
  .tabs { display: flex; }
  .tabs__item { flex: 1; justify-content: center; }
  .msg-card { padding: 16px 18px; gap: 14px; }
    .roles__table th, .roles__table td { padding: 12px 14px; }
}
.msg--mine .msg__meta { justify-content: flex-end; text-align: right; }
.card.card--flush { padding: 0; }
.compose__bar .btn { margin-left: auto; }

/* ---------- Team management ---------- */
.btn--xs { padding: 6px 11px; font-size: 12.5px; gap: 6px; border-radius: 9px; }
.btn--danger:hover { border-color: var(--st-cr-dot); color: var(--st-cr-fg); background: var(--st-cr-bg); }
.input--sm { padding: 8px 10px; font-size: 13.5px; width: auto; min-width: 140px; }
select.input { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.small { font-size: 13px; }
.footnote { margin-top: 14px; }
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-scroll { overflow-x: auto; }
.people { width: 100%; border-collapse: collapse; }
.people th, .people td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.people thead th { background: var(--surface-2); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.people tbody tr:last-child td { border-bottom: 0; }
.person--deactivated .person__who, .person--deactivated td:nth-child(4) { opacity: .55; }
.person__who { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.person__who .avatar { width: 36px; height: 36px; font-size: 15px; }
.person__name { font-weight: 600; }
.person__actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.person__actions form { margin: 0; }
.pill--member-active { --pill-bg: var(--st-ap-bg); --pill-fg: var(--st-ap-fg); --pill-dot: var(--st-ap-dot); }
.pill--member-invited { --pill-bg: var(--st-aw-bg); --pill-fg: var(--st-aw-fg); --pill-dot: var(--st-aw-dot); }
.pill--member-deactivated { --pill-bg: var(--st-ns-bg); --pill-fg: var(--st-ns-fg); --pill-dot: var(--st-ns-dot); }
.add-member { margin-bottom: 8px; }
.add-member .muted { margin: 6px 0 18px; }
.add-member__form { display: grid; grid-template-columns: 1fr 1.3fr 1fr auto; gap: 14px; align-items: end; }
.add-member__form--role { grid-template-columns: 1fr 2fr auto; }
.setup-link { margin-bottom: 22px; border-color: var(--gold); background: linear-gradient(0deg, var(--gold-soft), var(--gold-soft)), var(--surface); }
.setup-link__head { display: flex; gap: 14px; align-items: flex-start; }
.setup-link__head .muted { margin-top: 4px; }
.setup-link__row { display: flex; gap: 10px; margin-top: 16px; }
.setup-link__url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.role-card { display: grid; gap: 8px; align-content: start; color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.role-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.role-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-card__meta { color: var(--text-2); }
.role-card__edit { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 13.5px; font-weight: 500; margin-top: 4px; }
.role-card__edit .i { width: 15px; height: 15px; }
.roles__table--matrix td { text-align: center; }
.roles__table--matrix thead th { min-width: 120px; font-weight: 400; }
.roles__table--matrix thead th:first-child { min-width: 160px; }
.roles__table--matrix tbody th { white-space: nowrap; }
.tick { color: var(--gold); font-weight: 700; }
.tick--no { color: var(--text-3, var(--text-2)); opacity: .5; }
.role-form { display: grid; gap: 18px; margin-top: 18px; }
.role-form__grid { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; }
textarea.input { resize: vertical; min-height: 96px; font: inherit; }
.perms { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.perm { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); }
.perm:hover { border-color: var(--gold); }
.perm--locked { cursor: not-allowed; opacity: .75; }
.perm .check { margin-top: 1px; }
.perm__label { display: block; font-weight: 600; }
.perm__help { display: block; margin-top: 2px; }
.perm__key { display: inline-block; margin-top: 6px; font-size: 11.5px; color: var(--text-2); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.role-form .roles__bar { padding: 0; }
.danger-zone { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); display: grid; gap: 10px; justify-items: start; }
.simple { position: relative; }
.simple__top { position: absolute; top: 20px; right: 20px; }
.simple__card--form { text-align: left; justify-items: stretch; max-width: 440px; }
.simple__card--form .logo { justify-self: start; }
.status-card { max-width: 460px; }
.status-card__icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); background: var(--gold-soft); border: 1px solid var(--border); }
.status-card__icon .i { width: 24px; height: 24px; }
@media (max-width: 900px) {
  .add-member__form, .add-member__form--role, .role-form__grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .people thead { display: none; }
  .people, .people tbody, .people tr, .people td { display: block; width: 100%; }
  .people tr { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .people tbody tr:last-child { border-bottom: 0; }
  .people td { border: 0; padding: 6px 0; }
  .people td[data-label="Role"]::before, .people td[data-label="Status"]::before, .people td[data-label="Last sign-in"]::before { content: attr(data-label); display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin-bottom: 4px; }
  .person__actions { justify-content: flex-start; padding-top: 6px; }
  .setup-link__row { flex-direction: column; }
}
.btn, .topbar__who, .nav__item { white-space: nowrap; }
.section--first { margin-top: 0; }
.roles__table--matrix thead th { min-width: 0; font-weight: 400; text-align: center; vertical-align: bottom; padding: 14px 10px; }
.roles__table--matrix thead th:first-child { text-align: left; min-width: 150px; padding-left: 22px; }
.roles__table--matrix td { padding: 12px 10px; }
.roles__table--matrix .roles__perm { font-size: 12.5px; line-height: 1.25; }
.roles__table--matrix tbody tr:last-child th, .roles__table--matrix tbody tr:last-child td { border-bottom: 0; }
.perm-legend { margin-top: 14px; font-size: 13.5px; }
.perm-legend summary { cursor: pointer; color: var(--gold); font-weight: 500; }
.perm-legend ul { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 6px; }

/* ---------- Email settings + account recovery ---------- */
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field__row .link-quiet { font-size: 13px; }
.auth__card .status-card__icon { margin-bottom: 4px; }
.settings-card { margin-bottom: 18px; display: grid; gap: 14px; }
.settings-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.settings-card__head .muted { margin-top: 4px; }
.settings-form { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.settings-form .field--short .input { max-width: 140px; }
.settings-form__wide { grid-column: 1 / -1; }
.settings-form__bar { display: flex; justify-content: flex-end; }
.settings-test { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.settings-test .field { flex: 1; min-width: 220px; }
.inline-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--text-2); }
.steps { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.compose--closed { margin: 0; padding: 16px 24px; border-top: 1px solid var(--border); text-align: center; }
.btn[disabled] { opacity: .5; pointer-events: none; }
@media (max-width: 720px) {
  .settings-form { grid-template-columns: 1fr; }
  .settings-card__head { flex-direction: column; }
}
.topbar .logo, .topbar__brand { flex-shrink: 0; }
.topbar .logo__img { min-width: 132px; }
.link-quiet .i, .btn--ghost .i { width: 16px; height: 16px; }
p.small > .link-quiet { display: inline-flex; align-items: center; gap: 6px; }
.settings-form { grid-template-columns: repeat(4, 1fr); }
.settings-form .field { grid-column: span 2; }
.settings-form .field:first-of-type { grid-column: span 3; }
.settings-form .field--short { grid-column: span 1; }
.settings-form .field--short .input { max-width: none; }
.settings-form .settings-form__wide { grid-column: 1 / -1; }
@media (max-width: 720px) { .settings-form .field, .settings-form .field:first-of-type, .settings-form .field--short { grid-column: 1 / -1; } }
@media (max-width: 620px) {
  .topbar .logo__img { min-width: 0; width: 92px; }
  .topbar__tag { display: none; }
  .topbar__inner { gap: 6px; }
  .nav__item { padding: 8px 7px; }
}

/* ---------- Chef approvals ---------- */
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 10px; border-radius: 999px; font: 600 13px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--on-gold); background: var(--btn-grad); box-shadow: 0 4px 14px -6px rgba(150, 105, 30, .7); white-space: nowrap; }
.approvals .notice { margin: 0 0 16px; }
.approvals__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.approval { position: relative; padding: 26px 28px; border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: linear-gradient(150deg, var(--gold-soft), transparent 55%), var(--surface); scroll-margin-top: 90px; }
.approval::before { content: ""; position: absolute; left: -1px; top: 22px; bottom: 22px; width: 3px; border-radius: 3px; background: var(--gold-grad); }
.approval__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.approval__top .eyebrow { margin: 0; }
.approval__title { font: 500 26px/1.2 var(--serif); letter-spacing: -.01em; margin: 10px 0 4px; }
.approval__by { margin: 0; }
.approval__note { margin: 16px 0 0; padding: 14px 18px; border-left: 2px solid var(--gold); background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-radius: 0 12px 12px 0; font: italic 400 16px/1.55 var(--serif); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }
.approval__preview { margin: 14px 0 0; }
.approval__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.approval__changes > summary, .review-form > summary { list-style: none; cursor: pointer; }
.approval__changes > summary::-webkit-details-marker, .review-form > summary::-webkit-details-marker { display: none; }
.approval__changes[open] { flex-basis: 100%; order: 3; }
.approval__changes .when-open, .review-form .when-open { display: none; }
.approval__changes[open] .when-open, .review-form[open] .when-open { display: inline; }
.approval__changes[open] .when-closed, .review-form[open] .when-closed { display: none; }
.approval__changes[open] > summary, .review-form[open] > summary { background: none; border-color: transparent; box-shadow: none; color: var(--muted); padding: 2px 0; margin-bottom: 8px; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; width: auto; }
.approval__form { display: grid; gap: 12px; margin-top: 4px; }
.approval__form .notice { margin: 0; }
.approval__form textarea, .review-form__form textarea { resize: vertical; min-height: 96px; font: inherit; }
.approval__form-bar, .review-form__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.review-link { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: border-color .2s ease, background-color .2s ease; }
.review-link:hover { border-color: var(--gold); background: var(--gold-soft); }
.review-link .i { width: 16px; height: 16px; color: var(--gold); flex: none; }
.review-link__host { color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.task__cta { margin: 12px 0 0; font-size: 13.5px; }
.task__cta a { color: var(--gold); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.task__cta .i { width: 15px; height: 15px; }

/* Task history (chef + team) */
.history { margin-top: 14px; }
.history__toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); list-style: none; user-select: none; }
.history__toggle::-webkit-details-marker { display: none; }
.history__toggle::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--gold); border-bottom: 1.6px solid var(--gold); transform: rotate(-45deg); transition: transform .2s ease; }
.history[open] > .history__toggle::before { transform: rotate(45deg); }
.history__count { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 600; }
.history__list { list-style: none; margin: 12px 0 0; padding: 0 0 0 4px; display: grid; gap: 0; }
.history__item { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 14px; }
.history__item:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 14px; bottom: 0; width: 1px; background: var(--border-strong); }
.history__dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--pill-dot); box-shadow: 0 0 0 3px var(--surface); }
.history__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; font-size: 14px; }
.history__what { font-weight: 600; color: var(--text); }
.history__head time { font-size: 12.5px; color: var(--muted); }
.history__note { margin: 4px 0 0; font-size: 14px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }
.history .review-link { margin-top: 8px; padding: 5px 12px; font-size: 12.5px; }

/* Team chef page */
.chef-summary { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 22px 26px; }
.chef-summary__who { display: flex; align-items: center; gap: 14px; flex: 1 1 220px; min-width: 0; }
.chef-summary__company { font: 500 18px/1.25 var(--serif); margin: 0 0 6px; }
.avatar--lg { width: 52px; height: 52px; font-size: 22px; }
.chef-summary__stats { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-stat { display: grid; gap: 2px; min-width: 112px; padding: 10px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.mini-stat__num { font: 400 26px/1 var(--serif); font-variant-numeric: tabular-nums; }
.mini-stat--gold { border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: linear-gradient(160deg, var(--gold-soft), transparent 70%), var(--surface); }
.mini-stat--gold .mini-stat__num { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mini-stat--alert .mini-stat__num { color: var(--st-cr-fg); }
.chef-summary + .notice { margin-top: 18px; }
.task { scroll-margin-top: 90px; }
.review-current { margin-top: 14px; padding: 12px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); background: color-mix(in srgb, var(--surface-2) 70%, transparent); display: grid; gap: 6px; justify-items: start; }
.review-current p { margin: 0; }
.review-current--changes { border-color: color-mix(in srgb, var(--st-cr-dot) 45%, transparent); background: var(--st-cr-bg); color: var(--st-cr-fg); }
.review-current__note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--text-2); }
.review-current--changes .review-current__note { color: var(--st-cr-fg); }
.review-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 16px; }
.review-form[open] { flex-basis: 100%; }
.review-form__form { display: grid; gap: 12px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-2); }
.review-form__form .notice { margin: 0; }
.chef-row__link { color: inherit; text-decoration: none; }
.chef-row__link:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* Team dashboard: chef decisions */
.decisions { list-style: none; margin: 0; padding: 6px 24px; }
.decisions--empty { padding: 22px 24px; }
.decision { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.decision:last-child { border-bottom: 0; }
.decision__body p { margin: 0; }
.decision__chef { color: var(--gold); font-weight: 600; text-decoration: none; }
.decision__chef:hover { text-decoration: underline; }
.decision__comment { margin-top: 4px !important; color: var(--text-2); font-style: italic; overflow-wrap: anywhere; }

/* Automatic notes in threads */
.msg--system { align-self: center; align-items: center; max-width: min(92%, 620px); }
.msg--system .msg__meta { justify-content: center; }
.msg--system .msg__bubble { border-radius: 14px; text-align: center; background: var(--gold-soft); border: 1px dashed color-mix(in srgb, var(--gold) 45%, transparent); color: var(--text-2); font-size: 14px; }

@media (max-width: 620px) {
  .approval { padding: 22px 20px; }
  .approval__title { font-size: 22px; }
  .approval__actions > form, .approval__actions > details:not([open]) { flex: 1 1 140px; }
  .approval__actions .btn { width: 100%; justify-content: center; }
  .approval__form-bar .btn, .review-form__bar .btn { width: 100%; justify-content: center; }
  .chef-summary { padding: 20px; gap: 16px; }
  .chef-summary__stats { width: 100%; }
  .mini-stat { flex: 1 1 0; min-width: 0; padding: 10px 12px; }
  .mini-stat__num { font-size: 22px; }
  .decisions { padding: 4px 18px; }
}

/* ---------- Attachments ---------- */
.compose__bar .compose__attach { margin-left: 0; position: relative; cursor: pointer; }
.compose__hint { flex: 1; min-width: 0; }
.compose__file-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; font-size: 0; }
.compose__attach:focus-within { box-shadow: 0 0 0 4px var(--ring); border-color: var(--gold); }
.compose__files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.compose__files:empty { display: none; }
.compose__file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 12.5px; }
.compose__file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; color: var(--text); font-weight: 500; }
.compose__file-size { color: var(--muted); }
.compose__file.is-too-big { border-color: var(--st-cr-dot); background: var(--st-cr-bg); color: var(--st-cr-fg); }
.compose__file.is-too-big .compose__file-size { color: var(--st-cr-fg); }

.msg__files { display: grid; gap: 8px; margin-top: 6px; width: 100%; }
.msg--mine .msg__files { justify-items: end; }
.att-grid { display: grid; gap: 6px; width: min(420px, 100%); }
.att-grid--2 { grid-template-columns: 1fr 1fr; }
.att-grid--3 { grid-template-columns: repeat(3, 1fr); }
.att-media { display: block; position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-strong); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; aspect-ratio: 4 / 3; }
.att-grid--1 .att-media { aspect-ratio: auto; max-height: 360px; }
.att-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.att-grid--1 .att-media img { object-fit: contain; max-height: 360px; }
.att-media:hover img { transform: scale(1.02); }
.att-media--video { aspect-ratio: auto; background: #000; }
.att-media video { display: block; width: 100%; max-height: 360px; }
.att-chips { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: min(420px, 100%); }
.file-chip { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .2s ease, background-color .2s ease; }
.file-chip:hover { border-color: var(--gold); background: var(--gold-soft); }
.file-chip__icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: none; font: 700 10.5px/1 var(--sans); letter-spacing: .06em; color: var(--on-gold); background: var(--gold-grad); }
.file-chip__text { display: grid; gap: 2px; min-width: 0; flex: 1; text-align: left; }
.file-chip__name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip__meta { font-size: 12.5px; color: var(--muted); }
.file-chip > .i { width: 16px; height: 16px; color: var(--gold); flex: none; transform: rotate(90deg); }

/* ---------- Approval cards in threads ---------- */
.msg--card { max-width: min(92%, 560px); }
.acard { position: relative; width: min(520px, 100%); padding: 20px 22px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: linear-gradient(150deg, var(--gold-soft), transparent 60%), var(--surface); box-shadow: var(--shadow); display: grid; gap: 12px; text-align: left; scroll-margin-top: 90px; }
.acard::before { content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--gold-grad); }
.acard__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.acard__head .eyebrow { margin: 0; }
.acard__title { font: 500 22px/1.2 var(--serif); margin: 0; letter-spacing: -.01em; }
.acard__note { margin: 0; padding: 10px 14px; border-left: 2px solid var(--gold); background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-radius: 0 12px 12px 0; font: italic 400 15px/1.55 var(--serif); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.acard .att-grid, .acard .att-chips { width: 100%; }
.acard__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.acard__status { margin: 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.acard__status p { margin: 0; }
.acard__status--approved { color: var(--st-ap-fg); }
.acard__status--approved .i { width: 18px; height: 18px; stroke: currentColor; }
.acard__status--changes { display: grid; gap: 6px; color: var(--st-cr-fg); }
.acard__comment { padding: 10px 14px; border-radius: 12px; background: var(--st-cr-bg); color: var(--st-cr-fg); white-space: pre-wrap; overflow-wrap: anywhere; }
.acard__replaced { margin: 0; font-size: 13px; color: var(--muted); font-style: italic; }
.acard--superseded, .acard--withdrawn { opacity: .78; border-color: var(--border-strong); background: var(--surface); }
.acard--superseded::before, .acard--withdrawn::before { background: var(--border-strong); }
.acard--approved { border-color: color-mix(in srgb, var(--st-ap-dot) 45%, transparent); }
.acard--approved::before { background: var(--st-ap-dot); }
.acard--changes_requested { border-color: color-mix(in srgb, var(--st-cr-dot) 45%, transparent); }
.acard--changes_requested::before { background: var(--st-cr-dot); }
.thread__notice { margin: 18px 24px 0; }

/* Composer: Send for approval */
.compose__approval { display: grid; gap: 10px; }
.compose__toggle { display: inline-flex; align-items: center; gap: 10px; width: fit-content; padding: 6px 14px 6px 10px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.compose__toggle input { width: 16px; height: 16px; accent-color: var(--gold-2); }
.compose__toggle:hover { border-color: var(--gold); }
.compose__approval-fields { display: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); background: linear-gradient(150deg, var(--gold-soft), transparent 70%), var(--surface-2); }
.compose__approval-fields .input { width: 100%; }
.compose__approval-hint { grid-column: 1 / -1; margin: 0; }
.compose.is-approval .compose__toggle, .compose:has([data-for-approval]:checked) .compose__toggle { border-color: var(--gold); background: var(--gold-soft); color: var(--text); }
.compose.is-approval .compose__approval-fields, .compose:has([data-for-approval]:checked) .compose__approval-fields { display: grid; }
.compose.is-approval:not(.is-new-item) .compose__new-title { opacity: .45; }

/* Chef dashboard: previews on awaiting cards */
.approval__thumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.approval__thumb { display: block; width: 96px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-strong); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 12px 12px; }
.approval__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.approval__thread { margin: 12px 0 0; }
.approval__thread a { color: var(--gold); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.approval__thread .i { width: 15px; height: 15px; }

@media (max-width: 620px) {
  .msgs { padding: 20px 14px 10px; }
  .msg--card { max-width: 100%; align-self: stretch; }
  .msg--card.msg--mine { align-items: stretch; }
  .acard { padding: 18px 16px; }
  .acard__title { font-size: 20px; }
  .acard__actions > form, .acard__actions > details:not([open]) { flex: 1 1 140px; }
  .acard__actions .btn { width: 100%; justify-content: center; }
  .compose__approval-fields { grid-template-columns: 1fr; }
  .compose__hint { display: none; }
  .att-grid--3 { grid-template-columns: 1fr 1fr; }
}

/* message delete: quiet text button, not native button chrome */
.msg__delete { margin: 2px 4px 0; display: flex; justify-content: flex-end; }
.msg__delete button { background: none; border: 0; padding: 2px 4px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; border-radius: 6px; }
.msg__delete button:hover, .msg__delete button:focus-visible { color: var(--gold); text-decoration: underline; }

/* ---------- Team dashboard: Message shortcut + chef thread side panel ---------- */
.has-chat .chef-head, .has-chat .chef-row { grid-template-columns: 1.5fr 1fr 1.2fr 1.3fr 1.3fr auto; }
.chef-row__msg { display: flex; justify-content: flex-end; }
.chef-row__chat { position: relative; white-space: nowrap; gap: 7px; }
.chef-row__chat .i { width: 16px; height: 16px; }
.chef-row__chat.has-unread { border-color: var(--gold); color: var(--gold); }
.chef-row__badge { margin-left: 2px; }
@media (max-width: 980px) {
  .has-chat .chef-head { display: none; }
  .has-chat .chef-row { grid-template-columns: 1fr auto; }
  .has-chat .chef-row__next { grid-column: 1; }
  .has-chat .chef-row__msg { grid-column: 2; align-self: end; }
}

html.has-drawer, html.has-drawer body { overflow: hidden; }
.drawer { position: fixed; inset: 0; z-index: 80; }
.drawer[hidden] { display: none; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(10, 8, 5, .48); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s ease; }
.drawer__sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); display: flex; flex-direction: column; background: var(--bg); background-image: var(--glow); border-left: 1px solid var(--border-strong); box-shadow: -24px 0 60px -20px rgba(0, 0, 0, .45); transform: translateX(24px); opacity: 0; transition: transform .22s ease, opacity .22s ease; outline: none; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__sheet { transform: none; opacity: 1; }
.drawer__close { position: absolute; top: 14px; right: 14px; z-index: 3; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.drawer__close:hover { border-color: var(--gold); color: var(--gold); }
.drawer__close:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.drawer__close .i { width: 18px; height: 18px; }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.drawer__loading { padding: 32px 28px; }
.drawer__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 22px 70px 18px 24px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 94%, transparent); position: sticky; top: 0; z-index: 2; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.drawer__head .title { font: 500 26px/1.15 var(--serif); margin: 2px 0 6px; }
.drawer__full { white-space: nowrap; margin-left: auto; }
.drawer__head > div { flex: 1; min-width: 0; }
.drawer__head .thread-head__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.panel-thread { display: flex; flex-direction: column; min-height: 100%; }
.panel-thread .thread { flex: 1; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.panel-thread .msgs { padding: 22px 22px 10px; min-height: 0; flex: 1; }
.panel-thread .compose { margin-top: auto; border-radius: 0; }
@media (max-width: 720px) {
  .drawer__sheet { width: 100vw; border-left: 0; transform: translateY(16px); }
  .drawer__head { padding: 14px 62px 12px 16px; }
  .drawer__full { margin-left: 0; }
  .drawer__head .title { font-size: 22px; }
  .drawer__close { top: 10px; right: 10px; }
  .panel-thread .msgs { padding: 16px 12px 8px; }
}
@media (prefers-reduced-motion: reduce) { .drawer__sheet, .drawer__backdrop { transition: none; } }
