/* =====================================================================
   Boxland – web design system v3 (minimal / monochrome)
   Black, white and soft greys. No gradients, one accent: the text colour.
   Light + dark via [data-theme] (set before first paint in the layout).
   ===================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font);
  --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #fafafa;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #e9e9eb;
  --border: #ebebed;
  --border-strong: #d6d6da;
  --text: #0a0a0a;
  --text-2: #3f3f46;
  --muted: #71717a;

  /* "Brand" is simply ink: black buttons on white, white on black. */
  --brand: #0a0a0a;
  --brand-ink: #0a0a0a;
  --on-brand: #ffffff;
  --brand-soft: #f4f4f5;
  --brand-grad: #0a0a0a;

  --success: #16a34a;
  --warning: #b45309;
  --error: #dc2626;
  --info: #2563eb;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --pill: 999px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .04);
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px -12px rgb(0 0 0 / .10);
  --shadow-lg: 0 24px 64px -16px rgb(0 0 0 / .18);
  --ring: 0 0 0 3px rgb(10 10 10 / .12);
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --note-0: #fdf6e3; --note-1: #eef6ee; --note-2: #edf3fb;
  --note-3: #f4effa; --note-4: #fbefef; --note-5: #ecf7f7;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --surface: #121212;
  --surface-2: #1a1a1a;
  --surface-3: #232323;
  --border: #222222;
  --border-strong: #333333;
  --text: #fafafa;
  --text-2: #d4d4d8;
  --muted: #8b8b93;
  --brand: #fafafa;
  --brand-ink: #fafafa;
  --on-brand: #0a0a0a;
  --brand-soft: #1a1a1a;
  --brand-grad: #fafafa;
  --success: #4ade80;
  --warning: #fbbf24;
  --error: #f87171;
  --info: #60a5fa;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .5);
  --shadow: 0 1px 2px rgb(0 0 0 / .5), 0 16px 40px -16px rgb(0 0 0 / .7);
  --shadow-lg: 0 30px 70px -20px rgb(0 0 0 / .8);
  --ring: 0 0 0 3px rgb(250 250 250 / .16);
  --note-0: #26231b; --note-1: #1b241c; --note-2: #1b212a;
  --note-3: #231d29; --note-4: #2a1d1d; --note-5: #1a2626;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg, canvas { display: block; max-width: 100%; }
svg.icon { flex: none; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: text-decoration-color .15s; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 .45em; color: var(--text); font-weight: 600; }
h1 { font-size: clamp(1.9rem, 3.8vw, 2.75rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.65rem); }
h3 { font-size: 1.05rem; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.xs { font-size: .78rem; }
.mono { font-family: var(--mono); font-size: .86rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--surface); padding: 10px 14px; border-radius: var(--r); box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 24px; }
.container.narrow { max-width: 800px; }
@media (max-width: 640px) { .container { padding-inline: 16px; } }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > .grow, .grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.section { padding-block: 96px; }
.section-sm { padding-block: 48px; }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 500; color: var(--muted); margin-bottom: 14px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --_bg: var(--text); --_fg: var(--bg); --_bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: var(--pill);
  font: 500 .92rem/1 var(--font); letter-spacing: -.01em; text-decoration: none;
  background: var(--_bg); color: var(--_fg); border: 1px solid var(--_bd);
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform .12s var(--ease), background .2s, opacity .2s, border-color .2s;
}
.btn:hover { text-decoration: none; opacity: .86; }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .35; cursor: not-allowed; transform: none; }
.btn.secondary { --_bg: var(--surface); --_fg: var(--text); --_bd: var(--border-strong); }
.btn.secondary:hover { --_bg: var(--surface-2); opacity: 1; }
.btn.subtle { --_bg: var(--surface-2); --_fg: var(--text); }
.btn.subtle:hover { --_bg: var(--surface-3); opacity: 1; }
.btn.ghost { --_bg: transparent; --_fg: var(--text-2); }
.btn.ghost:hover { --_bg: var(--surface-2); --_fg: var(--text); opacity: 1; }
.btn.danger { --_bg: var(--error); --_fg: #fff; }
.btn.sm { height: 36px; padding: 0 14px; font-size: .86rem; gap: 6px; }
.btn.lg { height: 52px; padding: 0 28px; font-size: 1rem; }
.btn.block { width: 100%; }
.btn.icon-only { width: 42px; padding: 0; }
.btn.icon-only.sm { width: 36px; }

/* ----------------------------------------------------------------- forms */
label { display: block; font-weight: 500; font-size: .86rem; margin-bottom: 7px; color: var(--text-2); }
.field { margin-bottom: 18px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url],
input[type=search], input[type=datetime-local], input[type=date], textarea, select {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
  padding: 10px 14px; min-height: 46px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, textarea:focus, select:focus { border-color: var(--text); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
textarea.mono { min-height: 280px; font-family: var(--mono); font-size: .85rem; }
select {
  appearance: none; padding-right: 38px; cursor: pointer;
  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='%2371717a' 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 12px center;
}
input[type=color] { width: 100%; height: 46px; padding: 4px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--text); height: 28px; }
input[type=checkbox], input[type=radio] { accent-color: var(--text); width: 17px; height: 17px; margin: 0; }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 400; margin: 0; cursor: pointer; color: var(--text); }
.error-text { color: var(--error); font-size: .82rem; margin-top: 6px; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > input { padding-left: 44px; }
.options { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin: 20px 0; }

/* -------------------------------------------------------- cards & panels */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head a.more { font-size: .86rem; color: var(--muted); }
.panel { background: var(--surface-2); border-radius: var(--r); padding: 16px; }

.stat { display: flex; gap: 14px; align-items: center; }
.stat .value { font-size: 1.75rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .84rem; }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex: none; }
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); margin-top: 14px; }
.stat-row .card { padding: 14px 16px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; font-size: .92rem; border: 1px solid var(--border); background: var(--surface); }
.alert.success { color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, var(--border)); }
.alert.error { color: var(--error); border-color: color-mix(in srgb, var(--error) 30%, var(--border)); }
.alert.info { color: var(--text); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--pill); font-size: .74rem; font-weight: 500; background: var(--surface-2); color: var(--text-2); border: 0; white-space: nowrap; }
.badge.info, .badge.update, .badge.brand { background: var(--text); color: var(--bg); }
.badge.warning { color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); }
.badge.success { color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface)); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .empty-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.empty h3 { color: var(--text); margin-bottom: 4px; }

.table-wrap { overflow-x: auto; margin-inline: -24px; padding-inline: 24px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .8rem; }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--surface-3); color: var(--text); font-weight: 600; font-size: .8rem; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.2rem; }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; }
.pagination a, .pagination span { padding: 7px 16px; border-radius: var(--pill); border: 1px solid var(--border); font-size: .85rem; background: var(--surface); text-decoration: none; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.site-header .container { height: 100%; display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-weight: 600; font-size: 1.02rem; color: var(--text); letter-spacing: -.02em; margin-right: 14px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.logo { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--text); color: var(--bg); }
.main-nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: var(--pill);
  color: var(--muted); font-weight: 500; font-size: .9rem; background: none; border: 0; cursor: pointer; font-family: inherit; text-decoration: none;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--surface-2); }
.search-trigger {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 16px; min-width: 230px;
  border-radius: var(--pill); border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font: inherit; font-size: .88rem; cursor: pointer; transition: border-color .15s;
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger .spacer { min-width: 12px; }
kbd { font-family: var(--font); font-size: .72rem; font-weight: 500; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.mobile-only { display: none !important; }
@media (max-width: 980px) {
  .main-nav, .search-trigger, .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex !important; }
}

/* Mega menu */
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; top: calc(100% + 12px); left: 0; z-index: 50;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 8px; min-width: 220px; opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s;
}
.dropdown.open > .dropdown-panel { opacity: 1; visibility: visible; transform: none; }
.dropdown-panel.right { left: auto; right: 0; }
.mega { width: min(940px, calc(100vw - 48px)); padding: 24px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px 20px; left: -130px; }
.mega h4 { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 500; letter-spacing: 0; color: var(--muted); margin: 0 0 8px; padding-inline: 10px; }
.mega a, .menu-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); font-size: .88rem; text-decoration: none;
}
.mega a svg, .menu-item svg { color: var(--muted); }
.mega a:hover, .menu-item:hover { background: var(--surface-2); text-decoration: none; }
.mega .mega-foot { grid-column: 1 / -1; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.menu-item { width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; }
.menu-item.danger, .menu-item.danger svg { color: var(--error); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-head { padding: 10px 10px 8px; }
.menu-head b { display: block; font-size: .92rem; font-weight: 600; }

/* Drawer (mobile nav) */
.drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.drawer.open { visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .4); opacity: 0; transition: opacity .2s; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 88vw); background: var(--bg-elev);
  border-left: 1px solid var(--border); padding: 16px; overflow-y: auto; transform: translateX(100%); transition: transform .25s var(--ease);
  display: flex; flex-direction: column; gap: 2px;
}
.drawer.open .drawer-panel { transform: none; }
.drawer-panel .nav-link { width: 100%; height: 44px; justify-content: flex-start; color: var(--text); border-radius: 12px; }
.drawer-panel .nav-link svg { color: var(--muted) !important; }
.drawer-group { font-size: .8rem; color: var(--muted); margin: 16px 14px 4px; }

/* Command palette */
.cmdk { position: fixed; inset: 0; z-index: 70; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.cmdk.open { display: flex; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .35); backdrop-filter: blur(4px); }
.cmdk-box { position: relative; width: min(620px, 100%); background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s var(--ease); }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.cmdk-input input { border: 0; box-shadow: none !important; background: transparent; height: 60px; padding: 0; font-size: 1.02rem; }
.cmdk-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 8px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: var(--text); cursor: pointer; text-decoration: none; }
.cmdk-item:hover { text-decoration: none; }
.cmdk-item[aria-selected="true"] { background: var(--surface-2); }
.cmdk-item .t { font-weight: 500; font-size: .92rem; }
.cmdk-item .d { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex: none; }
.cmdk-item[aria-selected="true"] .ic { background: var(--surface); }
.cmdk-empty { padding: 28px; text-align: center; color: var(--muted); }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: .76rem; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; padding-block: 56px 32px; }
.footer-grid h4 { font-size: .86rem; font-weight: 500; color: var(--text); margin-bottom: 14px; letter-spacing: 0; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-grid a { color: var(--muted); font-size: .88rem; text-decoration: none; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding-block: 20px 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: .84rem; }
.footer-bottom a { color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--text); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ------------------------------------------------------------------ hero */
.hero { padding: 104px 0 72px; text-align: center; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.75rem); letter-spacing: -.045em; font-weight: 600; max-width: 900px; margin: 0 auto .3em; line-height: 1.02; }
.hero h1 .grad { color: var(--muted); }
.hero .lead { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--muted); max-width: 580px; margin: 0 auto 36px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--border); font-size: .84rem; color: var(--text-2); margin-bottom: 28px; }
.pill .tag { background: var(--text); color: var(--bg); border-radius: var(--pill); padding: 2px 10px; font-size: .74rem; font-weight: 500; }
.hero-search { position: relative; max-width: 560px; margin: 0 auto; }
.hero-search input { height: 60px; border-radius: var(--pill); padding-left: 54px; padding-right: 130px; font-size: 1rem; border-color: var(--border); box-shadow: var(--shadow); }
.hero-search > svg { position: absolute; left: 22px; top: 20px; color: var(--muted); }
.hero-search .btn { position: absolute; right: 8px; top: 8px; height: 44px; }
.hero-meta { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin-top: 26px; color: var(--muted); font-size: .88rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { color: var(--text); }

/* Filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 40px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 500 .86rem var(--font); cursor: pointer; transition: all .15s; text-decoration: none; }
.chip:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip svg { color: currentColor; }

/* -------------------------------------------------------------- tool grid */
.tool-section { margin-bottom: 56px; }
.tool-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.tool-section-head h2 { margin: 0; font-size: 1.3rem; }
.tool-section-head .tool-icon { display: none; }
.tool-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s;
}
.tool-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.tool-card .go { position: absolute; top: 22px; right: 22px; color: var(--text); opacity: 0; transform: translate(-4px, 4px) rotate(-45deg); transition: all .25s var(--ease); }
.tool-card:hover .go { opacity: 1; transform: rotate(-45deg); }
.tool-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex: none; margin-bottom: 8px; }
.tool-icon.lg { width: 60px; height: 60px; border-radius: 18px; margin-bottom: 0; }
.tool-name { font-weight: 600; font-size: 1rem; letter-spacing: -.015em; }
.tool-desc { color: var(--muted); font-size: .86rem; line-height: 1.5; }

/* Feature tiles */
.feature { display: flex; flex-direction: column; gap: 6px; padding: 28px; }
.feature .stat-icon { margin-bottom: 10px; }
.feature p { color: var(--muted); margin: 0; }
.steps-visual { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.step-card { position: relative; padding: 28px; padding-top: 72px; }
.step-card::before { counter-increment: step; content: "0" counter(step); position: absolute; top: 26px; left: 28px; font-size: .95rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.cta-band { border-radius: var(--r-xl); padding: 64px 32px; text-align: center; background: var(--text); color: var(--bg); }
.cta-band h2 { color: var(--bg); font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.cta-band p { color: color-mix(in srgb, var(--bg) 70%, transparent); max-width: 520px; margin-inline: auto; }
.cta-band .btn.secondary { --_bg: var(--bg); --_fg: var(--text); --_bd: transparent; }
.cta-band .btn.ghost { --_fg: var(--bg); --_bd: color-mix(in srgb, var(--bg) 30%, transparent); }
.cta-band .btn.ghost:hover { --_bg: color-mix(in srgb, var(--bg) 10%, transparent); }

/* -------------------------------------------------------------- tool page */
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: .84rem; margin-bottom: 22px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs svg { opacity: .5; }
.tool-hero { padding: 48px 0 28px; }
.tool-head { display: flex; gap: 20px; align-items: center; }
.tool-head h1 { margin-bottom: 8px; }
.tool-head p { margin: 0; color: var(--muted); font-size: 1.02rem; }
.trust { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.trust span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-2); font-size: .82rem; }
.trust a { color: var(--text); }
.tool-app { padding: 28px; border-radius: var(--r-xl); }
@media (max-width: 640px) { .tool-app { padding: 18px; } .tool-head { align-items: flex-start; } }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 260px; padding: 36px 20px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--bg);
  transition: background .2s, border-color .2s;
}
.dropzone:hover, .dropzone:focus { border-color: var(--text); outline: none; }
.dropzone.over { border-color: var(--text); border-style: solid; background: var(--surface-2); }
.dropzone .dz-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text); margin-bottom: 10px; }
.dropzone .big { font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.dropzone .pick { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; height: 46px; padding: 0 24px; border-radius: var(--pill); background: var(--text); color: var(--bg); font-weight: 500; }

.file-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.file-item[draggable="true"] { cursor: grab; }
.file-item .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

.result { margin-top: 18px; padding: 28px; border-radius: var(--r-xl); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); animation: pop .25s var(--ease); }
.result h2 { display: flex; align-items: center; gap: 12px; font-size: 1.35rem; }
.result h2::before { content: ""; width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center no-repeat; }
[data-theme="dark"] .result h2::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.result-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.result-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); }
.result-row .grow { flex: 1; min-width: 160px; }
.result-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); display: grid; place-items: center; background: var(--surface); color: var(--text); flex: none; }
.login-prompt { background: var(--surface-2); color: var(--text); border: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }

.thumbs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); margin: 16px 0; }
.thumb { position: relative; border: 1px solid var(--border); border-radius: var(--r); padding: 8px; background: var(--surface); text-align: center; cursor: grab; transition: box-shadow .2s, transform .2s; }
.thumb:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.thumb canvas, .thumb img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--border); }
.thumb .num { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.thumb .x { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--bg); background: var(--text); color: var(--bg); cursor: pointer; display: grid; place-items: center; padding: 0; opacity: 0; transition: opacity .15s; }
.thumb:hover .x, .thumb:focus-within .x { opacity: 1; }
@media (hover: none) { .thumb .x { opacity: 1; } }
.thumb.dragging { opacity: .4; }

.output-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.big-display { font-size: clamp(2.8rem, 9vw, 4.8rem); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -.04em; margin: 16px 0; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 380px; margin: 0 auto; }
.calc-grid .btn { height: 60px; font-size: 1.15rem; border-radius: 18px; }

.prose h2 { margin-top: 0; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; color: var(--text-2); }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text); font-weight: 600; font-size: .8rem; }
.faq { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 500; padding: 16px 0; list-style: none; display: flex; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; font-weight: 300; color: var(--muted); line-height: 1; transition: transform .2s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0; padding: 0 0 16px; color: var(--muted); }
.card .faq summary, .card .faq form { padding-inline: 0; }

/* ---------------------------------------------------------------- toasts */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: var(--pill); font-weight: 500; font-size: .9rem;
  box-shadow: var(--shadow-lg); transition: opacity .2s, transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--error); color: #fff; }
.toast.success { background: var(--text); color: var(--bg); }

/* ----------------------------------------------------------- app (signed in) */
.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 40px; padding-block: 32px 40px; align-items: start; }
.app-shell > * { min-width: 0; }
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 2px; }
.sidebar .nav-link { width: 100%; height: 42px; justify-content: flex-start; gap: 12px; border-radius: 12px; }
.sidebar .nav-link.active { background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.sidebar-card { margin-top: 20px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.sidebar-card p { color: var(--muted); font-size: .84rem; margin: 4px 0 14px; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; gap: 16px; padding-top: 16px; }
  .sidebar { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 6px; scrollbar-width: none; }
  .sidebar .nav-link { width: auto; flex: none; height: 38px; border-radius: var(--pill); }
  .sidebar-card { display: none; }
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 6px; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.page-head p { margin: 0; color: var(--muted); }
.page { padding-top: 28px; padding-bottom: 56px; }

.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }

/* Notes */
.note { border-radius: var(--r-lg); padding: 18px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; min-height: 160px; transition: box-shadow .2s, transform .2s var(--ease); color: var(--text); text-decoration: none; }
.note:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.note h3 { font-size: 1rem; margin: 0; }
.note .body { white-space: pre-wrap; word-break: break-word; font-size: .92rem; flex: 1; color: var(--text-2); }
.note .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }
.note details summary { cursor: pointer; color: var(--text-2); font-size: .84rem; font-weight: 500; list-style: none; }
.note details summary::-webkit-details-marker { display: none; }
.swatches { display: flex; gap: 8px; }
.swatches label { margin: 0; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches span { display: block; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-strong); cursor: pointer; transition: transform .15s; }
.swatches span:hover { transform: scale(1.1); }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.swatches input:focus-visible + span { box-shadow: var(--ring); }

/* Tasks */
.task { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task .title { font-weight: 500; }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.task .when { color: var(--muted); font-size: .82rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.circle-btn { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--bg); padding: 0; transition: all .15s; flex: none; }
.circle-btn:hover { border-color: var(--text); }
.task.done .circle-btn { background: var(--text); border-color: var(--text); }

/* Auth */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - var(--header-h)); gap: 0; }
.auth-aside { position: relative; margin: 16px; border-radius: var(--r-xl); padding: 48px; display: flex; flex-direction: column; justify-content: flex-end; background: var(--surface-2); color: var(--text); overflow: hidden; }
.auth-aside h2 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); max-width: 440px; }
.auth-aside .eyebrow { color: var(--muted) !important; opacity: 1 !important; }
.auth-aside ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.auth-aside li { display: flex; gap: 10px; align-items: center; color: var(--text-2); }
.auth-aside .floating { position: absolute; top: 48px; left: 48px; right: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 360px; }
.auth-aside .floating div { aspect-ratio: 1; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text); box-shadow: var(--shadow-sm); }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 2rem; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* Theme toggle icon swap */
[data-theme="light"] .theme-light, [data-theme="dark"] .theme-dark { display: none; }

/* ----------------------------------------------------------- motion prefs */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =====================================================================
   v3.1 – floating pill navbar, single orange accent, split hero
   ===================================================================== */
:root { --accent: #ff5a1f; --accent-ink: #e2480f; --on-accent: #ffffff; --accent-soft: #fff1ea; --nav-bg: #0a0a0a; --header-h: 88px; }
:root[data-theme="dark"] { --accent: #ff6a33; --accent-ink: #ff8a5c; --accent-soft: #2a1710; --nav-bg: #161616; }

.btn.accent { --_bg: var(--accent); --_fg: var(--on-accent); box-shadow: 0 8px 20px -10px var(--accent); }
.btn.accent:hover { opacity: 1; filter: brightness(1.05); }
.accent-text { color: var(--accent); }

/* Floating dark navbar */
.site-header { height: auto; padding-top: 14px; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
.site-header.scrolled { border: 0; }
.site-header .container { height: auto; display: block; }
.nav-shell {
  pointer-events: auto; display: flex; align-items: center; gap: 6px; height: 60px; padding: 0 8px 0 18px;
  background: var(--nav-bg); color: #fff; border-radius: var(--pill);
  border: 1px solid rgb(255 255 255 / .06); box-shadow: 0 14px 34px -14px rgb(0 0 0 / .45);
}
.nav-shell .brand { color: #fff; }
.nav-shell .logo { background: #fff; color: #0a0a0a; width: 30px; height: 30px; }
.nav-shell .nav-link { color: rgb(255 255 255 / .62); }
.nav-shell .nav-link:hover { color: #fff; }
.nav-shell .nav-link.active { background: #fff; color: #0a0a0a; }
.nav-shell .main-nav > .nav-link.active::before,
.nav-shell .dropdown > .nav-link.active::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.nav-shell .search-trigger { background: rgb(255 255 255 / .07); border-color: transparent; color: rgb(255 255 255 / .55); min-width: 210px; }
.nav-shell .search-trigger:hover { background: rgb(255 255 255 / .11); }
.nav-shell kbd { background: rgb(255 255 255 / .08); border-color: transparent; color: rgb(255 255 255 / .6); }
.nav-shell .btn.ghost { --_fg: rgb(255 255 255 / .8); }
.nav-shell .btn.ghost:hover { --_bg: rgb(255 255 255 / .1); --_fg: #fff; }
.nav-shell .avatar { background: rgb(255 255 255 / .14); color: #fff; }
.nav-shell .dropdown-panel { color: var(--text); }
@media (max-width: 640px) { .nav-shell { height: 56px; padding-left: 14px; } .site-header { padding-top: 10px; } }

/* Split hero */
.hero.split { text-align: left; padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero.split h1 { margin: 0 0 22px; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.04; letter-spacing: -.045em; font-weight: 600; max-width: none; }
.hero.split h1 .light { color: var(--muted); font-weight: 300; }
.hero.split h1 .squiggle { display: inline-block; width: .42em; height: .42em; vertical-align: top; margin-left: -.05em; margin-top: -.08em; color: var(--accent); }
.hero.split .lead { margin: 0 0 32px; max-width: 470px; font-size: 1.06rem; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-points { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 44px; }
.hero-point { display: flex; gap: 12px; align-items: center; }
.hero-point .dot-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); flex: none; }
.hero-point b { display: block; font-weight: 600; font-size: .92rem; }
.hero-point span { color: var(--muted); font-size: .8rem; }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero.split { text-align: center; padding-top: 40px; }
  .hero.split .lead { margin-inline: auto; }
  .hero-ctas, .hero-points { justify-content: center; }
}

/* Product visual: document card + phone mockup */
.hero-visual { position: relative; height: 560px; }
.doc-card { position: absolute; right: 0; top: 30px; width: 76%; height: 470px; border-radius: 32px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.doc-card::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--border-strong) 1px, transparent 1px); background-size: 18px 18px; opacity: .7; }
.doc-page { position: absolute; width: 190px; height: 250px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 18px; }
.doc-page i { display: block; height: 8px; border-radius: 6px; background: var(--surface-3); margin-bottom: 10px; }
.doc-page i.h { width: 60%; height: 12px; background: var(--text); opacity: .85; margin-bottom: 16px; }
.doc-page i.s { width: 80%; }
.doc-page i.xs { width: 45%; }
.doc-page .img { height: 70px; border-radius: 10px; background: var(--surface-2); margin: 14px 0; }
.doc-page.p1 { right: 34px; top: 64px; transform: rotate(6deg); }
.doc-page.p2 { right: 120px; top: 150px; transform: rotate(-5deg); }
.doc-badge { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .82rem; z-index: 3; }
.doc-badge .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.doc-badge b { display: block; font-size: .84rem; }
.doc-badge span { color: var(--muted); font-size: .74rem; }
.doc-badge.b1 { right: 18px; bottom: 76px; }
.doc-badge.b2 { right: 6%; top: 0; }

.phone { position: absolute; left: 6%; top: 0; width: 272px; height: 556px; border-radius: 46px; padding: 11px; background: #0a0a0a; box-shadow: 0 40px 80px -30px rgb(0 0 0 / .45); z-index: 2; }
.phone-screen { position: relative; height: 100%; border-radius: 36px; background: #fff; color: #0a0a0a; overflow: hidden; padding: 14px 14px 0; font-size: 11px; line-height: 1.35; }
:root[data-theme="dark"] .phone-screen { background: #121212; color: #fafafa; }
.phone-notch { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 84px; height: 24px; border-radius: 20px; background: #0a0a0a; }
.phone-status { display: flex; justify-content: space-between; font-weight: 600; font-size: 10px; padding: 2px 8px 14px; }
.ps-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ps-top .who { display: flex; gap: 8px; align-items: center; }
.ps-top .av { width: 26px; height: 26px; border-radius: 50%; background: #f4f4f5; color: #0a0a0a; display: grid; place-items: center; }
.ps-top small { display: block; color: #8b8b93; font-size: 9px; }
.ps-title { font-size: 15px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; margin-bottom: 10px; }
.ps-title .light { color: #8b8b93; font-weight: 400; }
.ps-search { display: flex; align-items: center; gap: 8px; height: 34px; border-radius: 999px; background: #f4f4f5; padding: 0 5px 0 12px; color: #8b8b93; margin-bottom: 12px; }
.ps-search .go { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; background: #0a0a0a; color: #fff; display: grid; place-items: center; }
.ps-chips { display: flex; gap: 6px; margin-bottom: 12px; }
.ps-chips span { padding: 6px 10px; border-radius: 999px; background: #f4f4f5; font-weight: 500; font-size: 10px; }
.ps-chips span.on { background: var(--accent); color: #fff; }
.ps-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ps-card { border-radius: 16px; background: #f4f4f5; padding: 10px; min-height: 96px; display: flex; flex-direction: column; gap: 3px; }
.ps-card .i { width: 26px; height: 26px; border-radius: 9px; background: #fff; display: grid; place-items: center; margin-bottom: 6px; }
.ps-card b { font-size: 11px; font-weight: 600; }
.ps-card small { color: #8b8b93; font-size: 9px; }
.ps-card.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px; min-height: 0; }
.ps-card.wide .grow { display: flex; flex-direction: column; gap: 5px; }
.ps-card.wide .bar { height: 5px; border-radius: 4px; background: #e4e4e7; overflow: hidden; }
.ps-card.wide .bar i { display: block; height: 100%; width: 68%; background: var(--accent); border-radius: 4px; }
:root[data-theme="dark"] .ps-search, :root[data-theme="dark"] .ps-chips span:not(.on), :root[data-theme="dark"] .ps-card { background: #1d1d1d; }
:root[data-theme="dark"] .ps-card .i { background: #2a2a2a; }
:root[data-theme="dark"] .ps-card.wide .bar { background: #2a2a2a; }
.ps-nav { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: #0a0a0a; }
:root[data-theme="dark"] .ps-nav { background: #262626; }
.ps-nav span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: rgb(255 255 255 / .6); }
.ps-nav span.on { background: var(--accent); color: #fff; }
@media (max-width: 960px) { .hero-visual { height: 560px; max-width: 520px; margin: 24px auto 0; width: 100%; } }
@media (max-width: 520px) {
  .hero-visual { height: 480px; }
  .phone { transform: scale(.84); transform-origin: top left; left: 0; }
  .doc-card { width: 66%; height: 400px; }
  .doc-page { transform: scale(.8) !important; }
  .doc-badge.b2 { display: none; }
}

/* =====================================================================
   v3.2 – same language on every page: split headings, black icon
   circles, orange only for the main action, dark rounded panels
   ===================================================================== */

/* Two-tone headings: <h1>Merge PDF <span class="light">online, free</span></h1> */
h1 .light, h2 .light, .light-text { color: var(--muted); font-weight: 300; }
h1 { letter-spacing: -.04em; }

/* Black icon circles (features, tool hero, stats, empty states) */
.icon-dot, .feature .stat-icon, .tool-hero .tool-icon.lg, .stat .stat-icon, .empty .empty-icon, .page-head .stat-icon {
  background: var(--text); color: var(--bg); border-radius: 50%;
}
.tool-hero .tool-icon.lg { width: 64px; height: 64px; }

/* The one main action of a screen is orange */
.tool-app .btn:not(.secondary):not(.ghost):not(.subtle):not(.danger):not(.calc-key),
.result .btn:not(.secondary):not(.ghost):not(.subtle),
.page-head .btn:not(.secondary):not(.ghost):not(.subtle):not(.danger),
.auth-card form .btn.lg,
.dropzone .pick {
  --_bg: var(--accent); --_fg: var(--on-accent); background: var(--accent); color: var(--on-accent);
  box-shadow: 0 8px 20px -10px var(--accent);
}
.calc-grid .btn { box-shadow: none !important; }
.calc-grid .btn[data-k="="] { --_bg: var(--accent); --_fg: #fff; }

/* Tool / listing page hero: left aligned, bigger */
.tool-hero { padding: 40px 0 28px; }
.tool-head h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1.05; }
.trust { gap: 22px; margin-top: 26px; }
.trust span { background: none; padding: 0; color: var(--text-2); font-size: .86rem; gap: 10px; }
.trust span > svg { width: 26px; height: 26px; padding: 6px; border-radius: 50%; background: var(--text); color: var(--bg); }
.tool-app { border-radius: 32px; padding: 32px; box-shadow: var(--shadow); }
.dropzone { border-radius: 24px; background: var(--surface-2); border-color: var(--border-strong); }
.dropzone .dz-icon { border-radius: 50%; background: var(--text); color: var(--bg); border: 0; }
.listing-hero { padding: 40px 0 8px; }
.listing-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.04; margin-bottom: 12px; }
.listing-hero p { color: var(--muted); max-width: 520px; margin: 0 0 28px; font-size: 1.04rem; }
.listing-hero .chips { justify-content: flex-start; }

/* Tool cards: a touch softer */
.tool-card { border-radius: 24px; padding: 24px; }
.tool-card:hover .tool-icon { background: var(--text); color: var(--bg); }
.tool-icon { transition: background .2s, color .2s; border-radius: 50%; }

/* Section heads & CTA */
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.08; }
.cta-band { border-radius: 36px; padding: 72px 32px; background: var(--nav-bg); color: #fff; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgb(255 255 255 / .62); }
.cta-band .btn.secondary { --_bg: var(--accent); --_fg: #fff; box-shadow: 0 8px 20px -10px var(--accent); }
.cta-band .btn.ghost { --_fg: #fff; --_bd: rgb(255 255 255 / .2); }

/* Footer as a dark rounded panel (matches the navbar) */
.site-footer { border: 0; margin-top: 96px; padding: 0 0 16px; }
.site-footer > .container { background: var(--nav-bg); color: #fff; border-radius: 36px; padding: 8px 40px; max-width: calc(1180px - 0px); }
.site-footer .brand { color: #fff; }
.site-footer .logo { background: #fff; color: #0a0a0a; }
.site-footer .muted { color: rgb(255 255 255 / .55); }
.footer-grid h4 { color: #fff; }
.footer-grid a, .footer-bottom, .footer-bottom a { color: rgb(255 255 255 / .55); }
.footer-grid a:hover, .footer-bottom a:hover { color: #fff; }
.footer-bottom { border-top-color: rgb(255 255 255 / .08); }
@media (max-width: 640px) { .site-footer > .container { border-radius: 28px; padding: 4px 22px; margin-inline: 12px; width: auto; } }

/* Auth: dark panel like the navbar */
.auth-aside { background: var(--nav-bg); color: #fff; border-radius: 36px; }
.auth-aside h2 { color: #fff; }
.auth-aside .eyebrow { color: rgb(255 255 255 / .55) !important; }
.auth-aside li { color: rgb(255 255 255 / .78); }
.auth-aside li svg { width: 26px; height: 26px; padding: 6px; border-radius: 50%; background: rgb(255 255 255 / .1); color: #fff; }
.auth-aside .floating div { background: rgb(255 255 255 / .06); border-color: rgb(255 255 255 / .08); color: #fff; box-shadow: none; border-radius: 50%; }
.auth-aside .floating div:nth-child(2) { background: var(--accent); border-color: transparent; }
.auth-card h1 { font-size: clamp(2rem, 3.6vw, 2.6rem); line-height: 1.05; }

/* Workspace */
.page-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.05; }
.sidebar .nav-link.active { background: var(--text); color: var(--bg); border-color: transparent; box-shadow: none; }
.sidebar .nav-link.active svg { color: var(--bg) !important; }
.sidebar-card { background: var(--nav-bg); color: #fff; border: 0; border-radius: 24px; }
.sidebar-card p { color: rgb(255 255 255 / .6); }
.sidebar-card .btn { --_bg: var(--accent); --_fg: #fff; }
.card { border-radius: 24px; }
.stat .value { font-size: 1.9rem; }
.circle-btn:hover { border-color: var(--accent); }
.task.done .circle-btn { background: var(--accent); border-color: var(--accent); }
.badge.update, .badge.brand, .badge.info { background: var(--text); color: var(--bg); }

/* =====================================================================
   v3.3 – YouTube / TikTok downloaders
   ===================================================================== */
.mega { grid-template-columns: repeat(6, minmax(0, 1fr)); width: min(1080px, calc(100vw - 48px)); left: -160px; }

.vd-switch { display: flex; gap: 4px; padding: 5px; border-radius: var(--pill); background: var(--surface-2); margin-bottom: 18px; }
.vd-switch a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: var(--pill); color: var(--muted); font-weight: 500; text-decoration: none; transition: background .2s, color .2s; }
.vd-switch a:hover { color: var(--text); }
.vd-switch a.on { background: var(--text); color: var(--bg); }
.vd-form { display: flex; gap: 10px; flex-wrap: wrap; }
.vd-input { position: relative; flex: 1; min-width: min(100%, 280px); display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 8px 0 18px; border: 1px solid var(--border-strong); border-radius: var(--pill); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.vd-input:focus-within { border-color: var(--text); box-shadow: var(--ring); }
.vd-input > svg { color: var(--muted); }
.vd-input input { border: 0; box-shadow: none !important; background: transparent; padding: 0; min-height: 0; height: 100%; flex: 1; font-size: 1rem; }
.vd-form .btn.lg { height: 56px; }
@media (max-width: 560px) { .vd-form .btn.lg { width: 100%; } }
.vd-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 0; }
#vd-error { margin: 16px 0 0; }
.vd-card { display: flex; gap: 16px; align-items: center; margin-top: 20px; padding: 14px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg); }
.vd-thumb { width: 132px; aspect-ratio: 16 / 9; border-radius: 14px; object-fit: cover; background: var(--surface-2); flex: none; }
[data-video-tool="tiktok"] .vd-thumb { width: 84px; aspect-ratio: 9 / 16; }
.vd-title { font-weight: 600; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vd-options { display: grid; gap: 8px; }
.vd-option { display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 12px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.vd-option .vd-q { min-width: 62px; height: 40px; padding: 0 10px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-weight: 600; font-size: .86rem; }
.vd-option:first-child .vd-q { background: var(--text); color: var(--bg); }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.skeleton.line { height: 12px; border-radius: 8px; margin: 8px 0; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.vd-app { display: flex; gap: 18px; align-items: flex-start; padding: 24px; border-radius: 24px; background: var(--surface-2); }
.vd-app-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); flex: none; }
.vd-app h2 { font-size: 1.4rem; margin-bottom: 8px; }
.vd-app p { max-width: 560px; }
.vd-app .btn.lg:not(.secondary) { --_bg: var(--accent); --_fg: #fff; }
.vd-app-steps { margin-top: 22px; }
@media (max-width: 560px) { .vd-app { flex-direction: column; } .vd-app .btn { width: 100%; } }

/* Real platform logos: YouTube keeps its red play button; TikTok stays ink. */
.logo-yt, .tool-card .icon-brand-youtube { color: #ff0000; }
.vd-switch a.on .logo-yt { color: #ff0000; }

/* =====================================================================
   v3.4 – platform logos, Account Required, new tools
   ===================================================================== */
.mega { grid-template-columns: repeat(7, minmax(0, 1fr)); width: min(1160px, calc(100vw - 48px)); left: -180px; gap: 8px 14px; }
.icon-brand-youtube, .logo-yt { color: #ff0000; }
.tool-card:hover .tool-icon .icon-brand-youtube { color: #ff0000; }

/* Account Required */
.card-badge { position: absolute; top: 22px; right: 48px; background: var(--surface-2); color: var(--text-2); }
.tool-card .card-badge svg { width: 12px; height: 12px; }
.trust .account-req { color: var(--text); font-weight: 600; }
.trust .account-req > svg { background: var(--accent); }
.account-gate { text-align: center; padding: 36px 16px; }
.account-gate-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: var(--text); color: var(--bg); }
.account-gate .badge { margin-bottom: 14px; background: var(--accent); color: #fff; }
.account-gate h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.account-gate p { max-width: 460px; margin: 0 auto 22px; }
.quick-add .qa-title { border: 0; box-shadow: none !important; padding-inline: 0; font-size: 1.1rem; font-weight: 600; min-height: 36px; }
.quick-add .qa-body { border: 0; box-shadow: none !important; padding-inline: 0; min-height: 80px; }

/* Focus timer */
.ft-modes { max-width: 460px; margin: 0 auto 20px; }
.ft-ring { position: relative; width: min(300px, 80vw); aspect-ratio: 1; margin: 0 auto 22px; }
.ft-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ft-track { fill: none; stroke: var(--surface-2); stroke-width: 6; }
.ft-progress { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.ft-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }

/* QR scanner */
.qrs-view { position: relative; aspect-ratio: 4 / 3; max-width: 520px; margin: 0 auto; border-radius: 24px; overflow: hidden; background: var(--surface-2); border: 1.5px dashed var(--border-strong); display: grid; place-items: center; }
.qrs-view.live { border-style: solid; border-color: var(--text); background: #000; }
.qrs-view video { width: 100%; height: 100%; object-fit: cover; }
.qrs-frame { position: absolute; inset: 18%; border-radius: 20px; box-shadow: 0 0 0 2000px rgb(0 0 0 / .35); border: 3px solid #fff; opacity: 0; pointer-events: none; transition: opacity .2s; }
.qrs-view.live .qrs-frame { opacity: 1; }
.qrs-idle { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 20px; }
.qrs-idle .dz-icon { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); margin-bottom: 8px; }
.qrs-idle .big { font-weight: 600; font-size: 1.15rem; }

/* Crop PDF */
.crop-preview { position: relative; display: inline-block; margin: 0 auto; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); max-width: 100%; }
.crop-preview canvas { display: block; max-width: 100%; height: auto; }
.crop-shade { position: absolute; left: 0; top: 0; border: 0 solid rgb(10 10 10 / .55); box-sizing: border-box; pointer-events: none; outline: 2px solid var(--accent); outline-offset: -2px; }

/* "Also in the app" strip */
.app-only { margin-top: 8px; padding: 28px; border-radius: 28px; background: var(--surface-2); }
.app-only h2 { margin-bottom: 6px; }
.app-only .chips { justify-content: flex-start; margin: 18px 0 0; }
.app-only .chip { cursor: default; }

/* ---------- v3.5 embed mode (pages opened inside the mobile app) ---------- */
body.embed main { padding-top: 12px; }
body.embed .skip-link { display: none; }
body.embed .tool-related, body.embed .tool-faq-cta, body.embed .crumbs { display: none; }

/* ---------- v3.6 admin control centre ---------- */
.badge.danger { color: var(--error); background: color-mix(in srgb, var(--error) 10%, var(--surface)); }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); animation: live-pulse 2s infinite; flex: none; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.live-card { margin-bottom: 16px; }
.live-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.live-num { padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); }
.live-num b { display: block; font-size: 2rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.live-num span { color: var(--muted); font-size: .84rem; display: inline-flex; gap: 5px; align-items: center; }
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.stat-grid .card { padding: 16px; }
table.compact th, table.compact td { padding: 9px 8px; }
table.compact td:nth-child(3) { white-space: normal; min-width: 220px; }
.tool-switches td:nth-child(3), .tool-switches td:nth-child(4) { white-space: nowrap; min-width: 0; }
.tool-icon.sm { width: 32px; height: 32px; margin: 0; }
tr.lvl-warning td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
tr.lvl-danger td:first-child { box-shadow: inset 3px 0 0 var(--error); }
tr.row-blocked { opacity: .7; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filter-bar select { width: auto; }
.filter-bar .spacer { flex: 1; }
/* bar chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 8px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.bar-stack { width: 100%; max-width: 28px; min-height: 3px; display: flex; flex-direction: column; border-radius: 6px 6px 3px 3px; overflow: hidden; background: var(--surface-2); }
.bar-stack .seg { display: block; min-height: 0; }
.seg.web, .legend i.web { background: var(--text); }
.seg.app, .legend i.app { background: var(--accent, #ff5a1f); }
.bar small { color: var(--muted); font-size: .7rem; }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
/* meters */
.meter { margin-bottom: 12px; }
.meter-label { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; margin-bottom: 5px; }
.meter-track { height: 8px; border-radius: var(--pill); background: var(--surface-2); overflow: hidden; }
.meter-track span { display: block; height: 100%; border-radius: inherit; background: var(--text); }
/* switches */
.switch-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.switch { position: relative; width: 44px; height: 26px; border-radius: var(--pill); border: 0; padding: 0; cursor: pointer; background: var(--border-strong, #d4d4d4); transition: background .2s; flex: none; }
.switch[aria-checked="true"] { background: var(--success); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s; }
.switch[aria-checked="true"] .switch-knob { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.switch-text { font-size: .82rem; color: var(--success); font-weight: 500; }
.switch-text.off { color: var(--muted); }
/* system */
.sys-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.sys-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.sys-item b { font-weight: 500; font-size: .9rem; word-break: break-word; }
.sys-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.sys-dot.ok { background: var(--success); }
.sys-dot.bad { background: var(--error); }
.log-entry summary { gap: 10px; }
.log-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.log-detail { margin: 0 16px 16px; padding: 12px; border-radius: 10px; background: var(--surface-2); font: .76rem/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; }
@media (max-width: 640px) {
  .live-num b { font-size: 1.5rem; }
  .log-msg { white-space: normal; }
}
.tool-switches tr[id] { scroll-margin-top: calc(var(--header-h, 88px) + 24px); }
.tool-switches tr:target td { background: var(--surface-2); }

/* ---------- v3.7 Boxland logo mark (the SVG brings its own dark tile) ---------- */
.logo, .nav-shell .logo, .site-footer .logo { background: none; color: inherit; padding: 0; overflow: hidden; }
.logo svg { display: block; width: 100%; height: 100%; }
.nav-shell .logo, .site-footer .logo { box-shadow: 0 0 0 1px rgb(255 255 255 / .14); }

/* ---------- v3.8 legal pages ---------- */
.legal { line-height: 1.7; }
.legal h2 { font-size: 1.15rem; margin: 26px 0 8px; }
.legal h2:first-of-type { margin-top: 18px; }
.legal ul, .legal ol { padding-left: 22px; margin: 6px 0 12px; }
.legal li { margin: 4px 0; }
.legal code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
