/* Kogoto Creator portal + Admin Console -- the one design system.
   Served same-origin (/creator/brand/console.css, /admin/brand/console.css).
   Mobile first; no framework; respects prefers-reduced-motion. */

:root {
  --blue: #0B0BC7;            /* kogotoSeedColor */
  --blue-600: #0909a8;
  --blue-700: #070785;
  --blue-50: #eef0ff;
  --blue-100: #dfe2ff;
  --sky: #0a5cff;             /* logo blue, accents only */
  --ink: #0f1222;
  --ink-2: #2a2f45;
  --muted: #535b70;           /* 6.4:1 on white */
  --line: #e3e6ef;
  --line-2: #d3d8e5;
  --bg: #f4f5fa;
  --card: #ffffff;
  --card-tint: #f8f9ff;       /* highlighted cards */
  --field: #ffffff;           /* inputs, selects, textareas */
  --field-alt: #fafbff;       /* file picker */
  --surface-2: #f2f3f9;       /* code boxes */
  --line-strong: #b9c0d3;     /* input hover */
  --accent: #0B0BC7;          /* brand as TEXT (links, ghost buttons); --blue stays the fill */
  --accent-strong: #070785;   /* hovered brand text */
  --ok-ink: #0a4f28; --bad-ink: #7d1a14; --warn-ink: #5f3e00; --impact-ink: #6a1510;
  --ok-fill: #0c6e36; --bad-fill: #b3261e;
  --ok: #0c6e36;  --ok-bg: #e9f7ee;  --ok-line: #bfe3cc;
  --warn: #7c5100; --warn-bg: #fff5de; --warn-line: #f0d9a0;
  --bad: #b3261e; --bad-bg: #fdeceb; --bad-line: #f3c5c1;
  --bad-600: #951f18;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 18, 34, .06), 0 1px 1px rgba(15, 18, 34, .04);
  --shadow: 0 6px 20px rgba(15, 18, 34, .08), 0 1px 3px rgba(15, 18, 34, .06);
  --shadow-lg: 0 24px 60px rgba(15, 18, 34, .22);
  --focus: 0 0 0 3px rgba(11, 11, 199, .35);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}

/* Dark mode follows the device setting. The brand blue (#0B0BC7) stays
   the fill of every primary button and the header; text that used it
   switches to a lighter tint so it keeps AA contrast on dark cards. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9ebf7; --ink-2: #c9cde2; --muted: #a2a9c0;
    --line: #2a2f4a; --line-2: #3a4064; --line-strong: #5a6188;
    --bg: #0a0c1b; --card: #141729; --card-tint: #181c38;
    --field: #0f1224; --field-alt: #121530; --surface-2: #1b1f3a;
    --accent: #aab2ff; --accent-strong: #d2d6ff; --blue-50: #1a1e48; --blue-100: #2c3274;
    --ok: #6fd69a; --ok-bg: #0f2a1c; --ok-line: #24603d; --ok-ink: #bdf0d0;
    --warn: #f1c461; --warn-bg: #2b2210; --warn-line: #5e4a1b; --warn-ink: #f7e2b1;
    --bad: #ff9a90; --bad-bg: #351514; --bad-line: #6e2b27; --bad-600: #ffc0b8; --bad-ink: #ffd2cc; --impact-ink: #ffd2cc;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 6px 20px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .35);
    --focus: 0 0 0 3px rgba(170, 178, 255, .45);
  }
  dialog.modal { background: var(--card); }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
[id] { scroll-margin-top: 84px; }   /* anchors land below the sticky header */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.6 var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;          /* long names/URLs never overflow */
}
img, video, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -120px; z-index: 100; background: var(--card); color: var(--accent); padding: 8px 14px; border-radius: 8px; font-weight: 700; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }

/* ---------- App shell ---------- */
header.top {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(90deg, var(--blue) 0%, #1414d6 100%); color: #fff;
  box-shadow: 0 2px 12px rgba(7, 7, 133, .25);
}
header.top .bar { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
header.top .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; color: #fff; text-decoration: none; font-size: 16px; white-space: nowrap; }
header.top .brand .kmark { display: block; background: #fff; border-radius: 50%; padding: 2px; }
header.top .brand .tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; background: rgba(255,255,255,.18); padding: 2px 8px; border-radius: 999px; }
header.top nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
header.top nav a, header.top nav button {
  color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 10px; min-height: 40px;
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 14px; border: 0; background: transparent; cursor: pointer;
  transition: background .15s var(--ease);
}
header.top nav a:hover, header.top nav a.active, header.top nav a[aria-current="page"], header.top nav button:hover { background: rgba(255,255,255,.16); color: #fff; }
header.top nav a[aria-current="page"] { background: rgba(255,255,255,.22); }
header.top nav .who { font-size: 13px; opacity: .85; padding: 0 8px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.top nav form { margin: 0; }
.nav-toggle { display: none; margin-left: auto; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 10px; width: 44px; height: 44px; cursor: pointer; font: inherit; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; position: relative; margin: 0 auto; transition: transform .2s var(--ease), opacity .2s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; } .nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 860px) {
  .js .nav-toggle { display: block; }
  .js header.top nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #070785; flex-direction: column; align-items: stretch; padding: 8px 12px 14px; gap: 2px; box-shadow: 0 12px 24px rgba(7,7,133,.3); }
  .js header.top nav.open { display: flex; animation: drop .18s var(--ease); }
  .js header.top nav a, .js header.top nav button { width: 100%; justify-content: flex-start; min-height: 46px; }
  .js header.top nav .who { max-width: none; padding: 8px 12px; }
  header.top .bar { position: relative; flex-wrap: wrap; }
}

main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 16px 72px; flex: 1; }
main.narrow { max-width: 760px; }
footer.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 32px; }
footer.foot a { color: inherit; }

/* EN / DE / FR switcher (creator/_language.html). Before sign-in it sits in
   the top-right corner over the video backdrop; signed in, inside the nav. */
.lang-switch { display: inline-flex; gap: 2px; align-items: center; padding: 2px; border-radius: 999px;
  background: rgba(255,255,255,.14); }
.lang-switch a, .lang-switch .lang-current { display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; min-height: 36px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; text-decoration: none; color: inherit; }
.lang-switch a { opacity: .8; }
.lang-switch a:hover { opacity: 1; background: rgba(255,255,255,.18); }
.lang-switch a:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; opacity: 1; }
.lang-switch .lang-current { background: #fff; color: #0B0BC7; }
.lang-corner { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 5; color: var(--text, #111); }
body.auth-page .lang-corner { color: #fff; }
body.auth-page .lang-corner .lang-switch { background: rgba(0,0,0,.32); backdrop-filter: blur(6px); }
.consent-links { display: block; margin-top: 4px; font-size: 13px; }
@media (max-width: 600px) { body.auth-page main { padding-top: 64px; } }
@media (prefers-reduced-motion: reduce) { .lang-switch a { transition: none; } }

/* ---------- Typography ---------- */
h1 { font-size: clamp(22px, 2.4vw + 12px, 30px); line-height: 1.2; margin: 4px 0 18px; letter-spacing: -.3px; font-weight: 800; }
h2 { font-size: 19px; line-height: 1.3; margin: 28px 0 12px; font-weight: 750; letter-spacing: -.1px; }
h3 { font-size: 16px; margin: 0 0 6px; font-weight: 700; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { font-size: 16px; color: var(--ink-2); }
code, .mono { font-family: var(--mono); font-size: .92em; }
.breadcrumb { font-size: 14px; margin: 0 0 8px; }
.breadcrumb a { text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 4px 0 22px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }

/* ---------- Layout helpers ---------- */
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer { flex: 1; }
.stack-sm > * + * { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); min-width: 0;
}
@media (max-width: 480px) { .card { padding: 16px; border-radius: 12px; } }
.card > h2:first-child, .card-head h2 { margin-top: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 18px; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card.danger-zone { border-color: var(--bad-line); }
.card.danger-zone h2 { color: var(--bad); }
.card.highlight { border-color: var(--blue-100); background: linear-gradient(180deg, var(--card) 0%, var(--card-tint) 100%); }
a.card, .card.link { display: block; color: inherit; text-decoration: none; transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s; }
a.card:hover, .card.link:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--blue-100); color: inherit; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); display: block; color: inherit; text-decoration: none; transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.stat { position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: .6; }
.stat .num { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.stat.attention { border-color: var(--warn-line); background: var(--warn-bg); }
.stat.attention::before { background: var(--warn); opacity: 1; }
.stat.attention .num { color: var(--warn); }

/* ---------- Item lists (responsive by nature) ---------- */
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list > li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.item-list > li:first-child { padding-top: 2px; }
.item-list > li:last-child { border-bottom: 0; padding-bottom: 2px; }
.item-list .main { flex: 1 1 240px; min-width: 0; }
.item-list .title { font-weight: 700; text-decoration: none; color: var(--ink); font-size: 15.5px; }
.item-list a.title:hover { color: var(--accent); text-decoration: underline; }
.item-list .meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.item-list .side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }

/* ---------- Tables (become cards on small screens) ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
@media (hover: hover) and (min-width: 721px) { table.resp tbody tr { transition: background .12s; } table.resp tbody tr:hover { background: var(--blue-50); } }
table.kv th { width: 34%; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 720px) {
  th.hide-s, td.hide-s { display: none; }
  table.resp thead { display: none; }
  table.resp, table.resp tbody, table.resp tr, table.resp td { display: block; width: 100%; }
  table.resp tr { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; background: var(--card); }
  table.resp td { border: 0; padding: 7px 0; display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; text-align: right; }
  table.resp td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; text-align: left; flex: none; }
  table.resp td[data-label=""]::before, table.resp td:not([data-label])::before { content: none; }
  table.resp td.primary { display: block; font-size: 16px; font-weight: 700; text-align: left; }
  table.resp td.actions { justify-content: flex-start; flex-wrap: wrap; }
  table.kv th, table.kv td { display: block; width: 100%; padding: 4px 0; border: 0; }
  table.kv tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.kv tr:last-child { border-bottom: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  background: var(--blue); color: #fff; font: inherit; font-weight: 700; font-size: 15px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none;
  box-shadow: 0 1px 2px rgba(11,11,199,.25), inset 0 1px 0 rgba(255,255,255,.12);
  transition: background .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease), color .15s, border-color .15s;
}
.btn:hover { background: var(--blue-600); color: #fff; box-shadow: 0 4px 14px rgba(11,11,199,.28); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.lg { min-height: 52px; padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--blue-50); border-color: var(--blue-100); color: var(--accent-strong); }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: none; padding-left: 10px; padding-right: 10px; }
.btn.ghost:hover { background: var(--blue-50); color: var(--accent-strong); }
.btn.danger { background: var(--bad-fill); box-shadow: 0 1px 2px rgba(179,38,30,.3); }
.btn.danger:hover { background: var(--bad-600); color: #fff; box-shadow: 0 4px 14px rgba(179,38,30,.28); }
.btn.danger-outline { background: var(--card); color: var(--bad); border-color: var(--bad-line); box-shadow: none; }
.btn.danger-outline:hover { background: var(--bad-bg); color: var(--bad-600); }
.btn.small, .btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.btn[disabled], .btn.is-loading { opacity: .65; cursor: progress; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn .ico { font-size: 1.1em; line-height: 1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 480px) { .btn-row.stack-mobile > .btn, .btn-row.stack-mobile > form, .btn-row.stack-mobile > form .btn { width: 100%; } }

/* ---------- Badges ---------- */
.pill, .badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.5; letter-spacing: .2px; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); text-transform: capitalize;
}
.pill::before, .badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.pill.bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.pill.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.pill.blue { color: var(--accent); border-color: var(--blue-100); background: var(--blue-50); }
.pill.plain::before { display: none; }

/* ---------- Alerts / flash ---------- */
.flash { display: block; position: relative; padding: 13px 16px 13px 48px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; font-weight: 500; animation: fade-up .3s var(--ease) both; }
.flash::before { position: absolute; left: 14px; top: 13px; font-weight: 800; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; }
.flash.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.flash.ok::before { content: "\2713"; background: var(--ok-fill); }
.flash.err { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); }
.flash.err::before { content: "!"; background: var(--bad-fill); }
.flash.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.flash.warn::before { content: "!"; background: #b27700; }
.flash.info { background: var(--blue-50); border-color: var(--blue-100); color: var(--accent); }
.flash.info::before { content: "i"; background: var(--blue); }
.flash .btn { margin-top: 8px; }

/* ---------- Forms ---------- */
form.stack { display: grid; gap: 20px; max-width: 640px; }
form.stack.wide { max-width: none; }
.field { display: grid; gap: 6px; min-width: 0; }
label, .label { display: block; font-weight: 700; font-size: 14.5px; color: var(--ink); margin-bottom: 6px; }
.field label { margin-bottom: 0; }
label .opt, legend .opt { font-weight: 500; color: var(--muted); }
label .req, .req { color: var(--bad); font-weight: 800; margin-left: 2px; }
.hint, form .small.muted { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=tel],
input[type=number], input[type=datetime-local], input[type=date], input[type=time], textarea, select {
  width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 12px;
  font: inherit; font-size: 16px; /* no iOS zoom */ background: var(--field); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #8a91a6; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"], .has-error input, .has-error textarea, .has-error select { border-color: var(--bad); }
input[type=file] { font: inherit; font-size: 14px; max-width: 100%; padding: 10px; border: 1px dashed var(--line-2); border-radius: 12px; width: 100%; background: var(--field-alt); cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 700; border: 0; border-radius: 9px; padding: 8px 14px; margin-right: 12px; background: var(--blue-50); color: var(--accent); cursor: pointer; }
fieldset.dt-group { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 0; min-width: 0; }
fieldset.dt-group legend { font-weight: 700; padding: 0 6px; font-size: 14px; }
fieldset.welcome-settings { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 0; min-width: 0; background: var(--card-tint); }
fieldset.welcome-settings > legend { font-weight: 700; font-size: 14.5px; padding: 0 6px; color: var(--ink); }
/* Date of birth as Day / Month / Year (Creator sign-up): no calendar to page back through decades. */
fieldset.dob { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.dob legend { padding: 0; }
fieldset.dob .hint { margin: 0 0 8px; }
.dob-row { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) 7rem; gap: 12px; }
.dob-row label { font-weight: 600; font-size: 13.5px; color: var(--muted); }
@media (max-width: 380px) { .dob-row { grid-template-columns: 4.5rem minmax(0, 1fr) 5.5rem; gap: 8px; } }
.check { display: flex; align-items: flex-start; gap: 10px; }
.check input { width: 20px; height: 20px; flex: none; margin: 2px 0 0; accent-color: var(--accent); }
.check label { margin: 0; font-weight: 500; }
.field-error { color: var(--bad); font-size: 13.5px; font-weight: 600; margin-top: 6px; }
.counter { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; margin-top: 4px; }
.counter.near { color: var(--warn); font-weight: 700; }
.counter.full { color: var(--bad); font-weight: 700; }
.preview { max-width: 240px; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; display: block; box-shadow: var(--shadow-sm); }
/* Spot and Event cover images: one frame everywhere (detail, edit, upload
   preview) -- 16:9, centre-cropped, never stretched; the stored original
   is untouched. */
.preview.cover-frame { width: 100%; max-width: 480px; aspect-ratio: 16 / 9; height: auto; object-fit: cover; object-position: center; border-radius: 16px; background: var(--blue-50); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 4px; }
@media (max-width: 480px) { .form-actions .btn { flex: 1 1 100%; } }

/* ---------- Code / QR ---------- */
.codebox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; word-break: break-all; }
.qr-wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.qr-wrap img { border: 1px solid var(--line); border-radius: 12px; background: #fff; width: 220px; height: auto; }
.qr-preview { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); max-width: 340px; width: 100%; }
.qr-preview img { display: block; width: 100%; height: auto; border-radius: 8px; }
.format-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 420px) { .format-grid { grid-template-columns: 1fr; } }

/* Creator-written text (descriptions, posts, announcements): line breaks
   and paragraphs as typed, web links visibly links, a long URL wraps
   instead of widening the page (app/core/linkify.py). */
.user-text { white-space: pre-line; overflow-wrap: anywhere; word-break: normal; max-width: 100%; }
.user-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.user-text a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
.draft-note .btn { margin-left: 8px; vertical-align: middle; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 6px 0; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "\25B8"; display: inline-block; margin-right: 6px; transition: transform .2s var(--ease); }
details.more[open] summary::before { transform: rotate(90deg); }
details.more[open] summary { margin-bottom: 8px; }
details.more[open] > *:not(summary) { animation: fade-up .25s var(--ease) both; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 28px 12px; }
.empty-state img { opacity: .6; display: block; margin: 0 auto 10px; }
.empty-state h3 { margin-bottom: 4px; }
.empty-state p { color: var(--muted); max-width: 440px; margin: 0 auto 14px; }

/* ---------- Steps / onboarding ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; counter-reset: step; margin: 0 0 18px; padding: 0; list-style: none; }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 50px; position: relative; font-size: 14px; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-50); color: var(--accent); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.steps li.done::before { content: "\2713"; background: var(--ok-bg); color: var(--ok); }
.steps li b { display: block; }

/* ---------- Modal dialog ---------- */
dialog.modal { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lg); color: var(--ink); overflow: auto; }
dialog.modal::backdrop { background: rgba(10, 12, 30, .55); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .2s var(--ease); }
dialog.modal[open]::backdrop { animation: fade .2s var(--ease); }
.modal-body { padding: 22px 22px 8px; }
.modal-body h2 { margin: 0 0 8px; font-size: 20px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px 22px; }
@media (max-width: 480px) { .modal-actions .btn, .modal-actions form { flex: 1 1 100%; } .modal-actions form .btn { width: 100%; } }
.impact { background: var(--bad-bg); border: 1px solid var(--bad-line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 14px; color: var(--impact-ink); }
.impact ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Auth pages (sign-in / sign-up) ---------- */
.login-wrap { max-width: 420px; margin: 7vh auto 0; }
.login-wrap.wide { max-width: 600px; }
.brand-big { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.brand-big img { display: block; height: auto; }
.brand-big .portal-label { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: 1.4px; text-transform: uppercase; }
.auth-backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #0B0BC7 url("/creator/brand/welcome_bg_poster.jpg") center / cover no-repeat; }
.auth-backdrop video, .auth-backdrop img.backdrop-motion { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,6,40,.55) 0%, rgba(6,6,40,.82) 100%); }
body.auth-page { background: #0B0BC7; }
body.auth-page footer.foot, body.auth-page footer.foot a { color: rgba(255,255,255,.86); }
body.auth-page .brand-big img { background: #fff; border-radius: 16px; padding: 10px 16px; box-sizing: content-box; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
body.auth-page .brand-big .portal-label { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
body.auth-page .card { box-shadow: 0 18px 50px rgba(0,0,0,.35); border: 0; padding: 26px; }
body.auth-page main { padding-top: 8px; }
body.auth-page .login-wrap { margin-top: 5vh; }
.auth-alt { text-align: center; margin-top: 16px; color: rgba(255,255,255,.9); }
.auth-alt a { color: #fff; font-weight: 700; }
@media (max-width: 480px) { body.auth-page .card { padding: 20px; } }

/* ---------- Announcement recipients ---------- */
.people-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 60vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.people-list li { border-bottom: 1px solid var(--line); }
.people-list li:last-child { border-bottom: 0; }
.people-list label { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 0; font-weight: 500; cursor: pointer; }
.people-list label:hover { background: var(--blue-50); }
.people-list input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--blue-50); }
.avatar.initials { display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; font-weight: 700; }
.picker-tools { gap: 8px; }
.picker-tools input[type=search] { max-width: 280px; }
.phone-row { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 8px; }
@media (max-width: 380px) { .phone-row { grid-template-columns: 1fr; } }
.interest-grid { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.interest-grid label { font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.badge-unverified { font-size: 11px; font-weight: 700; color: var(--warn); border: 1px solid var(--warn); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.post-images { display: flex; flex-wrap: wrap; gap: 12px; }
.post-images img { border-radius: 10px; }

/* ---------- Motion ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
main > * { animation: fade-up .35s var(--ease) both; }
main > *:nth-child(2) { animation-delay: .03s; }
main > *:nth-child(3) { animation-delay: .06s; }
main > *:nth-child(4) { animation-delay: .09s; }
main > *:nth-child(n+5) { animation-delay: .12s; }
/* Navigation feedback: a thin brand bar while the next page loads
   (console.js). No cross-document view transition: pages that don't opt
   in (legal, redirects) make Chromium abort it with a console error. */
.nav-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 1000; pointer-events: none; background: var(--blue); box-shadow: 0 0 8px rgba(11, 11, 199, .45); transform-origin: 0 50%; transform: scaleX(.92); animation: nav-progress 6s cubic-bezier(.1, .7, .2, 1) both; }
body.auth-page .nav-progress { background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .6); }
@keyframes nav-progress { 0% { transform: scaleX(0); } 8% { transform: scaleX(.4); } 100% { transform: scaleX(.92); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .auth-backdrop video, .auth-backdrop img.backdrop-motion { display: none; }
}

@media print {
  header.top, footer.foot, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}

/* ---------- Sign-in extras ---------- */
.auth-title { font-size: 22px; margin: 0 0 14px; }
.social-buttons { display: grid; gap: 10px; margin-bottom: 4px; }
.btn.social { width: 100%; justify-content: center; gap: 10px; min-height: 48px; }
.btn.social.google { background: #fff; color: #1f1f1f; border-color: #c7cad3; box-shadow: var(--shadow-sm); }
.btn.social.google:hover { background: #f6f7f9; color: #1f1f1f; }
.btn.social.apple { background: #000; color: #fff; box-shadow: none; }
.btn.social.apple:hover { background: #222; color: #fff; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.status-card { text-align: center; padding: 28px 22px; }
.status-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; }
.status-icon.pending { background: var(--warn-bg); color: #b27700; animation: pulse 2.4s ease-in-out infinite; }
.status-icon.ok { background: var(--ok-bg); color: var(--ok); }
.status-icon.bad { background: var(--bad-bg); color: var(--bad); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(178,119,0,.25); } 50% { box-shadow: 0 0 0 12px rgba(178,119,0,0); } }
.btn.kogoto-cta img { background: #fff; border-radius: 50%; padding: 2px; box-sizing: content-box; }
.forgot-link { display: block; text-align: center; margin-top: 14px; font-weight: 700; font-size: 15px; padding: 8px; border-radius: 10px; text-decoration: none; }
.forgot-link:hover { background: var(--blue-50); text-decoration: underline; }

/* ---- 1.2.2 recurring Events (admin/_recurrence_field.html, creator/series.html) ---- */
.rec { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--card-tint); display: grid; gap: 14px; }
.rec-title { font-size: 1rem; margin: 0; }
.rec-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rec-seg-opt { position: relative; display: block; cursor: pointer; }
.rec-seg-opt input { position: absolute; opacity: 0; inset: 0; }
.rec-seg-opt span { display: grid; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--field); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.rec-seg-opt small { color: var(--muted); font-size: .82rem; }
.rec-seg-opt input:checked + span { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.rec-seg-opt input:focus-visible + span { box-shadow: var(--focus); }
.rec-body[hidden], .rec [hidden] { display: none !important; }
.rec-body { display: grid; gap: 14px; }
.rec-inline { display: flex; gap: 8px; }
.rec-inline input { max-width: 90px; }
.rec fieldset { border: 0; padding: 0; margin: 0; }
.rec legend { font-weight: 600; margin-bottom: 6px; }
.rec-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rec-chip { position: relative; cursor: pointer; }
.rec-chip input { position: absolute; opacity: 0; inset: 0; }
.rec-chip span { display: inline-grid; place-items: center; min-width: 48px; height: 44px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--field); font-weight: 600; }
.rec-chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.rec-chip input:focus-visible + span { box-shadow: var(--focus); }
.rec-num { width: 76px; display: inline-block; }
.rec-end-opts, .rec-month { display: grid; gap: 8px; }
.rec .check span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rec .check select, .rec .check input[type=date] { width: auto; display: inline-block; }
.rec-preview { border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); padding: 14px; display: grid; gap: 8px; }
.rec-sentence { font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.rec-sentence:empty { display: none; }
.rec-cal { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.rec-month-name { font-weight: 600; margin-bottom: 6px; text-transform: capitalize; }
.rec-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; font-size: .85rem; }
.rec-dow { color: var(--muted); font-size: .75rem; font-weight: 600; padding: 2px 0; }
.rec-day { padding: 6px 0; border-radius: 8px; color: var(--ink); }
.rec-day.on { background: var(--blue); color: #fff; font-weight: 700; }
.rec-day.first { outline: 2px solid var(--sky); outline-offset: -2px; }
.rec-replace small { display: block; }
.badge.rec-badge, .rec-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--blue-50, #eef0ff); color: var(--accent); font-size: .8rem; font-weight: 600; }
/* Series page calendar */
.cal-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .dow { color: var(--muted); font-size: .75rem; font-weight: 600; text-align: center; }
.cal-cell { min-height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: .88rem; border: 1px solid transparent; text-decoration: none; color: var(--ink); }
.cal-cell.out { opacity: .35; }
.cal-cell.past { color: var(--muted); }
.cal-cell.today { border-color: var(--line-strong); font-weight: 700; }
.cal-cell.scheduled, .cal-cell.planned { background: var(--blue); color: #fff; font-weight: 700; }
.cal-cell.planned { background: var(--blue-50, #eef0ff); color: var(--accent); }
.cal-cell.edited { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); font-weight: 700; }
.cal-cell.cancelled { background: var(--bad-bg); color: var(--bad-ink); text-decoration: line-through; }
.cal-cell.paused { background: var(--line); color: var(--muted); }
a.cal-cell:hover { box-shadow: var(--shadow-sm); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--muted); }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.occ-list li .meta .tag { margin-left: 0; }
@media (max-width: 560px) { .rec { padding: 14px; } .rec-seg { grid-template-columns: 1fr; } .rec-chip span { min-width: 42px; } }
.cal-legend i.cal-cell { min-height: 0; width: 12px; height: 12px; display: inline-block; border-radius: 4px; }
.rec .check { display: flex; align-items: center; gap: 8px; }
.rec input.rec-num { width: 84px; min-width: 84px; flex: 0 0 auto; }
.rec input[type=date] { width: auto; min-width: 160px; }
.occ-list .side { flex-wrap: wrap; gap: 8px; }
.rec-badge::before { content: "\21bb"; font-weight: 700; }

/* Event participation limit (1.2.2) */
.capacity { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.capacity legend { font-weight: 600; margin-bottom: 6px; }
.capacity-limit { display: grid; gap: 6px; max-width: 260px; }
.capacity-limit[hidden] { display: none !important; }
.meta .cap { font-weight: 600; color: var(--blue); }
.meta .cap.full { color: var(--bad, #b42318); }

/* ========================================================================
   Creator Portal refresh (2026-11-06) -- scoped to .portal-creator so the
   Admin Console keeps its look. Calm, premium: soft depth, generous radii,
   brand-tinted surfaces, restrained motion (none with reduced motion).
   ======================================================================== */
.portal-creator {
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 18, 34, .05), 0 2px 8px rgba(15, 18, 34, .04);
  --shadow: 0 10px 30px rgba(15, 18, 34, .08), 0 2px 6px rgba(15, 18, 34, .05);
  background:
    radial-gradient(1200px 420px at 50% -120px, rgba(11, 11, 199, .10), transparent 70%),
    var(--bg);
}
.portal-creator header.top {
  background: linear-gradient(115deg, #0B0BC7 0%, #1a2bd8 55%, #2448ef 100%);
  box-shadow: 0 6px 24px rgba(11, 11, 199, .22);
}
.portal-creator header.top nav a, .portal-creator header.top nav button { border-radius: 10px; }
.portal-creator h1 { letter-spacing: -.6px; font-weight: 800; }
.portal-creator .page-head .sub { font-size: 15px; }

/* Cards: layered depth, hairline border, no harsh edges. */
.portal-creator .card {
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: var(--shadow-sm);
}
.portal-creator .card-head h2, .portal-creator .card > h2 { letter-spacing: -.2px; }

/* Stats: number first, a soft brand chip instead of the side bar. */
.portal-creator .stats { gap: 14px; }
.portal-creator .stat {
  border-radius: 16px; padding: 18px 18px 16px;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-tint) 100%);
}
.portal-creator .stat::before { display: none; }
.portal-creator .stat.attention { background: var(--warn-bg); }
.portal-creator .stat .num { font-size: 30px; }
.portal-creator a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Lists of Spots/Events: calm rows with a hover tint. */
.portal-creator .item-list > li {
  border-radius: 14px; padding: 14px 12px; margin: 0 -12px;
  border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent);
  transition: background-color .15s var(--ease);
}
.portal-creator .item-list > li:hover { background: color-mix(in srgb, var(--blue-50) 55%, transparent); }
.portal-creator .item-list .title { font-weight: 700; font-size: 16px; }
.portal-creator .item-list .meta { gap: 6px 14px; }

/* Buttons and fields. */
.portal-creator .btn { border-radius: 12px; transition: transform .12s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease); }
.portal-creator .btn:not(.secondary):not(.ghost):not(.danger) { box-shadow: 0 6px 16px rgba(11, 11, 199, .22); }
.portal-creator .btn:hover { transform: translateY(-1px); }
.portal-creator .btn:active { transform: translateY(0); }
.portal-creator input:not([type=checkbox]):not([type=radio]):not([type=file]),
.portal-creator select, .portal-creator textarea { border-radius: 12px; }
.portal-creator .rec-seg-opt span { border-radius: 14px; }
.portal-creator .flash { border-radius: 14px; }
.portal-creator .badge { border-radius: 999px; }

/* Empty states: a little more air. */
.portal-creator .empty-state { padding: 34px 16px; }

@media (prefers-color-scheme: dark) {
  .portal-creator {
    background: radial-gradient(1200px 420px at 50% -120px, rgba(90, 100, 255, .16), transparent 70%), var(--bg);
  }
  .portal-creator .item-list > li:hover { background: rgba(170, 178, 255, .07); }
}
@media (prefers-reduced-motion: reduce) {
  .portal-creator .btn, .portal-creator a.stat, .portal-creator .item-list > li { transition: none; }
  .portal-creator .btn:hover, .portal-creator a.stat:hover { transform: none; }
}
