/* ==========================================================================
   Secret Santa: white site header, mint left nav, pill buttons, hairline cards.
   ========================================================================== */
:root {
  --canvas: #ffffff;
  --canvas-soft: #faf6f3;
  --surface: #ffffff;
  --border: #e0e0e0;
  --border-soft: #f3ebe5;
  --card-edge: #efe3db;
  --input-edge: #e2d3c9;

  --ink: #2b1a20;
  --ink-soft: #5f5357;
  --ink-faint: #7a6d71;

  --accent: #9d2449;
  --accent-soft: #fbe8ec;
  --hero: #3a0d1f;
  --mint: #f4b942;
  --mint-deep: #e0a42e;
  --side: #fcf7f3;
  --side-active: #f5e4df;

  --ok: #1f9d61;
  --ok-soft: #d6f2e2;
  --warn: #856404;
  --warn-soft: #ffebad;
  --err: #c4221f;
  --err-soft: #f8d7da;
  --info-soft: #fdebd8;
  --mist: #f3ebe5;

  --shadow-card: 0 1px 2px #3a0d1f0a;
  --shadow-lift: 0 2px 4px #3a0d1f0d, 0 16px 32px -12px #3a0d1f33;
  --shadow-pop: 0 12px 32px #0000001f, 0 4px 8px #0000000f;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Plus Jakarta Sans", "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 21px;
  letter-spacing: 0.1px;
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    radial-gradient(900px 420px at 18% -160px, #f4b94222, transparent 70%),
    radial-gradient(900px 480px at 100% -120px, #9d244914, transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #f4b94240; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; color: var(--ink); }
p { margin: 0; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }

/* ---------- type scale ---------- */
.t-h1 { font-size: 32px; line-height: 41.6px; letter-spacing: -0.9px; }
.t-h4 { font-size: 24px; line-height: 31.2px; letter-spacing: -0.52px; }
.t-h6 { font-size: 20px; line-height: 26px; letter-spacing: 0.38px; }
.t-body-lg { font-size: 18px; line-height: 27px; letter-spacing: 0.36px; }
.t-body-md { font-size: 16px; line-height: 24px; }
.t-caption { font-size: 12px; line-height: 18px; letter-spacing: 0.36px; }
.eyebrow { font-size: 12px; line-height: 18px; letter-spacing: 0.9px; font-weight: 700; text-transform: uppercase; color: var(--accent); }

/* ---------- icons ---------- */
svg.ic { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ic-teal { color: var(--accent); }

/* ==========================================================================
   App shell
   ========================================================================== */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.app-body { flex: 1; display: flex; min-height: 0; }
.app-main { flex: 1; min-width: 0; overflow-y: auto; }
.page { max-width: 1120px; margin: 0 auto; padding: 32px 32px 96px; }
@media (max-width: 767px) { .page { padding: 20px 16px 110px; } }

/* site header */
.sh {
  position: relative; z-index: 20; flex-shrink: 0;
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 24px;
  background: #fff; border-bottom: 1px solid var(--border-soft); box-shadow: 0 1px 3px #0000000d;
}
.sh-logo { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.sh-logo img { height: 28px; width: auto; display: block; }
.sh-divider { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; }
.sh-title { font-size: 18px; font-weight: 500; line-height: 27px; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.sh-title small { color: var(--ink-faint); font-size: 14px; font-weight: 400; margin-left: 6px; }
.sh-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
@media (max-width: 767px) {
  .sh { padding: 0 16px; gap: 12px; }
  .sh-title { font-size: 16px; }
  .sh-title small { display: none; }
}
@media (max-width: 339px) { .sh-title, .sh-divider { display: none; } }

.avatar-btn { display: flex; align-items: center; gap: 4px; padding: 2px; border-radius: 999px; border: 0; background: none; cursor: pointer; color: var(--ink); }
.avatar-btn:hover, .avatar-btn.is-open { background: #9d24490f; }
.avatar { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 1100; width: 280px; overflow: hidden;
  background: #fff; border: 1px solid #efe6e1; border-radius: 12px; box-shadow: var(--shadow-pop);
  animation: fade-up .15s ease-out;
}
.menu-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border-soft); }
.menu-name { font-weight: 600; }
.menu-email { color: var(--ink-soft); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.menu-section { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.menu-body { padding: 8px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; color: var(--ink-soft); font: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
.menu-item:hover { background: #9d24490f; color: var(--ink); }
.menu-item.danger:hover { background: #fef2f2; color: var(--err); }

/* left nav */
.side {
  display: none; flex-shrink: 0; flex-direction: column; gap: 2px; overflow-y: auto;
  width: 72px; padding: 16px 10px;
  background: var(--side); border-right: 1px solid var(--border-soft);
}
.side-item {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  height: 44px; padding: 0 12px; border-radius: 8px; white-space: nowrap; text-decoration: none;
  color: var(--accent); font: inherit; font-size: 15px; font-weight: 500; line-height: 22px;
  background: none; border: 0; cursor: pointer; transition: background-color .15s, color .15s;
}
.side-item:hover { color: var(--ink); background: #9d24490f; }
.side-item[aria-current="page"] { color: var(--ink); background: var(--side-active); font-weight: 600; }
.side-item::before { content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.side-item[aria-current="page"]::before { background: var(--mint); }
.side-text { display: none; flex: 1; text-align: left; }
.side-badge { position: absolute; top: 4px; right: 2px; display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 1; }
.side-sep { height: 1px; margin: 8px 4px; background: var(--border-soft); }
.side-label { display: none; padding: 12px 12px 4px; }
.side-foot { margin-top: auto; }
@media (min-width: 768px) { .side { display: flex; } }
@media (min-width: 1100px) {
  .side { width: 232px; padding: 20px 12px; }
  .side-item { justify-content: flex-start; }
  .side-item::before { left: -12px; }
  .side-text, .side-label { display: block; }
  .side-badge { position: static; }
}

/* mobile bottom bar */
.bottom-nav { position: fixed; inset: auto 0 0 0; z-index: 30; display: flex; overflow-x: auto; border-top: 1px solid var(--border); background: #fff; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px #3a0d1f0d; }
.bottom-nav .side-item { flex: 1; min-width: 72px; flex-direction: column; gap: 4px; height: auto; padding: 8px 4px 10px; font-size: 11px; border-radius: 0; }
.bottom-nav .side-item::before { left: 16px; right: 16px; top: 0; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
.bottom-nav .side-item[aria-current="page"] { background: none; }
.bottom-nav .side-text { display: block; }
.bottom-nav .side-badge { position: absolute; top: 4px; right: 14px; }
@media (min-width: 768px) { .bottom-nav { display: none; } }

/* ==========================================================================
   Page building blocks
   ========================================================================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin-top: 4px; }
.page-head p.sub { margin-top: 6px; color: var(--ink-soft); font-size: 16px; line-height: 24px; max-width: 680px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--card-edge); border-radius: 16px; box-shadow: var(--shadow-card); padding: 24px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-size: 20px; line-height: 26px; letter-spacing: .2px; }
.card-head p { color: var(--ink-soft); margin-top: 2px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { padding: 20px 24px 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 960px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 20px; align-content: start; }

/* hero card (teal) */
.hero-card {
  position: relative; overflow: hidden; border-radius: 24px; color: #fff; padding: 32px;
  background:
    radial-gradient(600px 300px at 85% 0%, #f4b94233, transparent 60%),
    radial-gradient(700px 420px at 10% 120%, #9d244999, transparent 60%),
    linear-gradient(135deg, #3a0d1f 0%, #5a1124 55%, #8e1b34 100%);
}
.hero-card .eyebrow { color: var(--mint); }
.hero-card h1, .hero-card h2 { color: #fff; }
.hero-card p { color: #ffffffe6; }
.hero-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: #ffffff1a; border: 1px solid #ffffff33; font-size: 13px; font-weight: 500; color: #fff; }
.hero-pill.mint { background: var(--mint); border-color: var(--mint); color: var(--hero); font-weight: 700; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--card-edge); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow-card); display: flex; gap: 14px; align-items: flex-start; }
.kpi-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.kpi-k { color: var(--ink-soft); font-size: 13px; }
.kpi-v { font-size: 26px; line-height: 32px; font-weight: 500; letter-spacing: -.5px; }
.kpi-v.sm { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: 0; margin-top: 4px; }
.kpi-sub { color: var(--ink-faint); font-size: 12px; margin-top: 2px; }

/* progress */
.progress { height: 8px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--mint)); transition: width .4s ease; }
.progress-row { display: grid; gap: 6px; }
.progress-row + .progress-row { margin-top: 16px; }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; }
.progress-label b { font-weight: 600; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 20px 34px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 22px; bottom: 0; width: 2px; background: var(--border-soft); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--input-edge); background: #fff; }
.timeline li.done .dot { background: var(--accent); border-color: var(--accent); }
.timeline li.active .dot { background: var(--mint); border-color: var(--mint); box-shadow: 0 0 0 4px #f4b94233; }
.timeline .when { font-weight: 600; }
.timeline .what { color: var(--ink-soft); }
.timeline li.done .when { color: var(--ink-faint); }

/* checklist rows */
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.check-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.check-list li:hover { background: #fdf8f5; }
.check-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--mist); color: var(--ink-faint); }
.check-list li.done .check-ic { background: var(--ok-soft); color: var(--hero); }
.check-list .grow { flex: 1; min-width: 0; }
.check-list .t { font-weight: 600; }
.check-list .d { color: var(--ink-soft); font-size: 13px; }

/* key-value */
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px 16px; align-items: center; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* steps */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; }
.steps li::before { content: counter(s); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--hero); color: var(--mint); font-weight: 700; }
.steps b { display: block; font-size: 16px; font-weight: 600; }
.steps span { color: var(--ink-soft); }

/* ==========================================================================
   Controls
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 18px; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled { cursor: not-allowed; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; gap: 6px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; gap: 4px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--hero); border-color: var(--hero); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--mint); border-color: var(--mint); color: var(--hero); }
.btn-accent { background: var(--mint); border-color: var(--mint); color: var(--hero); }
.btn-accent:hover:not(:disabled) { background: var(--hero); border-color: var(--hero); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--input-edge); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); background: #fdf3ef; }
.btn-tertiary { background: transparent; color: var(--accent); padding: 0 10px; }
.btn-tertiary:hover:not(:disabled) { color: var(--ink); background: #9d244912; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #8f1714; border-color: #8f1714; }
.btn-danger-ghost { background: #fff; border-color: #f1c3bf; color: var(--err); }
.btn-danger-ghost:hover:not(:disabled) { background: #fef2f2; border-color: var(--err); }
.btn-primary:disabled, .btn-accent:disabled, .btn-danger:disabled { background: #ece4df; border-color: #ece4df; color: #7a6e6a; }
.btn-secondary:disabled, .btn-danger-ghost:disabled { border-color: #ece4df; color: #9a8f8b; background: #fff; }
.btn-tertiary:disabled { color: #9a8f8b; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; border: 0; background: none; color: var(--ink); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: #3a0d1f1a; }
.btn:focus-visible, .icon-btn:focus-visible, .side-item:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label.lbl { display: block; font-size: 14px; line-height: 1.4; font-weight: 500; margin: 16px 0 6px; }
label.lbl .hint { font-weight: 400; color: var(--ink-faint); font-size: 12px; }
.input, select.input {
  width: 100%; height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--input-edge); background: #fff; color: var(--ink); font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
select.input { padding-right: 36px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239d2449' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.input-sm { height: 36px; border-radius: 10px; padding: 0 12px; }
select.input.input-sm { padding-right: 32px; background-position: right 10px center; }
.input::placeholder { color: var(--ink-faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #f4b94233; }
.input:disabled { background: var(--canvas-soft); color: var(--ink-faint); }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.input-icon .input { padding-left: 40px; }

/* option tiles (radio) */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.option { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--input-edge); border-radius: 12px; cursor: pointer; font-weight: 500; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--accent); }
.option input { accent-color: var(--accent); margin: 0; width: 16px; height: 16px; }
.option:has(input:checked) { border-color: var(--accent); background: #fdf3ef; box-shadow: inset 0 0 0 1px var(--accent); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--mist); gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13px; color: var(--accent); padding: 6px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.seg button:hover:not(:disabled) { color: var(--ink); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #3a0d1f26; }
.seg button:disabled { color: #b9aca6; cursor: not-allowed; }

/* tabs (underline, like the header tabs) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 20px; }
.tab { position: relative; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 500; color: var(--accent); padding: 12px 14px; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.tab[aria-selected="true"]::after { background: var(--mint); }

/* switch */
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { appearance: none; flex-shrink: 0; width: 40px; height: 22px; border-radius: 999px; background: #dccfc8; position: relative; cursor: pointer; transition: background .2s; margin: 1px 0 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch .t { font-weight: 600; }
.switch .d { color: var(--ink-soft); font-size: 13px; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; border-radius: 25px; padding: 2px 10px; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--hero); background: var(--mist); }
.chip-success { background: var(--ok-soft); }
.chip-attention { background: var(--warn-soft); }
.chip-failed { background: #faadac; }
.chip-info { background: var(--info-soft); }
.chip-teal { background: var(--accent); color: #fff; }

/* banners */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid; font-size: 14px; }
.banner svg { margin-top: 1px; }
.banner-info { background: #fdf3ef; border-color: #f0d9cb; color: var(--ink); }
.banner-warn { background: #fff8e1; border-color: #f3dc8a; color: #5c4600; }
.banner-err { background: #fef2f2; border-color: #f1c3bf; color: #8f1714; }
.banner-ok { background: #eef8f2; border-color: #d6f2e2; color: var(--hero); }

/* table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.table thead th { background: #f7ede7; color: var(--hero); font-weight: 500; padding: 12px 16px; white-space: nowrap; }
.table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f4b9420f; }
.table .nowrap { white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 30px; height: 30px; font-size: 11px; }
.person .n { font-weight: 600; white-space: nowrap; }
.person .e { color: var(--ink-faint); font-size: 12px; }
.empty { padding: 40px 16px; text-align: center; color: var(--ink-soft); }
.empty svg { color: var(--accent); margin-bottom: 8px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--border-soft); }
.toolbar .grow { flex: 1; }
.toolbar .input-icon { width: 260px; max-width: 100%; }

/* dropdown */
.dd { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; padding: 6px; background: #fff; border: 1px solid #efe6e1; border-radius: 12px; box-shadow: var(--shadow-pop); display: none; animation: fade-up .15s ease-out; }
.dd.open .dd-menu { display: grid; gap: 2px; }

/* dialog */
dialog.dlg { border: 0; padding: 0; border-radius: 16px; box-shadow: var(--shadow-pop); width: min(480px, calc(100vw - 32px)); color: var(--ink); }
dialog.dlg::backdrop { background: #3a0d1f66; backdrop-filter: blur(2px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.dlg-head h3 { font-size: 20px; line-height: 26px; }
.dlg-body { padding: 8px 24px 4px; color: var(--ink-soft); }
.dlg-body .lbl { color: var(--ink); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 20px 24px 24px; }
.secret-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: var(--side); border: 1px dashed var(--accent); font-family: Consolas, Monaco, monospace; font-size: 18px; color: var(--ink); letter-spacing: 1px; }

/* toasts */
.toasts { position: fixed; z-index: 2000; right: 20px; bottom: 20px; display: grid; gap: 8px; max-width: min(400px, calc(100vw - 40px)); }
@media (max-width: 767px) { .toasts { bottom: 84px; left: 16px; right: 16px; } }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: var(--hero); color: #fff; box-shadow: var(--shadow-pop); animation: fade-up .2s ease-out; font-size: 14px; }
.toast svg { color: var(--mint); margin-top: 1px; }
.toast.err { background: #8f1714; }
.toast.err svg { color: #ffb4b2; }

@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fade-up .25s ease-out; }

/* ==========================================================================
   Sign-in screen
   ========================================================================== */
.signin { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.signin-bar { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 36px; border-bottom: 2px solid #333; background: #fff; }
.signin-bar img { height: 30px; }
.signin-bar .sh-title { margin-left: 4px; }
.signin-bar a.btn { margin-left: auto; }
@media (max-width: 640px) { .signin-bar { padding: 0 16px; } }
.signin-hero { flex: 1; background: radial-gradient(1100px 700px at 55% 45%, #8e1b34 0%, #6e1429 40%, #4d0f20 75%, #3a0b18 100%); padding: 56px 24px; }
.signin-grid { max-width: 1180px; margin: 0 auto; display: grid; column-gap: 48px; row-gap: 0; align-items: center; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); grid-template-areas: "copy card" "dates card"; }
.signin-copy { grid-area: copy; align-self: end; }
.signin-card { grid-area: card; }
.signin-dates { grid-area: dates; align-self: start; }
@media (max-width: 960px) {
  .signin-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "card" "dates"; row-gap: 24px; }
  .signin-hero { padding: 28px 16px 40px; }
  .signin-dates { margin-top: 0; max-width: none; }
}
.signin-copy { color: #fff; }
.signin-copy .eyebrow { color: var(--mint); }
.signin-copy h1 { color: #fff; font-size: 60px; line-height: 68px; letter-spacing: -1.2px; margin-top: 14px; }
@media (max-width: 640px) { .signin-copy h1 { font-size: 34px; line-height: 42px; margin-top: 8px; } .signin-copy .lead { font-size: 16px; line-height: 24px; margin-top: 10px; } .signin-card { padding: 22px 18px; } .signin-bar { height: 56px; } }
.signin-copy .lead { margin-top: 18px; max-width: 540px; font-size: 18px; line-height: 27px; color: #ffffffe6; }
.signin-dates { margin-top: 28px; display: grid; gap: 10px; max-width: 520px; }
.signin-date { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; background: #3a0d1f99; border: 1px solid #ffffff26; }
.signin-date .ic-wrap { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #ffffff14; color: var(--mint); flex-shrink: 0; }
.signin-date .when { font-weight: 600; color: #fff; }
.signin-date .what { color: #ffffffbf; font-size: 13px; }
.signin-date.active { border-color: var(--mint); }
.signin-date.active .ic-wrap { background: var(--mint); color: var(--hero); }
.signin-date.done { opacity: .6; }
.signin-card { background: #fff; border-radius: 20px; padding: 28px; box-shadow: 0 30px 60px -20px #00000066; }
.signin-card h2 { font-size: 24px; line-height: 31px; letter-spacing: -.5px; }
.signin-card .sub { color: var(--ink-soft); margin-top: 4px; }
.signin-card .tabs { margin: -6px -4px 18px; }
.form-foot { margin-top: 14px; text-align: center; color: var(--ink-faint); font-size: 13px; }

/* ==========================================================================
   Participant-specific
   ========================================================================== */
.pick-stage { text-align: center; padding: 36px 24px; border-radius: 16px; background: var(--side); border: 1px dashed #e8cbbd; }
.pick-stage .lock { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 14px; background: #fff; color: var(--accent); box-shadow: var(--shadow-card); }
.pick-stage h3 { font-size: 22px; line-height: 28px; }
.pick-stage p { color: var(--ink-soft); margin: 6px auto 0; max-width: 420px; }
.pick-stage .btn { margin-top: 20px; }
.reveal-card { text-align: center; padding: 36px 24px; border-radius: 20px; color: #fff;
  background: radial-gradient(500px 240px at 80% 0%, #f4b94240, transparent 60%), linear-gradient(135deg, #3a0d1f 0%, #5a1124 60%, #8e1b34 100%); }
.reveal-card .label { color: #ffffffcc; font-size: 15px; }
.reveal-card .name { font-size: 44px; line-height: 52px; font-weight: 500; letter-spacing: -1px; color: var(--mint); margin: 8px 0 6px; }
.reveal-card .when { color: #ffffffa6; font-size: 13px; }
.reveal-card .shuffle { font-size: 40px; letter-spacing: 8px; padding: 18px 0; }
.gift-toggle { margin-top: 16px; padding: 16px; border-radius: 12px; border: 1px solid var(--card-edge); }

.chat { display: flex; flex-direction: column; height: 460px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--canvas-soft); border-radius: 12px; border: 1px solid var(--border-soft); }
.chat-empty { margin: auto; text-align: center; color: var(--ink-soft); max-width: 360px; }
.chat-empty svg { color: var(--accent); margin-bottom: 8px; }
.bubble { max-width: 75%; padding: 10px 14px; border-radius: 16px; box-shadow: var(--shadow-card); }
.bubble.mine { align-self: flex-end; background: var(--hero); color: #fff; border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: #fff; border: 1px solid var(--card-edge); border-bottom-left-radius: 4px; }
.bubble .who { font-size: 11px; font-weight: 700; letter-spacing: .3px; opacity: .75; }
.bubble.mine .who { color: var(--mint); opacity: 1; }
.bubble .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .at { font-size: 11px; opacity: .6; margin-top: 2px; text-align: right; }
.chat-form { display: flex; gap: 8px; margin-top: 12px; }
.chat-form .input { border-radius: 999px; }

#snow { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

.btn-tertiary.text-danger { color: var(--err); }
.btn-tertiary.text-danger:hover:not(:disabled) { background: #fef2f2; color: #8f1714; }
.btn-tertiary.text-danger:disabled { color: #c4b8b3; }
.toolbar .input-icon { width: 220px; }

/* brand mark (gift tile + wordmark) */
.brand-tile { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--hero); color: var(--mint); }
.sh-logo .sh-title, .signin-bar .sh-title { font-weight: 600; letter-spacing: -.2px; }

.kpi > div { min-width: 0; }

/* ==========================================================================
   Phone layout (640px and below)
   ========================================================================== */
@media (max-width: 640px) {
  /* iOS zooms into inputs under 16px */
  .input, select.input, .chat-form .input { font-size: 16px; }
  .page-head { margin-bottom: 18px; }
  .page-head p.sub { font-size: 15px; line-height: 22px; }
  .t-h1 { font-size: 28px; line-height: 36px; letter-spacing: -.6px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .card { padding: 18px; border-radius: 14px; }
  .card-flush { padding: 0; }
  .card-flush .card-head { padding: 16px 18px 0; }
  .hero-card { padding: 22px 20px; border-radius: 18px; }
  .hero-pill { font-size: 12px; padding: 5px 12px; }

  /* KPI tiles: two per row, icon on top */
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .kpi { flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; }
  .kpi-ic { width: 32px; height: 32px; border-radius: 10px; }
  .kpi-ic svg { width: 16px; height: 16px; }
  .kpi-v { font-size: 22px; line-height: 28px; }
  .kpi-v.sm { font-size: 15px; line-height: 21px; margin-top: 0; }
  .kpi-sub { font-size: 11.5px; line-height: 16px; }

  .kv { grid-template-columns: 96px minmax(0, 1fr); gap: 10px 12px; }
  .check-list li { padding: 10px 6px; flex-wrap: wrap; }
  .check-list li > .btn { margin-left: 36px; }
  .check-list li > .chip { margin-left: 40px; }

  .toolbar { padding: 14px 16px; gap: 8px; }
  .toolbar .input-icon { width: 100%; }
  .toolbar .seg { width: 100%; }
  .toolbar .seg button { flex: 1; padding: 6px 8px; }
  .toolbar .grow { display: none; }
  .toolbar .switch { width: 100%; }
  .toolbar .dd { flex: 1; }
  .toolbar .dd > .btn { width: 100%; }
  .toolbar .dd-menu { left: 0; right: auto; }
  #drawInfo { margin: 14px 16px 0 !important; }

  /* Participants table becomes one card per person */
  .table.stack-on-phone thead { display: none; }
  .table.stack-on-phone, .table.stack-on-phone tbody { display: block; }
  .table.stack-on-phone tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .table.stack-on-phone tbody tr:last-child { border-bottom: 0; }
  .table.stack-on-phone tbody td { display: block; padding: 0; border: 0; white-space: normal; }
  .table.stack-on-phone tbody td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 2px; }
  .table.stack-on-phone tbody td.cell-person, .table.stack-on-phone tbody td.actions, .table.stack-on-phone tbody td[colspan] { grid-column: 1 / -1; }
  .table.stack-on-phone tbody td.actions { text-align: left; display: flex; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--border); }
  .table.stack-on-phone tbody td.actions .btn { flex: 1; justify-content: center; background: var(--canvas-soft); height: 34px; }

  .chat { height: calc(100dvh - 330px); min-height: 320px; }
  .bubble { max-width: 88%; }
  .reveal-card { padding: 28px 18px; }
  .reveal-card .name { font-size: 34px; line-height: 42px; }
  .pick-stage { padding: 28px 18px; }
  .pick-stage .btn { width: 100%; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; padding: 12px 10px; }
  .dlg-foot .btn { flex: 1; }
  .secret-box { font-size: 16px; }
  .sh-right { gap: 8px; }
}
@media (max-width: 400px) {
  .sh-right .btn-sm .btn-label { display: none; }
  .sh-right .btn-sm { width: 36px; padding: 0; }
}

/* ==========================================================================
   One-screen layouts (Overview + Dashboard fit a 1366x768 laptop)
   ========================================================================== */
.page { padding-top: 26px; padding-bottom: 32px; }
.card { padding: 20px 22px; }
.card + .card { margin-top: 16px; }
.card-head { margin-bottom: 12px; }
.card-head h2 { font-size: 18px; line-height: 24px; }
.page-head { margin-bottom: 18px; }
.page-head p.sub { margin-top: 4px; font-size: 15px; line-height: 22px; }
.t-h1 { font-size: 30px; line-height: 38px; }
.grid { gap: 16px; }
.kpis { gap: 14px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; gap: 12px; }
.kpi-ic { width: 36px; height: 36px; border-radius: 10px; }
.kpi-v { font-size: 24px; line-height: 30px; }
.kpi-bar { height: 5px; margin-top: 8px; }

.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
@media (max-width: 1099px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }

.check-list.compact { gap: 0; }
.check-list.compact li { padding: 7px 4px; gap: 10px; }
.check-list.compact .t { font-size: 14px; line-height: 19px; }
.check-list.compact .d { font-size: 12.5px; line-height: 17px; }
.check-list.compact li > .btn { height: 28px; padding: 0 10px; font-size: 12px; }
.timeline li { padding-bottom: 14px; }
.timeline .what { font-size: 13px; }

/* hero banner with the stat tiles inside it */
.hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 24px; align-items: center; padding: 22px 24px; margin-bottom: 16px; }
.hero-split h2 { margin-top: 4px; }
.hero-split p { margin-top: 4px; font-size: 14px; }
.hero-split .hero-meta { margin-top: 14px; gap: 8px; }
.hero-split .hero-meta .btn { height: 32px; }
.hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.hero-stats .kpi { background: #ffffff12; border-color: #ffffff22; box-shadow: none; color: #fff; padding: 12px 14px; gap: 10px; }
.hero-stats .kpi-ic { background: #ffffff1a; color: var(--mint); width: 32px; height: 32px; }
.hero-stats .kpi-k { color: #ffffffb3; font-size: 12px; }
.hero-stats .kpi-v, .hero-stats .kpi-v.sm { color: #fff; font-size: 15px; line-height: 21px; margin-top: 0; }
.hero-stats .kpi-sub { color: #ffffff8c; font-size: 11.5px; line-height: 16px; }
@media (max-width: 1099px) { .hero-split { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1100px) { .hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hero-stats .kpi { flex-direction: column; } }

@media (max-width: 640px) {
  .page { padding-bottom: 110px; }
  .hero-split { padding: 20px 18px; gap: 16px; }
  .hero-stats .kpi { flex-direction: column; gap: 6px; padding: 12px; }
}

/* grid cards must not inherit the stacked-card top margin */
.grid > .card + .card, .grid > .stack + .stack { margin-top: 0; }
.grid-3 { align-items: stretch; }
@media (min-width: 1100px) {
  .hero-split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.25fr); }
  .hero-stats .kpi { padding: 12px 14px; gap: 0; }
  .hero-stats .kpi-ic { display: none; }
}
.hero-split .hero-pill { padding: 4px 12px; font-size: 12.5px; }
@media (min-width: 641px) {
  .chat { height: clamp(300px, calc(100dvh - 360px), 560px); }
}

.stack > .card + .card { margin-top: 0; }
.kv { gap: 10px 16px; }

/* ==========================================================================
   Rooms: landing, create, room chip, invites
   ========================================================================== */
.code-input { text-transform: uppercase; letter-spacing: 6px; font-size: 22px !important; font-weight: 600; text-align: center; height: 56px; }
.code-input::placeholder { letter-spacing: 2px; font-size: 16px; font-weight: 400; text-transform: none; }
.code-text { font-family: Consolas, Monaco, monospace; font-size: 18px; font-weight: 700; letter-spacing: 3px; color: var(--ink); }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }
.room-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 6px 14px; border-radius: 999px; background: #ffffff1a; border: 1px solid #ffffff33; color: #fff; font-size: 13px; font-weight: 500; }
.room-chip svg { color: var(--mint); }
.room-ready { text-align: center; padding-top: 8px; }
.room-code-big { font-family: Consolas, Monaco, monospace; font-size: 40px; font-weight: 700; letter-spacing: 8px; color: var(--hero); margin: 4px 0 10px; }

.create-wrap { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; }
.create-head { margin-bottom: 20px; }
.create-head h1 { margin: 4px 0 6px; }
.create-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.create-grid .card + .card { margin-top: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 900px) { .create-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .create-wrap { padding: 20px 16px 40px; }
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
}
.signin-bar .btn-sm .btn-label { display: inline; }
@media (max-width: 400px) { .signin-bar .btn-sm .btn-label { display: none; } .signin-bar .btn-sm { width: 36px; padding: 0; } }
textarea.input { height: auto; min-height: 120px; padding: 12px 16px; resize: vertical; font-family: inherit; line-height: 1.5; }
.share-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.share-row .secret-box { flex: 1; margin: 0; font-size: 13px; letter-spacing: 0; font-family: inherit; min-width: 0; }
.share-row .secret-box span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* sign-in grid: left column starts at the top even when the form is tall */
@media (min-width: 961px) {
  .signin-grid { grid-template-rows: auto 1fr; align-items: start; }
  .signin-copy { align-self: start; padding-top: 24px; }
  .signin-dates { align-self: start; margin-top: 28px; }
  .signin-card { align-self: start; grid-row: 1 / span 2; }
}

/* four numbered event dates */
.date-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
.date-steps .lbl { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.step-n { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--hero); color: var(--mint); font-size: 11px; font-weight: 700; flex-shrink: 0; }
@media (max-width: 1180px) { .date-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .date-steps { grid-template-columns: minmax(0, 1fr); } }

#createForm .date-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 420px) { #createForm .date-steps { grid-template-columns: minmax(0, 1fr); } }

/* grand-reveal clue box */
.clue-box { margin-top: 16px; padding: 16px; border-radius: 14px; border: 1px solid #f0d9cb; background: linear-gradient(135deg, #fff9ef, #fdf3ef); }
.clue-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.clue-head .grow { flex: 1; min-width: 0; }
.clue-head .t { font-weight: 600; }
.clue-head .d { color: var(--ink-soft); font-size: 13px; line-height: 18px; }
.clue-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--hero); color: var(--mint); flex-shrink: 0; }
.clue-box textarea.input { min-height: 64px; background: #fff; }
.clue-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* spam-folder reminder */
.spam-note { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: #fff8e1; border: 1px solid #f3dc8a; color: #5c4600; font-size: 12.5px; line-height: 18px; }
.spam-note svg { margin-top: 2px; flex-shrink: 0; }

/* brand logo */
.brand-logo { width: 36px; height: 36px; border-radius: 10px; display: block; flex-shrink: 0; box-shadow: 0 2px 6px #3a0d1f33; }
