/* Portfolio CMS — admin design system. Light workspace, dark sidebar; shares type and accent with the public site. */

@font-face { font-family: "Geist Variable"; src: url("admin-fonts/geist-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono Variable"; src: url("admin-fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 100 900; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #f5f5f1;
  --surface: #ffffff;
  --sunken: #fafaf7;
  --ink: #111111;
  --text: #111111;
  --text-2: #666666;
  --muted: #92928d;
  --border: #e5e5df;
  --border-strong: #dadad4;
  --accent: #61ce70;
  --accent-ink: #1f6b2c;
  --accent-soft: rgba(97, 206, 112, 0.14);
  --warning: #e7b84b;
  --warning-ink: #7a5a0c;
  --warning-soft: rgba(231, 184, 75, 0.18);
  --danger: #e05a5a;
  --danger-ink: #a53232;
  --danger-soft: rgba(224, 90, 90, 0.1);
  --info-ink: #2f5b8f;
  --info-soft: rgba(79, 134, 198, 0.12);

  --side-bg: #111111;
  --side-text: rgba(255, 255, 255, 0.62);
  --side-line: rgba(255, 255, 255, 0.08);

  --side-w: 260px;
  --rail-w: 68px;
  --top-h: 64px;
  --radius: 14px;
  --radius-sm: 9px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.05);
  --shadow: 0 8px 24px -12px rgba(17, 17, 17, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(17, 17, 17, 0.3);
  --sans: "Geist Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
img, video { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.icon { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.sidebar :focus-visible { outline-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.sub { color: var(--text-2); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--ink); }
.skip { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 8px 12px; background: var(--ink); color: #fff; border-radius: 8px; transform: translateY(-200%); }
.skip:focus { transform: none; }
@view-transition { navigation: auto; }
::view-transition-group(root) { animation-duration: 0.16s; }

/* ---------- Shell ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--side-w); display: flex; flex-direction: column;
  background: var(--side-bg); color: var(--side-text); transition: width 0.22s var(--ease), transform 0.22s var(--ease);
  view-transition-name: sidebar;
}
.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.22s var(--ease); }
.is-rail .sidebar { width: var(--rail-w); }
.is-rail .main { margin-left: var(--rail-w); }
.no-anim .sidebar, .no-anim .main { transition: none; }

.brand { display: flex; align-items: baseline; gap: 6px; height: var(--top-h); padding: 0 22px; flex: none; align-items: center; color: #fff; white-space: nowrap; overflow: hidden; }
.brand__mark { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: #0b1a0e; font: 700 11px/1 var(--mono); }
.brand__name { font-weight: 600; letter-spacing: 0.14em; font-size: 13px; }
.brand__cms { font: 500 11px/1 var(--mono); color: rgba(255, 255, 255, 0.4); letter-spacing: 0.06em; }
.is-rail .brand { padding: 0; justify-content: center; }
.is-rail .brand__name, .is-rail .brand__cms { display: none; }

.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; }
.nav__label { padding: 18px 10px 8px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.32); white-space: nowrap; }
.nav__link {
  position: relative; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; margin-bottom: 2px; border-radius: 8px;
  color: var(--side-text); white-space: nowrap; transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav__link .icon { opacity: 0.8; transition: color 0.18s var(--ease), opacity 0.18s; }
.nav__link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav__link.is-active { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav__link.is-active .icon { color: var(--accent); opacity: 1; }
.nav__link.is-active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav__text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav__badge { min-width: 20px; padding: 0 6px; height: 18px; border-radius: 9px; background: var(--accent); color: #0b1a0e; font: 600 11px/18px var(--mono); text-align: center; }
.is-rail .nav { padding-inline: 14px; }
.is-rail .nav__label { height: 1px; padding: 0; margin: 12px 6px; background: var(--side-line); overflow: hidden; color: transparent; }
.is-rail .nav__link { justify-content: center; padding: 0; gap: 0; }
.is-rail .nav__text { display: none; }
.is-rail .nav__link.is-active::before { left: -14px; }
.is-rail .nav__badge { position: absolute; top: 4px; right: 4px; min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; }
.sidebar__foot { flex: none; padding: 10px 12px 14px; border-top: 1px solid var(--side-line); }
.sidebar__foot .nav__link { width: 100%; border: 0; background: none; text-align: left; }
.sidebar__foot .nav__link:hover { background: rgba(255, 255, 255, 0.06); }
.is-rail .sidebar__foot { padding-inline: 14px; }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(17, 17, 17, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.tip { position: fixed; z-index: 90; padding: 5px 9px; border-radius: 7px; background: #262626; color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); }

.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: var(--top-h); padding: 0 28px;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
  view-transition-name: topbar;
}
.topbar__left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar__right { display: flex; align-items: center; gap: 6px; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .sep { color: var(--border-strong); }
.kbd { padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); font: 500 11px/1.3 var(--mono); color: var(--muted); }
.searchbtn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; min-width: 220px; border: 1px solid var(--border); border-radius: 9px; background: var(--sunken); color: var(--muted); transition: border-color 0.18s, background 0.18s; }
.searchbtn:hover { border-color: var(--border-strong); background: var(--surface); }
.searchbtn span { flex: 1; text-align: left; }
.iconbtn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--text-2); transition: background 0.18s, color 0.18s; }
.iconbtn:hover { background: rgba(17, 17, 17, 0.06); color: var(--text); }
.iconbtn__dot { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--ink); color: #fff; font: 600 10px/16px var(--mono); border: 0; }
.avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 11px/1 var(--mono); letter-spacing: 0.02em; }
.avatar--soft { background: #ecece6; color: var(--text-2); }
.avatar--lg { width: 44px; height: 44px; font-size: 14px; }
.userbtn { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px 0 4px; margin-left: 4px; border: 0; border-radius: 20px; background: none; transition: background 0.18s; }
.userbtn:hover { background: rgba(17, 17, 17, 0.06); }
.userbtn b { font-weight: 500; }

.pop { position: relative; }
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; min-width: 220px; padding: 6px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-4px) scale(0.98); transform-origin: top right;
  pointer-events: none; visibility: hidden; transition: opacity 0.14s, transform 0.14s var(--ease), visibility 0.14s;
}
.menu.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.menu__head { padding: 10px 10px 8px; }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; color: var(--text); }
.menu__item:hover, .menu__item:focus-visible { background: var(--bg); }
.menu__item .icon { color: var(--muted); }
.menu__item--danger, .menu__item--danger .icon { color: var(--danger-ink); }
.menu__sep { height: 1px; margin: 6px 0; background: var(--border); }
.menu--wide { width: 340px; max-width: calc(100vw - 24px); }
.notice { display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px; }
.notice:hover { background: var(--bg); }
.notice__icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); }

.content { flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; padding: 32px 32px 120px; animation: enter 0.24s var(--ease) both; }
.content--narrow { max-width: 1040px; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.page-head p { margin-top: 4px; color: var(--text-2); max-width: 64ch; }
.page-head__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.back:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); color: var(--text); font-weight: 500; white-space: nowrap; text-decoration: none;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s, border-color 0.16s, opacity 0.16s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px -6px rgba(17, 17, 17, 0.25); border-color: #c9c9c2; }
.btn:active { transform: none; box-shadow: none; }
.btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--primary:hover { background: #262626; border-color: #262626; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #0b1a0e; }
.btn--accent:hover { border-color: var(--accent); filter: brightness(1.04); }
.btn--ghost { border-color: transparent; background: none; }
.btn--ghost:hover { background: rgba(17, 17, 17, 0.06); border-color: transparent; box-shadow: none; transform: none; }
.btn--danger { background: var(--danger-soft); border-color: transparent; color: var(--danger-ink); }
.btn--danger:hover { background: rgba(224, 90, 90, 0.16); border-color: transparent; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn--icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn.is-busy { pointer-events: none; opacity: 0.7; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card__title { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.card__body { padding: 22px; }
.card__head + .card__body { padding-top: 16px; }
.card__more { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.card__more:hover { color: var(--text); }
.card__more .icon { transition: transform 0.18s var(--ease); }
.card__more:hover .icon { transform: translateX(2px); }
.stack { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-7 { grid-column: span 7; } .col-6 { grid-column: span 6; } .col-5 { grid-column: span 5; } .col-4 { grid-column: span 4; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; background: #efefea; color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.badge--plain::before { display: none; }
.badge--green { background: var(--accent-soft); color: var(--accent-ink); }
.badge--amber { background: var(--warning-soft); color: var(--warning-ink); }
.badge--red { background: var(--danger-soft); color: var(--danger-ink); }
.badge--blue { background: var(--info-soft); color: var(--info-ink); }
.badge--muted { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }

/* ---------- Dashboard ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.hello h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.hello p { margin-top: 6px; color: var(--text-2); }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 20px; }
.stat { display: block; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 0.18s, transform 0.18s var(--ease), box-shadow 0.18s; }
.stat:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat__top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.stat__value { display: block; margin: 14px 0 10px; font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.stat__meta i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.stat__meta i.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s; }
.tile:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: var(--shadow); }
.tile__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--bg); }
.tile b { display: block; font-weight: 500; }
.tile small { color: var(--muted); font-size: 12.5px; }
.tile .arrow { margin-left: auto; color: var(--muted); transition: transform 0.18s var(--ease), color 0.18s; }
.tile:hover .arrow { transform: translateX(3px); color: var(--text); }
.bars { display: grid; gap: 12px; }
.bars__row { display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: 6px 12px; align-items: center; font-size: 13px; }
.bars__track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.bars__fill { height: 100%; border-radius: 3px; background: var(--ink); }
.bars__row b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.rows > * { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--border); transition: background 0.14s; }
.rows > a:hover { background: var(--sunken); }
.rows > :last-child { border-radius: 0 0 var(--radius) var(--radius); }
.rows__main { flex: 1; min-width: 0; }
.rows__main b { display: block; font-weight: 500; }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot--off { background: transparent; box-shadow: none; }

/* ---------- Toolbar & filters ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar__grow { flex: 1; }
.search { position: relative; flex: 1 1 260px; max-width: 360px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input[type="search"] { padding-left: 36px; height: 38px; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.seg button, .seg a { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 13px; transition: background 0.16s, color 0.16s; }
.seg [aria-pressed="true"], .seg [aria-current="true"] { background: var(--ink); color: #fff; }
.seg__count { font: 500 11px/1 var(--mono); opacity: 0.7; }
.toolbar select { width: auto; height: 38px; min-width: 130px; }
.hint { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th { padding: 12px 16px; text-align: left; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th a { display: inline-flex; align-items: center; gap: 5px; }
.table th a:hover, .table th[aria-sort] a { color: var(--text); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.14s; }
.table tbody tr:hover { background: var(--sunken); }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table .num { width: 1%; color: var(--muted); font: 500 12px/1 var(--mono); }
.table .actions { width: 1%; white-space: nowrap; text-align: right; }
.table .actions > * { vertical-align: middle; }
.table .actions form { display: inline-block; }
.card .table-wrap { border: 0; border-radius: 0 0 var(--radius) var(--radius); border-top: 1px solid var(--border); }
.card .table td, .card .table th { padding-top: 11px; padding-bottom: 11px; }
.cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell b { font-weight: 500; }
.cell__text { min-width: 0; }
.cell__text small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.thumb { flex: none; width: 44px; height: 32px; border-radius: 6px; object-fit: cover; background: var(--bg); border: 1px solid var(--border); }
.thumb--sq { width: 34px; height: 34px; border-radius: 50%; }
.thumb--empty { display: grid; place-items: center; color: var(--border-strong); }
.handle { display: grid; place-items: center; width: 24px; height: 28px; border: 0; background: none; color: var(--border-strong); cursor: grab; border-radius: 6px; touch-action: none; }
.handle:hover { color: var(--text-2); background: var(--bg); }
.is-dragging { opacity: 0.4; }
.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }

/* ---------- Project grid ---------- */
.pgrid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.pcard__media { position: relative; aspect-ratio: 16 / 10; background: var(--bg); overflow: hidden; }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.pcard:hover .pcard__media img { transform: scale(1.03); }
.pcard__placeholder { display: grid; place-items: center; height: 100%; color: var(--border-strong); background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(17, 17, 17, 0.02) 10px 20px); }
.pcard__flag { position: absolute; top: 10px; left: 10px; }
.pcard__body { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 14px; flex: 1; }
.pcard__title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.pcard__title a::after { content: ""; position: absolute; inset: 0; }
.pcard__foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 18px; border-top: 1px solid var(--border); }
.pcard__actions { display: flex; gap: 2px; }
.pcard__actions form { display: inline-flex; }
html[data-pview="list"] .view-grid, html:not([data-pview="list"]) .view-list { display: none; }

/* ---------- Tech grid, timeline, quotes ---------- */
.tgroup + .tgroup { margin-top: 26px; }
.tgroup__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.tcard { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.18s, transform 0.18s var(--ease), box-shadow 0.18s; }
.tcard:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.tcard__mark { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 9px; background: var(--bg); font: 600 12px/1 var(--mono); color: var(--text-2); }
.tcard__body { flex: 1; min-width: 0; }
.tcard__body a::after { content: ""; position: absolute; inset: 0; }
.tcard__body b { font-weight: 500; }
.tcard__body small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 12.5px; }
.tcard form, .tcard .handle { position: relative; z-index: 1; }
.tcard.is-off { opacity: 0.6; }
.timeline { position: relative; display: grid; gap: 14px; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 1px; background: var(--border-strong); }
.tl { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 0.18s, box-shadow 0.18s; }
.tl:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.tl::before { content: ""; position: absolute; left: -24px; top: 24px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.tl.is-current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl__body { flex: 1; min-width: 0; }
.tl__body h3 { font-size: 15px; font-weight: 600; }
.tl__body p { margin-top: 8px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl__actions { display: flex; gap: 2px; align-items: center; }
.tl__actions form { display: inline-flex; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 2px 9px; border-radius: 6px; background: var(--bg); font-size: 12px; color: var(--text-2); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 22px; }
.field { grid-column: 1 / -1; min-width: 0; }
.field--half { grid-column: span 1; }
.field--toggle { align-self: end; }
.field > label, .field__label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; color: var(--text); }
.field__help { margin-top: 7px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.field__error { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12.5px; color: var(--danger-ink); }
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.count { font: 500 11px/1 var(--mono); color: var(--muted); }
.count.is-over { color: var(--danger-ink); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], input[type="url"], select, textarea {
  display: block; width: 100%; height: 44px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  transition: border-color 0.16s, box-shadow 0.16s; appearance: none; -webkit-appearance: none;
}
textarea { height: auto; min-height: 112px; padding: 11px 13px; resize: vertical; line-height: 1.55; }
select { padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2392928d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input::placeholder, textarea::placeholder { color: #b3b3ad; }
input:hover, select:hover, textarea:hover { border-color: #c4c4bd; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(97, 206, 112, 0.22); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.has-error input:focus, .has-error textarea:focus { box-shadow: 0 0 0 3px rgba(224, 90, 90, 0.18); }
.code { font-family: var(--mono); font-size: 13px; }

.toggle { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color 0.16s; }
/* Inside a field the generic ".field > label" (display: block) would otherwise win and collapse the track. */
.field > label.toggle { display: flex; margin-bottom: 0; }
.toggle:hover { border-color: var(--border-strong); }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track { position: relative; flex: none; width: 36px; height: 20px; margin-top: 1px; border-radius: 10px; background: #d9d9d3; transition: background 0.18s; }
.toggle__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.18s var(--ease); }
.toggle input:checked + .toggle__track { background: var(--accent); }
.toggle input:checked + .toggle__track::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--ink); outline-offset: 2px; }
.toggle b { display: block; font-weight: 500; }
.toggle small { color: var(--muted); font-size: 12.5px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pill span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); color: var(--text-2); font-size: 13px; transition: background 0.16s, border-color 0.16s, color 0.16s; }
.pill span .icon { display: none; }
.pill:hover span { border-color: var(--ink); color: var(--text); }
.pill input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill input:checked + span .icon { display: block; color: var(--accent); }
.pill input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.dropzone { position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: center; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--sunken); transition: border-color 0.18s, background 0.18s; }
.dropzone.is-over { border-color: var(--accent); background: rgba(97, 206, 112, 0.07); }
.dropzone__preview { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 9px; background: #ecece6; color: var(--muted); overflow: hidden; }
.dropzone__preview img, .dropzone__preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dropzone--wide { grid-template-columns: minmax(0, 1fr); }
.dropzone--wide .dropzone__preview { aspect-ratio: 21 / 9; max-height: 340px; width: 100%; }
.dropzone--wide .dropzone__preview:not(:has(img, video)) { aspect-ratio: auto; height: 140px; }
.dropzone__body b { display: block; font-weight: 500; }
.dropzone__body p { margin: 2px 0 12px; color: var(--muted); font-size: 12.5px; }
.dropzone__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone.is-removed .dropzone__preview img, .dropzone.is-removed .dropzone__preview video { opacity: 0.25; filter: grayscale(1); }
.bigdrop { display: grid; place-items: center; gap: 6px; padding: 34px 20px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); text-align: center; cursor: pointer; transition: border-color 0.18s, background 0.18s; }
.bigdrop:hover, .bigdrop.is-over { border-color: var(--accent); background: rgba(97, 206, 112, 0.05); }
.bigdrop__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg); margin-bottom: 4px; }
.bigdrop b { font: 600 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.bigdrop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.queue { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 14px; }
.queue:empty { display: none; }
.queue__item { position: relative; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; font-size: 12px; }
.queue__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg); }
.queue__item span { display: block; padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue__item.is-bad { border-color: var(--danger); color: var(--danger-ink); }
.progress { height: 4px; border-radius: 2px; background: var(--bg); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

.pairs { display: grid; gap: 8px; }
.pairs__row { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--sunken); }
.pairs__n { font: 500 12px/1 var(--mono); color: var(--muted); text-align: center; }
.pairs__row input { height: 38px; }
.pairs__tools { display: flex; gap: 2px; }
.pairs__foot { display: flex; align-items: center; gap: 12px; }
.pairs + .field__help { margin-top: 10px; }

.md { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; transition: border-color 0.16s, box-shadow 0.16s; }
.md:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(97, 206, 112, 0.22); }
.md__bar { display: flex; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--sunken); flex-wrap: wrap; }
.md__bar .sep { width: 1px; height: 18px; margin: 0 4px; background: var(--border); }
.md__bar .seg { margin-left: auto; border: 0; background: none; padding: 0; }
.md textarea { border: 0; border-radius: 0; min-height: 460px; box-shadow: none !important; font-family: var(--mono); font-size: 13px; line-height: 1.7; padding: 16px; }
.md__preview { min-height: 460px; padding: 18px 22px; }
.prose { max-width: 72ch; font-size: 15px; line-height: 1.7; color: #222; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 20px; font-weight: 600; margin-top: 1.6em; letter-spacing: -0.01em; }
.prose h3 { font-size: 16px; font-weight: 600; margin-top: 1.4em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose code { font: 13px var(--mono); padding: 2px 5px; border-radius: 5px; background: var(--bg); }
.prose pre { padding: 14px 16px; border-radius: 10px; background: #161616; color: #eee; overflow-x: auto; }
.prose pre code { padding: 0; background: none; color: inherit; }
.prose blockquote { margin-inline: 0; padding-left: 16px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.prose ul, .prose ol { padding-left: 22px; }
.prose img { border-radius: 10px; }

.serp { padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); max-width: 620px; }
.serp__url { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #4d5156; overflow: hidden; }
.serp__title { margin-top: 6px; font-size: 19px; line-height: 1.3; color: #1a0dab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp__desc { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: #4d5156; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.social { max-width: 420px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.social__img { display: grid; place-items: center; aspect-ratio: 1200 / 630; background: var(--bg); color: var(--border-strong); overflow: hidden; }
.social__img img { width: 100%; height: 100%; object-fit: cover; }
.social__body { padding: 12px 14px; }
.social__body b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; align-items: start; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: 0; background: none; color: var(--muted); font-weight: 500; white-space: nowrap; transition: color 0.16s; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--text); }
.tab[aria-selected="true"]::after, .tab[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--ink); }
.tab__err { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.tab__count { font: 500 11px/1 var(--mono); padding: 3px 6px; border-radius: 6px; background: #ecece6; color: var(--text-2); }
[hidden] { display: none !important; }
[data-panel] { animation: enter 0.2s var(--ease) both; }
.panel-title { grid-column: 1 / -1; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.panel-title h2 { font-size: 15px; font-weight: 600; }
.panel-title p { margin-top: 2px; font-size: 13px; color: var(--muted); }

/* ---------- Save bar ---------- */
.savebar {
  position: fixed; left: var(--side-w); right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; gap: 12px; padding: 12px 32px;
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  transition: left 0.22s var(--ease);
}
.is-rail .savebar { left: var(--rail-w); }
.savebar__state { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: var(--muted); font-size: 13px; }
.savebar__state i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.savebar.is-dirty .savebar__state { color: var(--text); }
.savebar.is-dirty .savebar__state i { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.savebar [data-discard] { display: none; }
.savebar.is-dirty [data-discard] { display: inline-flex; }

/* ---------- Media library ---------- */
.mgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.mcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s var(--ease); }
.mcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.mcard__img { position: relative; aspect-ratio: 4 / 3; background: repeating-conic-gradient(#f1f1ec 0 25%, #fafaf7 0 50%) 0 0 / 16px 16px; }
.mcard__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcard__type { position: absolute; top: 8px; left: 8px; padding: 3px 6px; border-radius: 5px; background: rgba(17, 17, 17, 0.72); color: #fff; font: 500 10px/1 var(--mono); letter-spacing: 0.06em; }
.mcard__body { padding: 11px 12px 4px; min-width: 0; }
.mcard__body b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard__foot { display: flex; align-items: center; gap: 2px; padding: 6px 8px 8px; }
.mcard__foot form { display: inline-flex; }
.mcard__foot .badge { margin-right: auto; margin-left: 4px; }

/* ---------- Inbox & detail ---------- */
.inbox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.inbox__row { display: grid; grid-template-columns: 10px 36px minmax(120px, 200px) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border); transition: background 0.14s; }
.inbox__row:first-child { border-top: 0; }
.inbox__row:hover { background: var(--sunken); }
.inbox__row.is-unread .inbox__from, .inbox__row.is-unread .inbox__subject { font-weight: 600; }
.inbox__from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.inbox__subject { color: var(--text); }
.inbox__meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.detail__aside { display: grid; gap: 20px; position: sticky; top: calc(var(--top-h) + 20px); }
.sender { display: flex; align-items: center; gap: 12px; }
.sender b { display: block; font-weight: 600; }
.message { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 15px; line-height: 1.7; margin: 0; color: #222; }
.dl { display: grid; gap: 14px; margin: 0; }
.dl div { display: grid; gap: 3px; }
.dl dt { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }
.dl--cols { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.actions-col { display: grid; gap: 8px; }
.actions-col form { display: grid; }
.note { padding: 12px 14px; border-radius: 10px; background: #fbf7e9; border: 1px solid #efe6c4; }
.note p { white-space: pre-wrap; word-break: break-word; }
.note__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--warning-ink); }
.note__meta button { border: 0; background: none; color: inherit; padding: 0; text-decoration: underline; }
.pipeline { display: flex; gap: 4px; }
.pipeline i { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.pipeline i.on { background: var(--ink); }
.pipeline.is-won i.on { background: var(--accent); }
.pipeline.is-lost i.on { background: var(--danger); }

/* ---------- Empty, alerts, skeleton ---------- */
.empty { display: grid; justify-items: center; gap: 6px; padding: 56px 24px; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty__icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 8px; border-radius: 14px; background: var(--bg); color: var(--text-2); }
.empty h2 { font-size: 16px; font-weight: 600; }
.empty p { max-width: 44ch; color: var(--text-2); }
.empty .btn { margin-top: 12px; }
.empty--inline { padding: 30px 22px; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.empty--inline .empty__icon { width: 40px; height: 40px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 20px; border-radius: 10px; background: var(--danger-soft); color: var(--danger-ink); }
.alert ul { margin: 0; padding-left: 18px; }
.alert--info { background: var(--info-soft); color: var(--info-ink); }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, #eeeee9 25%, #f7f7f3 50%, #eeeee9 75%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-line { height: 12px; margin: 10px 0; }
.sk-row { height: 44px; margin: 6px 0; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.has-savebar .toasts { bottom: 84px; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 14px 12px 12px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); pointer-events: auto; animation: toast-in 0.28s var(--ease) both; }
.toast .icon { color: var(--accent); }
.toast--error .icon { color: #ff8f8f; }
.toast button { margin-left: 6px; border: 0; background: none; color: rgba(255, 255, 255, 0.5); padding: 2px; display: grid; }
.toast button:hover { color: #fff; }
.toast.is-leaving { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Dialogs ---------- */
dialog { padding: 0; border: 0; color: var(--text); background: none; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(17, 17, 17, 0.42); backdrop-filter: blur(2px); animation: fade 0.16s both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(440px, calc(100vw - 32px)); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); }
.modal[open] { animation: pop 0.2s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
.modal__body { padding: 24px 24px 8px; }
.modal__icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger-ink); }
.modal__body h2 { font-size: 17px; font-weight: 600; }
.modal__body p { margin-top: 6px; color: var(--text-2); }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 22px; }
.modal--form { width: min(520px, calc(100vw - 32px)); }
.palette { width: min(620px, calc(100vw - 24px)); margin-top: 12vh; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.palette[open] { animation: pop 0.18s var(--ease) both; }
.palette__input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.palette__input input { border: 0; height: 54px; padding: 0; box-shadow: none !important; font-size: 16px; }
.palette__list { max-height: min(56vh, 440px); overflow-y: auto; padding: 8px; }
.palette__group { padding: 10px 10px 6px; }
.palette__item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; }
.palette__item[aria-selected="true"] { background: var(--bg); }
.palette__item .icon { color: var(--muted); }
.palette__item small { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette__foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.palette__empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ---------- Login ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth__brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 48px; background: var(--ink); color: #fff; overflow: hidden; }
.auth__brand::after { content: ""; position: absolute; right: -180px; bottom: -180px; width: 520px; height: 520px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 0 0 80px rgba(255, 255, 255, 0.02), 0 0 0 160px rgba(255, 255, 255, 0.015); }
.auth__brand h2 { position: relative; z-index: 1; font-size: clamp(28px, 3.2vw, 44px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; max-width: 14ch; }
.auth__brand h2 em { font-style: normal; color: var(--accent); }
.auth__brand .brand { height: auto; padding: 0; }
.auth__form { display: grid; place-items: center; padding: 40px 24px; }
.auth__card { width: 100%; max-width: 380px; }
.auth__card h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.auth__card form { display: grid; gap: 18px; margin-top: 28px; }
.auth__card .btn { height: 44px; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .col-7, .col-5, .col-8, .col-4 { grid-column: span 12; }
}
@media (max-width: 1024px) {
  .main { margin-left: var(--rail-w); }
  .savebar { left: var(--rail-w); }
  .drawer-open .sidebar { width: var(--side-w); box-shadow: var(--shadow-lg); }
  .drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .content { padding: 24px 22px 120px; }
  .topbar { padding: 0 20px; }
  .searchbtn { min-width: 0; }
  .searchbtn span, .searchbtn .kbd { display: none; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail__aside { position: static; }
  .col-6 { grid-column: span 12; }
}
@media (max-width: 768px) {
  .main { margin-left: 0; }
  .savebar { left: 0; padding: 10px 16px; }
  .sidebar { width: min(86vw, 300px); transform: translateX(-100%); }
  .drawer-open .sidebar { width: min(86vw, 300px); transform: none; }
  .content { padding: 20px 16px 120px; }
  .topbar { padding: 0 12px; gap: 6px; }
  .crumbs > :not([aria-current]) { display: none; }
  .userbtn b, .viewsite span { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 16px; }
  .stat__value { font-size: 28px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field--half { grid-column: 1 / -1; }
  .card__body { padding: 18px 16px; }
  .card__head { padding: 16px 16px 0; }
  .rows > * { padding-inline: 16px; }
  .dropzone { grid-template-columns: minmax(0, 1fr); }
  .inbox__row { grid-template-columns: 10px 36px minmax(0, 1fr); row-gap: 2px; padding: 12px 14px; }
  .inbox__text { grid-column: 3; }
  .inbox__meta { grid-column: 3; }
  .pairs__row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .pairs__row input:nth-of-type(2) { grid-column: 2 / -1; grid-row: 2; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__brand { padding: 24px; min-height: 0; }
  .auth__brand h2, .auth__brand p { display: none; }
  .toasts { right: 12px; left: 12px; bottom: 12px; justify-items: stretch; }
  .page-head h1 { font-size: 21px; }
  .hello h1 { font-size: 23px; }
  .hide-sm { display: none !important; }
  .tl { flex-wrap: wrap; padding: 16px; }
  .tl__body { flex: 1 1 calc(100% - 40px); }
  .tl__actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .md textarea, .md__preview { min-height: 340px; }
  .savebar__state span { display: none; }
}
@media (max-width: 400px) {
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stat { padding: 14px; }
  .pgrid { grid-template-columns: minmax(0, 1fr); }
}
/* ---------- Structured sections editor ---------- */
.sections { display: grid; gap: 10px; }
.sections__item { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--sunken); }
.sections__head { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.sections__head input { height: 38px; font-weight: 600; }
.sections__item textarea { min-height: 0; }
.sections + .field__help { margin-top: 10px; }

/* ---------- Range field (e.g. logo width) with a preview of the result ---------- */
.rangefield { display: grid; gap: 14px; }
.rangefield__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.rangefield__controls input[type="range"] { flex: 1 1 220px; accent-color: var(--accent); cursor: pointer; }
.rangefield__value { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--mono); color: var(--muted); }
.rangefield__value input { width: 84px; }
.rangefield__preview { display: flex; align-items: center; gap: 24px; max-width: 100%; overflow: hidden; padding: 16px 20px; border: 1px solid var(--border); border-radius: 12px; background: #f4f4f0; }
.rangefield__preview img { display: block; flex: none; width: var(--rv); height: auto; }
.rangefield__preview--nav { border-radius: 999px; background: rgba(255, 255, 255, 0.9); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.06); }
.rangefield__preview--footer { background: #fff; }
.rangefield__links { display: flex; gap: 14px; margin-left: auto; }
.rangefield__links i { width: 38px; height: 7px; border-radius: 4px; background: rgba(17, 17, 17, 0.12); }

/* ---------- Theme colour field (Settings → Appearance). Previews the PUBLIC site; the CMS keeps its own colours. ---------- */
.themecolor { display: grid; gap: 16px; }
.themecolor__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.themecolor__controls input[type="color"] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }
.themecolor__controls input[type="text"] { width: 130px; text-transform: uppercase; }
.themecolor__note { color: var(--muted); }
.themecolor__note.is-bad { color: var(--danger-ink); }
.themecolor__preview { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.themecolor__row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 18px 20px; background: #f4f4f0; color: #111; font-size: 13px; }
.themecolor__row + .themecolor__row { border-top: 1px solid rgba(17, 17, 17, 0.1); background: #fff; }
.themecolor__row--dark { background: #0c2317 !important; color: #f4f4f0; }
.tp-btn { display: inline-flex; align-items: center; gap: 12px; height: 38px; padding: 0 5px 0 16px; border-radius: 999px; background: var(--pv); color: var(--pv-fg); font: 600 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.tp-btn i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #111; color: #fff; font-style: normal; }
.tp-nav { display: inline-flex; gap: 16px; font: 500 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #555; }
.tp-nav span { padding-bottom: 7px; border-bottom: 2px solid transparent; }
.tp-nav .is-on { color: #111; border-bottom-color: var(--pv); }
.tp-link { text-decoration: underline; text-decoration-color: var(--pv); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.tp-badge { padding: 4px 9px; border-radius: 999px; background: var(--pv); color: var(--pv-fg); font: 600 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.tp-section { font: 500 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: #555; }
.tp-section i { color: var(--pv); font-style: normal; font-weight: 700; }
.tp-chip { padding: 7px 12px; border: 1px solid rgba(17, 17, 17, 0.14); border-radius: 999px; font: 600 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #555; }
.tp-chip.is-on { background: var(--pv); border-color: var(--pv); color: var(--pv-fg); }
.tp-focus { padding: 7px 12px; border-radius: 8px; outline: 2px solid #111; outline-offset: 2px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--pv) 55%, transparent); }
.tp-dot { display: inline-flex; align-items: center; gap: 8px; }
.tp-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--pv); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pv) 30%, transparent); }
.tp-accent { font: italic 400 26px/1 Georgia, serif; color: var(--pv); }
.tp-num { font: 500 11px/1 var(--mono); letter-spacing: 0.12em; color: var(--pv); }

/* ---------- WordPress import ---------- */
.wizard { display: flex; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.wizard::-webkit-scrollbar { display: none; }
.wizard li { display: flex; align-items: center; gap: 8px; flex: 1 0 auto; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13px; color: var(--muted); white-space: nowrap; }
.wizard__n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); font: 600 11px/1 var(--mono); }
.wizard li.is-done { color: var(--text-2); }
.wizard li.is-done .wizard__n { background: var(--accent-soft); color: var(--accent-ink); }
.wizard li.is-current { border-color: var(--ink); color: var(--text); font-weight: 600; }
.wizard li.is-current .wizard__n { background: var(--ink); color: var(--surface); }
.figures dd { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figures dd small { font-size: 13px; font-weight: 400; letter-spacing: 0; }
.cell__text small.mono { font-size: 11.5px; }
.table td .cell__text { min-width: 0; }
.table td.small { min-width: 220px; overflow-wrap: anywhere; }
details > summary { cursor: pointer; }

/* ---------- Analytics & Integrations ---------- */
.form-grid--single .field, .form-grid--single .field--half { grid-column: 1 / -1; align-self: auto; }
.istatus { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
.istat { display: grid; gap: 10px; align-content: start; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 0.18s; }
a.istat:hover { border-color: var(--border-strong); }
.istat__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.istat__name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.istat__name .tile__icon { width: 30px; height: 30px; }
.istat p { font-size: 13px; color: var(--text-2); }
.istat__foot { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.statusline { display: grid; gap: 8px; }
.statusline p { font-size: 13px; color: var(--text-2); }
.checks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.checks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13px; }
.checks b { display: block; font-weight: 500; }
.checks span { color: var(--text-2); }
.checks .is-pass > .icon { color: var(--accent-ink); }
.checks .is-fail { border-color: rgba(224, 90, 90, 0.35); }
.checks .is-fail > .icon { color: var(--danger-ink); }
.checks .is-unknown > .icon { color: var(--muted); }
.rangebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.rangebar__group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rangebar__custom { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rangebar__custom[hidden] { display: none; }
.rangebar__custom input { width: 150px; height: 36px; }
.syncline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.syncline b { color: var(--text-2); font-weight: 500; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpi { display: grid; gap: 10px; align-content: start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.kpi__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.kpi__value { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi__src { font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 3px 6px; border-radius: 5px; background: var(--bg); }
.kpi small { font-size: 12px; color: var(--muted); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 230px; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 500 10.5px var(--mono); }
.chart .s1 { stroke: var(--ink); } .chart .s2 { stroke: var(--accent); } .chart .s3 { stroke: #8a8a84; stroke-dasharray: 4 3; }
.chart .dot1 { fill: var(--ink); } .chart .dot2 { fill: var(--accent); } .chart .dot3 { fill: #8a8a84; }
.chart__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: 12.5px; color: var(--text-2); }
.chart__legend i { display: inline-block; width: 14px; height: 3px; margin-right: 6px; border-radius: 2px; vertical-align: middle; background: var(--ink); }
.chart__legend .l2 i { background: var(--accent); } .chart__legend .l3 i { background: #8a8a84; }
.chart__tip { position: absolute; top: 0; z-index: 2; min-width: 150px; padding: 9px 11px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 12px; pointer-events: none; box-shadow: var(--shadow); transform: translateX(-50%); }
.chart__tip[hidden] { display: none; }
.chart__tip b { display: block; margin-bottom: 4px; font-weight: 600; }
.chart__tip span { display: flex; justify-content: space-between; gap: 14px; }
.ranked { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ranked li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; font-size: 13px; }
.ranked li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranked li b { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.ranked .bars__track { grid-column: 1 / -1; }
.report-state { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.report-state b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.report-state > div, .card__body code, .alert code { min-width: 0; overflow-wrap: anywhere; }
.report-state--warn { background: var(--warning-soft); border-color: transparent; color: var(--warning-ink); }
.report-state--warn b { color: var(--warning-ink); }
.report-state--error { background: var(--danger-soft); border-color: transparent; color: var(--danger-ink); }
.report-state--error b { color: var(--danger-ink); }
.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color 0.16s, box-shadow 0.16s; }
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input { margin: 3px 0 0; accent-color: var(--ink); }
.choice b { display: block; font-weight: 500; }
.choice small { display: block; color: var(--muted); font-size: 12.5px; }
.guide { display: grid; gap: 8px; margin: 0; padding-left: 20px; font-size: 13px; color: var(--text-2); }
.guide b { color: var(--text); font-weight: 500; }
.snippet { margin: 0; padding: 12px 14px; border-radius: 10px; background: #151515; color: #e8e8e3; font: 12px/1.6 var(--mono); overflow-x: auto; white-space: pre; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-form .field { flex: 1 1 260px; }
.card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 22px 20px; }
@media (max-width: 1024px) {
  .istatus { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .card__foot { padding: 0 16px 16px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .rangebar__custom input { width: calc(50% - 30px); }
}

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

/* Diagnostics: "not applicable" checks and the separate facts behind a status. */
.checks .is-skip { opacity: 0.75; }
.checks .is-skip > .icon { color: var(--muted); }
.checks small { display: block; margin-top: 3px; font-size: 11.5px; }
.facets { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.facet { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 12.5px; }
.facet b { display: block; font-weight: 500; }
.facet span { color: var(--text-2); }
.facet__state { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); text-align: center; font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.facet.is-yes .facet__state { color: var(--accent-ink); border-color: currentColor; }
.facet.is-no .facet__state { color: var(--danger-ink); border-color: currentColor; }
