/* ==========================================================================
   OmniKitly — Design System
   Prototype stylesheet. Vanilla CSS, no build step, no framework.
   Organised as: tokens → reset → primitives → components → views → responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Brand — sophisticated indigo/violet. Change these five to re-brand. */
  --brand-50:  #F1F1FE;
  --brand-100: #E4E5FC;
  --brand-200: #CDCFF9;
  --brand-300: #ADAEF3;
  --brand-400: #8B8AEB;
  --brand-500: #6E6AE0;
  --brand-600: #5B54D6;
  --brand-700: #4B44B6;
  --brand-800: #3E3993;
  --brand-900: #343175;

  /* Neutrals */
  --gray-25:  #FCFCFD;
  --gray-50:  #F8FAFC;
  --gray-100: #F2F4F7;
  --gray-200: #E4E7EC;
  --gray-300: #D0D5DD;
  --gray-400: #98A2B3;
  --gray-500: #667085;
  --gray-600: #475467;
  --gray-700: #344054;
  --gray-800: #1D2939;
  --gray-900: #101828;

  /* Semantic accents */
  --green-50:  #ECFDF3;  --green-200:#ABEFC6; --green-500: #17B26A; --green-700: #067647;
  --amber-50:  #FFFAEB;  --amber-200:#FEDF89; --amber-500: #F79009; --amber-700: #B54708;
  --red-50:    #FEF3F2;  --red-200:  #FECDCA; --red-500:   #F04438; --red-700:   #B42318;
  --blue-50:   #EFF8FF;  --blue-200: #B2DDFF; --blue-500:  #2E90FA; --blue-700:  #175CD3;
  --teal-50:   #F0FDF9;  --teal-200: #99F6E0; --teal-500:  #15B79E; --teal-700:  #107569;

  /* Surface roles (light theme) */
  --bg:            #F8FAFC;
  --bg-subtle:     #F2F4F7;
  --surface:       #FFFFFF;
  --surface-2:     #F8FAFC;
  --surface-hover: #F8FAFC;
  --surface-inset: #F2F4F7;
  --overlay:       rgba(16, 24, 40, .45);

  --text:      #101828;
  --text-2:    #667085;
  --text-3:    #98A2B3;
  --text-brand:#4B44B6;
  --text-invert:#FFFFFF;

  --border:        #E4E7EC;
  --border-strong: #D0D5DD;
  --border-brand:  #ADAEF3;

  /* Elevation — restrained. No hero drop-shadows. */
  --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-md: 0 4px 8px -2px rgba(16,24,40,.08), 0 2px 4px -2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 16px -4px rgba(16,24,40,.06), 0 4px 6px -2px rgba(16,24,40,.03);
  --shadow-xl: 0 20px 24px -4px rgba(16,24,40,.08), 0 8px 8px -4px rgba(16,24,40,.03);
  --ring: 0 0 0 3px var(--brand-100);

  /* Radii — deliberately modest */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-2xl: 18px;
  --r-full: 999px;

  /* Spacing — 8px system with 4px half-steps */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px;  --s-6: 24px;  --s-8: 32px;  --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --t-xs:   11px;
  --t-sm:   12px;
  --t-base: 13px;
  --t-md:   14px;
  --t-lg:   16px;
  --t-xl:   18px;
  --t-2xl:  22px;
  --t-3xl:  28px;
  --t-4xl:  34px;
  --t-5xl:  42px;

  /* Layout */
  --container: 1280px;
  --container-narrow: 920px;
  --header-h: 60px;

  /* Motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur-1: 100ms;
  --dur-2: 150ms;
  --dur-3: 220ms;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:            #0B0D12;
  --bg-subtle:     #0F1218;
  --surface:       #14171F;
  --surface-2:     #191D26;
  --surface-hover: #1B202A;
  --surface-inset: #10131A;
  --overlay:       rgba(0, 0, 0, .6);

  --text:      #E9EBF0;
  --text-2:    #99A1B0;
  --text-3:    #6B7383;
  --text-brand:#ADAEF3;
  --text-invert:#0B0D12;

  --border:        #242A36;
  --border-strong: #323947;
  --border-brand:  #4B44B6;

  --brand-50:  #191A2E;
  --brand-100: #21234133;

  --green-50: #0B2418; --green-200:#124A2E; --green-700:#75E0A7;
  --amber-50: #2A1D06; --amber-200:#5A3B0B; --amber-700:#FEC84B;
  --red-50:   #2A0F0E; --red-200:  #55201D; --red-700:  #FDA29B;
  --blue-50:  #0A1B2E; --blue-200: #123A63; --blue-700: #84CAFF;
  --teal-50:  #06231F; --teal-200: #0B463D; --teal-700: #5FE9D0;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 8px -2px rgba(0,0,0,.5), 0 2px 4px -2px rgba(0,0,0,.3);
  --shadow-lg: 0 12px 16px -4px rgba(0,0,0,.5), 0 4px 6px -2px rgba(0,0,0,.3);
  --shadow-xl: 0 20px 28px -6px rgba(0,0,0,.6), 0 8px 10px -6px rgba(0,0,0,.4);
  --ring: 0 0 0 3px rgba(91,84,214,.32);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--t-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02","cv03","cv04","cv11";
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -.018em; color: var(--text); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-6) 0; }
code, kbd, pre, samp { font-family: var(--font-mono); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--brand-200); color: var(--brand-900); }
[data-theme="dark"] ::selection { background: var(--brand-700); color: #fff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100px; left: var(--s-4); z-index: 200;
  background: var(--surface); color: var(--text); padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: var(--t-base);
}
.skip-link:focus { top: var(--s-4); }

/* Scrollbars — subtle, only where we own the surface */
.scroll-y { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.scroll-y::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll-y::-webkit-scrollbar-track { background: transparent; }
.scroll-y::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); border: 3px solid var(--surface); }

/* --------------------------------------------------------------------------
   3. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-6);
}
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: 1440px; }

.section { padding-block: var(--s-16); }
.section--tight { padding-block: var(--s-12); }
.section--flush { padding-block: var(--s-10); }
.section--alt { background: var(--bg-subtle); border-block: 1px solid var(--border); }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-6); margin-bottom: var(--s-6); flex-wrap: wrap;
}
.section-head__text { max-width: 620px; }
.section-title {
  font-size: var(--t-2xl); line-height: 1.25; letter-spacing: -.022em;
  display: flex; align-items: center; gap: var(--s-3);
}
.section-sub { color: var(--text-2); font-size: var(--t-md); margin-top: var(--s-2); }

.grid { display: grid; gap: var(--s-4); }
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
.grid--auto-lg { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap, var(--s-4)); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1 1 auto; }

.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.mono { font-family: var(--font-mono); font-size: .92em; }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------------------------------
   4. TYPOGRAPHY BLOCKS
   -------------------------------------------------------------------------- */
.eyebrow {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-3);
  display: inline-flex; align-items: center; gap: var(--s-2);
}

.prose { color: var(--text-2); font-size: var(--t-md); line-height: 1.7; }
.prose > * + * { margin-top: var(--s-4); }
.prose h2 { font-size: var(--t-xl); color: var(--text); margin-top: var(--s-8); }
.prose h3 { font-size: var(--t-lg); color: var(--text); margin-top: var(--s-6); }
.prose ul, .prose ol { padding-left: var(--s-5); }
.prose li + li { margin-top: var(--s-2); }
.prose li::marker { color: var(--text-3); }
.prose a { color: var(--text-brand); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code {
  background: var(--surface-inset); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: var(--r-xs); font-size: .88em;
}

/* --------------------------------------------------------------------------
   5. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  --btn-h: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--btn-h); padding: 0 var(--s-4);
  border-radius: var(--r-md); border: 1px solid transparent;
  background: transparent; color: var(--text);
  font-size: var(--t-base); font-weight: 550; letter-spacing: -.005em;
  white-space: nowrap; user-select: none;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease),
              transform var(--dur-1) var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(.5px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn svg { flex: none; }

.btn--primary {
  background: var(--brand-600); color: #fff; border-color: var(--brand-600);
  box-shadow: var(--shadow-xs);
}
.btn--primary:hover:not(:disabled) { background: var(--brand-700); border-color: var(--brand-700); }
.btn--primary:focus-visible { box-shadow: var(--ring); outline-color: var(--brand-700); }

.btn--secondary {
  background: var(--surface); color: var(--text); border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.btn--secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-strong); }

.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-inset); color: var(--text); }

.btn--subtle { background: var(--surface-inset); color: var(--text); }
.btn--subtle:hover:not(:disabled) { background: var(--border); }

.btn--danger { background: var(--surface); color: var(--red-700); border-color: var(--border); }
.btn--danger:hover:not(:disabled) { background: var(--red-50); border-color: var(--red-200); }

.btn--lg { --btn-h: 44px; padding-inline: var(--s-5); font-size: var(--t-md); border-radius: var(--r-lg); }
.btn--sm { --btn-h: 28px; padding-inline: var(--s-3); font-size: var(--t-sm); border-radius: var(--r-sm); }
.btn--icon { width: var(--btn-h); padding: 0; }
.btn--block { width: 100%; }

.btn-group { display: inline-flex; gap: var(--s-2); flex-wrap: wrap; }

/* Segmented control */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-inset); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.segmented button {
  border: 0; background: transparent; color: var(--text-2);
  height: 28px; padding: 0 var(--s-3); border-radius: var(--r-sm);
  font-size: var(--t-sm); font-weight: 550;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs);
}

/* --------------------------------------------------------------------------
   6. BADGES, CHIPS, KBD
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .005em;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface-inset); color: var(--text-2);
  white-space: nowrap;
}
.badge svg { width: 11px; height: 11px; }
.badge--brand { background: var(--brand-50); color: var(--text-brand); border-color: var(--border-brand); }
.badge--green { background: var(--green-50); color: var(--green-700); border-color: var(--green-200); }
.badge--amber { background: var(--amber-50); color: var(--amber-700); border-color: var(--amber-200); }
.badge--red   { background: var(--red-50);   color: var(--red-700);   border-color: var(--red-200); }
.badge--blue  { background: var(--blue-50);  color: var(--blue-700);  border-color: var(--blue-200); }
.badge--teal  { background: var(--teal-50);  color: var(--teal-700);  border-color: var(--teal-200); }
.badge--plain { background: transparent; }
.badge--lg { height: 26px; padding: 0 10px; font-size: var(--t-sm); }

/* Status dot — status never relies on colour alone, always paired with text */
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot--green { background: var(--green-500); }
.dot--amber { background: var(--amber-500); }
.dot--red   { background: var(--red-500); }
.dot--blue  { background: var(--blue-500); }
.dot--pulse { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 var(--s-3) 0 var(--s-3);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text-2);
  font-size: var(--t-base); font-weight: 500;
  box-shadow: var(--shadow-xs);
  transition: all var(--dur-1) var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); transform: translateY(-1px); }
.chip svg { width: 14px; height: 14px; color: var(--text-3); }
.chip:hover svg { color: var(--brand-600); }
.chip[aria-pressed="true"] {
  background: var(--brand-50); border-color: var(--border-brand); color: var(--text-brand);
}
.chip[aria-pressed="true"] svg { color: var(--brand-600); }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font-family: var(--font-sans); font-size: var(--t-xs); font-weight: 600;
  color: var(--text-3); background: var(--surface);
  border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: var(--r-xs); line-height: 1;
}
.kbd-hint { display: inline-flex; align-items: center; gap: 3px; }

/* --------------------------------------------------------------------------
   7. TOOLTIP
   -------------------------------------------------------------------------- */
.tip { position: relative; display: inline-flex; }
.tip__bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content; max-width: 260px;
  padding: var(--s-2) var(--s-3);
  background: var(--gray-900); color: #fff;
  font-size: var(--t-sm); line-height: 1.45; font-weight: 450;
  border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; z-index: 60;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
[data-theme="dark"] .tip__bubble { background: #2C3342; border: 1px solid var(--border-strong); }
.tip__bubble::after {
  content: ""; position: absolute; top: 100%; left: 50%; margin-left: -4px;
  border: 4px solid transparent; border-top-color: var(--gray-900);
}
[data-theme="dark"] .tip__bubble::after { border-top-color: #2C3342; }
.tip:hover .tip__bubble, .tip:focus-within .tip__bubble {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.tip--right .tip__bubble { left: auto; right: 0; transform: translateX(0) translateY(4px); }
.tip--right .tip__bubble::after { left: auto; right: 14px; }
.tip--right:hover .tip__bubble { transform: translateX(0) translateY(0); }

/* --------------------------------------------------------------------------
   8. CARDS
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
}
.card--pad { padding: var(--s-5); }
.card--flush { border-radius: var(--r-lg); }

.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: var(--t-md); }
.card-body { padding: var(--s-5); }
.card-foot {
  padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl);
}

/* Tool card ------------------------------------------------------------- */
.tool-card {
  position: relative;
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
              transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
  min-height: 128px;
}
.tool-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card:focus-within { border-color: var(--brand-400); box-shadow: var(--ring); }
.tool-card__top { display: flex; align-items: flex-start; gap: var(--s-3); }
.tool-card__icon {
  flex: none; width: 34px; height: 34px; border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--surface-inset); border: 1px solid var(--border);
  color: var(--text-2);
  transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease);
}
.tool-card__icon svg { width: 17px; height: 17px; }
.tool-card:hover .tool-card__icon {
  background: var(--brand-50); border-color: var(--border-brand); color: var(--brand-600);
}
.tool-card__name {
  font-size: var(--t-md); font-weight: 600; line-height: 1.35; letter-spacing: -.012em;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.tool-card__name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tool-card__desc {
  color: var(--text-2); font-size: var(--t-base); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tool-card__meta { display: flex; align-items: center; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.tool-card--soon { background: var(--surface-2); }
.tool-card--soon .tool-card__icon { opacity: .7; }

.fav-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--text-3); opacity: 0;
  transition: opacity var(--dur-2) var(--ease), color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}
.fav-btn svg { width: 15px; height: 15px; }
.tool-card:hover .fav-btn, .fav-btn:focus-visible, .fav-btn[aria-pressed="true"] { opacity: 1; }
.fav-btn:hover { background: var(--surface-inset); color: var(--text); }
.fav-btn[aria-pressed="true"] { color: var(--amber-500); }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }

/* Tool row (list view) --------------------------------------------------- */
.tool-row {
  position: relative;
  display: grid; grid-template-columns: 34px minmax(0,1.15fr) minmax(0,1.5fr) auto;
  align-items: center; gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.tool-row + .tool-row { margin-top: 6px; }
.tool-row:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.tool-row__icon {
  width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface-inset); border: 1px solid var(--border); color: var(--text-2);
}
.tool-row__icon svg { width: 15px; height: 15px; }
.tool-row__name { font-weight: 600; font-size: var(--t-base); display: flex; align-items: center; gap: 6px; }
.tool-row__name a::after { content: ""; position: absolute; inset: 0; }
.tool-row__desc {
  color: var(--text-2); font-size: var(--t-base);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tool-row__meta { display: flex; align-items: center; gap: 6px; }

/* Category card ---------------------------------------------------------- */
.cat-card {
  position: relative; display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-5); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
              transform var(--dur-2) var(--ease);
}
.cat-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-card__head { display: flex; align-items: center; gap: var(--s-3); }
.cat-card__icon {
  flex: none; width: 38px; height: 38px; border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--cat-bg, var(--surface-inset));
  border: 1px solid var(--cat-bd, var(--border));
  color: var(--cat-fg, var(--text-2));
}
.cat-card__icon svg { width: 19px; height: 19px; }
.cat-card__title { font-size: var(--t-md); font-weight: 600; letter-spacing: -.012em; }
.cat-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cat-card__count { font-size: var(--t-sm); color: var(--text-3); font-variant-numeric: tabular-nums; }
.cat-card__desc { color: var(--text-2); font-size: var(--t-base); line-height: 1.5; }
.cat-card__pick {
  margin-top: auto; padding-top: var(--s-3); border-top: 1px dashed var(--border);
  display: flex; align-items: center; gap: 6px;
  font-size: var(--t-sm); color: var(--text-2);
}
.cat-card__pick b { color: var(--text); font-weight: 600; }
.cat-card__pick svg { width: 13px; height: 13px; color: var(--text-3); }

/* Feature card ----------------------------------------------------------- */
.feature {
  display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.feature__icon {
  width: 32px; height: 32px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--brand-50); border: 1px solid var(--border-brand); color: var(--brand-600);
}
.feature__icon svg { width: 16px; height: 16px; }
.feature h3 { font-size: var(--t-md); }
.feature p { color: var(--text-2); font-size: var(--t-base); line-height: 1.55; }

/* --------------------------------------------------------------------------
   9. HEADER / NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 80;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(1px)) { .site-header { background: var(--surface); } }

.site-header__inner {
  height: 100%;
  display: flex; align-items: center; gap: var(--s-4);
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 650; font-size: 15px; letter-spacing: -.025em; color: var(--text);
  flex: none;
}
.brand__mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(155deg, var(--brand-500), var(--brand-700));
  color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.18), inset 0 1px 0 rgba(255,255,255,.22);
}
.brand__mark svg { width: 15px; height: 15px; }
.brand:hover { color: var(--text); }

.nav { display: flex; align-items: center; gap: 2px; }
.nav__link {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 10px; border-radius: var(--r-sm);
  font-size: var(--t-base); font-weight: 500; color: var(--text-2);
  border: 0; background: transparent;
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--surface-inset); }
.nav__link[aria-current="page"] { color: var(--text); font-weight: 600; }
.nav__link .caret { width: 12px; height: 12px; color: var(--text-3); transition: transform var(--dur-2) var(--ease); }
.nav__link[aria-expanded="true"] { color: var(--text); background: var(--surface-inset); }
.nav__link[aria-expanded="true"] .caret { transform: rotate(180deg); }

.header-actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }

/* Compact header search trigger */
.header-search {
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: 32px; min-width: 200px; padding: 0 8px 0 10px;
  background: var(--surface-inset); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text-3); font-size: var(--t-base);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.header-search:hover { border-color: var(--border-strong); background: var(--surface); }
.header-search svg { width: 14px; height: 14px; flex: none; }
.header-search span { flex: 1; text-align: left; }
.header-search kbd { font-size: 10px; height: 18px; min-width: 18px; }

.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--text-2);
  border-radius: var(--r-sm);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.icon-btn:hover { background: var(--surface-inset); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn--bordered { border-color: var(--border); background: var(--surface); }

.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: none; }

/* Mega menu -------------------------------------------------------------- */
.mega {
  position: absolute; left: 0; right: 0; top: var(--header-h);
  z-index: 79;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease),
              visibility var(--dur-2) var(--ease);
}
.mega[data-open="true"] { opacity: 1; visibility: visible; transform: translateY(0); }
.mega__inner {
  display: grid; grid-template-columns: minmax(0,1fr) 268px;
  gap: var(--s-8); padding-block: var(--s-6) var(--s-5);
}
.mega__cats {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 2px var(--s-4);
  align-content: start;
}
.mega__cat {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 9px 10px; border-radius: var(--r-md);
  transition: background var(--dur-1) var(--ease);
}
.mega__cat:hover { background: var(--surface-inset); }
.mega__cat-icon {
  width: 28px; height: 28px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--cat-bg, var(--surface-inset)); border: 1px solid var(--cat-bd, var(--border));
  color: var(--cat-fg, var(--text-2));
}
.mega__cat-icon svg { width: 15px; height: 15px; }
.mega__cat-name { font-size: var(--t-base); font-weight: 600; line-height: 1.3; }
.mega__cat-count { font-size: var(--t-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.mega__aside {
  border-left: 1px solid var(--border); padding-left: var(--s-6);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.mega__aside-title {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-3);
}
.mega__pop { display: flex; flex-direction: column; gap: 1px; }
.mega__pop-item {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 7px 8px; border-radius: var(--r-sm);
  font-size: var(--t-base); color: var(--text-2);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.mega__pop-item:hover { background: var(--surface-inset); color: var(--text); }
.mega__pop-item svg { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.mega__pop-item:hover svg { color: var(--brand-600); }
.mega__foot {
  border-top: 1px solid var(--border); background: var(--surface-2);
  padding-block: var(--s-3);
}
.mega__foot-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.mega__foot-note { font-size: var(--t-sm); color: var(--text-3); display: flex; align-items: center; gap: 7px; }

/* Mobile drawer ---------------------------------------------------------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90; background: var(--overlay);
  opacity: 0; visibility: hidden; transition: opacity var(--dur-3) var(--ease), visibility var(--dur-3) var(--ease);
}
.drawer-backdrop[data-open="true"] { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: min(340px, 88vw);
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-3) var(--ease-out);
}
.drawer[data-open="true"] { transform: translateX(0); }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); padding-inline: var(--s-4);
  border-bottom: 1px solid var(--border); flex: none;
}
.drawer__body { flex: 1; overflow-y: auto; padding: var(--s-4); }
.drawer__foot { flex: none; padding: var(--s-4); border-top: 1px solid var(--border); display: grid; gap: var(--s-2); }
.drawer__section + .drawer__section { margin-top: var(--s-5); }
.drawer__label {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); padding-inline: 10px; margin-bottom: var(--s-2);
}
.drawer__link {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px; border-radius: var(--r-md);
  font-size: var(--t-md); font-weight: 500; color: var(--text);
}
.drawer__link:hover, .drawer__link:focus-visible { background: var(--surface-inset); }
.drawer__link svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.drawer__link .spacer + span { font-size: var(--t-sm); color: var(--text-3); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   10. COMMAND PALETTE / SEARCH
   -------------------------------------------------------------------------- */
.palette-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: var(--overlay);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-2) var(--ease), visibility var(--dur-2) var(--ease);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(16px, 10vh, 120px) var(--s-4) var(--s-4);
}
.palette-backdrop[data-open="true"] { opacity: 1; visibility: visible; }

.palette {
  width: 100%; max-width: 620px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-xl);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: min(560px, 78vh);
  transform: scale(.98) translateY(-8px); opacity: 0;
  transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2) var(--ease);
}
.palette-backdrop[data-open="true"] .palette { transform: scale(1) translateY(0); opacity: 1; }

.palette__input-wrap {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4); border-bottom: 1px solid var(--border); flex: none;
}
.palette__input-wrap > svg { width: 17px; height: 17px; color: var(--text-3); flex: none; }
.palette__input {
  flex: 1; border: 0; background: transparent; font-size: var(--t-lg);
  letter-spacing: -.01em; padding: 0;
}
.palette__input::placeholder { color: var(--text-3); }
.palette__close { flex: none; }

.palette__results { overflow-y: auto; padding: var(--s-2); flex: 1; }
.palette__group-label {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); padding: var(--s-3) 10px var(--s-2);
}
.palette__item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 9px 10px; border-radius: var(--r-md); width: 100%; max-width: 100%;
  min-width: 0; overflow: hidden;
  border: 0; background: transparent; text-align: left; color: var(--text);
  scroll-margin: 8px;
}
.palette__item[data-active="true"] { background: var(--surface-inset); }
.palette__item[data-active="true"] .palette__enter { opacity: 1; }
.palette__icon {
  width: 30px; height: 30px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--surface-inset); border: 1px solid var(--border); color: var(--text-2);
}
.palette__item[data-active="true"] .palette__icon {
  background: var(--brand-50); border-color: var(--border-brand); color: var(--brand-600);
}
.palette__icon svg { width: 15px; height: 15px; }
.palette__text { min-width: 0; flex: 1; }
.palette__name {
  font-size: var(--t-base); font-weight: 600; line-height: 1.35;
  display: flex; align-items: center; gap: 6px;
}
.palette__name mark { background: transparent; color: var(--brand-600); font-weight: 700; }
[data-theme="dark"] .palette__name mark { color: var(--brand-300); }
.palette__desc {
  font-size: var(--t-sm); color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.palette__cat { font-size: var(--t-xs); color: var(--text-3); flex: none; }
.palette__enter { opacity: 0; transition: opacity var(--dur-1) var(--ease); flex: none; }
.palette__foot {
  flex: none; display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border);
  background: var(--surface-2); font-size: var(--t-sm); color: var(--text-3);
  flex-wrap: wrap;
}
.palette__foot .kbd-hint { gap: 4px; }

.palette__empty { padding: var(--s-10) var(--s-5); text-align: center; }

/* --------------------------------------------------------------------------
   11. HERO + BIG SEARCH
   -------------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: var(--s-16) var(--s-12);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(680px 300px at 50% -8%, color-mix(in srgb, var(--brand-500) 9%, transparent), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(560px 240px at 50% 0%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(560px 240px at 50% 0%, #000, transparent 78%);
}
.hero__inner { position: relative; text-align: center; }

.hero h1 {
  font-size: var(--t-5xl); line-height: 1.1; letter-spacing: -.035em;
  margin-bottom: var(--s-3);
}
.hero__sub {
  font-size: var(--t-lg); color: var(--text-2); max-width: 560px;
  margin: 0 auto var(--s-8); line-height: 1.55;
}

.omnibox { max-width: 640px; margin: 0 auto; }
.omnibox__field {
  display: flex; align-items: center; gap: var(--s-3);
  height: 54px; padding: 0 10px 0 var(--s-4);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-xl); box-shadow: var(--shadow-md);
  cursor: text; text-align: left; width: 100%;
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.omnibox__field:hover { border-color: var(--brand-300); }
.omnibox__field:focus-visible { border-color: var(--brand-500); box-shadow: var(--ring), var(--shadow-md); outline: none; }
.omnibox__field > svg { width: 19px; height: 19px; color: var(--text-3); flex: none; }
.omnibox__placeholder {
  flex: 1; color: var(--text-3); font-size: var(--t-lg); letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.omnibox__kbd {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  padding: 5px 8px; background: var(--surface-inset);
  border: 1px solid var(--border); border-radius: var(--r-md);
}
.omnibox__kbd kbd { border: 0; background: transparent; height: auto; padding: 0; font-size: var(--t-sm); }

.hero__chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2);
  margin-top: var(--s-5);
}
.hero__stats {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: var(--s-2) var(--s-6); margin-top: var(--s-8);
  font-size: var(--t-base); color: var(--text-2);
}
.hero__stat { display: inline-flex; align-items: center; gap: 7px; }
.hero__stat svg { width: 14px; height: 14px; color: var(--text-3); }
.hero__stat b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   12. PROTOTYPE NOTICES
   -------------------------------------------------------------------------- */
.proto-bar {
  position: relative; z-index: 81;
  background: var(--amber-50);
  border-bottom: 1px solid var(--amber-200);
  color: var(--amber-700);
  font-size: var(--t-base);
}
.proto-bar__inner {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 38px; padding-block: 7px;
}
.proto-bar svg { width: 15px; height: 15px; flex: none; }
.proto-bar strong { font-weight: 650; }
.proto-bar p { line-height: 1.4; }
.proto-bar a { text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.proto-bar__close {
  margin-left: auto; flex: none; border: 0; background: transparent;
  color: inherit; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: var(--r-sm); opacity: .75;
}
.proto-bar__close:hover { opacity: 1; background: color-mix(in srgb, var(--amber-700) 12%, transparent); }
.proto-bar[hidden] { display: none; }

.proto-note {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--amber-50); border: 1px solid var(--amber-200);
  border-radius: var(--r-md); color: var(--amber-700);
  font-size: var(--t-base); line-height: 1.5;
}
.proto-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.proto-note strong { font-weight: 650; }
.proto-note--info { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-700); }
.proto-note--brand { background: var(--brand-50); border-color: var(--border-brand); color: var(--text-brand); }

.ribbon-soon {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--t-xs); font-weight: 600; color: var(--text-3);
}

/* --------------------------------------------------------------------------
   13. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: var(--s-12) var(--s-6);
  margin-top: var(--s-16);
}
.site-footer__grid {
  display: grid; grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: var(--s-8);
}
.site-footer__brand { max-width: 300px; }
.site-footer__tag { color: var(--text-2); font-size: var(--t-base); margin-top: var(--s-3); line-height: 1.6; }
.footer-col h4 {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: var(--s-3);
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: var(--t-base); color: var(--text-2); transition: color var(--dur-1) var(--ease); }
.footer-col a:hover { color: var(--text); }
.site-footer__bottom {
  margin-top: var(--s-10); padding-top: var(--s-5); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
  font-size: var(--t-sm); color: var(--text-3);
}
.site-footer__legal { display: flex; gap: var(--s-4); flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   14. FORM CONTROLS
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: var(--t-base); font-weight: 550; color: var(--text); }
.hint { font-size: var(--t-sm); color: var(--text-3); line-height: 1.45; }

.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 var(--s-3);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: var(--t-base); box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.textarea { height: auto; min-height: 96px; padding: var(--s-3); resize: vertical; line-height: 1.6; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-500); box-shadow: var(--ring); outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select {
  appearance: none; padding-right: 30px; 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='%23667085' 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 9px center;
}
[data-theme="dark"] .select {
  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='%2399A1B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.input-group { display: flex; gap: var(--s-2); }
.input-group .input { flex: 1; }
.input-group .select { width: auto; min-width: 92px; flex: none; }

/* Radio card group */
.opt-group { display: grid; gap: var(--s-2); }
.opt {
  position: relative; display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.opt:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt__mark {
  flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.opt__mark::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff;
  transform: scale(0); transition: transform var(--dur-2) var(--ease-out);
}
.opt input:checked ~ .opt__mark { border-color: var(--brand-600); background: var(--brand-600); }
.opt input:checked ~ .opt__mark::after { transform: scale(1); }
.opt input:focus-visible ~ .opt__mark { box-shadow: var(--ring); }
.opt:has(input:checked) { border-color: var(--brand-400); background: var(--brand-50); }
.opt__body { min-width: 0; }
.opt__title { font-size: var(--t-base); font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.opt__desc { font-size: var(--t-sm); color: var(--text-2); line-height: 1.45; margin-top: 1px; }

/* Checkbox */
.check { display: inline-flex; align-items: flex-start; gap: var(--s-2); cursor: pointer; font-size: var(--t-base); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: var(--r-xs);
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; color: #fff;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.check__box svg { width: 11px; height: 11px; opacity: 0; transform: scale(.6); transition: all var(--dur-2) var(--ease-out); }
.check input:checked ~ .check__box { background: var(--brand-600); border-color: var(--brand-600); }
.check input:checked ~ .check__box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible ~ .check__box { box-shadow: var(--ring); }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 34px; height: 20px; border-radius: var(--r-full); flex: none;
  background: var(--border-strong); position: relative;
  transition: background var(--dur-2) var(--ease);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-xs); transition: transform var(--dur-2) var(--ease-out);
}
.switch input:checked ~ .switch__track { background: var(--brand-600); }
.switch input:checked ~ .switch__track::after { transform: translateX(14px); }
.switch input:focus-visible ~ .switch__track { box-shadow: var(--ring); }

/* Range */
.range { width: 100%; appearance: none; height: 4px; border-radius: var(--r-full); background: var(--border); }
.range::-webkit-slider-thumb {
  appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--brand-600);
  box-shadow: var(--shadow-sm); cursor: grab;
}
.range::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--surface);
  border: 1.5px solid var(--brand-600); box-shadow: var(--shadow-sm); cursor: grab;
}
.range:focus-visible::-webkit-slider-thumb { box-shadow: var(--ring); }

/* Search / filter bar */
.searchbar { position: relative; flex: 1; min-width: 200px; }
.searchbar > svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-3); pointer-events: none;
}
.searchbar .input { height: 38px; padding-left: 34px; }
.searchbar__clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-3); border-radius: var(--r-sm);
}
.searchbar__clear:hover { background: var(--surface-inset); color: var(--text); }

.filter-bar {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-3); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.filter-scroll {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 30px; padding: 0 11px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: var(--t-base); font-weight: 500;
  transition: all var(--dur-1) var(--ease);
}
.filter-pill:hover { border-color: var(--border-strong); color: var(--text); }
.filter-pill[aria-pressed="true"] {
  background: var(--brand-600); border-color: var(--brand-600); color: #fff;
}
.filter-pill__count {
  font-size: var(--t-xs); font-variant-numeric: tabular-nums;
  padding: 0 5px; border-radius: var(--r-full);
  background: var(--surface-inset); color: var(--text-3);
}
.filter-pill[aria-pressed="true"] .filter-pill__count { background: rgba(255,255,255,.2); color: #fff; }

/* --------------------------------------------------------------------------
   15. TABS
   -------------------------------------------------------------------------- */
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none; border: 0; background: transparent;
  padding: 10px 12px; font-size: var(--t-base); font-weight: 550; color: var(--text-2);
  transition: color var(--dur-1) var(--ease);
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px;
  height: 2px; background: var(--brand-600); border-radius: 2px 2px 0 0;
}
.tabpanel[hidden] { display: none; }

/* --------------------------------------------------------------------------
   16. MODAL / TOAST / SKELETON / EMPTY
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 110; background: var(--overlay);
  display: flex; align-items: center; justify-content: center; padding: var(--s-4);
  opacity: 0; visibility: hidden; transition: opacity var(--dur-2) var(--ease), visibility var(--dur-2) var(--ease);
}
.modal-backdrop[data-open="true"] { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 460px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl); overflow: hidden;
  transform: scale(.97); transition: transform var(--dur-3) var(--ease-out);
  max-height: 88vh; display: flex; flex-direction: column;
}
.modal--wide { max-width: 640px; }
.modal-backdrop[data-open="true"] .modal { transform: scale(1); }
.modal__head { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-5) var(--s-5) var(--s-3); }
.modal__title { font-size: var(--t-lg); }
.modal__sub { font-size: var(--t-base); color: var(--text-2); margin-top: 4px; }
.modal__body { padding: 0 var(--s-5) var(--s-5); overflow-y: auto; }
.modal__foot {
  display: flex; justify-content: flex-end; gap: var(--s-2);
  padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); background: var(--surface-2);
}

.toast-region {
  position: fixed; bottom: var(--s-5); left: 50%; transform: translateX(-50%);
  z-index: 120; display: flex; flex-direction: column; gap: var(--s-2);
  pointer-events: none; width: min(420px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); pointer-events: auto;
  background: var(--gray-900); color: #fff;
  border-radius: var(--r-lg); box-shadow: var(--shadow-xl);
  font-size: var(--t-base); line-height: 1.45;
  animation: toast-in var(--dur-3) var(--ease-out);
}
[data-theme="dark"] .toast { background: #232A38; border: 1px solid var(--border-strong); }
.toast[data-leaving="true"] { animation: toast-out var(--dur-2) var(--ease) forwards; }
.toast svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.toast--ok svg { color: var(--green-500); }
.toast--warn svg { color: var(--amber-500); }
.toast__close { margin-left: auto; border: 0; background: transparent; color: rgba(255,255,255,.6); flex: none; }
.toast__close:hover { color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

.skeleton {
  background: linear-gradient(90deg, var(--surface-inset) 25%, var(--border) 37%, var(--surface-inset) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skeleton-card { padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.skeleton-card .skeleton + .skeleton { margin-top: 10px; }

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--s-3); padding: var(--s-16) var(--s-5);
  border: 1px dashed var(--border-strong); border-radius: var(--r-xl);
  background: var(--surface);
}
.empty__icon {
  width: 44px; height: 44px; border-radius: var(--r-lg); display: grid; place-items: center;
  background: var(--surface-inset); border: 1px solid var(--border); color: var(--text-3);
}
.empty__icon svg { width: 21px; height: 21px; }
.empty h3 { font-size: var(--t-md); }
.empty p { color: var(--text-2); font-size: var(--t-base); max-width: 380px; }

/* --------------------------------------------------------------------------
   17. BREADCRUMB
   -------------------------------------------------------------------------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--t-base); }
.breadcrumb a { color: var(--text-2); transition: color var(--dur-1) var(--ease); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb li { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb svg { width: 13px; height: 13px; color: var(--text-3); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 550; }

/* --------------------------------------------------------------------------
   18. TOOL PAGE
   -------------------------------------------------------------------------- */
.tool-hero { padding-block: var(--s-6) var(--s-5); border-bottom: 1px solid var(--border); background: var(--surface); }
.tool-hero__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-5); flex-wrap: wrap; }
.tool-hero h1 {
  font-size: var(--t-4xl); line-height: 1.15; letter-spacing: -.03em; margin-top: var(--s-3);
}
.tool-hero__desc { font-size: var(--t-lg); color: var(--text-2); margin-top: var(--s-2); max-width: 620px; }
.tool-hero__badges { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-4); }
.tool-hero__actions { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }

.tool-layout {
  display: grid; grid-template-columns: minmax(0,1fr) 300px;
  gap: var(--s-8); align-items: start;
}
.tool-main { min-width: 0; }
.tool-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: var(--s-4); }

.workspace {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-2xl); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.workspace__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.workspace__title { font-size: var(--t-base); font-weight: 600; display: flex; align-items: center; gap: var(--s-2); }
.workspace__body { padding: var(--s-5); }
.workspace__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border);
  background: var(--surface-2); flex-wrap: wrap;
}
.workspace__stage[hidden] { display: none; }

/* Dropzone --------------------------------------------------------------- */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: var(--s-4); text-align: center;
  padding: var(--s-12) var(--s-5);
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-xl);
  background: var(--surface-2);
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.dropzone:hover { border-color: var(--brand-300); }
.dropzone[data-drag="true"] {
  border-color: var(--brand-500); background: var(--brand-50);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--brand-500) 8%, transparent);
}
.dropzone[data-drag="true"] .dropzone__icon {
  border-color: var(--border-brand); background: var(--surface); color: var(--brand-600);
  transform: translateY(-3px);
}
.dropzone__icon {
  width: 52px; height: 52px; border-radius: var(--r-xl); display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-3);
  box-shadow: var(--shadow-xs);
  transition: all var(--dur-2) var(--ease-out);
}
.dropzone__icon svg { width: 24px; height: 24px; }
.dropzone__title { font-size: var(--t-lg); font-weight: 600; letter-spacing: -.015em; }
.dropzone__sub { font-size: var(--t-base); color: var(--text-2); }
.dropzone__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: center; }
.dropzone__support {
  display: flex; align-items: center; gap: 7px; font-size: var(--t-sm); color: var(--text-3);
}
.dropzone__support svg { width: 13px; height: 13px; }
.dropzone__or { font-size: var(--t-sm); color: var(--text-3); }

/* File queue ------------------------------------------------------------- */
.queue { display: flex; flex-direction: column; }
.queue__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding-bottom: var(--s-3); margin-bottom: var(--s-3);
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.queue__summary { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-base); }
.queue__summary b { font-weight: 600; font-variant-numeric: tabular-nums; }
.queue__summary .sep { color: var(--text-3); }
.queue__actions { display: flex; align-items: center; gap: var(--s-2); }
.queue__list { display: flex; flex-direction: column; gap: 6px; }

.file-row {
  display: grid; grid-template-columns: 34px minmax(0,1fr) auto auto;
  align-items: center; gap: var(--s-3);
  padding: 10px var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface);
  animation: row-in var(--dur-3) var(--ease-out);
}
@keyframes row-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.file-row[data-state="done"] { border-color: var(--green-200); background: var(--green-50); }
.file-row[data-state="error"] { border-color: var(--red-200); background: var(--red-50); }
.file-row__icon {
  width: 32px; height: 34px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center; position: relative;
  background: var(--surface-inset); border: 1px solid var(--border); color: var(--text-2);
}
.file-row__icon svg { width: 15px; height: 15px; }
.file-row__ext {
  position: absolute; bottom: -1px; left: -1px; right: -1px;
  font-size: 7px; font-weight: 800; letter-spacing: .04em; text-align: center;
  background: var(--red-500); color: #fff; border-radius: 0 0 4px 4px; line-height: 9px;
}
.file-row__ext[data-kind="img"] { background: var(--blue-500); }
.file-row__ext[data-kind="doc"] { background: var(--brand-600); }
.file-row__ext[data-kind="other"] { background: var(--gray-500); }
.file-row__name {
  font-size: var(--t-base); font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-row__meta {
  font-size: var(--t-sm); color: var(--text-3); display: flex; align-items: center; gap: 7px;
  font-variant-numeric: tabular-nums;
}
.file-row__meta .sep { opacity: .5; }
.file-row__status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--text-2); }
.file-row__remove { flex: none; }
.file-row__bar { grid-column: 2 / -1; height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; }
.file-row__bar i { display: block; height: 100%; background: var(--brand-600); border-radius: 2px; transition: width var(--dur-3) var(--ease); }

/* Settings panel --------------------------------------------------------- */
.settings {
  margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--border);
}
.settings__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.settings__title { font-size: var(--t-base); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.settings__title svg { width: 14px; height: 14px; color: var(--text-3); }
.settings__grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--s-5); align-items: start; }
.settings__reveal {
  margin-top: var(--s-3); padding: var(--s-3); border-radius: var(--r-md);
  background: var(--surface-inset); border: 1px solid var(--border);
  animation: reveal var(--dur-3) var(--ease-out);
}
.settings__reveal[hidden] { display: none; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.settings__note {
  display: flex; align-items: center; gap: 7px; font-size: var(--t-sm); color: var(--text-3);
  margin-top: var(--s-3);
}
.settings__note svg { width: 13px; height: 13px; flex: none; }

/* Processing state ------------------------------------------------------- */
.processing { padding: var(--s-8) var(--s-5); text-align: center; }
.processing__spinner {
  width: 44px; height: 44px; margin: 0 auto var(--s-4); position: relative;
}
.processing__spinner svg { width: 100%; height: 100%; animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing__title { font-size: var(--t-lg); font-weight: 600; letter-spacing: -.015em; }
.processing__file { font-size: var(--t-base); color: var(--text-2); margin-top: 4px; }

.progress {
  max-width: 460px; margin: var(--s-6) auto 0;
  height: 6px; border-radius: var(--r-full); background: var(--border); overflow: hidden;
}
.progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
  border-radius: var(--r-full);
  transition: width 420ms var(--ease);
}
.progress__meta {
  max-width: 460px; margin: var(--s-2) auto 0;
  display: flex; justify-content: space-between; font-size: var(--t-sm); color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.steps {
  display: flex; align-items: center; justify-content: center; gap: 0;
  max-width: 460px; margin: var(--s-6) auto 0;
}
.step { display: flex; align-items: center; gap: var(--s-2); flex: none; }
.step__dot {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  color: var(--text-3); font-size: 10px; font-weight: 700;
  transition: all var(--dur-3) var(--ease);
}
.step__dot svg { width: 10px; height: 10px; }
.step__label { font-size: var(--t-sm); color: var(--text-3); font-weight: 550; transition: color var(--dur-2) var(--ease); }
.step__line { width: 34px; height: 1.5px; background: var(--border); margin-inline: var(--s-2); flex: none; transition: background var(--dur-3) var(--ease); }
.step[data-state="active"] .step__dot { border-color: var(--brand-600); color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-50); }
.step[data-state="active"] .step__label { color: var(--text); }
.step[data-state="done"] .step__dot { border-color: var(--brand-600); background: var(--brand-600); color: #fff; }
.step[data-state="done"] .step__label { color: var(--text-2); }
.step[data-state="done"] + .step__line { background: var(--brand-400); }

/* Result state ----------------------------------------------------------- */
.result { animation: reveal var(--dur-3) var(--ease-out); }
.result__head {
  display: flex; align-items: center; gap: var(--s-3);
  padding-bottom: var(--s-4); margin-bottom: var(--s-4); border-bottom: 1px solid var(--border);
}
.result__check {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--green-50); border: 1px solid var(--green-200); color: var(--green-700);
}
.result__check svg { width: 19px; height: 19px; }
.result__title { font-size: var(--t-lg); font-weight: 650; letter-spacing: -.015em; }
.result__sub { font-size: var(--t-base); color: var(--text-2); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.stat {
  padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
}
.stat__label { font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.stat__value { font-size: var(--t-2xl); font-weight: 650; letter-spacing: -.025em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat--win { background: var(--green-50); border-color: var(--green-200); }
.stat--win .stat__value { color: var(--green-700); }
.stat--win .stat__label { color: var(--green-700); opacity: .8; }
.stat__note { font-size: var(--t-sm); color: var(--text-3); }

.result__bar {
  margin-top: var(--s-4); display: grid; gap: 6px;
}
.result__bar-track { height: 8px; border-radius: var(--r-full); background: var(--surface-inset); border: 1px solid var(--border); overflow: hidden; display: flex; }
.result__bar-track i { display: block; height: 100%; }
.result__bar-track .b-before { background: var(--border-strong); }
.result__bar-track .b-after { background: var(--green-500); }
.result__bar-legend { display: flex; gap: var(--s-4); font-size: var(--t-sm); color: var(--text-3); }
.result__bar-legend span { display: inline-flex; align-items: center; gap: 6px; }

.result__actions { display: flex; gap: var(--s-2); margin-top: var(--s-5); flex-wrap: wrap; }
.result__privacy {
  margin-top: var(--s-4); padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  font-size: var(--t-base); color: var(--text-2);
}
.result__privacy svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }

/* Chaining / next steps -------------------------------------------------- */
.chain { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--border); }
.chain__label {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: var(--s-3);
  display: flex; align-items: center; gap: 7px;
}
.chain__label svg { width: 13px; height: 13px; }
.chain__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: var(--s-2); }
.chain__item {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 10px var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); font-size: var(--t-base); font-weight: 550; color: var(--text);
  transition: all var(--dur-1) var(--ease);
}
.chain__item:hover { border-color: var(--brand-300); background: var(--brand-50); color: var(--text-brand); transform: translateY(-1px); }
.chain__item svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.chain__item:hover svg { color: var(--brand-600); }
.chain__item .arrow { margin-left: auto; opacity: 0; transition: opacity var(--dur-1) var(--ease); }
.chain__item:hover .arrow { opacity: 1; }

/* Aside panels ----------------------------------------------------------- */
.aside-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.aside-card__head {
  padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); background: var(--surface-2);
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3);
}
.aside-card__body { padding: var(--s-4); }
.aside-list { list-style: none; display: flex; flex-direction: column; }
.aside-list li + li { border-top: 1px solid var(--border); }
.aside-list a {
  display: flex; align-items: center; gap: var(--s-3); padding: 10px var(--s-4);
  font-size: var(--t-base); color: var(--text-2); transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.aside-list a:hover { background: var(--surface-hover); color: var(--text); }
.aside-list svg { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.aside-list a:hover svg { color: var(--brand-600); }
.aside-list .spacer + svg { opacity: 0; }
.aside-list a:hover .spacer + svg { opacity: 1; }

.spec-list { display: grid; gap: var(--s-3); }
.spec { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: var(--s-3); font-size: var(--t-base); align-items: start; }
.spec dt { color: var(--text-3); }
.spec dd { margin: 0; color: var(--text); font-weight: 500; }

/* Tool content sections -------------------------------------------------- */
.tool-content { display: grid; gap: var(--s-10); margin-top: var(--s-12); }
.content-block h2 {
  font-size: var(--t-xl); letter-spacing: -.02em; margin-bottom: var(--s-3);
  display: flex; align-items: center; gap: var(--s-3);
}
.howto { list-style: none; counter-reset: step; display: grid; gap: var(--s-3); }
.howto li {
  counter-increment: step; display: grid; grid-template-columns: 24px minmax(0,1fr);
  gap: var(--s-3); align-items: start; font-size: var(--t-md); color: var(--text-2); line-height: 1.6;
}
.howto li::before {
  content: counter(step); width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: var(--t-sm); font-weight: 650;
  background: var(--surface-inset); border: 1px solid var(--border); color: var(--text-2);
}
.howto li b { color: var(--text); font-weight: 600; }

.format-grid { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.format-tag {
  font-family: var(--font-mono); font-size: var(--t-sm);
  padding: 5px 9px; border-radius: var(--r-sm);
  background: var(--surface-inset); border: 1px solid var(--border); color: var(--text-2);
}

.usecase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: var(--s-3); }
.usecase {
  padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
}
.usecase h3 { font-size: var(--t-base); margin-bottom: 5px; }
.usecase p { font-size: var(--t-base); color: var(--text-2); line-height: 1.55; }

/* Accordion / FAQ -------------------------------------------------------- */
.accordion { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.accordion details + details { border-top: 1px solid var(--border); }
.accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) var(--s-5); cursor: pointer; list-style: none;
  font-size: var(--t-md); font-weight: 550;
  transition: background var(--dur-1) var(--ease);
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { background: var(--surface-hover); }
.accordion summary svg { width: 15px; height: 15px; color: var(--text-3); flex: none; transition: transform var(--dur-2) var(--ease); }
.accordion details[open] summary svg { transform: rotate(45deg); }
.accordion details[open] summary { color: var(--text); }
.accordion__body { padding: 0 var(--s-5) var(--s-5); color: var(--text-2); font-size: var(--t-base); line-height: 1.65; max-width: 72ch; }

/* --------------------------------------------------------------------------
   19. PAGE HEADERS (interior pages)
   -------------------------------------------------------------------------- */
.page-hero { padding-block: var(--s-12) var(--s-10); border-bottom: 1px solid var(--border); background: var(--surface); }
.page-hero h1 { font-size: var(--t-4xl); line-height: 1.15; letter-spacing: -.03em; }
.page-hero__sub { font-size: var(--t-lg); color: var(--text-2); margin-top: var(--s-3); max-width: 640px; line-height: 1.55; }
.page-hero__actions { display: flex; gap: var(--s-2); margin-top: var(--s-6); flex-wrap: wrap; }
.page-hero--center { text-align: center; }
.page-hero--center .page-hero__sub { margin-inline: auto; }
.page-hero--center .page-hero__actions { justify-content: center; }

/* --------------------------------------------------------------------------
   20. BULK DASHBOARD
   -------------------------------------------------------------------------- */
.job-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 0;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  overflow: hidden;
}
.job-stat { padding: var(--s-4) var(--s-5); border-right: 1px solid var(--border); }
.job-stat:last-child { border-right: 0; }
.job-stat__label { font-size: var(--t-sm); color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.job-stat__value { font-size: var(--t-3xl); font-weight: 650; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.job-stat__value small { font-size: var(--t-md); font-weight: 500; color: var(--text-3); letter-spacing: 0; }

.table-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--t-base); min-width: 720px; }
table.data th {
  text-align: left; font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3);
  padding: 10px var(--s-4); border-bottom: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.data td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background var(--dur-1) var(--ease); }
table.data tbody tr:hover { background: var(--surface-hover); }
table.data .cell-file { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
table.data .cell-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
table.data .num { font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
table.data .cell-actions { display: flex; gap: 4px; justify-content: flex-end; }
table.data tr[hidden] { display: none; }

.mini-bar { width: 72px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; display: inline-block; vertical-align: middle; }
.mini-bar i { display: block; height: 100%; background: var(--brand-600); border-radius: 2px; }

.gate {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,320px); gap: var(--s-8);
  align-items: center;
  padding: var(--s-8); border-radius: var(--r-2xl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.gate__list { list-style: none; display: grid; gap: 10px; margin-top: var(--s-4); }
.gate__list li { display: flex; align-items: flex-start; gap: var(--s-3); font-size: var(--t-base); color: var(--text-2); }
.gate__list svg { width: 15px; height: 15px; color: var(--green-500); flex: none; margin-top: 2px; }
.gate__panel { padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface-2); }

/* --------------------------------------------------------------------------
   21. WORKFLOW BUILDER
   -------------------------------------------------------------------------- */
.wf-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: var(--s-6); align-items: start; }
.wf-panel { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: var(--s-4); }

.wf-canvas {
  position: relative;
  border: 1px solid var(--border); border-radius: var(--r-2xl);
  background: var(--surface);
  background-image: radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
  background-size: 22px 22px;
  padding: var(--s-8) var(--s-5);
  min-height: 520px;
}
.wf-canvas__head {
  position: absolute; top: var(--s-4); left: var(--s-5); right: var(--s-5);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
}
.wf-flow { display: flex; flex-direction: column; align-items: center; gap: 0; margin-top: var(--s-8); }

.wf-step {
  position: relative; width: min(420px, 100%);
  display: grid; grid-template-columns: 32px minmax(0,1fr) auto;
  align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.wf-step:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.wf-step[data-dragging="true"] { opacity: .55; border-style: dashed; }
.wf-step[data-fixed="true"] { background: var(--surface-2); border-style: dashed; }
.wf-step__icon {
  width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface-inset); border: 1px solid var(--border); color: var(--text-2);
}
.wf-step__icon svg { width: 15px; height: 15px; }
.wf-step[data-fixed="true"] .wf-step__icon { background: var(--brand-50); border-color: var(--border-brand); color: var(--brand-600); }
.wf-step__name { font-size: var(--t-base); font-weight: 600; }
.wf-step__meta { font-size: var(--t-sm); color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.wf-step__ctrl { display: flex; align-items: center; gap: 2px; }
.wf-step__ctrl .icon-btn { width: 26px; height: 26px; }
.wf-step__ctrl .icon-btn svg { width: 13px; height: 13px; }
.wf-step__num {
  position: absolute; left: -30px; top: 50%; transform: translateY(-50%);
  font-size: var(--t-sm); color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 600;
}

.wf-connector { display: grid; place-items: center; height: 30px; width: 100%; position: relative; }
.wf-connector::before { content: ""; position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--border-strong); }
.wf-connector svg { width: 14px; height: 14px; color: var(--text-3); background: var(--surface); position: relative; }
.wf-connector--drop { height: 40px; }
.wf-connector__add {
  position: relative; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface);
  border: 1px dashed var(--border-strong); color: var(--text-3);
  opacity: 0; transition: opacity var(--dur-2) var(--ease), all var(--dur-1) var(--ease);
}
.wf-connector:hover .wf-connector__add { opacity: 1; }
.wf-connector__add:hover { border-color: var(--brand-500); color: var(--brand-600); border-style: solid; }
.wf-connector__add svg { width: 11px; height: 11px; background: transparent; }

.wf-templates { display: grid; gap: var(--s-2); }
.wf-template {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); transition: all var(--dur-1) var(--ease);
}
.wf-template:hover { border-color: var(--brand-300); background: var(--brand-50); }
.wf-template__name { font-size: var(--t-base); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.wf-template__name svg { width: 14px; height: 14px; color: var(--text-3); }
.wf-template:hover .wf-template__name svg { color: var(--brand-600); }
.wf-template__meta { font-size: var(--t-sm); color: var(--text-2); line-height: 1.45; }
.wf-template[aria-pressed="true"] { border-color: var(--brand-400); background: var(--brand-50); }

.wf-library { display: grid; gap: 3px; max-height: 320px; overflow-y: auto; }
.wf-lib-item {
  display: flex; align-items: center; gap: var(--s-2); text-align: left;
  padding: 7px 8px; border: 0; border-radius: var(--r-sm); background: transparent;
  font-size: var(--t-base); color: var(--text-2); width: 100%;
}
.wf-lib-item:hover { background: var(--surface-inset); color: var(--text); }
.wf-lib-item svg { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.wf-lib-item .spacer + svg { opacity: 0; }
.wf-lib-item:hover .spacer + svg { opacity: 1; color: var(--brand-600); }

/* --------------------------------------------------------------------------
   22. API PAGE
   -------------------------------------------------------------------------- */
.code-block {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--gray-900); overflow: hidden;
}
[data-theme="dark"] .code-block { background: #0E1117; border-color: var(--border); }
.code-block__head {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 9px var(--s-4); border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.code-block__dots { display: flex; gap: 5px; }
.code-block__dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.16); }
.code-block__title { font-family: var(--font-mono); font-size: var(--t-sm); color: rgba(255,255,255,.5); }
.code-block__copy {
  margin-left: auto; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.7); height: 26px; padding: 0 9px; border-radius: var(--r-sm);
  font-size: var(--t-sm); display: inline-flex; align-items: center; gap: 5px;
}
.code-block__copy:hover { background: rgba(255,255,255,.1); color: #fff; }
.code-block__copy svg { width: 12px; height: 12px; }
.code-block pre {
  margin: 0; padding: var(--s-4); overflow-x: auto;
  font-size: var(--t-base); line-height: 1.7; color: #D6DAE3;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent;
}
.code-block pre::-webkit-scrollbar { height: 8px; }
.code-block pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 4px; }
.tok-key { color: #9BB8FF; }
.tok-str { color: #A5E3A0; }
.tok-num { color: #F0C674; }
.tok-com { color: #6C7689; font-style: italic; }
.tok-meth { color: #C7A6F5; font-weight: 600; }
.tok-punc { color: #7C879B; }

.api-flow { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0; align-items: stretch; }
.api-flow__node {
  padding: var(--s-5); border: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.api-flow__node:first-child { border-radius: var(--r-xl) 0 0 var(--r-xl); }
.api-flow__node:last-child { border-radius: 0 var(--r-xl) var(--r-xl) 0; }
.api-flow__node + .api-flow__node { border-left: 0; }
.api-flow__step { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); }
.api-flow__node h3 { font-size: var(--t-md); }
.api-flow__node p { font-size: var(--t-base); color: var(--text-2); line-height: 1.55; }
.api-flow__node code {
  font-size: var(--t-sm); color: var(--text-2); background: var(--surface-inset);
  border: 1px solid var(--border); border-radius: var(--r-xs); padding: 2px 6px; align-self: flex-start;
}

.endpoint {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: 10px var(--s-4); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); font-family: var(--font-mono); font-size: var(--t-base);
}
.endpoint__verb {
  font-weight: 700; font-size: var(--t-xs); letter-spacing: .04em;
  padding: 3px 7px; border-radius: var(--r-xs);
  background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200);
}
.endpoint__verb[data-verb="GET"] { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-200); }
.endpoint__verb[data-verb="DELETE"] { background: var(--red-50); color: var(--red-700); border-color: var(--red-200); }
.endpoint__path { color: var(--text); }
.endpoint__desc { font-family: var(--font-sans); color: var(--text-2); margin-left: auto; font-size: var(--t-sm); }

/* --------------------------------------------------------------------------
   23. SIGN PAGE
   -------------------------------------------------------------------------- */
.sign-canvas {
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  background: var(--surface-2); height: 150px; position: relative;
  display: grid; place-items: center; overflow: hidden; cursor: crosshair;
}
.sign-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.sign-canvas__hint { font-size: var(--t-base); color: var(--text-3); pointer-events: none; }
.sign-canvas__line {
  position: absolute; left: var(--s-5); right: var(--s-5); bottom: 34px;
  border-top: 1px solid var(--border-strong); pointer-events: none;
}
.sign-preview {
  height: 150px; display: grid; place-items: center;
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-2);
}
.sign-preview span { font-size: 34px; color: var(--text); }
.font-sig-1 { font-family: "Snell Roundhand", "Brush Script MT", cursive; }
.font-sig-2 { font-family: "Zapfino", "Segoe Script", cursive; font-size: 26px !important; }
.font-sig-3 { font-family: Georgia, "Times New Roman", serif; font-style: italic; }

.doc-preview {
  aspect-ratio: 8.5 / 11; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-md); padding: var(--s-6); position: relative; overflow: hidden;
}
.doc-preview__line { height: 7px; border-radius: 3px; background: var(--surface-inset); }
.doc-preview__line + .doc-preview__line { margin-top: 9px; }
.doc-preview__line.w-40 { width: 40%; } .doc-preview__line.w-60 { width: 60%; }
.doc-preview__line.w-80 { width: 80%; } .doc-preview__line.w-90 { width: 90%; }
.doc-preview__line.tall { height: 12px; width: 55%; margin-bottom: var(--s-5); background: var(--border); }
.doc-field {
  position: absolute; border: 1.5px dashed var(--brand-500); background: color-mix(in srgb, var(--brand-500) 8%, transparent);
  border-radius: var(--r-sm); display: grid; place-items: center;
  font-size: var(--t-sm); font-weight: 600; color: var(--text-brand);
  cursor: grab;
}
.doc-field[data-kind="sig"] { left: 8%; bottom: 14%; width: 40%; height: 46px; }
.doc-field[data-kind="date"] { right: 8%; bottom: 14%; width: 26%; height: 32px; }

.field-palette { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2); }
.field-chip {
  display: flex; align-items: center; gap: 7px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  font-size: var(--t-base); font-weight: 500; color: var(--text-2);
  transition: all var(--dur-1) var(--ease);
}
.field-chip:hover { border-color: var(--brand-300); color: var(--text); background: var(--brand-50); }
.field-chip svg { width: 14px; height: 14px; color: var(--text-3); }

.timeline { list-style: none; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 26px minmax(0,1fr); gap: var(--s-3); padding-bottom: var(--s-4); position: relative; }
.timeline li:not(:last-child)::before {
  content: ""; position: absolute; left: 12.5px; top: 26px; bottom: 0; width: 1px; background: var(--border);
}
.timeline__dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-3);
  font-size: var(--t-xs); font-weight: 700; z-index: 1;
}
.timeline__dot svg { width: 13px; height: 13px; }
.timeline h4 { font-size: var(--t-base); }
.timeline p { font-size: var(--t-base); color: var(--text-2); line-height: 1.5; margin-top: 2px; }

/* --------------------------------------------------------------------------
   24. AUTH / ACCOUNT / MARKETING BLOCKS
   -------------------------------------------------------------------------- */
.auth-wrap { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); min-height: calc(100vh - var(--header-h)); }
.auth-form-col { display: grid; place-items: center; padding: var(--s-12) var(--s-6); }
.auth-form { width: 100%; max-width: 380px; }
.auth-aside {
  background: var(--surface-2); border-left: 1px solid var(--border);
  display: grid; place-items: center; padding: var(--s-12) var(--s-6);
}
.auth-aside__inner { max-width: 400px; }
.divider-text { display: flex; align-items: center; gap: var(--s-3); color: var(--text-3); font-size: var(--t-sm); }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.account-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: var(--s-8); align-items: start; }
.account-nav { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 2px; }
.account-nav a {
  display: flex; align-items: center; gap: var(--s-3); padding: 9px 10px;
  border-radius: var(--r-md); font-size: var(--t-base); font-weight: 500; color: var(--text-2);
  transition: all var(--dur-1) var(--ease);
}
.account-nav a:hover { background: var(--surface-inset); color: var(--text); }
.account-nav a[aria-current="page"] { background: var(--brand-50); color: var(--text-brand); font-weight: 600; }
.account-nav svg { width: 15px; height: 15px; flex: none; }

.kv-list { display: grid; gap: 0; }
.kv {
  display: grid; grid-template-columns: 200px minmax(0,1fr); gap: var(--s-4);
  padding: var(--s-4) 0; border-bottom: 1px solid var(--border); align-items: center; font-size: var(--t-base);
}
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }

.meter { height: 6px; border-radius: var(--r-full); background: var(--surface-inset); border: 1px solid var(--border); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand-600); }
.meter i[data-level="warn"] { background: var(--amber-500); }

.value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: var(--s-4); }

.split {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  gap: var(--s-10); align-items: center;
}
.split--aside { grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); }

.privacy-viz {
  display: grid; gap: var(--s-3); padding: var(--s-5);
  border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface);
}
.pv-row {
  display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: var(--s-3);
  align-items: center; padding: var(--s-3); border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface-2);
}
.pv-row__icon {
  width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
}
.pv-row__icon svg { width: 15px; height: 15px; }
.pv-row--local .pv-row__icon { background: var(--green-50); border-color: var(--green-200); color: var(--green-700); }
.pv-row--server .pv-row__icon { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-700); }
.pv-row--hybrid .pv-row__icon { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber-700); }
.pv-row h4 { font-size: var(--t-base); }
.pv-row p { font-size: var(--t-sm); color: var(--text-2); line-height: 1.45; }

.logo-strip { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); align-items: center; justify-content: center; }
.logo-strip span { font-size: var(--t-base); color: var(--text-3); font-weight: 550; }

.cta-band {
  border: 1px solid var(--border); border-radius: var(--r-2xl);
  background: var(--surface); box-shadow: var(--shadow-sm);
  padding: var(--s-10); text-align: center; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 180px at 50% 0%, color-mix(in srgb, var(--brand-500) 8%, transparent), transparent 72%);
}
.cta-band > * { position: relative; }
.cta-band h2 { font-size: var(--t-3xl); letter-spacing: -.03em; }
.cta-band p { color: var(--text-2); font-size: var(--t-lg); margin-top: var(--s-3); max-width: 520px; margin-inline: auto; }

/* --------------------------------------------------------------------------
   25. RESPONSIVE
   Verified breakpoints: 1440 / 1024 / 768 / 430 / 375
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .tool-layout { grid-template-columns: minmax(0,1fr) 260px; gap: var(--s-6); }
  .mega__cats { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .site-footer__grid { grid-template-columns: 1.4fr repeat(3, 1fr); }
  .site-footer__grid .footer-col:last-child { grid-column: 2 / -1; }
}

@media (max-width: 1024px) {
  :root { --t-5xl: 36px; --t-4xl: 30px; --t-3xl: 25px; }
  .container { padding-inline: var(--s-5); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tool-layout { grid-template-columns: minmax(0,1fr); }
  .tool-aside { position: static; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .wf-layout { grid-template-columns: minmax(0,1fr); }
  .wf-panel { position: static; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .account-layout { grid-template-columns: minmax(0,1fr); }
  .account-nav { position: static; grid-auto-flow: column; overflow-x: auto; padding-bottom: 4px; }
  .account-nav a { white-space: nowrap; }
  .split, .split--aside { grid-template-columns: minmax(0,1fr); gap: var(--s-8); }
  .gate { grid-template-columns: minmax(0,1fr); gap: var(--s-6); padding: var(--s-6); }
  .auth-wrap { grid-template-columns: minmax(0,1fr); min-height: 0; }
  .auth-aside { border-left: 0; border-top: 1px solid var(--border); }
  .api-flow { grid-template-columns: minmax(0,1fr); }
  .api-flow__node { border-radius: 0 !important; border-left: 1px solid var(--border) !important; }
  .api-flow__node:first-child { border-radius: var(--r-xl) var(--r-xl) 0 0 !important; }
  .api-flow__node:last-child { border-radius: 0 0 var(--r-xl) var(--r-xl) !important; }
  .api-flow__node + .api-flow__node { border-top: 0; }
}

/* Below this the desktop nav collapses into the drawer */
@media (max-width: 900px) {
  .nav, .header-search span, .header-search kbd { display: none; }
  .header-search { min-width: 0; width: 32px; padding: 0; justify-content: center; }
  .nav-toggle { display: grid; }
  .mega { display: none; }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--s-6); }
  .site-footer__brand { grid-column: 1 / -1; max-width: none; }
  .site-footer__grid .footer-col:last-child { grid-column: auto; }
  .header-actions .btn--ghost.hide-md { display: none; }
}

@media (max-width: 768px) {
  :root { --t-5xl: 32px; --t-4xl: 27px; --t-3xl: 22px; --t-2xl: 20px; --header-h: 56px; }
  .section { padding-block: var(--s-12); }
  .section--tight { padding-block: var(--s-10); }
  .hero { padding-block: var(--s-10) var(--s-8); }
  .grid--auto, .grid--auto-lg { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .settings__grid { grid-template-columns: minmax(0,1fr); gap: var(--s-4); }
  .stats { grid-template-columns: minmax(0,1fr); }
  .tool-aside { grid-template-columns: minmax(0,1fr); }
  .wf-panel { grid-template-columns: minmax(0,1fr); }
  .workspace__body { padding: var(--s-4); }
  .workspace__head, .workspace__foot { padding: var(--s-3) var(--s-4); }
  .dropzone { padding: var(--s-8) var(--s-4); }
  .tool-row { grid-template-columns: 30px minmax(0,1fr) auto; }
  .tool-row__desc { display: none; }
  .cta-band { padding: var(--s-8) var(--s-5); }
  .kv { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .steps { gap: 0; }
  .step__line { width: 18px; margin-inline: 6px; }
  .step__label { display: none; }
  .steps .step[data-state="active"] .step__label { display: block; }
  .palette-backdrop { padding: 0; }
  .palette {
    max-width: none; height: 100%; max-height: none;
    border-radius: 0; border: 0;
  }
  .palette__foot { display: none; }
  .palette__input-wrap { padding: var(--s-3) var(--s-4); }
  .palette__cat { display: none; }
  .result__actions .btn { flex: 1 1 auto; }
  .site-footer { margin-top: var(--s-12); padding-block: var(--s-10) var(--s-5); }
  .wf-step__num { display: none; }
  .wf-canvas { padding: var(--s-8) var(--s-3) var(--s-5); }
  .wf-canvas__head { position: static; margin-bottom: var(--s-4); }
  .wf-flow { margin-top: 0; }
}

@media (max-width: 640px) {
  .container { padding-inline: var(--s-4); }
  .grid--auto, .grid--auto-lg, .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .value-grid, .usecase-grid, .chain__grid { grid-template-columns: minmax(0,1fr); }
  .job-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .job-stat { border-right: 0; border-bottom: 1px solid var(--border); }
  .job-stat:nth-child(odd) { border-right: 1px solid var(--border); }
  .tool-card { min-height: 0; }
  .tool-card__desc { -webkit-line-clamp: 3; }
  .filter-bar { padding: var(--s-2); }
  .field-palette { grid-template-columns: minmax(0,1fr); }
  .section-head { align-items: flex-start; flex-direction: column; gap: var(--s-3); }
  .hero__stats { gap: var(--s-2) var(--s-4); font-size: var(--t-sm); }
  .toast-region { bottom: var(--s-3); }
}

@media (max-width: 430px) {
  .grid--auto, .grid--auto-lg, .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0,1fr); }
  .omnibox__field { height: 48px; padding-inline: var(--s-3) 8px; }
  .omnibox__placeholder { font-size: var(--t-md); }
  .omnibox__kbd { display: none; }
  .hero h1 { font-size: 28px; }
  .hero__sub { font-size: var(--t-md); }
  .tool-hero h1 { font-size: 24px; }
  .file-row { grid-template-columns: 32px minmax(0,1fr) auto; row-gap: 6px; }
  .file-row__icon { grid-row: 1 / span 2; }
  .file-row__status { grid-column: 2; grid-row: 2; }
  .file-row__remove { grid-column: 3; grid-row: 1; }
  .btn--lg { --btn-h: 42px; }
  .result__actions { display: grid; grid-template-columns: minmax(0,1fr); }
  .queue__head { gap: var(--s-2); }
  .stat__value { font-size: var(--t-xl); }
}

@media (max-width: 375px) {
  .container { padding-inline: var(--s-3); }
  .brand > span:not(.brand__mark) { display: none; }
  .job-summary { grid-template-columns: minmax(0,1fr); }
  .job-stat { border-right: 0 !important; }
}

/* --------------------------------------------------------------------------
   26. MOTION / PRINT / MISC
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .tool-card:hover, .cat-card:hover, .chip:hover { transform: none; }
}

@media (prefers-contrast: more) {
  :root { --border: #B4BAC5; --border-strong: #8A93A3; --text-2: #4A5464; }
  .btn { border-width: 1.5px; }
}

@media print {
  .site-header, .site-footer, .proto-bar, .drawer, .drawer-backdrop,
  .palette-backdrop, .toast-region, .tool-aside, .fav-btn { display: none !important; }
  body { background: #fff; }
  .card, .workspace, .tool-card { box-shadow: none; border-color: #ccc; }
}

.reveal-on-scroll { opacity: 0; transform: translateY(10px); }
.reveal-on-scroll.is-visible {
  opacity: 1; transform: none;
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
@media (prefers-reduced-motion: reduce) { .reveal-on-scroll { opacity: 1; transform: none; } }

[hidden] { display: none !important; }
.no-js-hide { display: none; }

/* --------------------------------------------------------------------------
   27. CATEGORY HUES
   Set on the element via data-hue; consumed by .cat-card__icon / .mega__cat-icon.
   Deliberately desaturated — identification, not decoration.
   -------------------------------------------------------------------------- */
[data-hue="red"]    { --cat-bg:#FEF3F2; --cat-fg:#B42318; --cat-bd:#FECDCA; }
[data-hue="blue"]   { --cat-bg:#EFF8FF; --cat-fg:#175CD3; --cat-bd:#B2DDFF; }
[data-hue="violet"] { --cat-bg:#F4F3FF; --cat-fg:#5925DC; --cat-bd:#D9D6FE; }
[data-hue="teal"]   { --cat-bg:#F0FDF9; --cat-fg:#107569; --cat-bd:#99F6E0; }
[data-hue="indigo"] { --cat-bg:#F1F1FE; --cat-fg:#4B44B6; --cat-bd:#CDCFF9; }
[data-hue="amber"]  { --cat-bg:#FFFAEB; --cat-fg:#B54708; --cat-bd:#FEDF89; }
[data-hue="green"]  { --cat-bg:#ECFDF3; --cat-fg:#067647; --cat-bd:#ABEFC6; }
[data-hue="pink"]   { --cat-bg:#FDF2FA; --cat-fg:#C11574; --cat-bd:#FCCEEE; }
[data-hue="slate"]  { --cat-bg:#F2F4F7; --cat-fg:#475467; --cat-bd:#E4E7EC; }

[data-theme="dark"] [data-hue="red"]    { --cat-bg:#2A100F; --cat-fg:#FDA29B; --cat-bd:#55211E; }
[data-theme="dark"] [data-hue="blue"]   { --cat-bg:#0A1B2E; --cat-fg:#84CAFF; --cat-bd:#123A63; }
[data-theme="dark"] [data-hue="violet"] { --cat-bg:#1B1533; --cat-fg:#BDB4FE; --cat-bd:#342A63; }
[data-theme="dark"] [data-hue="teal"]   { --cat-bg:#06231F; --cat-fg:#5FE9D0; --cat-bd:#0B463D; }
[data-theme="dark"] [data-hue="indigo"] { --cat-bg:#181A32; --cat-fg:#ADAEF3; --cat-bd:#2F2F66; }
[data-theme="dark"] [data-hue="amber"]  { --cat-bg:#2A1D06; --cat-fg:#FEC84B; --cat-bd:#5A3B0B; }
[data-theme="dark"] [data-hue="green"]  { --cat-bg:#0B2418; --cat-fg:#75E0A7; --cat-bd:#124A2E; }
[data-theme="dark"] [data-hue="pink"]   { --cat-bg:#2B0F22; --cat-fg:#FAA7E0; --cat-bd:#571E45; }
[data-theme="dark"] [data-hue="slate"]  { --cat-bg:#1A1F29; --cat-fg:#99A1B0; --cat-bd:#242A36; }
