/* ==========================================================================
   Design system: tokens, base, components. No build step, no CDN.
   Theme colour per business is injected as --brand / --brand-ink on <body>.
   ========================================================================== */

:root {
  color-scheme: light;
  /* GloRefs brand (sampled from the logo) */
  --navy: #000e2e;
  --navy-2: #0b1d4a;
  --navy-line: #1a2b5c;
  --amber: #fdaa00;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --ink: #0b1430;
  --ink-2: #444f6b;
  --ink-3: #717b95;
  --line: #e2e6ee;
  --line-strong: #ccd2df;
  /* --brand fills buttons/chips; --brand-ink is text on it; --brand-text is brand-coloured text on surfaces. */
  --brand: var(--amber);
  --brand-ink: var(--navy);
  --brand-text: #8f5200;
  --brand-soft: color-mix(in oklab, var(--brand) 14%, transparent);
  --success: #0f7a57;
  --success-soft: #e1f3eb;
  --danger: #c2372f;
  --danger-soft: #fbe9e7;
  --warning: #a35a00;
  --warning-soft: #fff1d6;
  --focus: color-mix(in oklab, var(--brand) 45%, transparent);

  --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;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --shadow-sm: 0 1px 2px rgb(0 14 46 / 6%);
  --shadow-md: 0 1px 2px rgb(0 14 46 / 5%), 0 8px 24px -8px rgb(0 14 46 / 14%);
  --shadow-lg: 0 2px 4px rgb(0 14 46 / 5%), 0 24px 48px -16px rgb(0 14 46 / 26%);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000a22;
    --surface: #06153a;
    --surface-2: #0c1f4b;
    --ink: #f1f4fa;
    --ink-2: #b6c0d8;
    --ink-3: #8691ae;
    --line: #18295a;
    --line-strong: #253872;
    --brand-text: #ffc04d;
    --success-soft: #0b2f27;
    --danger-soft: #36161c;
    --warning-soft: #33250a;
    --shadow-md: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px -8px rgb(0 0 0 / 50%);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 30%), 0 24px 48px -16px rgb(0 0 0 / 60%);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; font-weight: 650; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.9rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-soft); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.icon { display: inline-block; vertical-align: -0.2em; width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-md);
  font-weight: 600; font-size: 15px; letter-spacing: -0.005em;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 0 rgb(255 255 255 / 15%) inset, 0 6px 16px -6px color-mix(in oklab, var(--brand) 60%, transparent); }
.btn-primary:hover { background: color-mix(in oklab, var(--brand) 90%, black); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 16px; border-radius: var(--r-lg); padding: 0 22px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: .7; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; align-content: start; }
.field + .field { margin-top: 16px; }
.label { font-weight: 600; font-size: 14px; color: var(--ink); }
.hint { font-size: 13px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { min-height: 110px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
.field.has-error .input, .field.has-error .textarea, .field.has-error .select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; font-weight: 500; }
.code-input { font: 600 26px/1 var(--mono); letter-spacing: .4em; text-align: center; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 76px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--line); }
.divider { height: 1px; background: var(--line); border: 0; margin: 20px 0; }

/* ---------- Alerts / flashes ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--brand-soft); color: var(--ink); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-brand { background: var(--brand-soft); color: var(--brand-text); }

/* ---------- Auth layout (navy brand backdrop, logo above the card) ---------- */
.auth-shell {
  min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 22px; padding: 32px 16px;
  background:
    radial-gradient(900px 520px at 15% -10%, color-mix(in oklab, var(--amber) 22%, transparent), transparent 62%),
    radial-gradient(800px 480px at 110% 115%, color-mix(in oklab, var(--amber) 12%, transparent), transparent 60%),
    var(--navy);
}
.auth-logo { display: block; width: min(220px, 60vw); height: auto; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; border-radius: var(--r-xl); box-shadow: 0 30px 60px -20px rgb(0 0 0 / 55%); border-color: transparent; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-weight: 700; letter-spacing: -0.02em; }
.auth-brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; }
.auth-brand-mark .icon { width: 18px; height: 18px; }
.auth-title { margin-bottom: 6px; }
.auth-sub { color: var(--ink-2); margin-bottom: 24px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 14px; color: var(--ink-3); }
.auth-legal { color: rgb(255 255 255 / 45%); font-size: 12.5px; }

/* ---------- Error page ---------- */
.error-code { font: 700 64px/1 var(--font); letter-spacing: -0.04em; color: var(--brand-text); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; animation: toast-in .25s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ==========================================================================
   App shell (admin + business dashboards)
   ========================================================================== */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100dvh; }
/* The sidebar is always brand navy (same colour as the logo background) in light and dark mode. */
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 16px 14px; background: var(--navy); color: #fff; border-right: 1px solid var(--navy-line);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 16px; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.sidebar-brand img { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; }
.sidebar-brand img.brand-logo { width: 132px; height: auto; border-radius: 0; object-fit: contain; margin: 4px 0 0 6px; }
.sidebar .badge-brand { background: color-mix(in oklab, var(--amber) 20%, transparent); color: var(--amber); }
.nav-label { padding: 14px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / 45%); }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 12px; border-radius: 11px;
  color: rgb(255 255 255 / 72%); font-weight: 550; font-size: 14.5px;
}
.nav-link:hover { background: rgb(255 255 255 / 7%); color: #fff; text-decoration: none; }
.nav-link[aria-current="page"] { background: color-mix(in oklab, var(--amber) 16%, transparent); color: var(--amber); }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber); }
.nav-link .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber); color: var(--navy); font-size: 11.5px; font-weight: 750; display: grid; place-items: center; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--navy-line); }
.sidebar .user-chip .muted { color: rgb(255 255 255 / 50%); }
.sidebar .btn-ghost { color: rgb(255 255 255 / 70%); }
.sidebar .btn-ghost:hover { background: rgb(255 255 255 / 7%); color: #fff; }
.sidebar .avatar { background: color-mix(in oklab, var(--amber) 22%, transparent); color: var(--amber); }
.sidebar .select { background: var(--navy-2); border-color: var(--navy-line); color: #fff; min-height: 38px; font-size: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user-chip .who { min-width: 0; font-size: 13px; line-height: 1.3; }
.user-chip .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { color: var(--ink-3); margin-top: 4px; }
.breadcrumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.impersonation-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px 16px; background: var(--warning-soft); color: var(--warning); font-size: 14px; font-weight: 600; }

/* Mobile: sidebar becomes a navy bottom tab bar */
.mobile-top { display: none; }
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 40; inset: auto 0 0 0; height: auto; flex-direction: row; justify-content: space-around; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--navy-line);
  }
  .sidebar-brand, .nav-label, .sidebar-foot, .sidebar-switch, .sidebar-business { display: none; }
  .nav-link { flex-direction: column; gap: 3px; min-height: 54px; padding: 6px 2px; font-size: 11px; flex: 1; justify-content: center; text-align: center; border-radius: 12px; }
  .nav-link[aria-current="page"]::before { display: none; }
  .nav-link .nav-extra { display: none; }
  .nav-link .count { position: absolute; top: 3px; left: calc(50% + 4px); margin: 0; min-width: 18px; height: 17px; font-size: 10.5px; }
  .main { padding: 18px 16px calc(100px + env(safe-area-inset-bottom)); }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--navy); color: #fff; font-weight: 700; }
  .mobile-top img { height: 26px; width: auto; }
  .mobile-top .btn-ghost { color: rgb(255 255 255 / 75%); }
}

/* ---------- Grid + tiles ---------- */
.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)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.tile { padding: 18px 20px; }
.tile-label { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.tile-value { margin-top: 10px; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile-foot { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.tile-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.tile-icon .icon { width: 16px; height: 16px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; letter-spacing: .02em; color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .row-link { color: var(--ink); font-weight: 600; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 260px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search .input { padding-left: 38px; min-height: 40px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 11px; flex-wrap: wrap; }
.segmented a { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }

/* ---------- Form layout ---------- */
.form-section { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 24px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section h3 { margin-bottom: 4px; }
.form-section > div:first-child p { color: var(--ink-3); font-size: 13.5px; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fields-2 .field + .field { margin-top: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
@media (max-width: 1100px) { .form-section { grid-template-columns: 1fr; gap: 12px; } }
@media (max-width: 800px) { .fields-2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ---------- Key/value list ---------- */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Empty state ---------- */
.empty { padding: 48px 24px; text-align: center; color: var(--ink-3); }
.empty .icon { width: 36px; height: 36px; margin: 0 auto 12px; color: var(--line-strong); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ---------- Dialog ---------- */
dialog.modal { width: min(94vw, 520px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgb(10 10 14 / 45%); backdrop-filter: blur(3px); }
.modal-head { padding: 20px 24px 0; }
.modal-head p { color: var(--ink-3); margin-top: 4px; font-size: 14px; }
.modal-body { padding: 18px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }

/* ---------- Secret reveal (one-time password) ---------- */
.secret { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px dashed var(--brand); border-radius: var(--r-md); background: var(--brand-soft); }
.secret code { font: 700 20px/1.2 var(--mono); letter-spacing: .04em; flex: 1; overflow-wrap: anywhere; }

/* ---------- Plan cards ---------- */
.plan-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.plan-price { font-size: 30px; font-weight: 750; letter-spacing: -0.03em; }
.plan-price small { font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.feature-list li { display: flex; gap: 8px; align-items: center; }
.feature-list .icon { width: 16px; height: 16px; color: var(--success); }
.feature-list li.off { color: var(--ink-3); text-decoration: line-through; }
.feature-list li.off .icon { color: var(--ink-3); }

/* ---------- Dropdown menu ---------- */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.menu-list button, .menu-list a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; text-align: left; font-size: 14px; color: var(--ink); cursor: pointer; }
.menu-list button:hover, .menu-list a:hover { background: var(--surface-2); text-decoration: none; }
.menu-list .danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---------- Activity ---------- */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.activity li:last-child { border-bottom: 0; }
.activity time { margin-left: auto; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }

/* ---------- Review setup (keywords + AI knowledge base) ---------- */
.kw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kw-box { display: grid; gap: 8px; align-content: start; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.kw-box legend { padding: 0 4px; font-weight: 650; font-size: 14px; }
.kw-box .hint { margin: -4px 0 2px; font-size: 12.5px; }
.kw-box.has-error { border-color: var(--danger); }
.input-sm { min-height: 38px; padding: 7px 11px; font-size: 14px; border-radius: 9px; }
.input.is-filled { animation: kw-flash .6s var(--ease); }
@keyframes kw-flash { 0% { background: var(--brand-soft); } }
