:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-2: #f1ece4;
  --ink: #1c1b19;
  --ink-2: #4a4741;
  --muted: #857f75;
  --line: #e7e0d5;
  --line-strong: #d4cbbd;
  --gold: #a8885a;
  --gold-dark: #85693f;
  --gold-soft: #f3ece0;
  --green: #3f7d58;
  --green-soft: #e5f0e8;
  --red: #b4432f;
  --red-soft: #f8e6e1;
  --amber: #a26f17;
  --amber-soft: #f8eed9;
  --blue: #3b6aa0;
  --blue-soft: #e5edf6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(28, 27, 25, 0.04), 0 6px 20px rgba(28, 27, 25, 0.05);
  --font: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sidebar: 248px;
  --focus: 0 0 0 3px rgba(168, 136, 90, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--gold-dark); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-family: var(--serif); font-size: 34px; font-weight: 600; letter-spacing: 0; line-height: 1.1; }
h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: 0; }
h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.error-text { color: var(--red); font-size: 13px; margin-top: 10px; }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Wordmark */
.wordmark { font-weight: 700; letter-spacing: 0.32em; font-size: 20px; color: var(--ink); }
.wordmark span { color: var(--gold); font-weight: 500; }
.wordmark.small { font-size: 13px; letter-spacing: 0.3em; white-space: nowrap; }

/* ----- Auth ----- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; align-content: center; gap: 18px;
  background: radial-gradient(120% 80% at 50% 0%, #fffdf9 0%, var(--bg) 60%); }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 38px 34px 32px; box-shadow: 0 20px 60px rgba(28, 27, 25, 0.08);
}
.auth-card.wide { max-width: 520px; }
.auth-card .wordmark { text-align: center; }
.auth-card h1 { font-size: 28px; text-align: center; margin: 18px 0 6px; }
.auth-card .lead { text-align: center; color: var(--muted); margin-bottom: 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-foot { color: var(--muted); font-size: 12px; text-align: center; letter-spacing: 0.08em; }
.qr-box { display: flex; justify-content: center; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.secret { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14px; letter-spacing: 0.12em; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; text-align: center; word-break: break-all; user-select: all; }
.otp-input { font-size: 22px !important; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14px; }
.codes span { background: var(--surface-2); padding: 8px; border-radius: 8px; text-align: center; letter-spacing: 0.06em; }
.steps { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
.steps i { width: 26px; height: 3px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--gold); }
.link-btn { background: none; border: 0; color: var(--gold-dark); font: inherit; cursor: pointer; padding: 4px; text-decoration: underline; text-underline-offset: 3px; }

/* ----- Shell ----- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--ink); color: #d9d3c7; display: flex; flex-direction: column; padding: 22px 14px 16px; z-index: 40; }
.sidebar .wordmark { color: #fff; }
.sidebar-brand { padding: 0 10px 18px; border-bottom: 1px solid #33302b; margin-bottom: 12px; }
.sidebar-sub { color: #8f887c; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { color: #7d776c; font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #d9d3c7; padding: 8px 12px; border-radius: 9px; font-weight: 500; position: relative; }
.nav a .ic { width: 18px; text-align: center; color: #8f887c; font-size: 14px; }
.nav a:hover { background: #2a2824; color: #fff; }
.nav a[aria-current='page'] { background: #2f2c27; color: #fff; }
.nav a[aria-current='page']::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--gold); }
.nav a[aria-current='page'] .ic { color: var(--gold); }
.nav .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.nav .badge.warn { background: var(--amber); }
.sidebar-foot { border-top: 1px solid #33302b; padding: 12px 10px 0; font-size: 12px; color: #8f887c; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgba(247, 244, 239, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-title { flex: 1; color: var(--muted); font-size: 13px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-dark); display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 1px solid var(--line); }
.user-btn { display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 4px 8px 4px 4px; cursor: pointer; font: inherit; color: var(--ink); }
.user-btn:hover { background: var(--surface-2); }
.user-btn .who { text-align: left; line-height: 1.2; }
.user-btn .who small { display: block; color: var(--muted); font-size: 11px; text-transform: capitalize; }
.menu { position: absolute; right: 24px; top: 54px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 200px; padding: 6px; z-index: 45; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.topbar .menu-btn { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(28, 27, 25, 0.4); z-index: 35; }
@media (min-width: 961px) { .scrim { display: none !important; } }

.container { max-width: 1320px; width: 100%; margin: 0 auto; padding: 30px 28px 120px; outline: none; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.view-head p { color: var(--muted); margin-top: 6px; max-width: 760px; }
.eyebrow-label { color: var(--gold-dark); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 6px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: none; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .container { padding: 22px 16px 120px; }
  .topbar-user .who { display: none; }
}

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { font-size: 21px; }
.card-head .sub { color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; font-family: var(--font); }
.card-body { padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.sticky { position: sticky; top: 84px; }
@media (max-width: 1180px) {
  .split { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
}

/* KPI tiles */
.kpi { padding: 18px 20px; }
.kpi .label { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; }
.kpi .value { font-family: var(--serif); font-size: 36px; font-weight: 600; margin-top: 4px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .foot { color: var(--muted); font-size: 12px; margin-top: 4px; }
.kpi.accent { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.accent .label, .kpi.accent .foot { color: #bdb6a9; }
.kpi.accent .value { color: var(--gold); }

/* Bars */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 90px; gap: 12px; align-items: center; font-size: 13px; }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--gold); border-radius: 99px; transition: width 0.4s ease; }
.bar-row .num { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Alerts */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid; font-size: 13px; }
.alert b { display: block; }
.alert .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.alert.error { background: var(--red-soft); border-color: #efcfc6; }
.alert.error .dot { background: var(--red); }
.alert.warn { background: var(--amber-soft); border-color: #eedcb5; }
.alert.warn .dot { background: var(--amber); }
.alert.ok { background: var(--green-soft); border-color: #cfe3d6; }
.alert.ok .dot { background: var(--green); }
.alert a { margin-left: auto; white-space: nowrap; }

/* Status chips & pills */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip.ok .dot { background: var(--green); }
.chip.warn .dot { background: var(--amber); }
.chip.error .dot { background: var(--red); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.gold { background: var(--gold-soft); color: var(--gold-dark); }
.pill.ink { background: var(--ink); color: #fff; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .label-text { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.01em; }
.field .counter { font-weight: 400; color: var(--muted); float: right; }
input[type='text'], input[type='password'], input[type='email'], input[type='url'], input[type='number'], input[type='datetime-local'], input[type='search'], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%; transition: border-color 0.15s, box-shadow 0.15s; min-width: 0;
}
textarea { resize: vertical; min-height: 72px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--red); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; user-select: none; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--gold); }
.json-editor { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; min-height: 480px; line-height: 1.55; white-space: pre; tab-size: 2; }

/* Segmented control */
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; font: inherit; font-weight: 500; padding: 6px 12px; border-radius: 8px; color: var(--ink-2); cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; border-radius: 10px; padding: 9px 16px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #33312d; }
.btn-gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-icon { padding: 5px 8px; font-size: 13px; line-height: 1; border-radius: 8px; min-width: 30px; }
.btn-block { width: 100%; padding: 12px; }

/* Editor list items */
.item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.item + .item { margin-top: 12px; }
.item-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); background: #fdfbf8; border-radius: var(--radius) var(--radius) 0 0; }
.item-head .title { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-head .idx { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; width: 18px; }
.item-body { padding: 14px 16px 16px; }
.item-actions { display: flex; gap: 4px; }
.thumb { width: 64px; height: 44px; border-radius: 6px; background: var(--surface-2) center/cover no-repeat; border: 1px solid var(--line); flex: none; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* Subnav inside Home editor */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; }
.subnav button { font: inherit; font-weight: 500; border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 99px; cursor: pointer; color: var(--ink-2); }
.subnav button.active { border-color: var(--gold); color: var(--gold-dark); background: var(--gold-soft); }
.subnav .count { color: var(--muted); font-size: 12px; margin-left: 4px; }

/* Save bar */
.savebar {
  position: fixed; left: calc(50% + var(--sidebar) / 2); bottom: 20px; transform: translateX(-50%) translateY(140%); z-index: 30;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 10px 10px 18px; display: flex; gap: 12px; align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); transition: transform 0.25s ease, visibility 0.25s; width: min(760px, calc(100vw - var(--sidebar) - 32px)); visibility: hidden;
}
@media (max-width: 960px) { .savebar { left: 50%; width: calc(100vw - 32px); } }
.savebar.show { transform: translateX(-50%) translateY(0); visibility: visible; }
.savebar .msg { font-weight: 500; white-space: nowrap; }
.savebar input { background: #2b2a27; border-color: #3d3b37; color: #fff; flex: 1; }
.savebar input::placeholder { color: #8f8a80; }
.savebar .btn-ghost { color: #d8d2c6; }
.savebar .btn-ghost:hover { background: #2b2a27; }

/* Issues */
.issues { background: var(--red-soft); color: var(--red); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; }
.issues ul { margin: 6px 0 0; padding-left: 18px; }
.notice { background: var(--gold-soft); color: var(--gold-dark); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: #fcfaf6; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.cell-title { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }
.pager { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; align-items: center; }

/* Definition lists */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Env vars */
.env-group + .env-group { margin-top: 8px; }
.env-row { display: grid; grid-template-columns: 240px 120px 1fr; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); align-items: start; }
.env-row:first-child { border-top: 0; }
.env-row code { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.env-row .use { color: var(--ink-2); font-size: 13px; }
.env-row .use small { display: block; color: var(--muted); margin-top: 2px; }
@media (max-width: 860px) { .env-row { grid-template-columns: 1fr; gap: 4px; } }
.howto { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; font-size: 13px; }
.howto ol { margin: 6px 0 0; padding-left: 18px; }
.howto li + li { margin-top: 3px; }

/* Tiers */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tier { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: linear-gradient(180deg, #fff, #fbf8f3); }
.tier .name { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.tier.bronze .name { color: #8a5a35; }
.tier.silver .name { color: #6d6f73; }
.tier.gold .name { color: var(--gold-dark); }
.tier .n { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .tiers { grid-template-columns: 1fr; } }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 6px; }
.timeline .dot.campaign { background: var(--blue); }
.timeline .dot.audit { background: var(--muted); }
.timeline small { color: var(--muted); }

/* iPhone previews */
.phone {
  width: 300px; margin: 0 auto; border-radius: 44px; background: #111; padding: 10px; box-shadow: 0 20px 50px rgba(28, 27, 25, 0.25);
}
.phone-screen { border-radius: 36px; overflow: hidden; height: 600px; position: relative; background: #fff; }
.lock { height: 100%; background: radial-gradient(120% 80% at 20% 0%, #6b5a3e 0%, #2a2620 45%, #121110 100%); color: #fff; padding: 46px 12px 12px; }
.lock .date { text-align: center; font-size: 15px; font-weight: 500; opacity: 0.85; }
.lock .time { text-align: center; font-size: 72px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; margin: 2px 0 28px; }
.notif { background: rgba(245, 242, 236, 0.78); backdrop-filter: blur(20px); color: #111; border-radius: 20px; padding: 11px 12px; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; }
.notif .appicon { width: 34px; height: 34px; border-radius: 8px; background: #1c1b19; color: var(--gold); display: grid; place-items: center; font-family: Georgia, serif; font-weight: 600; font-size: 18px; }
.notif .meta { display: flex; justify-content: space-between; font-size: 12px; color: #6e6a63; }
.notif .ntitle { font-weight: 600; font-size: 14px; line-height: 1.3; margin-top: 1px; word-break: break-word; }
.notif .nbody { font-size: 14px; line-height: 1.3; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.notif .nimg { width: 38px; height: 38px; border-radius: 8px; background: #ddd center/cover no-repeat; margin-top: 16px; }
.notif-expanded { margin-top: 14px; background: rgba(245, 242, 236, 0.85); backdrop-filter: blur(20px); border-radius: 20px; overflow: hidden; color: #111; }
.notif-expanded .big { width: 100%; aspect-ratio: 4 / 3; background: #ccc center/cover no-repeat; }
.notif-expanded .txt { padding: 10px 14px 14px; }
.preview-caption { text-align: center; color: var(--muted); font-size: 12px; margin-top: 12px; }

/* Home preview */
.home-prev { height: 100%; overflow-y: auto; font-size: 11px; color: var(--ink); background: var(--bg); }
.home-prev::-webkit-scrollbar { display: none; }
.hp-status { height: 40px; }
.hp-announce { background: var(--ink); color: #fff; text-align: center; padding: 6px 10px; font-size: 10px; letter-spacing: 0.02em; }
.hp-hero { position: relative; height: 300px; background: #333 center/cover no-repeat; display: flex; align-items: flex-end; }
.hp-hero .ov { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55) 100%); }
.hp-hero.light .ov { background: linear-gradient(180deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.7) 100%); }
.hp-hero .txt { position: relative; padding: 16px; color: #fff; }
.hp-hero.light .txt { color: var(--ink); }
.hp-hero .eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 9px; opacity: 0.85; }
.hp-hero .t { font-size: 20px; font-weight: 600; line-height: 1.15; margin: 4px 0 2px; }
.hp-hero .cta { display: inline-block; margin-top: 10px; background: #fff; color: var(--ink); padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: 10px; }
.hp-hero.light .cta { background: var(--ink); color: #fff; }
.hp-dots { display: flex; gap: 4px; justify-content: center; padding: 8px 0 0; }
.hp-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.hp-dots i.on { background: var(--ink); }
.hp-sec { padding: 14px 14px 4px; }
.hp-sec h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.hp-row { display: flex; gap: 8px; overflow: hidden; }
.hp-tile { flex: none; width: 96px; }
.hp-tile .img { height: 110px; background: var(--surface-2); border-radius: 6px; }
.hp-tile .l { height: 6px; background: var(--line); border-radius: 3px; margin-top: 6px; width: 80%; }
.hp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hp-grid .img { height: 120px; }
.hp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hp-chips span { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 4px 9px; }
.hp-banner { height: 120px; border-radius: 8px; background: #555 center/cover no-repeat; position: relative; overflow: hidden; color: #fff; display: flex; align-items: flex-end; }
.hp-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.55)); }
.hp-banner div { position: relative; padding: 10px; }
.hp-promo { background: var(--ink); color: #fff; border-radius: 8px; padding: 12px; }
.hp-promo .badge { color: var(--gold); font-size: 8px; letter-spacing: 0.16em; font-weight: 700; }
.hp-promo .code { display: inline-block; border: 1px dashed var(--gold); color: var(--gold); padding: 2px 8px; border-radius: 4px; margin-top: 6px; font-family: ui-monospace, monospace; }
.hp-box { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; color: var(--muted); }
.hp-stars { color: var(--gold); letter-spacing: 2px; }
.hp-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 14px; text-align: center; }
.hp-trust div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px; font-size: 9px; }
.hp-trust b { display: block; font-size: 10px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(28, 27, 25, 0.45); z-index: 50; display: grid; place-items: center; padding: 20px; animation: fade 0.15s ease; }
.modal { background: var(--surface); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
.modal.wide { width: min(980px, 100%); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal pre { background: var(--surface-2); padding: 14px; border-radius: 8px; overflow: auto; max-height: 60vh; font-size: 12px; margin: 0; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Toasts */
.toasts { position: fixed; top: 72px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); font-weight: 500; max-width: 380px; animation: slidein 0.2s ease; }
.toast.error { background: var(--red); }
.toast.success::before { content: '✓ '; color: var(--gold); }
@keyframes slidein { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.loading { padding: 60px; text-align: center; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 6px 0; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); min-height: 40px; align-items: center; }
.tag-input:focus-within { border-color: var(--gold); box-shadow: var(--focus); }
.tag-input input { border: 0 !important; box-shadow: none !important; padding: 4px; flex: 1; min-width: 80px; width: auto; }
.tag { background: var(--gold-soft); color: var(--gold-dark); padding: 3px 4px 3px 9px; border-radius: 99px; font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 2px; }
.tag button { border: 0; background: transparent; cursor: pointer; color: inherit; font-size: 14px; line-height: 1; padding: 0 4px; }
.audience { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px; background: var(--gold-soft); border-radius: var(--radius-sm); }
.audience b { font-size: 22px; color: var(--gold-dark); font-variant-numeric: tabular-nums; }
.device-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.device-list button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); padding: 10px 12px; cursor: pointer; font: inherit; }
.device-list button:hover { background: var(--surface-2); }

/* Polish */
.field > span.hint { font-weight: 400; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.stack > div:empty { display: none; }
.row > select { width: auto; min-width: 160px; }
.row > input[type='search'] { width: auto; min-width: 240px; flex: 1; }

/* Localised texts (Home & Promotions) */
.lang-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.lang-bar .hint { flex: 1 1 220px; margin: 0; }
.lang-switch button { display: inline-flex; align-items: center; gap: 5px; letter-spacing: 0.04em; }
.lang-missing { font-size: 10px; font-weight: 700; min-width: 16px; padding: 1px 5px; border-radius: 99px; background: var(--amber-soft); color: var(--amber); }
.lang-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--gold-dark); background: var(--gold-soft); padding: 1px 6px; border-radius: 6px; vertical-align: 1px; }
.tr-flag { font-size: 9px; padding: 1px 6px; vertical-align: 1px; }
.tr-flag[hidden] { display: none; }
