/* Linkframe — design system from Linkframe.dc.html (Claude Design) */
:root {
  --bg: #fafcfb;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --surface-hover: #eef4f1;
  --border: #e3eae6;
  --border-strong: #d6e0da;
  --ink: #14201a;
  --ink-2: #3d4d45;
  --ink-3: #6b7a72;
  --ink-4: #9aa8a0;
  --accent: oklch(0.62 0.17 155);
  --accent-hover: oklch(0.56 0.17 155);
  --accent-soft: oklch(0.95 0.03 155);
  --accent-soft-2: oklch(0.97 0.02 155);
  --accent-ink: oklch(0.45 0.13 155);
  --accent-link: oklch(0.5 0.15 155);
  --nav-idle: #5b6b63;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --warn-ink: #7c4a12;
  --warn-soft: #fff7ed;
  --warn-border: #fed7aa;
  --shadow-card: 0 20px 50px -24px rgba(20, 60, 40, 0.25);
  --shadow-pop: 0 24px 60px -24px rgba(20, 60, 40, 0.3);
  --shadow-modal: 0 40px 100px -30px rgba(0, 0, 0, 0.5);
  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-link); text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; }
h1 { font-size: 26px; letter-spacing: -0.02em; }
h2 { font-size: 20px; letter-spacing: -0.02em; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
input, select, textarea, button { font-family: var(--font); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.hidden { display: none !important; }

/* Layout ------------------------------------------------------------------*/
.app-root { min-height: 100vh; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 32px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* App shell: sidebar ------------------------------------------------------*/
.shell { display: flex; min-height: 100vh; background: var(--bg); }
.sidebar { width: 220px; flex-shrink: 0; border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; padding: 20px 14px; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 9px; padding: 6px 10px 20px; cursor: pointer; color: var(--ink); }
.sidebar .brand:hover { color: var(--ink); }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--nav-idle); background: transparent; border: 0; text-align: left; width: 100%; }
.side-item:hover { background: var(--surface-hover); color: var(--nav-idle); }
.side-item.on { background: var(--surface-hover); color: var(--ink); }
.side-item svg { width: 16px; height: 16px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); min-width: 0; }
.side-user .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 12px; display: grid; place-items: center; text-transform: uppercase; flex-shrink: 0; }
.side-user .who { min-width: 0; line-height: 1.25; }
.side-user .who .nm { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who .em { font-size: 11px; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-card { background: var(--accent-soft); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.plan-card .h { font-weight: 700; font-size: 14px; }
.plan-card .d { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.plan-card .u { font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.plan-card button { border: none; background: var(--ink); color: #fff; border-radius: 9px; padding: 9px; font-size: 13px; font-weight: 600; cursor: pointer; }
.pro-chip { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; }
.dot-live { width: 8px; height: 8px; border-radius: 99px; background: var(--accent); flex-shrink: 0; }
.main { flex: 1; min-width: 0; }
.app-topbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 40px 0; }
.page { padding: 22px 40px 36px; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 10px 14px; }
  .sidebar .brand { padding: 6px 10px; }
  .side-item { width: auto; }
  .side-foot { margin-top: 0; margin-left: auto; flex-direction: row; align-items: center; padding-top: 0; }
  .plan-card { display: none; }
  .page { padding: 18px 20px 24px; }
  .app-topbar { padding: 12px 20px 0; }
}

/* Language switcher -------------------------------------------------------*/
.lang-seg { display: flex; gap: 2px; background: var(--surface-2); border-radius: 9px; padding: 3px; width: fit-content; }
.lang-seg button { border: none; background: transparent; color: var(--ink-3); border-radius: 7px; padding: 5px 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.lang-seg button.on { background: var(--ink); color: #fff; }

/* Top nav (landing / auth) ------------------------------------------------*/
.topnav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; gap: 16px; flex-wrap: wrap; }
.topnav .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.topnav .brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
.topnav .brand .brand-name { font-size: 18px; }
.topnav .links { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.topnav .links a { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.topnav .links a:hover { color: var(--ink); }
.topnav .links a.btn { color: var(--ink); font-weight: 600; }
.topnav-user { padding: 5px 12px 5px 5px; border-radius: 999px; max-width: 220px; }
.topnav-user .nm { color: var(--ink); }
.topnav-user .who { display: flex; align-items: center; gap: 8px; }
.topnav-user .plan-badge { flex-shrink: 0; }
.chip.plan-badge:empty { display: none; }
.chip.plan-free { background: var(--surface-2); color: var(--ink-3); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; }
.topnav .links a.btn.dark, .topnav .links a.btn.dark:hover { color: #fff; }

/* Buttons -----------------------------------------------------------------*/
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--bg); color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.dark:hover { background: #24332b; border-color: #24332b; color: #fff; }
.btn.accent { background: var(--accent); color: #fff; border-color: transparent; border-radius: 12px; }
.btn.accent:hover { background: var(--accent-hover); color: #fff; }
.btn.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.lg { padding: 14px 24px; font-size: 16px; border-radius: 12px; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.icon { padding: 8px; }
.btn.block { width: 100%; }

/* Cards, forms ------------------------------------------------------------*/
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.card.pad-0 { padding: 0; }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; padding: 11px 14px; font-size: 14px; background: var(--surface); color: var(--ink); outline-color: var(--accent); }
textarea.input { min-height: 88px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.range { width: 100%; accent-color: var(--accent); }

/* Pill tabs (destination) -------------------------------------------------*/
.pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-tabs button { border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); border-radius: 10px; padding: 9px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pill-tabs button svg { width: 14px; height: 14px; }
.pill-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.info-box { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #2c4a3a; line-height: 1.5; }
.warn-box { background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--warn-ink); line-height: 1.5; }

/* Segmented ---------------------------------------------------------------*/
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--ink-3); padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 32, 26, .1); }
.seg.block { display: flex; }
.seg.block button { flex: 1; }

/* Swatches ----------------------------------------------------------------*/
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 9px; cursor: pointer; border: 2px solid transparent; padding: 0; box-shadow: inset 0 0 0 1px var(--border); }
.swatch.on { border-color: var(--ink); }
.color-input { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 3px 8px 3px 3px; background: var(--surface); }
.color-input input[type=color] { width: 26px; height: 26px; border: 0; padding: 0; background: none; border-radius: 7px; cursor: pointer; }
.color-input input[type=text] { border: 0; width: 82px; background: transparent; outline: none; font-family: var(--mono); font-size: 12.5px; color: var(--ink); }

/* Style pickers -----------------------------------------------------------*/
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.picker button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 10px; padding: 8px 6px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-2); font-size: 11px; font-weight: 600; }
.picker button svg { width: 30px; height: 30px; }
.picker button.on { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Toggle ------------------------------------------------------------------*/
.toggle { width: 44px; height: 26px; border-radius: 99px; border: none; cursor: pointer; padding: 3px; background: #cfd9d4; display: flex; justify-content: flex-start; transition: background .15s; flex-shrink: 0; }
.toggle.on { background: var(--accent); justify-content: flex-end; }
.toggle span { width: 20px; height: 20px; border-radius: 99px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }

/* Image slot --------------------------------------------------------------*/
.image-slot { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 12px; display: flex; align-items: center; gap: 14px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.image-slot:hover, .image-slot.drag { border-color: var(--accent); background: var(--accent-soft-2); }
.image-slot .thumb { width: 56px; height: 56px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.image-slot .thumb img { width: 100%; height: 100%; object-fit: contain; }
.image-slot .thumb svg { width: 20px; height: 20px; color: var(--ink-4); }
.image-slot .text { flex: 1; min-width: 0; }
.image-slot .text strong { display: block; font-size: 13.5px; }
.image-slot .text span { font-size: 12px; color: var(--ink-3); }
.image-slot input[type=file] { display: none; }

/* Editor layout -----------------------------------------------------------*/
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 420px; }
.editor-left { padding: 36px 40px; display: flex; flex-direction: column; gap: 28px; max-width: 640px; width: 100%; }
.editor-right { border-left: 1px solid var(--border); background: var(--surface); padding: 36px 32px; }
.editor-right .sticky { position: sticky; top: 36px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 1000px) { .editor { grid-template-columns: 1fr; } .editor-right { border-left: 0; border-top: 1px solid var(--border); } }
.preview-frame { border: 1px solid var(--border); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; align-self: center; background: #fff; }
.preview-frame svg { display: block; max-width: 260px; height: auto; }
.preview-caption { font-size: 13px; color: var(--ink-3); text-align: center; max-width: 34ch; overflow-wrap: break-word; align-self: center; }
.accordion { border-top: 1px solid var(--border); }
.accordion:first-of-type { border-top: 0; }
.accordion > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 13.5px; color: var(--ink-2); padding: 12px 0; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary .chev { transition: transform .15s; color: var(--ink-4); display: inline-flex; }
.accordion[open] > summary .chev { transform: rotate(180deg); }
.accordion .body { padding: 2px 0 16px; display: flex; flex-direction: column; gap: 14px; }

/* Codes table -------------------------------------------------------------*/
.codes-table { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.codes-head, .codes-row { display: grid; grid-template-columns: 56px 1.3fr 1fr 110px 90px 120px; gap: 12px; align-items: center; padding: 12px 20px; }
.codes-head { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--border); }
.codes-row { border-bottom: 1px solid var(--surface-2); font-size: 14px; color: var(--ink); cursor: pointer; }
.codes-row:hover { background: var(--bg); }
.codes-row:last-child { border-bottom: 0; }
.codes-row .thumb { width: 40px; height: 40px; display: grid; place-items: center; background: #fff; border-radius: 8px; border: 1px solid var(--surface-2); overflow: hidden; }
.codes-row .thumb svg { width: 36px; height: auto; }
.codes-row .name { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.codes-row .name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codes-row .dest { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codes-row .scans { font-weight: 600; }
@media (max-width: 760px) {
  .codes-head { display: none; }
  .codes-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .codes-row .dest, .codes-row .type-col { display: none; }
}
.chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; background: var(--surface-2); color: var(--nav-idle); white-space: nowrap; }
.chip.dynamic { background: var(--accent-soft); color: var(--accent-ink); }
.chip.active { background: var(--accent-soft); color: var(--accent-ink); }
.chip.paused { background: var(--warn-soft); color: var(--warn-ink); }
.chip.archived { background: var(--surface-2); color: var(--ink-4); }
.chip.pro { background: var(--ink); color: #fff; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; }

/* Stats -------------------------------------------------------------------*/
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.stat-card .k { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.stat-card .v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.stat-card .v.sm { font-size: 20px; }
.stat-card .d { font-size: 12.5px; color: var(--ink-3); }
.stat-card .d.up { color: var(--accent-link); font-weight: 600; }
.hbar-row { display: flex; align-items: center; gap: 12px; }
.hbar-row .lbl { width: 80px; font-size: 13px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-row .track { flex: 1; height: 22px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar-row .fill { height: 100%; border-radius: 6px; background: var(--accent); }
.hbar-row .pct { width: 56px; font-size: 13px; font-weight: 600; text-align: right; }
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.vbars > div { flex: 1; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 2px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th { text-align: left; font-weight: 700; font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.table td { padding: 10px 12px; border-bottom: 1px solid var(--surface-2); }
table.table tr:last-child td { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.linkbox { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 8px 8px 12px; }
.linkbox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } }

/* Landing -----------------------------------------------------------------*/
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; padding: 64px 0 80px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; padding: 40px 0 56px; } }
.hero-badge { align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-link); background: var(--accent-soft); border-radius: 999px; padding: 6px 12px; }
.hero-h1 { font-size: 52px; line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; text-wrap: pretty; margin: 0; }
@media (max-width: 860px) { .hero-h1 { font-size: 36px; } }
.hero-p { font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 44ch; text-wrap: pretty; }
.hero-qr-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 28px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 16px; align-items: center; }
.hero-qr-card svg { display: block; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.feature-card .t { font-weight: 600; font-size: 16px; }
.feature-card .d { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.price-card.pro { background: var(--ink); color: #fff; border-color: var(--ink); position: relative; }
.price-card .amount { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; }
.price-card .amount small { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.price-card.pro .amount small { color: #9db3a8; }
.price-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-2); }
.price-card.pro ul { color: #cfe0d7; }
.price-card ul .off { color: var(--ink-4); }
.pop-badge { position: absolute; top: 20px; right: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: var(--accent); border-radius: 999px; padding: 5px 10px; }
.foot { border-top: 1px solid var(--border); padding: 24px 0 40px; font-size: 13px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Auth --------------------------------------------------------------------*/
.auth-wrap { max-width: 420px; margin: 32px auto 64px; padding: 0 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-card); }
.auth-card h1 { font-size: 24px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--ink-2); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-4); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.alert { border-radius: 10px; padding: 10px 14px; font-size: 13.5px; line-height: 1.5; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.success { background: var(--accent-soft); color: var(--accent-ink); }
.alert.info { background: var(--accent-soft); color: #2c4a3a; }
.alert.warn { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid var(--warn-border); }

/* Toast, modal, misc ------------------------------------------------------*/
@keyframes lfToast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 12px; padding: 13px 22px; font-size: 14px; font-weight: 600; z-index: 60; animation: lfToast 0.25s ease; box-shadow: 0 12px 32px -8px rgba(0,0,0,0.4); max-width: min(90vw, 480px); text-align: center; }
.toast.error { background: var(--danger); }
.modal-back { position: fixed; inset: 0; background: rgba(10, 20, 15, 0.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border-radius: 24px; width: 440px; max-width: 92vw; padding: 32px; display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow-modal); max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; }
pre.code { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; overflow-x: auto; font-size: 12px; line-height: 1.55; margin: 0; }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--surface-2); }
.key-row:first-of-type { border-top: 0; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty svg { width: 48px; height: 48px; color: var(--ink-4); margin-bottom: 10px; }
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-pop); min-width: 190px; padding: 6px; z-index: 30; }
.menu-panel button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; color: var(--ink); background: none; border: 0; cursor: pointer; font-size: 14px; font-weight: 500; }
.menu-panel button:hover { background: var(--surface-hover); }
.menu-panel .sep { height: 1px; background: var(--border); margin: 6px 0; }

/* Admin console ---------------------------------------------------------*/
.atable { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow-x: auto; }
.atable .ahead, .atable .arow { display: grid; grid-template-columns: var(--cols); gap: 12px; align-items: center; padding: 12px 20px; min-width: 720px; }
.atable .ahead { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--border); }
.atable .arow { border-bottom: 1px solid var(--surface-2); font-size: 14px; color: var(--ink); }
.atable .arow.clickable { cursor: pointer; }
.atable .arow.clickable:hover { background: var(--bg); }
.atable .arow:last-of-type { border-bottom: 0; }
.atable .arow .name { min-width: 0; }
.atable .arow .name .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atable .arow .dest { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-user .avatar, .avatar.lg { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 12px; display: grid; place-items: center; text-transform: uppercase; flex-shrink: 0; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.cell-user .who { min-width: 0; line-height: 1.25; }
.cell-user .who .nm { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.cell-user .who .em { font-size: 12px; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-list { display: flex; flex-direction: column; }
.audit-row { padding: 9px 0; border-bottom: 1px solid var(--surface-2); }
.audit-row:last-child { border-bottom: 0; }
.limits-row { display: grid; grid-template-columns: 90px repeat(3, 1fr) auto; gap: 12px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--surface-2); }
.limits-row:last-of-type { border-bottom: 0; }
@media (max-width: 860px) { .limits-row { grid-template-columns: 1fr 1fr; } }
