/* Handy Toolkit themed system
   ----------------------------------------------------
   One shared structure, two emotional finishes.
   Components use semantic tokens; theme blocks define the mood.
*/

:root {
  /* Type */
  --font-main: "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-plain: Inter, ui-sans-serif, system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, monospace;

  --step--1: .86rem;
  --step-0: 1rem;
  --step-1: 1.18rem;
  --step-2: 1.58rem;
  --step-3: 2.25rem;
  --step-4: 4.35rem;
  --tool-title-size: clamp(2.35rem, 5.1vw, 3.7rem);
  --brand-name-size: 2.1rem;
  --brand-line-size: .92rem;
  --header-padding-y: var(--space-4);
  --header-gap: var(--space-3);
  --nav-gap: .35rem;
  --nav-padding: .35rem;
  --theme-switch-padding: .3rem;

  /* Spacing */
  --space-1: .35rem;
  --space-2: .65rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.25rem;
  --space-6: 3.5rem;
  --space-7: 5rem;
  --gutter: clamp(1rem, 3vw, 2rem);
  --site-width: 1180px;

  /* Geometry */
  --radius-xs: .625rem;
  --radius-sm: .9rem;
  --radius-md: 1.25rem;
  --radius-lg: 1.75rem;
  --radius-xl: 2.25rem;
  --radius-xxl: 3rem;
  --line: 2px;

  /* Motion */
  --ease-snap: cubic-bezier(.2, 1.1, .2, 1);
  --ease-calm: cubic-bezier(.2, .8, .2, 1);
  --speed-fast: 160ms;
  --speed: 260ms;

  /* Shared structural treatments */
  --featured-tilt: rotate(1.5deg);
  --hover-lift: translateY(-.25rem);
  --control-border-width: var(--line);
  --panel-soft-border: var(--border-color);
  --control-border: var(--input-border);
  --control-surface: var(--surface-soft);
  --control-surface-blur: var(--surface-blur);
  --note-surface: var(--surface-soft);
  --inset-surface: var(--form-bg);
  --shadow-control-panel: var(--shadow-small);
  --shadow-note: var(--shadow-small);
  --inset-control-shadow: var(--inset-highlight);
  --shadow-control-button: var(--shadow-card);
  --shadow-control-button-hover: var(--shadow-medium);
  --shadow-disabled-control: none;
  --drop-zone-shadow: var(--tool-object-shadow);
}

html[data-theme="pop"] {
  color-scheme: light;

  --line: 3px;
  --radius-md: 1.35rem;
  --radius-lg: 1.9rem;
  --radius-xl: 2.45rem;
  --radius-xxl: 3.25rem;
  --heading-weight: 950;
  --title-weight: 950;
  --body-weight: 720;
  --label-weight: 950;
  --control-weight: 950;
  --surface-blur: 18px;
  --category-wash-blur: 3px;

  /* Text colors */
  --text-hero: #20111f;
  --text-brand: #2a1628;
  --text-nav: #49384f;
  --text-body: #3b2a45;
  --text-muted: #6c5570;
  --text-label: #7b315d;
  --text-soft: #8a748c;
  --text: var(--text-body);
  --text-strong: var(--text-hero);
  --text-dim: var(--text-soft);
  --text-on-accent: #ffffff;

  /* Page background */
  --page-bg: linear-gradient(135deg, #fff4ae 0%, #ffe0c4 30%, #ffd9f0 58%, #d7dcff 82%, #bfeeff 100%);
  --page-overlay:
    linear-gradient(115deg, rgba(255, 214, 41, .46), transparent 38%),
    linear-gradient(245deg, rgba(91, 142, 255, .24), transparent 48%),
    linear-gradient(0deg, rgba(255, 56, 134, .28), transparent 58%);
  --hero-accent-overlay:
    linear-gradient(120deg, transparent 0 49%, rgba(23, 19, 35, .055) 49% 52%, transparent 52% 100%),
    linear-gradient(135deg, rgba(255, 56, 134, .28), transparent 45%),
    linear-gradient(315deg, rgba(32, 225, 255, .24), transparent 52%),
    linear-gradient(25deg, rgba(255, 218, 46, .28), transparent 44%);
  --grid-rgb: 23 19 35;
  --grid-opacity: .07;

  /* Surfaces */
  --surface: rgba(255, 255, 255, .76);
  --surface-soft: rgba(255, 255, 255, .62);
  --surface-strong: rgba(255, 255, 255, .9);
  --surface-stronger: #ffffff;
  --surface-inset: rgba(255, 255, 255, .7);
  --surface-tint:
    linear-gradient(135deg, rgba(255, 255, 255, .82), rgba(255, 244, 169, .28) 46%, rgba(255, 216, 240, .34));
  --object-sheen: linear-gradient(150deg, rgba(255, 255, 255, .54), transparent 30%, rgba(23, 19, 35, .2) 100%);
  --inset-highlight: inset 0 2px 0 rgba(255, 255, 255, .42);
  --glyph-shadow: 0 3px 0 rgba(23, 19, 35, .28);
  --border-color: rgba(23, 19, 35, .18);
  --border-strong: rgba(23, 19, 35, .32);
  --border-bright: rgba(255, 255, 255, .78);

  /* Shadows */
  --shadow-small: 0 .5rem 0 rgba(23, 19, 35, .14);
  --shadow-card: 0 .78rem 0 rgba(23, 19, 35, .18);
  --shadow-medium: 0 1rem 0 rgba(23, 19, 35, .16), 0 1.7rem 3rem rgba(23, 19, 35, .16);
  --shadow-large: 0 1rem 0 rgba(23, 19, 35, .14), 0 1.8rem 4rem rgba(23, 19, 35, .18);
  --shadow-glow: 0 0 4.5rem rgba(255, 56, 134, .3), 0 0 5.5rem rgba(32, 225, 255, .16);

  /* Accents and category gradients */
  --accent: #551bff;
  --accent-2: #16dfff;
  --accent-3: #ff2f87;
  --accent-gradient: conic-gradient(from 210deg, #ff2f87, #ff7a1a, #ffda2e, #31f0a7, #16dfff, #7d4dff, #ff2f87);
  --category-text-wranglers: linear-gradient(135deg, #16dfff 0%, #336dff 48%, #8a4dff 100%);
  --category-picture-bench: linear-gradient(135deg, #ff2f87 0%, #ff7a1a 50%, #ffda2e 100%);
  --category-file-oddities: linear-gradient(135deg, #31f0a7 0%, #ffda2e 47%, #ff7a1a 100%);
  --category-web-bits: linear-gradient(135deg, #8a4dff 0%, #ff2f87 48%, #16dfff 100%);
  --category-number-nook: linear-gradient(135deg, #2fe6b0 0%, #16dfff 48%, #ffda2e 100%);
  --category-data-drawers: linear-gradient(135deg, #ff4f6d 0%, #8a4dff 50%, #31f0a7 100%);
  --category-media-bench: linear-gradient(135deg, #ff7a1a 0%, #ff2f87 52%, #8a4dff 100%);
  --category-time-fiddlers: linear-gradient(135deg, #336dff 0%, #16dfff 52%, #31f0a7 100%);
  --category-desk-helpers: linear-gradient(135deg, #ffda2e 0%, #ff7a1a 46%, #ff2f87 100%);
  --category-colour-bits: linear-gradient(135deg, #ff2f87 0%, #ffda2e 36%, #31f0a7 68%, #16dfff 100%);
  --category-setup-bay: linear-gradient(135deg, #ffda2e 0%, #31f0a7 48%, #16dfff 100%);
  --category-oddments: linear-gradient(135deg, #8a4dff 0%, #ffda2e 48%, #ff2f87 100%);
  --category-text: var(--category-text-wranglers);
  --category-pictures: var(--category-picture-bench);
  --category-files: var(--category-file-oddities);
  --category-web: var(--category-web-bits);
  --category-sound: var(--category-media-bench);
  --category-devices: var(--category-setup-bay);
  --category-wash-opacity: .38;

  /* Buttons and forms */
  --button-bg: var(--text);
  --badge-bg: #5a274d;
  --badge-text: #ffffff;
  --badge-border: rgba(23, 19, 35, .22);
  --button-text: #ffffff;
  --button-border: rgba(23, 19, 35, .26);
  --button-ghost-bg: rgba(255, 255, 255, .76);
  --button-ghost-text: var(--text-nav);
  --button-disabled-bg: rgba(255, 255, 255, .58);
  --button-disabled-text: rgba(23, 19, 35, .48);
  --form-bg: rgba(255, 255, 255, .86);
  --input-border: rgba(23, 19, 35, .2);
  --input-focus: rgba(85, 27, 255, .68);
  --focus-ring: rgba(85, 27, 255, .68);
  --control-border-width: 2px;
  --panel-soft-border: rgba(23, 19, 35, .11);
  --control-border: rgba(23, 19, 35, .14);
  --control-surface:
    linear-gradient(135deg, rgba(255, 255, 255, .38), rgba(255, 246, 214, .18));
  --control-surface-blur: 10px;
  --note-surface: rgba(255, 255, 255, .56);
  --inset-surface: rgba(255, 255, 255, .7);
  --shadow-control-panel:
    inset 0 2px 0 rgba(255, 255, 255, .35),
    0 .55rem 1.2rem rgba(23, 19, 35, .06);
  --shadow-note:
    inset 0 2px 0 rgba(255, 255, 255, .38),
    0 .35rem 0 rgba(23, 19, 35, .07);
  --inset-control-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .58),
    inset 0 -1px 0 rgba(23, 19, 35, .06);
  --shadow-control-button:
    0 .45rem 0 rgba(23, 19, 35, .14),
    0 .85rem 1.5rem rgba(23, 19, 35, .1);
  --shadow-control-button-hover:
    0 .55rem 0 rgba(23, 19, 35, .16),
    0 1.1rem 2rem rgba(23, 19, 35, .12);
  --shadow-disabled-control:
    inset 0 2px 0 rgba(255, 255, 255, .3);

  /* Tool object treatment */
  --tool-object-bg: linear-gradient(180deg, #fffefa, #ebe5d9);
  --tool-object-border: rgba(23, 19, 35, .24);
  --tool-object-shadow:
    inset 0 0 0 .72rem rgba(23, 19, 35, .045),
    0 1rem 0 rgba(23, 19, 35, .15),
    0 2.3rem 4.4rem rgba(23, 19, 35, .18);
  --drop-zone-shadow:
    inset 0 0 0 .72rem rgba(23, 19, 35, .045),
    0 1.2rem 2.8rem rgba(23, 19, 35, .14);
  --device-stage-bg:
    linear-gradient(135deg, rgba(255, 218, 46, .16), rgba(255, 47, 135, .08) 46%, rgba(22, 223, 255, .16)),
    rgba(255, 255, 255, .58);
  --loading-bg: rgba(23, 19, 35, .72);
  --loading-text: #ffffff;

  --featured-tilt: rotate(2deg);
  --hover-lift: translateY(-.35rem) rotate(-.18deg);
}

html[data-theme="nova"] {
  color-scheme: dark;

  --line: 1px;
  --radius-md: 1rem;
  --radius-lg: 1.35rem;
  --radius-xl: 1.75rem;
  --radius-xxl: 2.35rem;
  --heading-weight: 760;
  --title-weight: 790;
  --body-weight: 520;
  --label-weight: 760;
  --control-weight: 720;
  --surface-blur: 30px;
  --category-wash-blur: 20px;

  /* Text colors */
  --text-hero: #fffaff;
  --text-brand: #f0ebfb;
  --text-nav: #d0c8df;
  --text-body: #d8d2e4;
  --text-muted: #aaa1bb;
  --text-label: #b9c7ff;
  --text-soft: #948ba3;
  --text: var(--text-body);
  --text-strong: var(--text-hero);
  --text-dim: var(--text-soft);
  --text-on-accent: #ffffff;

  /* Page background */
  --page-bg: linear-gradient(135deg, #010108 0%, #070411 44%, #020711 100%);
  --page-overlay:
    linear-gradient(120deg, rgba(100, 56, 244, .18), transparent 45%),
    linear-gradient(255deg, rgba(45, 218, 255, .055), transparent 50%),
    linear-gradient(0deg, rgba(0, 0, 0, .58), transparent 68%);
  --hero-accent-overlay:
    linear-gradient(120deg, transparent 0 50%, rgba(255, 255, 255, .07) 50% 51.4%, transparent 51.4% 100%),
    linear-gradient(135deg, rgba(122, 72, 255, .16), transparent 46%),
    linear-gradient(315deg, rgba(45, 218, 255, .06), transparent 54%);
  --grid-rgb: 255 255 255;
  --grid-opacity: .024;

  /* Surfaces */
  --surface: rgba(8, 5, 20, .66);
  --surface-soft: rgba(255, 255, 255, .04);
  --surface-strong: rgba(255, 255, 255, .064);
  --surface-stronger: rgba(255, 255, 255, .105);
  --surface-inset: rgba(0, 0, 0, .46);
  --surface-tint:
    linear-gradient(180deg, rgba(255, 255, 255, .082), rgba(255, 255, 255, .022)),
    linear-gradient(135deg, rgba(122, 72, 255, .075), rgba(45, 218, 255, .018));
  --object-sheen: linear-gradient(150deg, rgba(255, 255, 255, .32), transparent 31%, rgba(0, 0, 0, .42) 100%);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, .15);
  --glyph-shadow: 0 1px 1px rgba(0, 0, 0, .44), 0 0 1rem rgba(255, 255, 255, .2);
  --border-color: rgba(255, 255, 255, .15);
  --border-strong: rgba(255, 255, 255, .31);
  --border-bright: rgba(255, 255, 255, .2);

  /* Shadows */
  --shadow-small: 0 .9rem 2.6rem rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08);
  --shadow-card: 0 1.4rem 3.7rem rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .105);
  --shadow-medium: 0 1.9rem 4.8rem rgba(0, 0, 0, .58), inset 0 1px 0 rgba(255, 255, 255, .11);
  --shadow-large: 0 2.6rem 6.2rem rgba(0, 0, 0, .66), inset 0 1px 0 rgba(255, 255, 255, .125);
  --shadow-glow: 0 0 1.8rem rgba(45, 218, 255, .12), 0 0 4.4rem rgba(122, 72, 255, .15);

  /* Accents and category gradients */
  --accent: #62e8ff;
  --accent-2: #8b65ff;
  --accent-3: #e94bb0;
  --accent-gradient: conic-gradient(from 232deg, #e94bb0, #9867ff, #62e8ff, #26e0bd, #8b65ff, #e94bb0);
  --category-text-wranglers: linear-gradient(135deg, #62e8ff 0%, #4c7cff 52%, #8b65ff 100%);
  --category-picture-bench: linear-gradient(135deg, #e94bb0 0%, #9867ff 58%, #d58cff 100%);
  --category-file-oddities: linear-gradient(135deg, #26e0bd 0%, #62e8ff 60%, #87f0db 100%);
  --category-web-bits: linear-gradient(135deg, #8b65ff 0%, #e94bb0 54%, #62e8ff 100%);
  --category-number-nook: linear-gradient(135deg, #36e7b8 0%, #62e8ff 52%, #d7e97d 100%);
  --category-data-drawers: linear-gradient(135deg, #ff6f91 0%, #8b65ff 50%, #26e0bd 100%);
  --category-media-bench: linear-gradient(135deg, #e94bb0 0%, #8b65ff 54%, #62e8ff 100%);
  --category-time-fiddlers: linear-gradient(135deg, #4c7cff 0%, #62e8ff 52%, #26e0bd 100%);
  --category-desk-helpers: linear-gradient(135deg, #f2c84b 0%, #e94bb0 50%, #8b65ff 100%);
  --category-colour-bits: linear-gradient(135deg, #e94bb0 0%, #f2c84b 34%, #26e0bd 66%, #62e8ff 100%);
  --category-setup-bay: linear-gradient(135deg, #87f0db 0%, #62e8ff 54%, #9867ff 100%);
  --category-oddments: linear-gradient(135deg, #8b65ff 0%, #f2c84b 48%, #e94bb0 100%);
  --category-text: var(--category-text-wranglers);
  --category-pictures: var(--category-picture-bench);
  --category-files: var(--category-file-oddities);
  --category-web: var(--category-web-bits);
  --category-sound: var(--category-media-bench);
  --category-devices: var(--category-setup-bay);
  --category-wash-opacity: .075;

  /* Buttons and forms */
  --button-bg:
    linear-gradient(135deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .028)),
    linear-gradient(135deg, rgba(233, 75, 176, .62), rgba(139, 101, 255, .74) 52%, rgba(98, 232, 255, .46));
  --button-text: #ffffff;
  --button-border: rgba(255, 255, 255, .18);
  --button-ghost-bg: rgba(255, 255, 255, .058);
  --button-ghost-text: var(--text-nav);
  --button-disabled-bg: rgba(255, 255, 255, .055);
  --button-disabled-text: rgba(255, 255, 255, .34);
  --form-bg: rgba(0, 0, 0, .42);
  --input-border: rgba(255, 255, 255, .16);
  --input-focus: rgba(98, 232, 255, .6);
  --focus-ring: rgba(98, 232, 255, .62);
  --control-border-width: 1px;
  --panel-soft-border: rgba(255, 255, 255, .075);
  --control-border: rgba(255, 255, 255, .09);
  --control-surface:
    linear-gradient(180deg, rgba(255, 255, 255, .028), rgba(255, 255, 255, .01));
  --control-surface-blur: 16px;
  --note-surface: rgba(255, 255, 255, .035);
  --inset-surface: rgba(0, 0, 0, .32);
  --shadow-control-panel:
    inset 0 1px 0 rgba(255, 255, 255, .045);
  --shadow-note:
    inset 0 1px 0 rgba(255, 255, 255, .055),
    0 1rem 2rem rgba(0, 0, 0, .16);
  --inset-control-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    inset 0 0 0 1px rgba(0, 0, 0, .18);
  --shadow-control-button:
    0 .9rem 1.9rem rgba(0, 0, 0, .34),
    inset 0 1px 0 rgba(255, 255, 255, .11);
  --shadow-control-button-hover:
    0 1.15rem 2.4rem rgba(0, 0, 0, .42),
    0 0 1.1rem rgba(98, 232, 255, .1),
    inset 0 1px 0 rgba(255, 255, 255, .13);
  --shadow-disabled-control:
    inset 0 1px 0 rgba(255, 255, 255, .04),
    0 .7rem 1.3rem rgba(0, 0, 0, .18);

  /* Tool object treatment */
  --tool-object-bg:
    linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .028)),
    #0d0d16;
  --tool-object-border: rgba(255, 255, 255, .2);
  --tool-object-shadow:
    0 1.9rem 4.6rem rgba(0, 0, 0, .64),
    0 0 2.8rem rgba(98, 232, 255, .085),
    inset 0 1px 0 rgba(255, 255, 255, .12);
  --drop-zone-shadow:
    0 1.4rem 3.2rem rgba(0, 0, 0, .48),
    inset 0 1px 0 rgba(255, 255, 255, .12);
  --device-stage-bg:
    linear-gradient(180deg, rgba(255, 255, 255, .052), rgba(255, 255, 255, .018)),
    rgba(0, 0, 0, .42);
  --loading-bg: rgba(3, 3, 10, .78);
  --loading-text: #ffffff;

  --featured-tilt: rotate(0deg);
  --hover-lift: translateY(-2px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--page-overlay), var(--page-bg);
  background-attachment: fixed;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-body);
  font-family: var(--font-main);
  font-size: var(--step-0);
  line-height: 1.5;
  background: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgb(var(--grid-rgb) / var(--grid-opacity)) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--grid-rgb) / var(--grid-opacity)) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, black 0%, rgba(0, 0, 0, .32) 100%);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

button,
input,
select {
  font: inherit;
}

.site-shell {
  width: min(var(--site-width), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--header-gap);
  padding: var(--header-padding-y) 0;
}

.brand {
  display: inline-grid;
  align-items: start;
  flex: 0 1 auto;
  min-width: 0;
  color: var(--text-brand);
  text-decoration: none;
}

.brand-copy {
  position: relative;
  display: grid;
  min-width: 0;
  line-height: 1;
  padding-bottom: .34rem;
}

.brand-name {
  position: relative;
  display: inline-block;
  width: fit-content;
  font-size: var(--brand-name-size);
  font-weight: var(--title-weight);
  line-height: 1.05;
  letter-spacing: -.025em;
  text-shadow: none;
}

.brand-line {
  position: relative;
  width: fit-content;
  margin-top: .42rem;
  font-family: var(--font-plain);
  font-size: var(--brand-line-size);
  font-weight: var(--body-weight);
  line-height: 1;
  letter-spacing: .01em;
  text-shadow: none;
}

/* Pop: actual colour, no fake effects */
html[data-theme="pop"] .brand-name {
  color: transparent;
  background: linear-gradient(90deg, #c91863 0%, #5630c4 48%, #007f9e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 .13rem 0 rgba(38, 18, 43, .22));
}

html[data-theme="pop"] .brand-copy::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(100%, 18.8rem);
  height: .11rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffda2e 0%, #ff2f87 48%, #16dfff 100%);
}

html[data-theme="pop"] .brand-line {
  color: #76527b;
}

/* Nova: elegant, modern, not bubbly */
html[data-theme="nova"] .brand-name {
  color: #f2eefb;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  text-shadow: 0 0 .7rem rgba(98, 232, 255, .08);
}

html[data-theme="nova"] .brand-copy::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(100%, 18.8rem);
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(98, 232, 255, .75), rgba(139, 101, 255, .5), transparent);
  box-shadow: 0 0 .7rem rgba(98, 232, 255, .18);
}

html[data-theme="nova"] .brand-line {
  color: rgba(218, 210, 236, .68);
}

.top-nav,
.theme-switch {
  border: var(--line) solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-soft);
  backdrop-filter: blur(var(--surface-blur));
  box-shadow: var(--shadow-small);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
  flex: 0 0 auto;
  justify-self: auto;
  margin-left: auto;
  min-width: 0;
  max-width: 100%;
  padding: var(--nav-padding);
  overflow-x: auto;
  scrollbar-width: none;
}

.top-nav::-webkit-scrollbar {
  display: none;
}

.top-nav a {
  flex: 0 0 auto;
  padding: .62rem .9rem;
  border-radius: 999px;
  color: var(--text-nav);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--control-weight);
  text-decoration: none;
  transition:
    color var(--speed-fast) var(--ease-calm),
    background var(--speed-fast) var(--ease-calm),
    transform var(--speed-fast) var(--ease-snap);
}

.top-nav a:hover {
  color: var(--button-text);
  background: var(--button-bg);
  transform: translateY(-1px);
}

.theme-switch {
  display: inline-flex;
  flex: 0 0 auto;
  justify-self: auto;
  gap: var(--nav-gap);
  margin-left: var(--space-2);
  padding: var(--theme-switch-padding);
}

.theme-switch button {
  min-height: 2.25rem;
  padding: .48rem .72rem;
  border: 0;
  border-radius: 999px;
  color: var(--text-nav);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-plain);
  font-size: .78rem;
  font-weight: var(--control-weight);
  letter-spacing: 0;
}

.theme-switch button[aria-pressed="true"] {
  color: var(--button-text);
  background: var(--button-bg);
  box-shadow: var(--inset-highlight);
}

.grid-surface,
.dock-card,
.feature-strip,
.app-panel,
.toolbox-hero,
.workshop-map,
.workbench,
.bench-nav,
.tool-hero,
.tool-workspace,
.canvas-bench {
  border: var(--line) solid var(--border-color);
  background: var(--surface-tint), var(--surface);
  backdrop-filter: blur(var(--surface-blur));
  box-shadow: var(--shadow-large);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, .82fr);
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-6);
  border-radius: var(--radius-xxl);
  overflow: hidden;
}

.hero::before,
.toolbox-hero::before,
.tool-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--hero-accent-overlay);
  opacity: .9;
}

.hero > *,
.toolbox-hero > *,
.tool-hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.mini-label {
  margin: 0 0 var(--space-2);
  color: var(--text-label);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--label-weight);
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.section-intro h2,
.app-panel h2,
.toolbox-hero h1,
.tool-hero h1 {
  max-width: 12ch;
  margin: 0;
  color: var(--text-hero);
  font-size: var(--step-4);
  line-height: .94;
  letter-spacing: 0;
  font-weight: var(--heading-weight);
}

.hero-text,
.section-intro p:not(.eyebrow),
.app-panel p:not(.eyebrow),
.toolbox-hero p:not(.eyebrow),
.tool-hero p:not(.eyebrow) {
  max-width: 62ch;
  color: var(--text-body);
  font-family: var(--font-plain);
  font-size: var(--step-1);
  font-weight: var(--body-weight);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: .86rem 1.1rem;
  border: var(--line) solid var(--button-border);
  border-radius: 999px;
  color: var(--button-ghost-text);
  background: var(--button-ghost-bg);
  font-family: var(--font-plain);
  font-weight: var(--control-weight);
  letter-spacing: 0;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition:
    transform var(--speed-fast) var(--ease-snap),
    border-color var(--speed-fast) var(--ease-calm),
    box-shadow var(--speed-fast) var(--ease-snap);
}

.button:hover {
  transform: var(--hover-lift);
  box-shadow: var(--shadow-medium);
}

.button--primary {
  color: var(--button-text);
  background: var(--button-bg);
}

.button:disabled {
  color: var(--button-disabled-text);
  background: var(--button-disabled-bg);
  box-shadow: var(--shadow-disabled-control);
  cursor: not-allowed;
  transform: none;
}

.hero-console {
  position: relative;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border: var(--line) solid var(--border-bright);
  border-radius: var(--radius-xl);
  background: var(--surface-tint), var(--surface-strong);
  box-shadow: var(--shadow-large), var(--shadow-glow);
  transform: var(--featured-tilt);
  overflow: hidden;
}

.dock-card h3,
.feature-strip h3 {
  margin: 0;
  color: var(--text-brand);
  font-size: var(--step-2);
  line-height: 1;
  letter-spacing: 0;
  font-weight: var(--heading-weight);
}

.dock-card p,
.feature-strip p {
  margin: .55rem 0 0;
  color: var(--text-body);
  font-family: var(--font-plain);
  font-weight: var(--body-weight);
}

.icon-gradient {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: var(--line) solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.icon-gradient--text-wranglers,
.icon-gradient--aqua { background: var(--category-text-wranglers); }
.icon-gradient--picture-bench,
.icon-gradient--sunset { background: var(--category-picture-bench); }
.icon-gradient--file-oddities,
.icon-gradient--citrus { background: var(--category-file-oddities); }
.icon-gradient--web-bits,
.icon-gradient--violet { background: var(--category-web-bits); }
.icon-gradient--number-nook { background: var(--category-number-nook); }
.icon-gradient--data-drawers { background: var(--category-data-drawers); }
.icon-gradient--media-bench,
.icon-gradient--sound { background: var(--category-media-bench); }
.icon-gradient--time-fiddlers { background: var(--category-time-fiddlers); }
.icon-gradient--desk-helpers { background: var(--category-desk-helpers); }
.icon-gradient--colour-bits { background: var(--category-colour-bits); }
.icon-gradient--setup-bay,
.icon-gradient--devices { background: var(--category-setup-bay); }
.icon-gradient--oddments { background: var(--category-oddments); }

.icon-glyph {
  color: var(--text-on-accent);
  font-size: 2.15rem;
  font-weight: var(--heading-weight);
  text-shadow: var(--glyph-shadow);
}

.launch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 1rem 1.1rem;
  color: var(--button-text);
  border-radius: var(--radius-lg);
  background: var(--button-bg);
  font-weight: var(--control-weight);
  text-decoration: none;
}

.launch-card strong {
  display: grid;
  place-items: center;
  width: 2.2rem;
  aspect-ratio: 1;
  color: var(--text-brand);
  border-radius: 999px;
  background: var(--surface-stronger);
}

.section-intro {
  display: grid;
  gap: .2rem;
  margin: var(--space-7) 0 var(--space-4);
}

.section-intro h2,
.app-panel h2 {
  max-width: 15ch;
  font-size: var(--step-3);
}

.tool-dock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.dock-card {
  --category-gradient: var(--category-pictures);
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--space-4);
  min-height: 26rem;
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition:
    transform var(--speed) var(--ease-snap),
    border-color var(--speed) var(--ease-calm),
    box-shadow var(--speed) var(--ease-snap);
}

.dock-card::before,
.workbench::before,
.workshop-zone::before,
.tool-tile::before,
.app-panel::before {
  content: "";
  position: absolute;
  inset: auto -3.5rem -3.8rem auto;
  width: 13rem;
  height: 7rem;
  border-radius: var(--radius-lg);
  background: var(--category-gradient);
  opacity: var(--category-wash-opacity);
  filter: blur(var(--category-wash-blur));
  transform: rotate(-22deg);
  transition: transform var(--speed) var(--ease-calm), opacity var(--speed) var(--ease-calm);
}

.dock-card--text-wranglers,
.dock-card--cool,
.workshop-zone--text-wranglers,
.workshop-zone--text,
.workbench--text-wranglers,
.workbench--text {
  --category-gradient: var(--category-text-wranglers);
}

.dock-card--picture-bench,
.dock-card--hot,
.workshop-zone--picture-bench,
.workshop-zone--pictures,
.workbench--picture-bench,
.workbench--pictures {
  --category-gradient: var(--category-picture-bench);
}

.dock-card--file-oddities,
.dock-card--bright,
.workshop-zone--file-oddities,
.workshop-zone--files,
.workbench--file-oddities,
.workbench--files {
  --category-gradient: var(--category-file-oddities);
}

.dock-card--web-bits,
.dock-card--violet,
.workshop-zone--web-bits,
.workshop-zone--web,
.workbench--web-bits,
.workbench--web {
  --category-gradient: var(--category-web-bits);
}

.dock-card--number-nook,
.workshop-zone--number-nook,
.workbench--number-nook {
  --category-gradient: var(--category-number-nook);
}

.dock-card--data-drawers,
.workshop-zone--data-drawers,
.workbench--data-drawers {
  --category-gradient: var(--category-data-drawers);
}

.dock-card--media-bench,
.dock-card--sound,
.workshop-zone--media-bench,
.workshop-zone--sound,
.workbench--media-bench,
.workbench--sound {
  --category-gradient: var(--category-media-bench);
}

.dock-card--time-fiddlers,
.workshop-zone--time-fiddlers,
.workbench--time-fiddlers {
  --category-gradient: var(--category-time-fiddlers);
}

.dock-card--desk-helpers,
.workshop-zone--desk-helpers,
.workbench--desk-helpers {
  --category-gradient: var(--category-desk-helpers);
}

.dock-card--colour-bits,
.workshop-zone--colour-bits,
.workbench--colour-bits {
  --category-gradient: var(--category-colour-bits);
}

.dock-card--setup-bay,
.dock-card--devices,
.workshop-zone--setup-bay,
.workshop-zone--devices,
.workbench--setup-bay,
.workbench--devices {
  --category-gradient: var(--category-setup-bay);
}

.dock-card--oddments,
.workshop-zone--oddments,
.workbench--oddments {
  --category-gradient: var(--category-oddments);
}

.dock-card:hover,
.workshop-zone:hover,
.tool-tile:hover {
  transform: var(--hover-lift);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-medium);
}

.dock-card:hover::before,
.workshop-zone:hover::before,
.tool-tile:hover::before {
  transform: rotate(-12deg) scale(1.12);
  opacity: calc(var(--category-wash-opacity) + .1);
}

.dock-card__icon {
  width: 4.7rem;
}

.dock-card__copy,
.dock-card__links,
.dock-card__icon,
.workshop-zone > *,
.tool-tile > *,
.app-panel > * {
  position: relative;
  z-index: 1;
}

.dock-card__links {
  display: grid;
  gap: .55rem;
  margin-top: auto;
}

.dock-card__links a,
.bench-nav a {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: .78rem .9rem;
  border: var(--line) solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text-nav);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--control-weight);
  text-decoration: none;
  transition:
    transform var(--speed-fast) var(--ease-snap),
    background var(--speed-fast) var(--ease-calm),
    color var(--speed-fast) var(--ease-calm),
    border-color var(--speed-fast) var(--ease-calm);
}

.dock-card__links a::after {
  content: "→";
  opacity: .65;
}

.dock-card__links a:hover,
.bench-nav a:hover {
  color: var(--button-text);
  border-color: var(--border-strong);
  background: var(--button-bg);
  transform: translateX(.18rem);
}

.category-link,
.dock-card__links a.category-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .58rem;
  width: fit-content;
  min-height: 2.7rem;
  padding: .66rem .95rem;
  border: var(--line) solid var(--button-border);
  border-radius: 999px;
  color: var(--text-on-accent);
  background: var(--surface-tint), var(--category-gradient);
  box-shadow: var(--shadow-card);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--control-weight);
  text-decoration: none;
  transition:
    transform var(--speed-fast) var(--ease-snap),
    border-color var(--speed-fast) var(--ease-calm),
    box-shadow var(--speed-fast) var(--ease-snap);
}

.category-link::after {
  content: "→";
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  aspect-ratio: 1;
  border-radius: 999px;
  color: var(--text-brand);
  background: var(--surface-stronger);
  box-shadow: var(--inset-highlight);
}

.dock-card__links a.category-link::after {
  opacity: 1;
}

.dock-card__links .category-link {
  margin-bottom: .45rem;
}

.category-link:hover,
.dock-card__links a.category-link:hover {
  color: var(--text-on-accent);
  border-color: var(--border-strong);
  background: var(--surface-tint), var(--category-gradient);
  box-shadow: var(--shadow-medium);
  transform: translateY(-.12rem);
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding: var(--space-4);
  border-radius: var(--radius-xl);
}

.feature-strip article {
  padding: var(--space-4);
  border-left: var(--line) solid var(--border-color);
}

.feature-strip__number,
.zone-kicker,
.tool-tile__status {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  min-height: 1.75rem;
  padding: .38rem .58rem;
  color: var(--badge-text, var(--button-text));
  border: var(--line) solid var(--badge-border, var(--button-border));
  border-radius: 999px;
  background: var(--badge-bg, var(--button-bg));
  font-family: var(--font-plain);
  font-size: .74rem;
  font-weight: var(--label-weight);
  letter-spacing: 0;
  text-transform: uppercase;
}

.feature-strip__number {
  min-width: 2.7rem;
  aspect-ratio: 1;
  margin-bottom: var(--space-3);
}

.app-panel {
  --category-gradient: var(--category-files);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin: var(--space-6) 0;
  padding: var(--space-6);
  border-radius: var(--radius-xxl);
  overflow: hidden;
}

.app-panel::before {
  width: 24rem;
  height: 12rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0 var(--space-6);
  color: var(--text-soft);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

.site-footer a {
  color: var(--text-nav);
  font-weight: var(--control-weight);
}

/* Toolbox / workshop architecture */

.toolbox-page,
.tool-page,
.category-page {
  --site-width: 1240px;
}

.toolbox-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .46fr);
  gap: var(--space-5);
  align-items: end;
  padding: var(--space-6);
  border-radius: var(--radius-xxl);
  overflow: hidden;
}

.tool-search {
  position: relative;
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-3);
  border: var(--line) solid var(--border-color);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  box-shadow: var(--shadow-card);
}

.tool-search--compact {
  width: min(100%, 21.75rem);
  margin-top: var(--space-3);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.tool-search label,
.form-group label,
.option-card label {
  display: block;
  margin-bottom: .45rem;
  color: var(--text-label);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tool-search__box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2);
  align-items: center;
  min-height: 3.5rem;
  padding: 0 var(--space-3);
  border: var(--line) solid var(--input-border);
  border-radius: var(--radius-lg);
  background: var(--form-bg);
  transition:
    border-color var(--speed-fast) var(--ease-calm),
    box-shadow var(--speed-fast) var(--ease-calm);
}

.tool-search__box:focus-within {
  border-color: var(--input-focus);
  box-shadow: var(--inset-highlight), 0 0 0 .2rem color-mix(in srgb, var(--input-focus) 18%, transparent);
}

.tool-search__box span {
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: var(--label-weight);
}

.tool-search--compact .tool-search__box {
  min-height: 3.2rem;
  padding-inline: 1rem;
  border-color: var(--button-border);
  border-radius: 999px;
  background: var(--button-ghost-bg);
  box-shadow: var(--shadow-card);
}

.tool-search--compact .tool-search__box span {
  font-size: 1.18rem;
}

.tool-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text-body);
  background: transparent;
  font-family: var(--font-plain);
  font-size: clamp(.82rem, 1vw, .95rem);
  font-weight: 650;
}

.tool-search p {
  margin: 0;
  color: var(--text-soft);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

.toolbox-hero .tool-search p {
  color: var(--text-soft);
}

.category-hero {
  --category-gradient: var(--category-text-wranglers);
}

.category-list {
  margin-top: var(--space-5);
}

.category-hero::after {
  content: "";
  position: absolute;
  inset: auto -4rem -5rem auto;
  width: 24rem;
  height: 11rem;
  border-radius: var(--radius-xl);
  background: var(--category-gradient);
  opacity: var(--category-wash-opacity);
  filter: blur(var(--category-wash-blur));
  transform: rotate(-16deg);
  pointer-events: none;
}

.category-hero > * {
  position: relative;
  z-index: 1;
}

.workshop-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--radius-xxl);
  overflow: hidden;
}

.workshop-zone {
  --category-gradient: var(--category-pictures);
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: .82rem;
  min-height: 16.5rem;
  padding: var(--space-3);
  border: var(--line) solid var(--border-color);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition:
    transform var(--speed) var(--ease-snap),
    border-color var(--speed) var(--ease-calm),
    box-shadow var(--speed) var(--ease-snap);
}

.workshop-zone__icon {
  width: 3.35rem;
  border-radius: var(--radius-md);
}

.workshop-zone__icon .icon-glyph {
  font-size: 1.55rem;
}

.workshop-zone strong {
  max-width: 11ch;
  color: var(--text-brand);
  font-size: var(--step-2);
  line-height: .98;
  letter-spacing: 0;
}

.workshop-zone em {
  max-width: 23ch;
  color: var(--text-muted);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-style: normal;
  font-weight: var(--body-weight);
}

.workshop-zone .category-link {
  margin-top: auto;
  pointer-events: none;
}

.toolbox-layout {
  display: grid;
  grid-template-columns: 14.5rem minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  margin-top: var(--space-5);
}

.bench-nav {
  position: sticky;
  top: var(--space-3);
  display: grid;
  gap: .55rem;
  padding: var(--space-3);
  border-radius: var(--radius-xl);
}

.bench-stack {
  display: grid;
  gap: var(--space-5);
}

.category-preview-stack {
  margin-top: var(--space-5);
}

.workbench {
  --category-gradient: var(--category-pictures);
  position: relative;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-xxl);
  overflow: hidden;
  scroll-margin-top: var(--space-4);
}

.workbench::before {
  width: 26rem;
  height: 13rem;
  opacity: calc(var(--category-wash-opacity) - .02);
}

.workbench__header,
.tool-shelf {
  position: relative;
  z-index: 1;
}

.workbench__header {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(220px, .42fr);
  gap: var(--space-4);
  align-items: end;
}

.workbench__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.workbench__badge {
  width: 4.6rem;
  flex: 0 0 auto;
  color: var(--text-on-accent);
  font-size: 2rem;
  font-weight: var(--heading-weight);
}

.workbench h2 {
  margin: 0;
  color: var(--text-brand);
  font-size: var(--step-3);
  line-height: .98;
  letter-spacing: 0;
  font-weight: var(--heading-weight);
}

.workbench__header p:not(.eyebrow) {
  margin: 0;
  color: var(--text-body);
  font-family: var(--font-plain);
  font-weight: var(--body-weight);
}

.workbench__summary,
.category-actions {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
}

.category-preview .tool-shelf {
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
}

.category-empty {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .45rem;
  min-height: 10rem;
  padding: var(--space-4);
  border: var(--line) dashed color-mix(in srgb, var(--border-color) 78%, transparent);
  border-radius: var(--radius-xl);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-family: var(--font-plain);
  box-shadow: var(--inset-highlight);
}

.category-empty strong {
  color: var(--text-brand);
  font-family: var(--font-main);
  font-size: var(--step-1);
  line-height: 1;
  font-weight: var(--heading-weight);
}

.category-empty span {
  max-width: 34ch;
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

.tool-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13.5rem, 100%), 1fr));
  gap: var(--space-3);
}

.tool-tile {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 14rem;
  padding: var(--space-3);
  border: var(--line) solid var(--border-color);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-small);
  overflow: hidden;
  transition:
    transform var(--speed) var(--ease-snap),
    border-color var(--speed) var(--ease-calm),
    box-shadow var(--speed) var(--ease-snap);
}

.tool-tile--hero {
  min-height: 19rem;
  background: var(--surface-tint), var(--category-gradient);
}

.tool-tile strong {
  max-width: 12ch;
  margin-top: auto;
  color: var(--text-brand);
  font-size: var(--step-2);
  line-height: .98;
  letter-spacing: 0;
  font-weight: var(--heading-weight);
}

.tool-tile span:last-child {
  margin-top: .7rem;
  color: var(--text-muted);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

/* Tool page foundation */

.tool-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: end;
  padding: clamp(1.5rem, 3vw, 2.5rem) var(--space-6);
  border-radius: var(--radius-xxl);
  overflow: hidden;
}

.tool-hero h1 {
  max-width: 17ch;
  font-size: var(--tool-title-size);
}

.tool-hero__badge {
  width: clamp(4.5rem, 9vw, 7rem);
  border-radius: var(--radius-xl);
  transform: rotate(4deg);
}

.tool-hero__badge .icon-glyph {
  font-size: clamp(2.2rem, 4.8vw, 3.35rem);
}

.tool-workspace {
  display: grid;
  grid-template-columns: minmax(300px, .45fr) minmax(0, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--radius-xxl);
}

/* Single-panel tools: one full-width workspace column (see layout-single-panel on body). */
.tool-page.layout-single-panel .tool-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.tool-controls,
.canvas-bench {
  border-radius: var(--radius-xl);
}

.tool-controls {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 0;
  background: var(--control-surface);
  backdrop-filter: blur(var(--control-surface-blur));
  box-shadow: var(--shadow-control-panel);
}

.tool-note {
  padding: var(--space-3);
  border: var(--control-border-width) solid var(--panel-soft-border);
  border-radius: var(--radius-lg);
  background: var(--note-surface);
  box-shadow: var(--shadow-note);
  font-family: var(--font-plain);
}

.tool-note strong {
  display: block;
  margin-bottom: .45rem;
  color: var(--text-brand);
  font-size: var(--step-0);
  font-weight: var(--heading-weight);
}

.tool-note p {
  margin: 0;
  color: var(--text-body);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

.tool-note p + p {
  margin-top: .75rem;
}

.tool-note a {
  color: var(--accent);
  font-weight: var(--control-weight);
}

.tool-note__small {
  font-size: .8rem;
}

.control-stack {
  display: grid;
  gap: var(--space-3);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.form-group {
  margin: 0;
}

input[type="text"],
select,
input[type="search"] {
  width: 100%;
  min-height: 3.25rem;
  padding-block: .82rem;
  padding-inline: .85rem;
  color: var(--text-body);
  border: var(--line) solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--form-bg);
  font-family: var(--font-plain);
  font-size: clamp(.82rem, 1vw, .95rem);
  font-weight: 650;
  box-shadow: var(--inset-highlight);
}

select option {
  font-family: var(--font-plain);
  font-size: clamp(.82rem, 1vw, .95rem);
  font-weight: 650;
}

input[type="text"]::placeholder,
input[type="search"]::placeholder,
textarea::placeholder {
  color: var(--text-soft);
  font-family: var(--font-plain);
  font-size: clamp(.82rem, 1vw, .95rem);
  font-weight: 500;
  opacity: 1;
}

textarea {
  width: 100%;
  min-height: 8rem;
  padding: .85rem;
  border: var(--line) solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--form-bg);
  font-family: var(--font-plain);
  font-size: clamp(.82rem, 1vw, .95rem);
  font-weight: 650;
  color: var(--text-body);
  box-shadow: var(--inset-highlight);
  resize: vertical;
}

.tool-controls input[type="text"],
.tool-controls select,
.tool-controls textarea {
  border-color: var(--control-border);
  background: var(--inset-surface);
  box-shadow: var(--inset-control-shadow);
}

.tool-controls input[type="text"]:focus,
.tool-controls select:focus,
.tool-controls textarea:focus,
textarea:focus {
  border-color: var(--input-focus);
}

input[type="text"]:focus,
select:focus,
input[type="search"]:focus {
  border-color: var(--input-focus);
}

.tool-search__box input[type="search"] {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.tool-search__box input[type="search"]::-webkit-search-decoration,
.tool-search__box input[type="search"]::-webkit-search-cancel-button,
.tool-search__box input[type="search"]::-webkit-search-results-button,
.tool-search__box input[type="search"]::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
}

.search-popover {
  position: fixed;
  left: var(--search-popover-left, 1rem);
  top: var(--search-popover-top, 6rem);
  z-index: 1000;
  box-sizing: border-box;
  display: grid;
  gap: .45rem;
  width: var(--search-popover-width, min(28rem, calc(100vw - 2rem)));
  max-width: calc(100vw - 1.25rem);
  max-height: var(--search-popover-max-height, min(32rem, calc(100vh - 8rem)));
  padding: .55rem;
  overflow: auto;
  overflow-x: hidden;
  border: var(--line) solid var(--border-color);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .18), transparent 42%),
    var(--surface-strong);
  box-shadow: var(--shadow-large);
  backdrop-filter: blur(var(--surface-blur));
}

.search-popover[hidden] {
  display: none;
}

.search-result,
.search-empty {
  border: var(--control-border-width) solid var(--panel-soft-border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  box-shadow: var(--inset-highlight);
}

.search-result {
  display: grid;
  gap: .35rem;
  padding: .85rem;
  color: var(--text-body);
  font-family: var(--font-plain);
  text-decoration: none;
  transition:
    transform var(--speed-fast) var(--ease-snap),
    border-color var(--speed-fast) var(--ease-calm),
    background var(--speed-fast) var(--ease-calm),
    box-shadow var(--speed-fast) var(--ease-snap);
}

.search-result:hover,
.search-result:focus-visible,
.search-result.is-active {
  color: var(--text-body);
  border-color: var(--border-strong);
  background: var(--surface-stronger);
  box-shadow: var(--shadow-control-button-hover);
  transform: translateY(-.08rem);
}

.search-result__badge {
  display: inline-flex;
  width: fit-content;
  padding: .28rem .5rem;
  border-radius: 999px;
  color: var(--button-text);
  background: var(--button-bg);
  font-size: .68rem;
  font-weight: var(--label-weight);
  line-height: 1;
  text-transform: uppercase;
}

.search-result strong {
  color: var(--text-brand);
  font-size: var(--step-0);
  line-height: 1.1;
  font-weight: var(--heading-weight);
}

.search-result__description {
  color: var(--text-muted);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
  line-height: 1.35;
}

.search-empty {
  padding: var(--space-3);
  color: var(--text-muted);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
  text-align: center;
}

select {
  color-scheme: inherit;
}

.option-card {
  padding: .9rem;
  border: var(--control-border-width) solid var(--control-border);
  border-radius: var(--radius-lg);
  background: var(--inset-surface);
  box-shadow: var(--inset-control-shadow);
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tool-actions .button {
  min-height: 2.8rem;
  box-shadow: var(--shadow-control-button);
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
  padding: .35rem;
  border: var(--control-border-width) solid var(--control-border);
  border-radius: 999px;
  background: var(--inset-surface);
  box-shadow: var(--inset-control-shadow);
}

.mode-switch button {
  min-height: 2.35rem;
  border: 0;
  border-radius: 999px;
  color: var(--text-nav);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-plain);
  font-size: .78rem;
  font-weight: var(--control-weight);
}

.mode-switch--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-switch--four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: var(--radius-lg);
}

.mode-switch--four button {
  border-radius: var(--radius-md);
}

.mode-switch button[aria-pressed="true"] {
  color: var(--button-text);
  background: var(--button-bg);
}

.tool-status-line {
  min-height: 1.2rem;
  color: var(--text-soft);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

.checkbox-label {
  display: flex !important;
  gap: .75rem;
  align-items: flex-start;
  margin: 0 !important;
  color: var(--text-body);
  cursor: pointer;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.checkbox-label input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: .18rem;
  accent-color: var(--accent);
}

.checkbox-label span {
  display: grid;
  gap: .2rem;
}

.checkbox-label strong {
  color: var(--text-brand);
  font-size: var(--step--1);
  font-weight: var(--label-weight);
}

.checkbox-label small {
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: var(--body-weight);
}

.generate-button {
  width: 100%;
  box-shadow: var(--shadow-control-button);
  cursor: pointer;
}

.generate-button:hover:not(:disabled) {
  box-shadow: var(--shadow-control-button-hover);
}

.generate-button:disabled {
  color: var(--button-disabled-text);
  background: var(--button-disabled-bg);
  box-shadow: var(--shadow-disabled-control);
  cursor: not-allowed;
  transform: none;
}

.canvas-bench {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}

.bench-topline {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: end;
}

.bench-topline h2 {
  margin: 0;
  color: var(--text-brand);
  font-size: var(--step-3);
  line-height: .98;
  letter-spacing: 0;
  font-weight: var(--heading-weight);
}

.bench-topline p:not(.mini-label) {
  max-width: 24ch;
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

.device-stage {
  display: grid;
  place-items: center;
  min-height: 42rem;
  padding: var(--space-4);
  border: var(--line) solid var(--border-color);
  border-radius: var(--radius-xl);
  background: var(--device-stage-bg);
  overflow: hidden;
}

.tool-stage {
  align-content: stretch;
  place-items: stretch;
}

.tool-stage__stack {
  display: grid;
  gap: var(--space-3);
  align-content: stretch;
  width: 100%;
  min-height: 100%;
}

.qr-tool-page .qr-preview {
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: center;
  width: min(100%, 28rem);
  min-height: 28rem;
  padding: var(--space-4);
  border: var(--line) solid var(--tool-object-border);
  border-radius: var(--radius-xl);
  background: var(--tool-object-bg);
  box-shadow: var(--tool-object-shadow);
}

.qr-tool-page .qr-preview.is-empty {
  justify-self: stretch;
  align-self: stretch;
  width: 100%;
  min-height: 100%;
  box-shadow: var(--drop-zone-shadow);
}

.qr-tool-page .qr-preview canvas {
  width: min(100%, 20rem) !important;
  height: auto !important;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-medium);
}

.qr-tool-page .qr-preview.is-empty canvas {
  display: none;
}

.qr-tool-page .qr-preview:not(.is-empty) .qr-empty {
  display: none;
}

.qr-tool-page .qr-empty {
  max-width: 18rem;
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-plain);
  font-size: var(--step-0);
  font-weight: var(--body-weight);
  text-align: center;
}

.tool-field {
  display: grid;
  gap: var(--space-2);
}

.tool-field label,
.tool-field__label {
  color: var(--text-label);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--label-weight);
  text-transform: uppercase;
}

.file-drop-zone {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 18rem;
  padding: var(--space-4);
  border: var(--line) dashed var(--tool-object-border);
  border-radius: var(--radius-xl);
  background: var(--tool-object-bg);
  box-shadow: var(--drop-zone-shadow);
  color: var(--text-body);
  cursor: pointer;
  text-align: center;
  transition:
    transform var(--speed) var(--ease-snap),
    border-color var(--speed-fast) var(--ease-calm),
    box-shadow var(--speed-fast) var(--ease-calm);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: var(--input-focus);
  transform: var(--hover-lift);
}

.file-drop-zone strong {
  display: block;
  color: var(--text-brand);
  font-size: var(--step-1);
}

.file-drop-zone small {
  display: block;
  margin-top: .35rem;
  color: var(--text-muted);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

.file-list,
.asset-grid,
.page-grid,
.metadata-list,
.tree-list {
  display: grid;
  gap: var(--space-2);
  width: 100%;
}

.file-list:empty,
.asset-grid:empty,
.page-grid:empty,
.metadata-list:empty,
.tree-list:empty {
  display: none;
}

.tool-stage__stack:has(> .file-list:empty) > .file-drop-zone,
.tool-stage__stack:has(> .asset-grid:empty) > .file-drop-zone,
.tool-stage__stack:has(> .page-grid:empty) > .file-drop-zone,
.tool-stage__stack:has(> .metadata-list:empty) > .file-drop-zone,
.tool-stage__stack:has(> .tree-list:empty) > .file-drop-zone {
  min-height: 100%;
}

.file-row,
.asset-card,
.page-card,
.metadata-row,
.tree-row {
  border: var(--line) solid var(--input-border);
  border-radius: var(--radius-lg);
  background: var(--form-bg);
  color: var(--text-body);
  box-shadow: var(--inset-highlight);
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-3);
}

.file-row strong,
.asset-card strong,
.metadata-row strong,
.tree-row strong {
  color: var(--text-brand);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--label-weight);
}

.file-row span,
.asset-card span,
.metadata-row span,
.tree-row span {
  color: var(--text-muted);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

.file-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: end;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 2.15rem;
  min-height: 2.15rem;
  border: var(--line) solid var(--control-border);
  border-radius: 999px;
  color: var(--text-nav);
  background: var(--inset-surface);
  box-shadow: var(--inset-control-shadow);
  cursor: pointer;
  font-family: var(--font-plain);
  font-size: .85rem;
  font-weight: var(--control-weight);
}

.icon-button:disabled {
  color: var(--button-disabled-text);
  cursor: not-allowed;
}

.page-grid {
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.page-card {
  position: relative;
  display: grid;
  gap: .65rem;
  padding: .75rem;
  cursor: pointer;
}

.page-card input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.page-card canvas {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.page-card__label {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: center;
  color: var(--text-muted);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

.page-card__check {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  border: var(--line) solid var(--control-border);
  color: transparent;
  background: var(--inset-surface);
}

.page-card input:checked + canvas + .page-card__label .page-card__check {
  color: var(--button-text);
  border-color: transparent;
  background: var(--button-bg);
}

.asset-grid {
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.asset-card {
  display: grid;
  gap: .55rem;
  align-content: start;
  padding: var(--space-3);
}

.asset-card img,
.asset-card canvas {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--tool-object-bg);
}

.metadata-row,
.tree-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  padding: .72rem .85rem;
}

.tree-row {
  padding-left: calc(.85rem + (var(--tree-level, 0) * 1rem));
}

.tree-row--folder strong::before {
  content: "/";
  margin-right: .4rem;
  color: var(--text-label);
}

.preview-canvas,
.interaction-canvas,
.wave-canvas {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-lg);
  background: var(--tool-object-bg);
  box-shadow: var(--tool-object-shadow);
  touch-action: none;
}

.privacy-blur-page .device-stage,
.screen-ruler-page .device-stage,
.audio-snipper-page .device-stage {
  min-height: 32rem;
}

.picture-shrinker-page,
.privacy-blur-page {
  --category-gradient: var(--category-picture-bench);
}

.photo-scrub-page {
  --category-gradient: var(--category-file-oddities);
}

.favicon-lab-page {
  --category-gradient: var(--category-web-bits);
}

.kindle-tool-page {
  --category-gradient: var(--category-setup-bay);
}

.privacy-stage,
.audio-stage,
.ruler-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 24rem;
  overflow: hidden;
}

.privacy-stage,
.audio-stage {
  min-height: 100%;
}

.privacy-stage .file-drop-zone,
.audio-stage .file-drop-zone {
  min-height: 100%;
}

.ruler-stage {
  min-height: 28rem;
  border: var(--line) solid var(--tool-object-border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--text-soft) 14%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--text-soft) 14%, transparent) 1px, transparent 1px),
    var(--tool-object-bg);
  background-size: 24px 24px;
  box-shadow: var(--tool-object-shadow);
}

.ruler-bar {
  position: absolute;
  display: grid;
  place-items: center;
  border: var(--line) solid var(--input-focus);
  border-radius: var(--radius-md);
  color: var(--button-text);
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, color-mix(in srgb, var(--button-text) 35%, transparent) 9px 10px),
    var(--button-bg);
  box-shadow: var(--shadow-medium);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.ruler-bar.is-vertical {
  background:
    repeating-linear-gradient(0deg, transparent 0 9px, color-mix(in srgb, var(--button-text) 35%, transparent) 9px 10px),
    var(--button-bg);
}

.ruler-bar:focus-visible {
  outline: 2px solid var(--input-focus);
  outline-offset: 3px;
}

.ruler-readout {
  padding: .25rem .5rem;
  border-radius: 999px;
  background: color-mix(in srgb, #000 24%, transparent);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--label-weight);
}

.ruler-handle {
  position: absolute;
  right: -.65rem;
  top: 50%;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  background: var(--button-text);
  box-shadow: var(--shadow-soft);
  transform: translateY(-50%);
  cursor: ew-resize;
}

.ruler-bar.is-vertical .ruler-handle {
  top: auto;
  right: 50%;
  bottom: -.65rem;
  transform: translateX(50%);
  cursor: ns-resize;
}

.audio-wave-wrap {
  position: relative;
  display: grid;
  width: 100%;
}

.audio-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  border-inline: 2px solid var(--input-focus);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  pointer-events: none;
}

.audio-handle {
  position: absolute;
  top: -.35rem;
  bottom: -.35rem;
  width: 1rem;
  border-radius: 999px;
  background: var(--button-bg);
  box-shadow: var(--shadow-medium);
  cursor: ew-resize;
  touch-action: none;
  transform: translateX(-50%);
}

.audio-time-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  color: var(--text-muted);
  font-family: var(--font-plain);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

.rich-paste-area,
.tool-output {
  width: 100%;
  min-height: 14rem;
  padding: var(--space-3);
  border: var(--line) solid var(--input-border);
  border-radius: var(--radius-lg);
  background: var(--form-bg);
  color: var(--text-body);
  box-shadow: var(--inset-highlight);
  font-family: var(--font-plain);
  font-size: clamp(.88rem, 1vw, 1rem);
  font-weight: 600;
  line-height: 1.55;
}

.rich-paste-area {
  overflow: auto;
}

.rich-paste-area:empty::before {
  content: attr(data-placeholder);
  color: var(--text-soft);
}

.tool-output {
  white-space: pre-wrap;
}

.image-drop-zone {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 22rem;
  border: var(--line) dashed var(--tool-object-border);
  border-radius: var(--radius-xl);
  background: var(--tool-object-bg);
  box-shadow: var(--drop-zone-shadow);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform var(--speed) var(--ease-snap),
    border-color var(--speed-fast) var(--ease-calm),
    box-shadow var(--speed-fast) var(--ease-calm);
}

.image-drop-zone:hover,
.image-drop-zone.dragover {
  border-color: var(--input-focus);
  transform: var(--hover-lift);
}

.image-drop-zone img {
  display: none;
  width: 100%;
  height: 100%;
  max-height: 34rem;
  object-fit: contain;
}

.image-drop-zone.has-image {
  padding: var(--space-3);
}

.image-drop-zone.has-image .drop-prompt {
  display: none;
}

.image-drop-zone.has-image img {
  display: block;
}

.picture-shrinker-page .device-stage {
  place-items: stretch;
}

.picture-shrinker-page .image-drop-zone {
  min-height: 100%;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 28rem);
  max-height: 70vh;
  border: var(--line) dashed var(--tool-object-border);
  border-radius: var(--radius-xl);
  background: var(--tool-object-bg);
  box-shadow: var(--tool-object-shadow);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform var(--speed) var(--ease-snap),
    border-color var(--speed-fast) var(--ease-calm),
    box-shadow var(--speed-fast) var(--ease-calm);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--input-focus);
  transform: var(--hover-lift);
}

.drop-zone.dragover {
  background: var(--surface-tint), var(--category-pictures);
}

.drop-prompt {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: .4rem;
  width: 100%;
  padding: var(--space-4);
  color: var(--text-muted);
  text-align: center;
  pointer-events: none;
  font-family: var(--font-plain);
}

.drop-prompt__icon {
  display: grid;
  place-items: center;
  width: 4.2rem;
  aspect-ratio: 1;
  margin-bottom: .3rem;
  color: var(--text-on-accent);
  border-radius: var(--radius-lg);
  background: var(--category-pictures);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  font-size: 2.4rem;
  font-weight: var(--heading-weight);
}

.drop-prompt strong {
  color: var(--text-brand);
  font-family: var(--font-main);
  font-size: var(--step-1);
  line-height: 1;
  letter-spacing: 0;
  font-weight: var(--heading-weight);
}

.drop-prompt small {
  max-width: 22ch;
  color: var(--text-soft);
  font-size: var(--step--1);
  font-weight: var(--body-weight);
}

.upload-drop-zone {
  position: relative;
  overflow: hidden;
}

.upload-drop-zone.dragover {
  background: var(--surface-tint), var(--category-gradient, var(--category-picture-bench));
}

.upload-drop-zone .drop-prompt {
  position: relative;
  inset: auto;
  width: min(100%, 22rem);
}

.upload-drop-zone .drop-prompt__icon {
  background: var(--category-gradient, var(--category-picture-bench));
}

#previewCanvas {
  display: none;
  max-width: 100%;
  max-height: 70vh;
  cursor: grab;
  filter: grayscale(100%) contrast(110%);
}

#previewCanvas:active {
  cursor: grabbing;
}

#loadingOverlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  color: var(--loading-text);
  background: var(--loading-bg);
  backdrop-filter: blur(8px);
  font-weight: var(--label-weight);
}

@media (max-width: 1100px) {
  .tool-dock,
  .workshop-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbox-layout {
    grid-template-columns: 1fr;
  }

  .bench-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
  }

  .bench-nav .mini-label {
    width: 100%;
  }

  .tool-shelf {
    grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  }

  .tool-tile--hero {
    min-height: 14rem;
  }
}

@media (max-width: 980px) {
  .hero,
  .toolbox-hero,
  .tool-hero,
  .tool-workspace {
    grid-template-columns: 1fr;
  }

  .hero-console {
    max-width: 38rem;
    margin-inline: auto;
  }

  .feature-strip {
    grid-template-columns: 1fr;
  }

  .workbench__header {
    grid-template-columns: 1fr;
  }

  .tool-controls,
  .canvas-bench {
    order: 0;
  }

  .layout-input-first .tool-controls,
  .layout-control-first .tool-controls {
    order: 1;
  }

  .layout-input-first .canvas-bench,
  .layout-control-first .canvas-bench {
    order: 2;
  }

  .layout-preview-first .canvas-bench,
  .layout-live-canvas .canvas-bench,
  .layout-inspector .canvas-bench,
  .layout-stepper .canvas-bench {
    order: 1;
  }

  .layout-preview-first .tool-controls,
  .layout-live-canvas .tool-controls,
  .layout-inspector .tool-controls,
  .layout-stepper .tool-controls {
    order: 2;
  }

  .device-stage {
    min-height: 36rem;
  }

  .device-stage--compact {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  :root {
    --header-gap: var(--space-2);
    --nav-gap: .25rem;
    --nav-padding: .28rem;
    --theme-switch-padding: .28rem;
  }

  .site-header {
    flex-wrap: wrap;
  }

  .theme-switch {
    margin-left: var(--space-1);
  }
}

@media (max-width: 680px) {
  :root {
    --gutter: 1rem;
    --step-1: 1.06rem;
    --step-2: 1.38rem;
    --step-3: 1.85rem;
    --step-4: 3rem;
    --brand-name-size: 1.72rem;
    --brand-line-size: .8rem;
    --header-padding-y: var(--space-3);
    --header-gap: .65rem;
    --nav-padding: .25rem;
    --theme-switch-padding: .25rem;
  }

  html {
    background-attachment: scroll;
    background-size: 100vw 140svh;
    background-position: 0 0;
    background-repeat: repeat-y;
  }

  input[type="text"],
  input[type="search"],
  select,
  textarea,
  .tool-search input,
  .tool-search__box input[type="search"] {
    font-size: 16px;
  }

  .site-header {
    align-items: center;
  }

  .theme-switch button {
    padding-inline: .6rem;
  }

  .hero,
  .toolbox-hero,
  .tool-hero,
  .workshop-map,
  .workbench,
  .tool-workspace,
  .tool-controls,
  .canvas-bench {
    padding: var(--space-4);
    border-radius: var(--radius-xl);
  }

  .hero h1,
  .toolbox-hero h1,
  .tool-hero h1 {
    max-width: 11ch;
  }

  .hero-text,
  .section-intro p,
  .app-panel p,
  .toolbox-hero p,
  .tool-hero p {
    font-size: var(--step-0);
  }

  .hero-actions,
  .app-panel {
    align-items: stretch;
  }

  .tool-search--compact {
    width: 100%;
    max-width: none;
  }

  .button {
    width: 100%;
  }

  .search-popover {
    max-width: calc(100vw - 1.25rem);
    padding: .55rem;
    border-radius: var(--radius-lg);
  }

  .search-result {
    padding: .78rem;
  }

  .hero-console {
    max-width: calc(100% - 1rem);
    transform: rotate(.65deg);
  }

  html[data-theme="nova"] .hero-console {
    transform: none;
  }

  .tool-dock,
  .workshop-map,
  .tool-shelf,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .dock-card,
  .tool-tile {
    min-height: auto;
  }

  .tool-tile__status {
    margin-bottom: var(--space-3);
  }

  .workshop-zone {
    min-height: 11rem;
  }

  .workbench__title {
    align-items: flex-start;
  }

  .workbench__badge,
  .tool-hero__badge {
    width: 3.8rem;
    border-radius: var(--radius-md);
  }

  .tool-hero__badge .icon-glyph {
    font-size: 2rem;
  }

  .app-panel,
  .site-footer {
    flex-direction: column;
  }

  .bench-topline {
    display: grid;
    align-items: start;
  }

  .device-stage {
    min-height: 31rem;
    padding: var(--space-3);
  }

  .drop-zone {
    width: min(100%, 22rem);
  }
}

@media (max-width: 430px) {
  :root {
    --brand-name-size: 1.5rem;
    --brand-line-size: .76rem;
    --header-gap: .55rem;
    --nav-gap: .18rem;
  }

  .theme-switch {
    margin-left: var(--space-1);
  }
}

@media (max-width: 520px) {
  .brand {
    flex-basis: 100%;
  }

  .top-nav {
    margin-left: 0;
    max-width: calc(100% - 8.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
