:root {
  --ink: #0f1222;
  --ink-soft: #2a2e40;
  --muted: #646a7e;
  --faint: #9aa0b2;
  --paper: #f5f6f9;
  --card: #ffffff;
  --line: #e6e8ef;
  --line-strong: #d6d9e3;
  --brand: #8b1e3f;
  --brand-strong: #6f1631;
  --brand-soft: #fbf0f3;
  --brand-ring: rgba(139, 30, 63, 0.18);
  --gold: #d4a24c;
  --sidebar: #110b14;
  --sidebar-2: #1d1220;
  --good: #0f7a4b;
  --good-bg: #e8f7ef;
  --warn: #9a5b06;
  --warn-bg: #fff6e5;
  --bad: #b4233a;
  --bad-bg: #fdeef0;
  --info: #2450a6;
  --info-bg: #edf2fd;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(16, 20, 40, 0.05);
  --shadow: 0 1px 2px rgba(16, 20, 40, 0.04), 0 8px 24px -12px rgba(16, 20, 40, 0.12);
  --shadow-lg: 0 24px 60px -24px rgba(16, 20, 40, 0.35);
  --sans: "Inter", "Noto Sans Devanagari", "Segoe UI", system-ui, sans-serif;
  --display: "Plus Jakarta Sans", "Inter", "Noto Sans Devanagari", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
::selection { background: var(--brand-ring); }
a { color: var(--brand); text-decoration: none; font-weight: 550; }
a:hover { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); letter-spacing: -0.02em; }
h1 { margin: 0; font-size: 1.75rem; line-height: 1.2; font-weight: 700; }
h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 0.75rem; overflow-wrap: anywhere; }
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: #f1f2f6;
  border: 1px solid var(--line);
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
}
svg.icon { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Shell */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(139, 30, 63, 0.45), transparent 60%),
    radial-gradient(80% 40% at 100% 100%, rgba(212, 162, 76, 0.12), transparent 60%),
    linear-gradient(180deg, var(--sidebar-2), var(--sidebar));
  color: #e9e4ee;
  padding: 1.25rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.brand { display: flex; gap: 0.75rem; align-items: center; padding: 0.3rem 0.5rem 1.4rem; }
.brand-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.brand-name { margin: 0.15rem 0 0; color: #fff; font-family: var(--display); font-weight: 650; font-size: 0.86rem; line-height: 1.35; }
.nav-label {
  margin: 0.4rem 0.75rem 0.45rem;
  color: rgba(233, 228, 238, 0.42);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 1rem; }
.nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: rgba(233, 228, 238, 0.74);
  font-weight: 550;
  font-size: 0.92rem;
  padding: 0.58rem 0.75rem;
  border-radius: 10px;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; text-decoration: none; }
.nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(184, 50, 90, 0.35), rgba(184, 50, 90, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.nav a.active::before {
  content: "";
  position: absolute;
  left: -0.9rem;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}
.nav a.active svg.icon { color: var(--gold); }
.signout {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #e9e4ee;
}
.avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #2b1608;
  background: linear-gradient(135deg, #f3d28f, var(--gold));
  flex: 0 0 auto;
}
.who { min-width: 0; flex: 1; line-height: 1.25; }
.who strong { display: block; font-size: 0.88rem; color: #fff; overflow: hidden; text-overflow: ellipsis; }
.who small { color: rgba(233, 228, 238, 0.5); font-size: 0.74rem; }
.signout button, .row-actions button, .pager a, .button-quiet { background: transparent; }
.signout button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: rgba(233, 228, 238, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.signout button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* Workspace */
.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 2.25rem;
  background: rgba(245, 246, 249, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 0.2rem; color: var(--muted); font-size: 0.78rem; font-weight: 550; letter-spacing: 0.01em; }
.top-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(15, 122, 75, 0.15); }
.chip[data-tone="warn"] .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(154, 91, 6, 0.15); }
.chip[data-tone="neutral"] .dot { background: var(--faint); box-shadow: none; }
a.chip:hover { color: var(--ink); text-decoration: none; border-color: var(--line-strong); }
.page { padding: 1.6rem 2.25rem 3rem; width: 100%; }
.lede { max-width: 68rem; color: var(--muted); }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem 1.4rem;
  margin-bottom: 1.15rem;
}
.card-head, .lone { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.card-head { margin: -0.15rem 0 1.1rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--line); }
.card-head a { font-size: 0.86rem; }
.card > h2:first-child { margin-bottom: 0.85rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.15rem; }
.stat {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.1rem;
}
.stat::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #c2416a);
}
.stat:nth-child(2)::after { background: linear-gradient(90deg, #b07a1c, var(--gold)); }
.stat:nth-child(3)::after { background: linear-gradient(90deg, #2450a6, #5b8def); }
.stat:nth-child(4)::after { background: linear-gradient(90deg, #0f7a4b, #34c48a); }
.stat span { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.stat small { display: block; color: var(--faint); font-size: 0.78rem; }
.stat strong { display: block; margin: 0.35rem 0 0.15rem; font-family: var(--display); font-size: 2rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1.15rem; }
.split.solo { grid-template-columns: 1fr; }
.split > * { min-width: 0; }
.template-list { display: grid; gap: 1rem; }
.template-card { transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.template-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
.send-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.75rem 0.8rem 0.75rem 3.1rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.steps li:hover { background: #fafbfc; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0.75rem;
  top: 0.8rem;
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #f0d3dc;
}
.steps li.done::before { content: "✓"; color: #fff; background: var(--good); border-color: var(--good); }
.steps li a { font-weight: 650; }
.steps li p { margin: 0.1rem 0 0; font-size: 0.88rem; }
.steps p, .muted { color: var(--muted); }
.header-preview { display: block; max-width: 280px; margin: 0.4rem 0 0.9rem; border-radius: var(--radius-sm); border: 1px solid var(--line); box-shadow: var(--shadow); }
.facts { margin: 0; display: grid; gap: 0; }
.facts div { display: grid; grid-template-columns: 11rem 1fr; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px dashed var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 0.88rem; }
.facts dd { margin: 0; font-weight: 600; }
.facts-top { margin-top: 1rem; }
.facts .mono { word-break: normal; overflow-wrap: anywhere; }
.facts-tight div { grid-template-columns: 8rem 1fr; }

/* Forms */
label { display: block; font-weight: 600; font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 1rem; max-width: 100%; }
input, select, button, textarea { font: inherit; }
input[type="text"], input[type="password"], input[type="search"], input[type="time"], input[type="date"],
input[type="email"], input[type="number"], input[type="tel"], input[type="url"], input:not([type]), select, textarea, input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.62rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.93rem;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="time"] { max-width: 11rem; }
input::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #c4c8d4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
select {
  appearance: none;
  padding-right: 2.4rem;
  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='%23646a7e' stroke-width='2' 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 0.8rem center;
}
input[type="file"] { padding: 0.45rem; cursor: pointer; background: #fafbfc; border-style: dashed; }
input[type="file"]::file-selector-button {
  margin-right: 0.8rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 1rem; height: 1rem; }
.check { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); column-gap: 0.6rem; align-items: start; font-weight: 550; max-width: 100%; }
.check input { width: auto; margin-top: 0.2rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0 0 1.1rem; padding: 0.85rem 1rem 0.2rem; background: #fcfcfd; }
legend { padding: 0 0.4rem; font-weight: 700; font-size: 0.84rem; color: var(--ink-soft); }

/* Buttons */
.button, .danger-button {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.62rem 1.1rem;
  background: linear-gradient(180deg, #a3264c, var(--brand));
  color: #fff;
  font-weight: 650;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(16, 20, 40, 0.1), 0 6px 16px -8px rgba(139, 30, 63, 0.6);
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.button:hover { color: #fff; text-decoration: none; background: linear-gradient(180deg, #b02d55, var(--brand-strong)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 22px -10px rgba(139, 30, 63, 0.7); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button-quiet, .button.button-quiet {
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.button.button-quiet:hover { background: #f8f9fb; color: var(--ink); border-color: #c4c8d4; box-shadow: var(--shadow-xs); }
.danger-button, button.danger {
  background: #fff;
  color: var(--bad);
  border: 1px solid #f2c7ce;
  box-shadow: var(--shadow-xs);
}
.danger-button:hover, button.danger:hover { background: var(--bad-bg); color: var(--bad); }
.button-row, .row-actions, .filters, .badge-row, .counts { display: flex; gap: 0.55rem; flex-wrap: wrap; align-items: center; }
.filters { justify-content: flex-end; }
.filters input, .filters select { width: 14rem; margin-top: 0; }
.row-actions form { margin: 0; }
td.row-actions { display: table-cell; white-space: nowrap; text-align: right; }
td.row-actions form { display: inline-block; margin-left: 0.9rem; }
.row-actions button {
  border: 0;
  background: transparent;
  color: var(--info);
  cursor: pointer;
  padding: 0;
  font-weight: 650;
  font-size: 0.86rem;
}
.row-actions button:hover { text-decoration: underline; text-underline-offset: 3px; }
.row-actions button.danger { color: var(--bad); border: 0; box-shadow: none; background: transparent; }
.narrow { max-width: 30rem; }

/* Notices */
.note, .banner, .flash {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.banner { flex-direction: column; gap: 0; }
.banner p:last-child { margin-bottom: 0; }
.note, .banner { background: #fffaf0; border-color: #f2e0b8; color: #6b4a10; }
.workspace > .banner { margin: 1rem 2.25rem 0; }
.banner[data-tone="warn"] { background: var(--warn-bg); border-color: #f5d9a3; color: var(--warn); }
.flash::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}
.flash[data-tone="good"] { background: var(--good-bg); border-color: #bfe8d2; color: var(--good); }
.flash[data-tone="bad"] { background: var(--bad-bg); border-color: #f5c6cd; color: var(--bad); }
.flash[data-tone="info"] { background: var(--info-bg); border-color: #cddbf8; color: var(--info); }
.flash[data-tone="warn"] { background: var(--warn-bg); border-color: #f5d9a3; color: var(--warn); }
.flashes { padding: 1rem 2.25rem 0; }
.flashes .flash { margin-bottom: 0.5rem; }
.gate .flashes { padding: 0 0 0.5rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
.card:has(> .table-wrap) { overflow: hidden; }
.card > .table-wrap { margin: 0 -1.4rem; }
.card > .table-wrap:first-child { margin-top: -1.35rem; }
.card > .table-wrap:last-child { margin-bottom: -1.4rem; }
.card > .table-wrap:not(:last-child) { border-bottom: 1px solid var(--line); }
.card-head + .table-wrap { margin-top: -1.1rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.8rem 1.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: #fafbfc; white-space: nowrap; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: #fafbfd; }
tbody tr:last-child td { border-bottom: 0; }
td .muted { font-size: 0.82rem; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 650;
  background: #f1f2f6;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge[data-tone="good"] { background: var(--good-bg); color: var(--good); border-color: #c4ead6; }
.badge[data-tone="bad"] { background: var(--bad-bg); color: var(--bad); border-color: #f5ccd2; }
.badge[data-tone="warn"] { background: var(--warn-bg); color: var(--warn); border-color: #f5ddb0; }
.badge[data-tone="info"] { background: var(--info-bg); color: var(--info); border-color: #d2def9; }

.preview {
  white-space: pre-wrap;
  font-family: var(--sans);
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
}
.slot-row { border-top: 1px solid var(--line); padding-top: 0.95rem; margin-top: 0.5rem; }
.slot-label { font-weight: 700; color: var(--ink); }
.bar { height: 0.55rem; background: #eceef4; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #d0567c, var(--gold)); transition: width 0.4s ease; }
.mono { font-family: var(--mono); font-size: 0.8rem; word-break: break-all; }
.empty {
  color: var(--muted);
  margin: 0;
  padding: 1.6rem 1rem;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fcfcfd;
}
.pager { display: flex; gap: 1rem; align-items: center; justify-content: flex-end; padding-top: 1rem; font-size: 0.88rem; color: var(--muted); }
.plain { margin: 0; padding-left: 1.1rem; }
.plain li { margin-bottom: 0.3rem; }

/* WhatsApp preview */
.phone {
  width: min(100%, 320px);
  background: linear-gradient(160deg, #23232b, #0c0c10);
  border-radius: 2rem;
  padding: 0.65rem;
  margin-top: 0.6rem;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.phone-notch { width: 5.5rem; height: 0.4rem; border-radius: 999px; background: #2e2e36; margin: 0.2rem auto 0.6rem; }
.phone-screen {
  background-color: #efe7dd;
  background-image: radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 14px 14px;
  border-radius: 1.45rem;
  padding: 0.9rem;
  min-height: 8rem;
}
.phone-screen > * { background: #fff; }
.phone-screen p, .phone-screen strong, .phone-screen small { display: block; white-space: pre-wrap; margin: 0; padding: 0.15rem 0.7rem; }
.phone-screen > :first-child { border-radius: 0.8rem 0.8rem 0 0; padding-top: 0.6rem; }
.phone-screen > :last-child { border-radius: 0 0 0.8rem 0.8rem; padding-bottom: 0.6rem; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); }
.phone-screen > :only-child { border-radius: 0.8rem; }
.phone-screen small { color: var(--faint); font-size: 0.72rem; text-align: right; }
.phone-media { font-size: 0.78rem; color: var(--info); word-break: break-all; padding: 0.6rem 0.7rem 0.3rem; }
.phone-btn { text-align: center; color: #0b8a73; font-weight: 650; border-top: 1px solid #ece6de; padding: 0.5rem 0.7rem; }

/* Sign-in */
.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--card);
}
.gate-story {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(184, 50, 90, 0.55), transparent 70%),
    radial-gradient(50% 45% at 90% 90%, rgba(212, 162, 76, 0.28), transparent 70%),
    linear-gradient(160deg, #1f1224, var(--sidebar));
  color: #f4eff7;
  padding: 4.5rem clamp(2rem, 6vw, 5.5rem);
}
.gate-story::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 60% at 30% 40%, #000, transparent);
  pointer-events: none;
}
.gate-story > * { position: relative; z-index: 1; }
.gate-story h1 { color: #fff; font-size: clamp(2.1rem, 3.6vw, 3.2rem); font-weight: 750; letter-spacing: -0.035em; max-width: 16ch; margin: 0.4rem 0 1rem; }
.gate-story p { max-width: 34rem; color: rgba(244, 239, 247, 0.72); font-size: 1.05rem; }
.gate-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 0.8rem; max-width: 30rem; }
.gate-points li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(244, 239, 247, 0.88);
  font-size: 0.95rem;
}
.gate-points svg.icon {
  width: 2rem;
  height: 2rem;
  padding: 0.45rem;
  border-radius: 10px;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.gate-panel { display: flex; flex-direction: column; justify-content: center; padding: 3rem clamp(2rem, 6vw, 5.5rem); background: var(--card); }
.gate-panel form { max-width: 24rem; width: 100%; }
.gate-panel h2 { font-size: 1.6rem; margin-bottom: 0.35rem; letter-spacing: -0.025em; }
.gate-panel h2 + form { margin-top: 1.6rem; }
.gate-panel .button { width: 100%; justify-content: center; padding: 0.78rem 1.1rem; margin-top: 0.4rem; }
.gate-foot { margin-top: 2.4rem; color: var(--faint); font-size: 0.8rem; }

/* Layout helpers */
.stack { display: grid; gap: 1.15rem; align-content: start; min-width: 0; }
.stack > .card { margin-bottom: 0; }
.small { font-size: 0.84rem; }
.strong-line { font-weight: 650; color: var(--ink); margin-bottom: 0.25rem; }
.template-list { grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); align-items: start; }
.template-list .card { margin-bottom: 0; }

/* Status banner (Birthdays) */
.status-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.15rem;
  padding: 1.15rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.status-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--line-strong); }
.status-card[data-tone="good"]::before { background: var(--good); }
.status-card[data-tone="info"]::before { background: var(--info); }
.status-card[data-tone="warn"]::before { background: var(--gold); }
.status-card[data-tone="good"] { background: linear-gradient(90deg, var(--good-bg), var(--card) 40%); }
.status-card[data-tone="info"] { background: linear-gradient(90deg, var(--info-bg), var(--card) 40%); }
.status-card[data-tone="warn"] { background: linear-gradient(90deg, var(--warn-bg), var(--card) 40%); }
.status-icon {
  flex: 0 0 auto;
  width: 2.9rem;
  height: 2.9rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--brand);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.status-icon svg.icon { width: 22px; height: 22px; }
.status-body { flex: 1; min-width: 0; }
.status-body h2 { font-size: 1.15rem; margin: 0.25rem 0 0.1rem; }
.status-body p { margin: 0; color: var(--muted); }
.status-body .status-kicker { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); font-weight: 550; }

/* People lists */
.people { list-style: none; margin: 0; padding: 0; }
.person { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.person:first-child { padding-top: 0; }
.person:last-child { border-bottom: 0; }
.person-main { flex: 1; min-width: 0; line-height: 1.3; }
.person-main strong { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.person-main small { color: var(--muted); font-size: 0.8rem; }
.avatar-sm {
  flex: 0 0 auto;
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #f0d3dc;
}
.date-tile {
  flex: 0 0 auto;
  width: 2.6rem;
  padding: 0.2rem 0;
  text-align: center;
  line-height: 1.1;
  border-radius: 10px;
  background: #f4f5f9;
  border: 1px solid var(--line);
}
.date-tile b { display: block; font-family: var(--display); font-size: 1rem; }
.date-tile small { font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.after-list { margin: 1rem 0 0.75rem; }

/* Dashboard birthday card */
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 0.9rem 0 1.1rem; }
.mini-stats div { padding: 0.65rem 0.7rem; border-radius: var(--radius-sm); background: #f7f8fb; border: 1px solid var(--line); }
.mini-stats b { display: block; font-family: var(--display); font-size: 1.4rem; line-height: 1.1; }
.mini-stats span { font-size: 0.74rem; color: var(--muted); font-weight: 600; }

/* Report count chips and delivery hint */
.counts { margin: 0.2rem 0 0.9rem; }
.count-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  background: #f1f2f6;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.count-chip strong { font-family: var(--display); font-size: 0.98rem; }
.count-chip[data-tone="good"] { background: var(--good-bg); color: var(--good); border-color: #c4ead6; }
.count-chip[data-tone="bad"] { background: var(--bad-bg); color: var(--bad); border-color: #f5ccd2; }
.count-chip[data-tone="warn"] { background: var(--warn-bg); color: var(--warn); border-color: #f5ddb0; }
.count-chip[data-tone="info"] { background: var(--info-bg); color: var(--info); border-color: #d2def9; }
.hint { margin: 0 0 1rem; padding: 0.85rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fafbfc; font-size: 0.9rem; }
.hint strong { display: block; margin-bottom: 0.15rem; }
.hint p { margin: 0 0 0.3rem; color: var(--muted); }
.hint a { font-weight: 650; }
.hint[data-tone="warn"] { background: var(--warn-bg); border-color: #f5d9a3; }
.hint[data-tone="warn"] strong { color: var(--warn); }
.hint[data-tone="info"] { background: var(--info-bg); border-color: #cddbf8; }
.hint[data-tone="info"] strong { color: var(--info); }

/* Small copy button */
.copy {
  margin-left: 0.4rem;
  padding: 0.15rem 0.55rem;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 650;
  cursor: pointer;
  vertical-align: middle;
}
.copy:hover { background: #f4f5f9; }

.role-grid { display: grid; gap: 0.9rem; }
.role-box { padding: 0.9rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fafbfc; }
.role-title { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.5rem; font-weight: 650; }
.ticks { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; color: var(--ink-soft); }
.ticks li { position: relative; padding: 0.18rem 0 0.18rem 1.3rem; }
.ticks li::before { content: ""; position: absolute; left: 0.2rem; top: 0.55rem; width: 0.5rem; height: 0.28rem; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg); }

.user-row { flex-wrap: wrap; }
.user-row.is-off .person-main, .user-row.is-off .avatar-sm { opacity: 0.55; }
.user-edit { flex-basis: auto; }
.user-edit summary {
  list-style: none;
  cursor: pointer;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink-soft);
  background: #fff;
}
.user-edit summary::-webkit-details-marker { display: none; }
.user-edit summary:hover { background: #f4f5f9; }
.user-edit[open] { flex-basis: 100%; order: 10; }
.user-edit[open] summary { display: inline-block; margin-bottom: 0.7rem; }
.user-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem 1.4rem;
  align-items: end;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fafbfc;
}
.user-panel form { margin: 0; }
.user-panel .button-row { grid-column: 1 / -1; }

button:disabled { opacity: 0.5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 2px; }

/* Organisation logo */
.logo-tile {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  padding: 0.22rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(212, 162, 76, 0.35), 0 8px 20px -10px rgba(0, 0, 0, 0.7);
}
.logo-tile img { display: block; width: 100%; height: 100%; object-fit: contain; }
.logo-tile-large { width: 6.5rem; height: 6.5rem; padding: 0.5rem; border-radius: 22px; margin-bottom: 1.4rem; }
.print-head { display: none; }

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .shell, .split, .send-layout, .stats, .gate { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; padding-bottom: 0.8rem; }
  .nav-label { display: none; }
  .nav { flex-direction: row; overflow-x: auto; margin-bottom: 0.6rem; }
  .nav a { white-space: nowrap; }
  .nav a.active::before { display: none; }
  .signout { margin-top: 0.2rem; }
  .topbar { position: relative; }
  .page, .topbar, .flashes { padding-left: 1rem; padding-right: 1rem; }
  .workspace > .banner { margin: 1rem 1rem 0; }
  .gate-story, .gate-panel { padding: 2.4rem 1.4rem; }
  .facts div { grid-template-columns: 1fr; gap: 0.1rem; }
}
@media print {
  .sidebar, .topbar, .no-print, .flashes, .banner { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; }
  .card, .stat { box-shadow: none; }
  .print-head { display: flex; align-items: center; gap: 0.8rem; padding: 0 0 0.8rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line-strong); }
  .print-head img { width: 3.2rem; height: auto; }
  .print-head strong { display: block; font-family: var(--display); font-size: 1rem; color: var(--ink); }
  .print-head span { color: var(--muted); font-size: 0.8rem; }
}
