/* ApplyReady interface styles.
   One stylesheet owns how the interface looks. The resume paper and its print layout live in
   document.css (resume.html only) and are never restyled here. Every value comes from a token
   in section 0; docs/DESIGN_SYSTEM.md describes the tokens and patterns exactly as written here.

   0  Tokens            6  Choice controls      12 Tool workspace
   1  Base              7  Tabs and disclosure  13 Tool specifics
   2  Layout            8  Feedback             14 Resume builder
   3  Site header       9  Dialogs and toasts   15 Responsive
   4  Site footer      10  Reading content      16 Print and motion
   5  Buttons, fields  11  Page patterns
*/

/* ================================================================== 0. TOKENS */
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: optional; src: url('../assets/fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'Inter Fallback'; src: local('Arial'); size-adjust: 107.64%; ascent-override: 90.49%; descent-override: 22.56%; line-gap-override: 0%; }
@font-face { font-family: 'ApplyReady Devanagari'; font-style: normal; font-weight: 100 900; font-display: optional; src: url('../assets/fonts/noto-devanagari.woff2') format('woff2'); unicode-range: U+0900-097F,U+1CD0-1CFF,U+200C-200D,U+20A8-20B9,U+A830-A839,U+A8E0-A8FF,U+11B00-11B09; }

:root {
  color-scheme: light;

  /* Colour: warm neutral "paper" greys */
  --c-bg: #f6f6f4;
  --c-surface: #ffffff;
  --c-surface-2: #f1f1ee;
  --c-surface-3: #e6e6e1;
  --c-desk: #e9e9e4;
  --c-line: #e4e4df;
  --c-line-strong: #cfcfc8;
  --c-field-line: #8a8a82;       /* 3:1 or better on bg, surface and surface-2 */
  --c-text: #191917;
  --c-text-2: #3b3b36;
  --c-text-3: #5f5f58;
  --c-text-4: #9a9a92;           /* disabled only */
  --c-backdrop: rgba(20, 20, 18, .5);

  /* Colour: ApplyReady ink (action, selection, links, focus) */
  --c-accent: #3a3ab0;
  --c-accent-hover: #2e2e93;
  --c-accent-press: #252578;
  --c-accent-soft: #efeffb;
  --c-accent-line: #c3c3ee;
  --c-on-accent: #ffffff;
  --c-focus: #3a3ab0;
  --c-focus-ring: rgba(58, 58, 176, .22);

  /* Colour: status (meaning only, never decoration) */
  --c-success: #1d6b3a;  --c-success-soft: #eaf5ee;  --c-success-line: #a9d5b8;
  --c-warning: #835000;  --c-warning-soft: #fbf1dc;  --c-warning-line: #e5c27a;
  --c-danger: #b3261e;   --c-danger-soft: #fcecea;   --c-danger-line: #efb4ae;

  /* Type: ten roles */
  --font: Inter, 'Inter Fallback', 'ApplyReady Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 12px;    /* metadata, captions */
  --fs-sm: 13px;    /* helper text, footnotes */
  --fs-label: 14px; /* field labels, compact controls, menus */
  --fs-md: 15px;    /* interface text, buttons, inputs */
  --fs-lg: 16px;    /* lead interface text, large buttons */
  --fs-read: 17px;  /* long-form reading */
  --fs-xl: 19px;    /* panel and result headings */
  --fs-2xl: 23px;   /* section headings */
  --fs-3xl: 30px;   /* page and tool titles */
  --fs-4xl: 38px;   /* product title on the home page */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-strong: 600;
  --lh-tight: 1.2;
  --lh-ui: 1.45;
  --lh-read: 1.7;
  --ls-title: -.018em;

  /* Space: 4 point scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* Controls */
  --h-sm: 32px;
  --h-md: 40px;
  --h-lg: 48px;
  --h-header: 56px;
  --icon: 16px;
  --field-fs: var(--fs-md);

  /* Shape and depth */
  --r-xs: 4px;      /* tags, checkboxes, segments */
  --r-sm: 6px;      /* buttons, fields */
  --r-md: 8px;      /* panels, menus, lists */
  --r-lg: 12px;     /* dialogs */
  --r-full: 999px;  /* switches, round markers */
  --bw: 1px;
  --sh-pop: 0 1px 2px rgba(20, 20, 18, .06), 0 8px 24px rgba(20, 20, 18, .12);
  --sh-dialog: 0 2px 6px rgba(20, 20, 18, .08), 0 24px 56px rgba(20, 20, 18, .22);
  --sh-paper: 0 1px 2px rgba(20, 20, 18, .1), 0 6px 20px rgba(20, 20, 18, .1);

  /* Layout */
  --w-read: 700px;
  --w-app: 1200px;
  --w-wide: 1440px;
  --w-rail: 340px;
  --gutter: 16px;

  /* Motion */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --t-fast: 120ms;
  --t-base: 180ms;

  /* Stacking */
  --z-sticky: 30;
  --z-header: 40;
  --z-pop: 60;
  --z-dialog: 80;
  --z-toast: 90;

  /* Icon masks (checks, selects, disclosures) */
  --mask-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --mask-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4l3 3 6.6-6.9' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --mask-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1000px) { :root { --gutter: 32px; } }
@media (pointer: coarse) { :root { --h-sm: 40px; --h-md: 44px; --h-lg: 48px; --field-fs: var(--fs-lg); } }

[data-theme='dark'] {
  color-scheme: dark;
  --c-bg: #111111;
  --c-surface: #1a1a19;
  --c-surface-2: #222221;
  --c-surface-3: #2d2d2b;
  --c-desk: #0c0c0c;
  --c-line: #2c2c2a;
  --c-line-strong: #3e3e3b;
  --c-field-line: #77776f;
  --c-text: #ededea;
  --c-text-2: #c8c8c2;
  --c-text-3: #9d9d96;
  --c-text-4: #66665f;
  --c-backdrop: rgba(0, 0, 0, .66);
  --c-accent: #a3a4ff;
  --c-accent-hover: #bebfff;
  --c-accent-press: #d3d4ff;
  --c-accent-soft: #24244a;
  --c-accent-line: #45458a;
  --c-on-accent: #15153a;
  --c-focus: #a3a4ff;
  --c-focus-ring: rgba(163, 164, 255, .3);
  --c-success: #73d39b;  --c-success-soft: #13261a;  --c-success-line: #2a5a3b;
  --c-warning: #eabb52;  --c-warning-soft: #2a2111;  --c-warning-line: #66501f;
  --c-danger: #ff938a;   --c-danger-soft: #2f1715;   --c-danger-line: #6f2c27;
  --sh-pop: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .5);
  --sh-dialog: 0 24px 56px rgba(0, 0, 0, .66);
  --sh-paper: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .45);
}

/* ================================================================== 1. BASE */
* { box-sizing: border-box; margin: 0; padding: 0; }
::before, ::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--h-header) + var(--s-4)); scroll-padding-bottom: 96px; }
body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-ui);
  background-color: var(--c-bg);
  color: var(--c-text-2);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
:where(h1, h2, h3, h4, h5, h6) { font-weight: var(--fw-strong); line-height: var(--lh-tight); color: var(--c-text); }
:where(strong, b) { font-weight: var(--fw-strong); }
small { font-size: var(--fs-sm); }
sub, sup { font-size: var(--fs-xs); }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
:where(ul, ol) { list-style-position: outside; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
:disabled, [aria-disabled='true'] { cursor: not-allowed; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: var(--bw) solid var(--c-line); }
code, kbd { font-family: var(--font-mono); font-size: .9em; padding: 1px 5px; border: var(--bw) solid var(--c-line); border-radius: var(--r-xs); background: var(--c-surface-2); color: var(--c-text); }
@media screen { body { text-rendering: optimizeLegibility; } }
[hidden], .hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; top: -80px; left: var(--s-4); z-index: calc(var(--z-toast) + 1); padding: var(--s-3) var(--s-4); background: var(--c-text); color: var(--c-surface); border-radius: var(--r-sm); font-weight: var(--fw-medium); }
.skip-link:focus { top: var(--s-3); text-decoration: none; }
.noscript-note { padding: var(--s-3) var(--s-4); text-align: center; background: var(--c-warning-soft); color: var(--c-text); border-bottom: var(--bw) solid var(--c-warning-line); font-size: var(--fs-label); }
.fa-solid, .fa-regular { font-size: var(--icon); line-height: 1; }
.fa-spin { animation: ar-spin .8s linear infinite; }
@keyframes ar-spin { to { transform: rotate(360deg); } }
@keyframes ar-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes ar-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ar-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ================================================================== 2. LAYOUT */
.page { flex: 1 0 auto; width: 100%; max-width: calc(var(--w-app) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s-6) var(--gutter) var(--s-8); }
.page--wide { max-width: calc(var(--w-wide) + 2 * var(--gutter)); }
.page--read { max-width: calc(var(--w-read) + 2 * var(--gutter)); }
.section { margin-top: var(--s-8); }
.section-title { font-size: var(--fs-2xl); letter-spacing: var(--ls-title); margin-bottom: var(--s-4); }
.section-lede { color: var(--c-text-3); font-size: var(--fs-lg); margin: calc(-1 * var(--s-2)) 0 var(--s-5); max-width: 64ch; }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.muted, .text-muted { color: var(--c-text-3); }
.form-stack { display: grid; gap: var(--s-4); max-width: 480px; }
.nowrap { white-space: nowrap; }

/* Page head: where am I, in one glance */
.page-head { margin-bottom: var(--s-6); max-width: 780px; }
.eyebrow { display: block; margin-bottom: var(--s-2); font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--c-text-3); }
.page-title { font-size: var(--fs-3xl); line-height: 1.15; letter-spacing: var(--ls-title); text-wrap: balance; }
.page-lede { margin-top: var(--s-3); font-size: var(--fs-xl); font-weight: var(--fw-regular); line-height: 1.5; color: var(--c-text-2); max-width: 62ch; text-wrap: pretty; }
.assurance { display: flex; align-items: flex-start; gap: var(--s-2); margin-top: var(--s-4); color: var(--c-text-3); font-size: var(--fs-label); line-height: 1.45; }
.assurance > .fa-solid { margin-top: 2px; font-size: 12px; color: var(--c-text-3); flex: none; }
.assurance strong { color: var(--c-text-2); font-weight: var(--fw-medium); }
.page-head--home { max-width: 860px; }
.page-head--home .page-title { font-size: var(--fs-4xl); line-height: 1.1; }

.breadcrumb-nav { margin-bottom: var(--s-4); font-size: var(--fs-label); color: var(--c-text-3); }
.breadcrumb-list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); list-style: none; }
.breadcrumb-item + .breadcrumb-item::before { content: '/'; margin-right: var(--s-2); color: var(--c-text-4); }
.breadcrumb-nav .breadcrumb-item a { color: var(--c-text-3); text-decoration: none; }
.breadcrumb-nav .breadcrumb-item a:hover { color: var(--c-text); text-decoration: underline; }
.breadcrumb-item[aria-current='page'], .breadcrumb-item.active { color: var(--c-text-2); }
.lang-switch { display: inline-flex; align-items: center; min-height: var(--h-sm); margin-left: auto; font-size: var(--fs-label); font-weight: var(--fw-medium); }
.breadcrumb-nav:has(.lang-switch) { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }

/* ================================================================== 3. SITE HEADER */
.site-header { position: sticky; top: 0; z-index: var(--z-header); background: var(--c-surface); border-bottom: var(--bw) solid var(--c-line); }
.site-header__inner { max-width: calc(var(--w-app) + 2 * var(--gutter)); height: var(--h-header); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: var(--s-6); }
.brand { display: inline-flex; align-items: center; min-height: var(--h-md); gap: 10px; color: var(--c-text); font-weight: var(--fw-strong); font-size: var(--fs-lg); letter-spacing: -.01em; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 26px; height: 26px; border-radius: var(--r-sm); display: block; }
.site-nav { display: flex; flex: 1; min-width: 0; align-items: center; }
.site-nav__list { display: flex; align-items: center; gap: var(--s-1); list-style: none; flex: 1; }
.site-nav__lang { margin-left: auto; }
.site-nav__link { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s-3); border-radius: var(--r-sm); font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--c-text-2); transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.site-nav__link:hover { background: var(--c-surface-2); color: var(--c-text); text-decoration: none; }
.site-nav__link[aria-current='page'] { color: var(--c-text); }
.site-nav__link[aria-current='page']::after { content: ''; position: absolute; left: var(--s-3); right: var(--s-3); bottom: -10px; height: 2px; background: var(--c-accent); border-radius: 1px; }
.site-nav__link[aria-expanded='true'] { background: var(--c-surface-2); color: var(--c-text); }
.site-nav__link .fa-chevron-down { font-size: 12px; color: var(--c-text-3); transition: transform var(--t-base) var(--ease); }
.site-nav__link[aria-expanded='true'] .fa-chevron-down { transform: rotate(180deg); }
.site-nav__item { position: relative; }
.site-header__tools { display: flex; align-items: center; gap: var(--s-1); }
.site-header .nav-toggle { display: none; }

/* Tools menu: what you can do on the left, quick routes on the right */
.menu { position: absolute; top: calc(100% + 10px); left: calc(-1 * var(--s-2)); z-index: var(--z-pop); width: min(660px, calc(100vw - 2 * var(--gutter))); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: var(--c-surface); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-md); box-shadow: var(--sh-pop); overflow: hidden; animation: ar-pop var(--t-base) var(--ease); }
.menu__group { padding: var(--s-4) var(--s-3); }
.menu__group--refs { background: var(--c-surface-2); border-left: var(--bw) solid var(--c-line); }
.menu__title { font-size: var(--fs-xs); font-weight: var(--fw-strong); line-height: var(--lh-tight); color: var(--c-text-3); padding: 0 var(--s-2) var(--s-2); }
.menu__list + .menu__title { margin-top: var(--s-4); }
.menu__list { list-style: none; }
.menu__item { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-2); border-radius: var(--r-sm); color: var(--c-text); }
.menu__item:hover { background: var(--c-surface-2); text-decoration: none; }
.menu__group--refs .menu__item:hover { background: var(--c-surface-3); }
.menu__icon { width: 20px; margin-top: 2px; text-align: center; color: var(--c-text-3); flex: none; }
.menu__text { display: grid; gap: 1px; min-width: 0; }
.menu__name { font-size: var(--fs-label); font-weight: var(--fw-medium); }
.menu__desc { font-size: var(--fs-sm); color: var(--c-text-3); }
.menu__item[aria-current='page'] .menu__name { color: var(--c-accent); }
.menu__item[aria-current='page'] .menu__icon { color: var(--c-accent); }

body.resume-page .site-header__inner, body.resume-page .site-footer__inner { max-width: calc(var(--w-wide) + 2 * var(--gutter)); }
body.resume-page .site-footer__base { max-width: var(--w-wide); }

/* ================================================================== 4. SITE FOOTER */
.site-footer { margin-top: auto; border-top: var(--bw) solid var(--c-line); color: var(--c-text-3); font-size: var(--fs-label); background: var(--c-surface); }
.site-footer__inner { max-width: calc(var(--w-app) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s-7) var(--gutter) var(--s-6); display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); gap: var(--s-6); }
.site-footer__brand .brand { font-size: var(--fs-md); }
.site-footer__brand p { margin-top: var(--s-3); max-width: 34ch; line-height: 1.6; }
.site-footer__title { font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--c-text); margin-bottom: var(--s-2); }
.site-footer__list { list-style: none; }
.site-footer__list a { display: flex; align-items: center; min-height: var(--h-sm); color: var(--c-text-3); }
.site-footer__list a:hover { color: var(--c-text); }
.site-footer__list a[aria-current='page'] { color: var(--c-text); font-weight: var(--fw-medium); }
.site-footer__base { max-width: var(--w-app); width: calc(100% - 2 * var(--gutter)); margin: 0 auto; padding: var(--s-4) 0 var(--s-5); border-top: var(--bw) solid var(--c-line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-4); font-size: var(--fs-sm); }
.site-footer__base .fa-solid { font-size: 12px; margin-right: var(--s-1); }

/* ================================================================== 5. BUTTONS AND FIELDS */
.btn {
  --btn-bg: var(--c-surface); --btn-fg: var(--c-text); --btn-line: var(--c-line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--h-md); max-width: 100%; padding: var(--s-1) var(--s-4);
  background: var(--btn-bg); color: var(--btn-fg); border: var(--bw) solid var(--btn-line); border-radius: var(--r-sm);
  font-size: var(--fs-md); font-weight: var(--fw-medium); line-height: 1.2; text-align: center;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:hover { background: var(--c-surface-2); text-decoration: none; }
.btn:active { background: var(--c-surface-3); }
.btn .fa-solid, .btn .fa-regular { flex-shrink: 0; }
.btn-primary { --btn-bg: var(--c-accent); --btn-fg: var(--c-on-accent); --btn-line: var(--c-accent); }
.btn-primary:hover { background: var(--c-accent-hover); border-color: var(--c-accent-hover); }
.btn-primary:active { background: var(--c-accent-press); border-color: var(--c-accent-press); }
.btn-secondary { /* the default look, kept as an explicit name */ }
.btn-ghost { --btn-bg: transparent; --btn-line: transparent; --btn-fg: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-link { --btn-bg: transparent; --btn-line: transparent; --btn-fg: var(--c-accent); padding-inline: var(--s-2); }
.btn-link:hover { background: var(--c-accent-soft); }
.btn-danger { --btn-fg: var(--c-danger); --btn-line: var(--c-danger-line); }
.btn-danger:hover { background: var(--c-danger-soft); }
.btn-danger-ghost { --btn-bg: transparent; --btn-line: transparent; --btn-fg: var(--c-text-3); }
.btn-danger-ghost:hover, .btn-danger-ghost:focus-visible { background: var(--c-danger-soft); color: var(--c-danger); }
.btn-danger-solid { --btn-bg: var(--c-danger); --btn-fg: var(--c-surface); --btn-line: var(--c-danger); }
.btn-danger-solid:hover { background: var(--c-danger); filter: brightness(.92); }
.btn-sm { min-height: var(--h-sm); padding: var(--s-1) var(--s-3); font-size: var(--fs-label); }
.btn-lg { min-height: var(--h-lg); padding: var(--s-2) var(--s-5); font-size: var(--fs-lg); font-weight: var(--fw-strong); }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: var(--h-md); padding: 0; flex-shrink: 0; }
.btn-icon.btn-sm { width: var(--h-sm); }
.btn:disabled, .btn[aria-disabled='true'] { --btn-bg: var(--c-surface-2); --btn-fg: var(--c-text-4); --btn-line: var(--c-line); cursor: not-allowed; pointer-events: none; }
.btn-ghost:disabled, .btn-danger-ghost:disabled { --btn-bg: transparent; --btn-line: transparent; }
.btn[aria-busy='true'] { cursor: progress; --btn-bg: var(--c-accent); --btn-fg: var(--c-on-accent); --btn-line: var(--c-accent); opacity: .85; }

/* Fields: label, control, optional helper, error under the field */
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field-label { font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--c-text); line-height: 1.35; }
.optional { font-weight: var(--fw-regular); color: var(--c-text-3); }
.field-hint, .form-hint { font-size: var(--fs-sm); line-height: 1.5; color: var(--c-text-3); }
.field-error { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); font-weight: var(--fw-medium); line-height: 1.4; color: var(--c-danger); }
.field-error::before { content: '!'; flex: none; display: grid; place-items: center; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; background: var(--c-danger); color: var(--c-surface); font-size: 11px; font-weight: 700; line-height: 1; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ws-custom .field-row { align-items: end; }
.input, .textarea {
  display: block; width: 100%; min-height: var(--h-md); padding: 0 var(--s-3);
  background: var(--c-surface); color: var(--c-text); border: var(--bw) solid var(--c-field-line); border-radius: var(--r-sm);
  font-size: var(--field-fs); line-height: 1.4;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.textarea { min-height: 104px; padding: 10px var(--s-3); resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--c-text-3); opacity: .8; }
.input:hover:not(:disabled), .textarea:hover:not(:disabled) { border-color: var(--c-text-3); }
.input:focus, .textarea:focus { outline: none; border-color: var(--c-focus); box-shadow: 0 0 0 3px var(--c-focus-ring); }
.input:disabled, .textarea:disabled { background: var(--c-surface-2); color: var(--c-text-4); border-color: var(--c-line-strong); cursor: not-allowed; }
.input.is-invalid, .textarea.is-invalid, .input[aria-invalid='true'], .textarea[aria-invalid='true'] { border-color: var(--c-danger); background: var(--c-danger-soft); }
.input.is-invalid:focus, .input[aria-invalid='true']:focus { box-shadow: 0 0 0 3px var(--c-danger-line); }
input[type='number'] { -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type='date'] { appearance: none; -webkit-appearance: none; min-width: 0; }
input[type='date']::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .65; }
[data-theme='dark'] input[type='date']::-webkit-calendar-picker-indicator { filter: invert(1); }
.input-unit { position: relative; }
.input-unit .input { padding-right: 48px; }
.input-unit__text { position: absolute; right: var(--s-3); top: 50%; transform: translateY(-50%); font-size: var(--fs-label); color: var(--c-text-3); pointer-events: none; }
.input-group { display: flex; }
.input-group .input, .input-group .select { flex: 1; min-width: 0; }
.input-group .input, .input-group .select-btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }

/* ================================================================== 6. CHOICE CONTROLS */
/* Select: the native <select> stays in the DOM; a button and a listbox are drawn over it */
.select { position: relative; display: block; width: 100%; min-width: 0; }
.select > select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.select-btn { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); width: 100%; min-height: var(--h-md); padding: 0 var(--s-3); background: var(--c-surface); color: var(--c-text); border: var(--bw) solid var(--c-field-line); border-radius: var(--r-sm); font-size: var(--field-fs); text-align: left; cursor: pointer; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.select-btn:hover:not(:disabled) { border-color: var(--c-text-3); }
.select-btn:focus-visible, .select.is-open .select-btn { outline: none; border-color: var(--c-focus); box-shadow: 0 0 0 3px var(--c-focus-ring); }
.select-btn:disabled { background: var(--c-surface-2); color: var(--c-text-4); border-color: var(--c-line-strong); }
.select.is-invalid .select-btn { border-color: var(--c-danger); }
.select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-value.is-placeholder { color: var(--c-text-3); }
.select-btn::after { content: ''; flex: none; width: 14px; height: 14px; background: var(--c-text-3); -webkit-mask: var(--mask-chevron) center/contain no-repeat; mask: var(--mask-chevron) center/contain no-repeat; transition: transform var(--t-base) var(--ease); }
.select.is-open .select-btn::after { transform: rotate(180deg); }
.select-list { position: fixed; z-index: var(--z-pop); overflow-y: auto; overscroll-behavior: contain; padding: var(--s-1); background: var(--c-surface); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-md); box-shadow: var(--sh-pop); animation: ar-pop var(--t-fast) var(--ease); }
.select-list[hidden] { display: none; }
.select-opt { position: relative; display: flex; align-items: center; min-height: var(--h-sm); padding: 6px var(--s-6) 6px var(--s-3); border-radius: var(--r-xs); font-size: var(--fs-md); color: var(--c-text); cursor: pointer; line-height: 1.35; }
.select-opt:hover, .select-opt.is-active { background: var(--c-surface-2); }
.select-opt[aria-selected='true'] { font-weight: var(--fw-medium); color: var(--c-accent); }
.select-opt[aria-selected='true']::after { content: ''; position: absolute; right: var(--s-3); top: 50%; width: 14px; height: 14px; margin-top: -7px; background: currentColor; -webkit-mask: var(--mask-check) center/contain no-repeat; mask: var(--mask-check) center/contain no-repeat; }
.select-opt[aria-disabled='true'] { color: var(--c-text-4); cursor: not-allowed; }
.select-opt:focus { outline: none; }
.select-opt:focus-visible { outline: 2px solid var(--c-focus); outline-offset: -2px; }

/* Checkbox, radio, switch: native inputs, drawn here */
.check, .switch { display: inline-flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; font-size: var(--fs-md); color: var(--c-text); line-height: 1.4; min-height: 24px; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 1px 0 0; background: var(--c-surface); border: var(--bw) solid var(--c-field-line); display: grid; place-content: center; cursor: pointer; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.check input { border-radius: var(--r-xs); }
.check input::before { content: ''; width: 12px; height: 12px; background: var(--c-on-accent); transform: scale(0); transition: transform var(--t-fast) var(--ease); -webkit-mask: var(--mask-check) center/contain no-repeat; mask: var(--mask-check) center/contain no-repeat; }
.check input:checked, .check input:indeterminate { background: var(--c-accent); border-color: var(--c-accent); }
.check input:checked::before { transform: scale(1); }
.check input:indeterminate::before { -webkit-mask-image: var(--mask-dash); mask-image: var(--mask-dash); transform: scale(1); }
.check:hover input:not(:disabled):not(:checked) { border-color: var(--c-text-3); }
.check input:focus-visible, .switch input:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.check input:disabled { background: var(--c-surface-2); border-color: var(--c-line-strong); cursor: not-allowed; }
.check input:disabled ~ span { color: var(--c-text-4); }
.check:has(input:disabled) { cursor: not-allowed; }
.switch { align-items: center; justify-content: space-between; width: 100%; min-height: var(--h-sm); }
.switch input { appearance: none; -webkit-appearance: none; order: 2; flex: none; position: relative; width: 36px; height: 20px; margin: 0; border-radius: var(--r-full); background: var(--c-field-line); border: 0; cursor: pointer; transition: background-color var(--t-base) var(--ease); }
.switch input::before { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--c-surface); transition: transform var(--t-base) var(--ease); }
.switch input:checked { background: var(--c-accent); }
.switch input:checked::before { transform: translateX(16px); background: var(--c-on-accent); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.switch--inline { width: auto; justify-content: flex-start; }
.switch--inline input { order: 0; }
.check-group { display: grid; gap: var(--s-2); }

/* Range */
.range-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.range-value { min-width: 3ch; font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--c-text); font-variant-numeric: tabular-nums; text-align: right; }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; --pct: 50%; }
input[type='range']::-webkit-slider-runnable-track { height: 4px; border-radius: var(--r-full); background: linear-gradient(to right, var(--c-accent) var(--pct), var(--c-surface-3) var(--pct)); }
input[type='range']::-moz-range-track { height: 4px; border-radius: var(--r-full); background: var(--c-surface-3); }
input[type='range']::-moz-range-progress { height: 4px; border-radius: var(--r-full); background: var(--c-accent); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--c-surface); border: 2px solid var(--c-accent); box-shadow: 0 1px 2px rgba(20, 20, 18, .2); }
input[type='range']::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--c-surface); border: 2px solid var(--c-accent); }
input[type='range']:focus-visible { outline: none; }
input[type='range']:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--c-focus-ring); }
input[type='range']:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--c-focus-ring); }
input[type='range']:disabled { opacity: .5; cursor: not-allowed; }

/* Segmented control: one choice among two to four views */
.segmented { display: inline-flex; gap: 2px; padding: 2px; background: var(--c-surface-2); border: var(--bw) solid var(--c-line); border-radius: var(--r-sm); max-width: 100%; }
.segmented > button { min-height: calc(var(--h-sm) - 4px); padding: 0 var(--s-3); border: var(--bw) solid transparent; border-radius: var(--r-xs); font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--c-text-3); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.segmented > button:hover { color: var(--c-text); }
.segmented > button[aria-pressed='true'], .segmented > button.active, .segmented > button[aria-selected='true'] { background: var(--c-surface); border-color: var(--c-line-strong); color: var(--c-text); box-shadow: 0 1px 1px rgba(20, 20, 18, .05); }
.segmented > button span { font-weight: var(--fw-regular); color: var(--c-text-3); font-variant-numeric: tabular-nums; }

/* Chips: filters only */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--h-sm); padding: 0 var(--s-3); background: var(--c-surface); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-sm); font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--c-text-2); cursor: pointer; white-space: nowrap; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.chip:hover { background: var(--c-surface-2); color: var(--c-text); }
.chip[aria-pressed='true'], .chip.active { background: var(--c-text); border-color: var(--c-text); color: var(--c-surface); }
.chip-sub { font-weight: var(--fw-regular); color: var(--c-text-3); }
.chip[aria-pressed='true'] .chip-sub, .chip.active .chip-sub { color: inherit; opacity: .8; }

/* Choice cards: one requirement among several, name first, consequence under it */
.choice { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 18px; grid-template-rows: auto auto; align-content: center; column-gap: var(--s-3); row-gap: 2px; width: 100%; min-width: 0; min-height: 64px; padding: var(--s-3) var(--s-4); text-align: left; color: var(--c-text); background: var(--c-surface); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-md); transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.choice:hover { background: var(--c-surface-2); border-color: var(--c-text-4); }
.choice__name { grid-column: 1; grid-row: 1; min-width: 0; font-size: var(--fs-md); font-weight: var(--fw-medium); line-height: 1.3; overflow-wrap: anywhere; }
.choice__spec { grid-column: 1; grid-row: 2; min-width: 0; font-size: var(--fs-sm); color: var(--c-text-3); line-height: 1.35; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.choice::after { content: ''; grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 18px; height: 18px; border: var(--bw) solid var(--c-field-line); border-radius: 50%; background: var(--c-surface); }
.choice[aria-pressed='true'] { background: var(--c-accent-soft); border-color: var(--c-accent); box-shadow: inset 0 0 0 1px var(--c-accent); }
.choice[aria-pressed='true'] .choice__name { color: var(--c-accent); font-weight: var(--fw-strong); }
.choice[aria-pressed='true'] .choice__spec { color: var(--c-text-2); }
.choice[aria-pressed='true']::after { border-color: var(--c-accent); background: var(--c-accent); box-shadow: inset 0 0 0 3px var(--c-surface); }

/* ================================================================== 7. TABS AND DISCLOSURE */
.tabs { display: flex; gap: var(--s-1); border-bottom: var(--bw) solid var(--c-line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--h-lg); padding: 0 var(--s-3); font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--c-text-3); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.tab:hover { color: var(--c-text); }
.tab[aria-selected='true'], .tab.active { color: var(--c-text); border-bottom-color: var(--c-accent); }
.tab-count { min-width: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--c-surface-3); color: var(--c-text-2); font-size: var(--fs-xs); font-weight: var(--fw-strong); line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.tab-count--error { background: var(--c-danger-soft); color: var(--c-danger); }
.tabpanel[hidden] { display: none; }

.disclosure { border-top: var(--bw) solid var(--c-line); }
.disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: var(--h-md); padding: var(--s-2) 0; font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--c-text); cursor: pointer; list-style: none; user-select: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: ''; flex: none; width: 14px; height: 14px; background: var(--c-text-3); -webkit-mask: var(--mask-chevron) center/contain no-repeat; mask: var(--mask-chevron) center/contain no-repeat; transition: transform var(--t-base) var(--ease); }
.disclosure[open] > summary::after { transform: rotate(180deg); }
.disclosure > summary:hover { color: var(--c-accent); }
.disclosure__body { display: grid; gap: var(--s-4); padding: var(--s-2) 0 var(--s-4); }

/* ================================================================== 8. FEEDBACK */
/* Inline message: stays beside what it is about. Severity is named by an icon and words, not colour alone. */
.notice { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); background: var(--c-surface-2); color: var(--c-text); font-size: var(--fs-md); line-height: 1.5; box-shadow: inset 3px 0 0 var(--c-line-strong); }
.notice > .fa-solid, .notice > .fa-regular { margin-top: 3px; flex: none; color: var(--c-text-3); }
.notice__body { flex: 1; min-width: 0; }
.notice--error { background: var(--c-danger-soft); box-shadow: inset 3px 0 0 var(--c-danger); }
.notice--error > .fa-solid { color: var(--c-danger); }
.notice--warning { background: var(--c-warning-soft); box-shadow: inset 3px 0 0 var(--c-warning); }
.notice--warning > .fa-solid { color: var(--c-warning); }
.notice--info { background: var(--c-accent-soft); box-shadow: inset 3px 0 0 var(--c-accent); }
.notice--info > .fa-solid { color: var(--c-accent); }
.badge { display: inline-flex; align-items: center; gap: var(--s-1); height: 22px; padding: 0 var(--s-2); border-radius: var(--r-xs); background: var(--c-surface-3); color: var(--c-text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; }
.badge--accent { background: var(--c-accent-soft); color: var(--c-accent); }
.progress { height: 6px; border-radius: var(--r-full); background: var(--c-surface-3); overflow: hidden; }
.progress > span, .progress-bar { display: block; height: 100%; background: var(--c-accent); border-radius: inherit; transition: width var(--t-base) var(--ease); }
.empty { display: grid; gap: var(--s-2); justify-items: center; text-align: center; padding: var(--s-6) var(--s-4); color: var(--c-text-3); }
.status-ok { color: var(--c-success) !important; }
.status-warning { color: var(--c-warning) !important; }

/* ================================================================== 9. DIALOGS AND TOASTS */
.dialog-backdrop { position: fixed; inset: 0; z-index: var(--z-dialog); display: flex; align-items: center; justify-content: center; padding: var(--s-4); background: var(--c-backdrop); animation: ar-fade var(--t-base) var(--ease); }
.dialog { display: flex; flex-direction: column; width: min(100%, 440px); max-height: calc(100dvh - 2 * var(--s-4)); background: var(--c-surface); color: var(--c-text-2); border: var(--bw) solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--sh-dialog); animation: ar-rise var(--t-base) var(--ease); }
.dialog--lg { width: min(100%, 920px); height: calc(100dvh - 2 * var(--s-4)); max-height: 960px; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: var(--bw) solid var(--c-line); }
.dialog__title { font-size: var(--fs-xl); }
.dialog__body { flex: 1; min-height: 0; overflow: auto; padding: var(--s-5); }
.dialog__foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-4) var(--s-5); border-top: var(--bw) solid var(--c-line); }
.dialog--confirm .dialog__head { border-bottom: 0; padding-bottom: 0; }
.dialog--confirm .dialog__body { padding-top: var(--s-3); line-height: 1.55; }
.dialog--confirm .dialog__foot { border-top: 0; padding-top: 0; }
.task-notification { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) var(--s-4); background: var(--c-text); color: var(--c-surface); border-radius: var(--r-md); box-shadow: var(--sh-pop); font-size: var(--fs-label); font-weight: var(--fw-medium); line-height: 1.45; opacity: 0; transform: translateY(8px); transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease); }
.task-notification { position: fixed; left: 50%; bottom: calc(var(--s-4) + env(safe-area-inset-bottom, 0px) + var(--toast-lift, 0px)); translate: -50% 0; z-index: var(--z-toast); width: max-content; max-width: min(520px, calc(100vw - 2 * var(--s-4))); pointer-events: none; }
.task-notification.is-visible { opacity: 1; transform: none; }
.task-notification.is-error { background: var(--c-danger); color: var(--c-surface); }
[data-theme='dark'] .task-notification.is-error { background: var(--c-danger-soft); color: var(--c-danger); border: var(--bw) solid var(--c-danger-line); }

/* ================================================================== 10. READING CONTENT */
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: var(--bw) solid var(--c-line-strong); border-bottom: var(--bw) solid var(--c-line-strong); }
.table-wrap:focus-visible { outline-offset: 0; }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-md); line-height: 1.5; font-variant-numeric: tabular-nums; }
:where(.table-wrap, .prose) table th { text-align: left; font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--c-text); padding: var(--s-3) var(--s-4) var(--s-3) 0; border-bottom: var(--bw) solid var(--c-line-strong); white-space: nowrap; vertical-align: bottom; }
:where(.table-wrap, .prose) table td { padding: var(--s-3) var(--s-4) var(--s-3) 0; border-bottom: var(--bw) solid var(--c-line); vertical-align: top; min-width: 96px; color: var(--c-text-2); }
:where(.table-wrap, .prose) table tr:last-child td { border-bottom: 0; }
:where(.table-wrap, .prose) table td strong { color: var(--c-text); }
.prose table { margin: var(--s-4) 0; }
.prose, .faq-answer, .callout, .guide-card, .page-head, .notice, .article { overflow-wrap: break-word; }
.prose { max-width: var(--w-read); font-size: var(--fs-read); line-height: var(--lh-read); color: var(--c-text-2); }
.prose > * + * { margin-top: var(--s-4); }
.prose h2 { margin-top: var(--s-7); font-size: var(--fs-2xl); line-height: 1.3; letter-spacing: var(--ls-title); text-wrap: balance; }
.prose > h2:first-child, .prose > :first-child { margin-top: 0; }
.prose h3 { margin-top: var(--s-6); font-size: var(--fs-xl); line-height: 1.35; }
.prose h4 { margin-top: var(--s-5); font-size: var(--fs-lg); }
.prose h2 .fa-solid, .prose h2 .fa-regular { display: none; }
.prose ul, .prose ol { padding-left: var(--s-5); }
.prose li + li { margin-top: var(--s-2); }
.prose li::marker { color: var(--c-text-3); }
.prose li > ul, .prose li > ol { margin-top: var(--s-2); }
.prose strong { color: var(--c-text); }
.prose a, .callout a, .faq-answer a, .notice a, .page-lede a, .section-lede a, .field-hint a, .assurance a, .article p a, .article li a { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.prose a:hover, .callout a:hover, .faq-answer a:hover, .notice a:hover, .article p a:hover, .article li a:hover { text-decoration-thickness: 2px; }
.prose a.btn, .prose a.btn:hover, .article a.btn, .article a.btn:hover, .callout a.btn, .prose a.guide-card, .prose a.related-tool, .prose a.resource-link { text-decoration: none; }
.prose img { border-radius: var(--r-md); }
.prose blockquote { padding-left: var(--s-4); border-left: 2px solid var(--c-line-strong); color: var(--c-text-2); }
.prose .table-wrap { margin: var(--s-5) 0; }
.prose code { font-size: .88em; }
/* Callout: a ruled aside, not a card */
.callout { padding: var(--s-1) 0 var(--s-1) var(--s-4); border-left: 2px solid var(--c-accent); color: var(--c-text-2); font-size: var(--fs-md); line-height: 1.6; max-width: var(--w-read); }
.callout.is-warning { border-left-color: var(--c-warning); }
.callout > * + * { margin-top: var(--s-2); }
.callout .text-muted { font-size: var(--fs-label); }
.section > .callout, .article > .callout, .callout + .callout { margin-top: var(--s-5); }
.guide-meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin-top: var(--s-4); font-size: var(--fs-label); color: var(--c-text-3); }
/* Screenshots and diagrams in guides: the image, then a quiet caption */
.shot { margin: var(--s-5) 0; max-width: 100%; }
.shot img, .shot svg { display: block; max-width: 100%; height: auto; border: var(--bw) solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); }
.shot svg { width: 100%; box-sizing: border-box; padding: var(--s-2) var(--s-3); }
/* On a phone a diagram keeps a readable text size and scrolls sideways inside its own frame. */
.shot:has(> svg) { overflow-x: auto; }
@media (max-width: 600px) { .shot > svg { min-width: 560px; } }
.shot figcaption { margin-top: var(--s-2); font-size: var(--fs-label); line-height: 1.5; color: var(--c-text-3); }
/* "Last checked against ..." and "Report an error" under exam and guide headings */
.checked-line { margin-top: var(--s-3); font-size: var(--fs-label); line-height: 1.5; color: var(--c-text-3); }
.checked-line strong { color: var(--c-text-2); font-weight: var(--fw-medium); }
.sources-list { font-size: var(--fs-md); }
.rb-howto { max-width: var(--w-read); }
.sources-list li + li { margin-top: var(--s-2); }
.prose .hub-list { list-style: none; padding: 0; margin: var(--s-4) 0 0; display: grid; gap: var(--s-4); }
.prose .hub-list > li { margin: 0; }
.hub-list__item { padding: 0 0 var(--s-4); border-bottom: var(--bw) solid var(--c-line); }
.hub-list__item p { margin: var(--s-1) 0 0; }
.hub-list__date { font-size: var(--fs-label); color: var(--c-text-3); }
/* Diagrams in guides: inline SVG drawn with the site tokens, so they follow the theme. */
.shot svg text { font-family: inherit; }
/* guide-diagrams:start: utility classes for the SVG figures in guides (fills, strokes and text sizes) */
.dg-color-text { color: var(--c-text); }
.dg-dash-3-4 { stroke-dasharray: 3 4; }
.dg-dash-5-4 { stroke-dasharray: 5 4; }
.dg-dash-6-5 { stroke-dasharray: 6 5; }
.dg-fill-accent { fill: var(--c-accent); }
.dg-fill-danger-soft { fill: var(--c-danger-soft); }
.dg-fill-on-accent { fill: var(--c-on-accent); }
.dg-fill-success { fill: var(--c-success); }
.dg-fill-success-soft { fill: var(--c-success-soft); }
.dg-fill-surface { fill: var(--c-surface); }
.dg-fill-surface-2 { fill: var(--c-surface-2); }
.dg-fill-text { fill: var(--c-text); }
.dg-fill-text-2 { fill: var(--c-text-2); }
.dg-fill-text-3 { fill: var(--c-text-3); }
.dg-fill-text-4 { fill: var(--c-text-4); }
.dg-fill-warning { fill: var(--c-warning); }
.dg-fo { margin: 0; line-height: 1.4; }
.dg-fs-12 { font-size: 12px; }
.dg-fs-13 { font-size: 13px; }
.dg-fs-14 { font-size: 14px; }
.dg-fw-600 { font-weight: 600; }
.dg-stroke-accent { stroke: var(--c-accent); }
.dg-stroke-danger { stroke: var(--c-danger); }
.dg-stroke-danger-line { stroke: var(--c-danger-line); }
.dg-stroke-line-strong { stroke: var(--c-line-strong); }
.dg-stroke-success-line { stroke: var(--c-success-line); }
.dg-stroke-text-3 { stroke: var(--c-text-3); }
.dg-stroke-warning { stroke: var(--c-warning); }
.dg-sw-1-5 { stroke-width: 1.5; }
.dg-sw-2 { stroke-width: 2; }
/* guide-diagrams:end */
.tool-jump { margin-top: var(--s-5); }
.tool-jump a { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--h-md); padding: 0 var(--s-4); border-radius: var(--r-sm); background: var(--c-accent); color: var(--c-on-accent); font-weight: var(--fw-medium); }
.tool-jump a:hover { background: var(--c-accent-hover); text-decoration: none; }

/* ================================================================== 11. PAGE PATTERNS */
/* Link list: guides and related tools, divided rows rather than cards */
.guide-card-grid, .related-guides-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-6); border-top: var(--bw) solid var(--c-line); }
.guide-card { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-4) 0; border-bottom: var(--bw) solid var(--c-line); color: var(--c-text-2); }
a.guide-card:hover { text-decoration: none; }
a.guide-card:hover strong { color: var(--c-accent); text-decoration: underline; text-underline-offset: .2em; }
.guide-card strong { font-size: var(--fs-lg); font-weight: var(--fw-strong); line-height: 1.35; color: var(--c-text); }
.guide-card p { font-size: var(--fs-md); line-height: 1.55; color: var(--c-text-3); }
.guide-card h3 { font-size: var(--fs-lg); }
.prose .guide-card-grid, .prose .related-guides-grid { margin-top: var(--s-4); }
.prose .guide-card { font-size: var(--fs-md); }
.resource-link { display: none; }
.related-guides-title, .resource-section > h2, .resource-section > h3 { font-size: var(--fs-2xl); letter-spacing: var(--ls-title); margin-bottom: var(--s-4); }
.related-guides-section, .resource-section { margin-top: var(--s-8); }
.related-tool { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); flex-wrap: wrap; margin-top: var(--s-8); padding: var(--s-6) 0; border-top: var(--bw) solid var(--c-line); border-bottom: var(--bw) solid var(--c-line); }
.related-tool h2 { font-size: var(--fs-2xl); letter-spacing: var(--ls-title); margin: 0 0 var(--s-2); }
.related-tool p { color: var(--c-text-3); max-width: 56ch; }
.related-tool .eyebrow { text-transform: none; }

/* Tool section on landing pages: the tool sits right under the page head */
.page-head + .tool-section { margin-top: 0; }
/* Measured with the font loaded: 633px at 390px wide, 539px at 768 and 1280.
   The reserve sits a few pixels above that so a late wrap does not move the page. */
#resize-tool { min-height: 540px; }
@media (max-width: 639px) { #resize-tool { min-height: 640px; } }
.tool-section > .section-title { font-size: var(--fs-xl); letter-spacing: -.01em; margin-bottom: var(--s-2); }
.tool-section > .section-lede { font-size: var(--fs-md); margin: 0 0 var(--s-4); }
.tool-section > .section-title + .ws { margin-top: var(--s-3); }

/* Product family: the other tools, shown after a task */
.toolset { margin-top: var(--s-8); }
.toolset__title { font-size: var(--fs-2xl); letter-spacing: var(--ls-title); margin-bottom: var(--s-4); }
.toolset__list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 var(--s-5); list-style: none; border-top: var(--bw) solid var(--c-line); }
/* Each link fills its row, so the rules under a row line up even when one description wraps */
.toolset__list > li { display: flex; }
.toolset__list a { flex: 1; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-content: start; gap: 2px var(--s-3); padding: var(--s-4) 0; border-bottom: var(--bw) solid var(--c-line); color: var(--c-text); }
.toolset__list a:hover { text-decoration: none; }
.toolset__list a:hover .toolset__name { color: var(--c-accent); }
.toolset__list .fa-solid { grid-row: 1 / span 2; margin-top: 3px; color: var(--c-text-3); }
.toolset__name { font-weight: var(--fw-strong); }
.toolset__desc { font-size: var(--fs-label); color: var(--c-text-3); }

.faq-section { margin-top: var(--s-8); max-width: var(--w-read); }
.faq-title, .faq-section > h2 { font-size: var(--fs-2xl); letter-spacing: var(--ls-title); }
.faq-subtitle { margin-top: var(--s-2); color: var(--c-text-3); font-size: var(--fs-lg); }
.faq-header { margin-bottom: var(--s-4); }
.faq-list { border-top: var(--bw) solid var(--c-line); }
.faq-section > h2 + .faq-item { border-top: var(--bw) solid var(--c-line); margin-top: var(--s-4); }
.faq-item { border-bottom: var(--bw) solid var(--c-line); }
.faq-question { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 56px; padding: var(--s-3) 0; font-size: var(--fs-lg); font-weight: var(--fw-medium); color: var(--c-text); cursor: pointer; list-style: none; line-height: 1.4; }
.faq-question::-webkit-details-marker { display: none; }
.faq-question:hover { color: var(--c-accent); }
.faq-item:not(:has(.faq-chevron)) > .faq-question::after { content: ''; flex: none; width: 14px; height: 14px; background: var(--c-text-3); -webkit-mask: var(--mask-chevron) center/contain no-repeat; mask: var(--mask-chevron) center/contain no-repeat; transition: transform var(--t-base) var(--ease); }
.faq-item[open] > .faq-question::after { transform: rotate(180deg); }
.faq-chevron { flex: none; font-size: 12px; color: var(--c-text-3); transition: transform var(--t-base) var(--ease); }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 0 var(--s-5); font-size: var(--fs-read); line-height: var(--lh-read); color: var(--c-text-2); max-width: var(--w-read); }
.faq-answer > * + * { margin-top: var(--s-3); }

/* Status pages (404, offline) */
.status-page { padding: var(--s-6) 0; }
.status-page .actions { display: grid; gap: var(--s-2); max-width: 420px; margin: var(--s-6) 0; }
.status-page .actions .btn { justify-content: flex-start; white-space: normal; text-align: left; }

/* ================================================================== 12. TOOL WORKSPACE */
/* One frame for every tool. data-state is empty | ready | done (set by components.js), data-busy
   while a long job runs. Two arrangements, neither with inner scrolling; only the small action bar
   is sticky:
   - .ws: secondary tools. A document bar, the stage, and on desktops a settings rail beside it.
   - .ws--linear: the image resizer. One column in task order: requirement, file, stage, settings,
     action. It looks the same at every width; only the requirement grid changes its column count. */
.ws { display: grid; grid-template-columns: minmax(0, 1fr) var(--w-rail); grid-template-rows: auto 1fr; grid-template-areas: 'head head' 'stage rail'; background: var(--c-surface); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-md); }
.ws-head { grid-area: head; display: flex; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); flex-wrap: wrap; min-height: 52px; padding: var(--s-2) var(--s-4) var(--s-2) var(--s-5); border-bottom: var(--bw) solid var(--c-line); background: var(--c-surface); }
.ws[data-state='empty'] .ws-head { display: none; }
.ws-status { margin-left: auto; font-size: var(--fs-label); color: var(--c-text-3); }
.ws-status::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: var(--s-2); border-radius: 50%; background: var(--c-line-strong); vertical-align: 1px; }
.ws[data-state='ready'] .ws-status::before { background: var(--c-accent); }
.ws[data-state='done'] .ws-status::before { background: var(--c-success); }
/* The first visible region carries the top corners */
.ws > :first-child, .ws:not(.ws--linear)[data-state]:not([data-state='empty']) .ws-head { border-top-left-radius: var(--r-md); border-top-right-radius: var(--r-md); }

.filebar { display: flex; align-items: center; gap: var(--s-2) var(--s-3); flex: 1 1 320px; flex-wrap: wrap; min-width: 0; }
.filebar__icon { color: var(--c-text-3); flex: none; }
.filebar__name { flex: 1 1 180px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--c-text); }
.filebar__actions { display: flex; gap: var(--s-1); flex: none; }

.ws-stage { grid-area: stage; position: relative; min-width: 0; display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-5); background: var(--c-surface-2); }
.ws:not(.ws--linear) .ws-stage { border-bottom-left-radius: var(--r-md); }
.ws-empty { display: flex; flex-direction: column; gap: var(--s-3); flex: 1; }
.dropzone { flex: 1; display: grid; align-content: center; justify-items: center; gap: var(--s-2); min-height: 340px; padding: var(--s-6) var(--s-5); text-align: center; background: var(--c-surface); border: 1.5px dashed var(--c-line-strong); border-radius: var(--r-md); cursor: pointer; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.dropzone:hover { border-color: var(--c-field-line); }
.dropzone.dragover { border-color: var(--c-accent); border-style: solid; background: var(--c-accent-soft); }
.dropzone__icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: var(--s-1); border-radius: 50%; background: var(--c-accent-soft); color: var(--c-accent); }
.dropzone__icon .fa-solid { font-size: 20px; }
.dropzone__title { font-size: var(--fs-xl); letter-spacing: -.01em; }
.dropzone__text { color: var(--c-text-3); font-size: var(--fs-md); margin-bottom: var(--s-2); }
.dropzone__hint { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--c-text-3); max-width: 52ch; }
.ws-empty > .btn-link { align-self: center; }

/* Numbered steps of the resizer: 1 what you are preparing, 2 the file */
.ws-step { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-lg); font-weight: var(--fw-strong); line-height: 1.3; color: var(--c-text); }
.ws-step__n { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--c-text); color: var(--c-surface); font-size: var(--fs-xs); font-weight: var(--fw-strong); }

.ws-crop { display: grid; gap: var(--s-3); }
.cropper-container-wrapper { position: relative; height: clamp(320px, 58vh, 560px); width: 100%; background: #1c1c1b; border-radius: var(--r-sm); overflow: hidden; }
.cropper-container-wrapper:focus-visible { outline-offset: 2px; }
.cropper-container-wrapper img { display: block; max-width: 100%; }
.ws-toolbar { display: flex; align-items: center; gap: var(--s-2) var(--s-3); flex-wrap: wrap; }
.ws-toolbar__group { display: flex; gap: 2px; padding: 2px; background: var(--c-surface); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-sm); }
.ws-toolbar__group .btn { border-color: transparent; }
.ws-toolbar > .ws-hint { flex: 1 1 220px; }
.ws-toolbar > .btn-ghost { margin-left: auto; }
.ws-hint { font-size: var(--fs-sm); color: var(--c-text-3); }
.cropper-view-box { outline: 2px solid #fff; outline-color: rgba(255, 255, 255, .95); }
.cropper-line { background-color: #fff; opacity: .18; }
.cropper-point { width: 10px; height: 10px; background-color: #fff; border: 1px solid #3a3ab0; opacity: 1; border-radius: 2px; }
.cropper-point.point-e { right: -5px; margin-top: -5px; } .cropper-point.point-n { top: -5px; margin-left: -5px; }
.cropper-point.point-w { left: -5px; margin-top: -5px; } .cropper-point.point-s { bottom: -5px; margin-left: -5px; }
.cropper-point.point-ne { right: -5px; top: -5px; } .cropper-point.point-nw { left: -5px; top: -5px; }
.cropper-point.point-sw { left: -5px; bottom: -5px; } .cropper-point.point-se { right: -5px; bottom: -5px; width: 10px; height: 10px; }
.cropper-point::before { content: ''; position: absolute; inset: -9px; }
.cropper-dashed { border-color: #fff; opacity: .45; }
.cropper-center::before, .cropper-center::after { background-color: #fff; }
.cropper-face { background-color: transparent; }
.cropper-modal { background-color: #000; opacity: .6; }
/* Processing: the editor stays in place, dimmed, while the action shows progress */
.ws:has([aria-busy='true']) .cropper-container-wrapper::after, .ws[data-busy='true'] .ws-preview::after { content: ''; position: absolute; inset: 0; z-index: 5; background: rgba(20, 20, 18, .45); }
.ws:has([aria-busy='true']) .cropper-container-wrapper::before { content: ''; position: absolute; z-index: 6; top: 50%; left: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: ar-spin .8s linear infinite; }

/* Result: the verdict and Download first, then the preview and the proof */
.ws-result { display: grid; gap: var(--s-5); }
.ws-result__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.verdict { display: flex; align-items: flex-start; gap: var(--s-3); min-width: 0; flex: 1 1 320px; }
.verdict > .fa-solid { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--c-success-soft); color: var(--c-success); font-size: 16px; }
.ws-result__title { font-size: var(--fs-xl); letter-spacing: -.01em; }
.ws-result__ok { margin-top: 2px; font-size: var(--fs-md); color: var(--c-text-2); }
.ws-result__ok .meta-stat-val, .ws-result__ok #resultStatus { color: var(--c-text-2) !important; font-weight: var(--fw-regular); text-align: left; }
.ws-result__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.ws-result__body { display: grid; gap: var(--s-5); }
@media (min-width: 1000px) { .ws-result__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.ws-result__view { display: grid; gap: var(--s-3); min-width: 0; justify-items: start; }
.ws-result__view .ws-preview { justify-self: stretch; }
.ws-preview { position: relative; display: grid; place-items: center; min-height: 220px; padding: var(--s-5); border: var(--bw) solid var(--c-line); border-radius: var(--r-md); background-color: var(--c-surface); overflow: hidden; }
.ws-preview img { max-width: 100%; max-height: 360px; width: auto; height: auto; object-fit: contain; box-shadow: var(--sh-paper); }
.checkerboard { background-color: var(--c-surface); background-image: linear-gradient(45deg, var(--c-surface-3) 25%, transparent 25%), linear-gradient(-45deg, var(--c-surface-3) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--c-surface-3) 75%), linear-gradient(-45deg, transparent 75%, var(--c-surface-3) 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.ws-result__facts { display: grid; gap: var(--s-3); align-content: start; min-width: 0; }
/* Requirement against the file, one row per rule */
.check-table { width: 100%; border-collapse: collapse; background: var(--c-surface); border: var(--bw) solid var(--c-line); border-radius: var(--r-md); font-size: var(--fs-md); table-layout: fixed; }
.check-table th, .check-table td { padding: var(--s-3); text-align: left; vertical-align: top; border-bottom: var(--bw) solid var(--c-line); overflow-wrap: anywhere; }
.check-table tr:last-child th, .check-table tr:last-child td { border-bottom: 0; }
.check-table thead th { font-size: var(--fs-xs); font-weight: var(--fw-strong); color: var(--c-text-3); padding-block: var(--s-2); }
.check-table tbody th { width: 28%; font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--c-text-3); }
.check-table td { color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.check-table td.is-met { color: var(--c-text); font-weight: var(--fw-strong); }
.check-table td.is-met::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 6px; background: var(--c-success); -webkit-mask: var(--mask-check) center/contain no-repeat; mask: var(--mask-check) center/contain no-repeat; vertical-align: -1px; }
.check-table .bytes, .meta-stat-val .bytes { display: block; font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--c-text-3); }
.ws-result__orig { font-size: var(--fs-sm); color: var(--c-text-3); }
.meta-stats { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--c-surface); border: var(--bw) solid var(--c-line); border-radius: var(--r-md); padding: 0 var(--s-4); }
.meta-stat-item { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) 0; min-width: 0; }
.meta-stat-item + .meta-stat-item { border-top: var(--bw) solid var(--c-line); }
.meta-stat-label { color: var(--c-text-3); font-size: var(--fs-label); flex: none; }
.meta-stat-val { color: var(--c-text); font-size: var(--fs-md); font-weight: var(--fw-medium); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.meta-stats--row { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s-5); }
.meta-stats--row .meta-stat-item { display: grid; gap: 2px; align-content: start; }
.meta-stats--row .meta-stat-item + .meta-stat-item { border-top: 0; }
.meta-stats--row .meta-stat-val { text-align: left; }

/* Rail (secondary tools): settings, then the action. Normal page scrolling; the action bar alone
   sticks to the bottom of the screen while the rail is longer than the screen. */
.ws-rail { grid-area: rail; display: flex; flex-direction: column; min-width: 0; border-left: var(--bw) solid var(--c-line); }
.ws-side { grid-area: side; flex: 1 0 auto; display: grid; gap: var(--s-5); align-content: start; padding: var(--s-5); min-width: 0; }
.ws-section { display: grid; gap: var(--s-3); min-width: 0; }
.ws-section__title { font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--c-text); }
.ws-group { display: grid; gap: var(--s-3); align-content: start; min-width: 0; }
.ws-group__title { font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--c-text); }
.ws-dims { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--s-2); align-items: end; }
.btn-lock { color: var(--c-text-3); }
.btn-lock.active, .btn-lock[aria-pressed='true'] { background: var(--c-accent-soft); border-color: var(--c-accent-line); color: var(--c-accent); }
.ws-reset { justify-self: start; margin-left: calc(-1 * var(--s-3)); }

.ws-action { grid-area: action; position: sticky; bottom: 0; z-index: 2; display: grid; gap: var(--s-2); align-content: start; padding: var(--s-4) var(--s-5); border-top: var(--bw) solid var(--c-line); background: var(--c-surface); border-bottom-right-radius: var(--r-md); }
.ws[data-state='empty'] #btnProcess, .ws[data-state='empty'] #btnStartCompress { display: none; }
.ws[data-state='done'] .ws-action { display: none; }
.process-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-1); min-height: 1.5em; font-size: var(--fs-label); color: var(--c-text-3); line-height: 1.5; }
.process-summary.is-invalid { color: var(--c-danger); font-weight: var(--fw-medium); }
.process-summary.is-pending { color: var(--c-text); font-weight: var(--fw-medium); }
.process-summary button { color: var(--c-accent); text-decoration: underline; text-underline-offset: .2em; font-size: inherit; padding: 0 var(--s-1); }
.process-summary:empty { visibility: hidden; }
#processErrorBox { margin: 0; }

/* Linear workspace (image resizer) */
.ws--linear { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: 'req' 'head' 'stage' 'settings' 'action'; }
.ws-req { grid-area: req; padding: var(--s-4) var(--s-5); border-bottom: var(--bw) solid var(--c-line); }
.ws-req__bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-4); min-height: var(--h-sm); }
.ws-req[data-open='true'] .ws-step__done, .ws-req[data-open='false'] .ws-step__ask { display: none; }
.req-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 var(--s-3); flex: 1 1 260px; min-width: 0; font-size: var(--fs-md); }
.ws-req[data-open='true'] .req-summary { display: none; }
.req-summary__name { font-weight: var(--fw-strong); color: var(--c-text); }
.req-summary__spec { color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.req-change { margin-left: auto; }
.ws[data-req='pending'] .req-change { display: none; }
.req-grid { display: grid; grid-auto-rows: 1fr; gap: var(--s-2); margin-top: var(--s-3); }
.ws-req[data-open='false'] .req-grid { display: none; }
.req-grid--d2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.req-grid--d3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.req-grid--d4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ws--linear .ws-head { border-bottom: var(--bw) solid var(--c-line); }
.ws--linear .ws-stage { padding: var(--s-5); min-height: 360px; }
.ws--linear .dropzone { min-height: 240px; }
.ws--linear .ws-empty > .ws-step { margin-bottom: var(--s-1); }
.ws-settings { grid-area: settings; padding: 0 var(--s-5); border-top: var(--bw) solid var(--c-line); }
.ws--linear[data-state='empty'][data-settings='closed'] .ws-settings, .ws--linear[data-state='done'] .ws-settings { display: none; }
.ws--linear .ws-action { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--s-2) var(--s-5); padding: var(--s-3) var(--s-5); border-radius: 0 0 var(--r-md) var(--r-md); }
.ws--linear .ws-action .process-summary { flex: 1 1 280px; }
.ws--linear .ws-action .btn-lg { min-width: 280px; }
.ws--linear[data-state='empty'] .ws-action { display: none; }

/* Settings disclosure (resizer): one quiet row; open, the groups sit side by side on desktops */
.ws-customize { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); width: 100%; min-height: 56px; padding: var(--s-2) 0; text-align: left; color: var(--c-text); font-size: var(--fs-md); font-weight: var(--fw-strong); }
.ws-customize:hover { color: var(--c-accent); }
.ws-customize__hint { display: block; font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--c-text-3); }
.ws-customize::after { content: ''; flex: none; width: 14px; height: 14px; background: var(--c-text-3); -webkit-mask: var(--mask-chevron) center/contain no-repeat; mask: var(--mask-chevron) center/contain no-repeat; transition: transform var(--t-base) var(--ease); }
.ws-customize[aria-expanded='true']::after { transform: rotate(180deg); }
.ws-customize:focus-visible { outline-offset: 4px; }
.ws[data-settings='closed'] .ws-custom { display: none; }
.ws-custom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5) var(--s-6); padding: var(--s-2) 0 var(--s-5); }
.ws-custom > .ws-advanced { grid-column: 1 / -1; }
.ws-advanced { border-top: var(--bw) solid var(--c-line); }

/* Workspace variants: tools without settings before a file, tools that keep settings after a result */
.ws[data-simple-empty][data-state='empty'] { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'stage'; }
.ws[data-simple-empty][data-state='empty'] .ws-rail { display: none; }
.ws[data-simple-empty][data-state='empty'] .ws-stage { border-radius: var(--r-md); }
.ws[data-compact-drop]:not([data-state='empty']) .dropzone { flex: 0 0 auto; min-height: 0; grid-template-columns: auto 1fr; grid-auto-flow: column; justify-items: start; align-items: center; text-align: left; gap: 0 var(--s-3); padding: var(--s-3) var(--s-4); border-width: 1px; }
.ws[data-compact-drop]:not([data-state='empty']) .dropzone__icon { grid-row: 1 / span 2; width: 36px; height: 36px; margin: 0; }
.ws[data-compact-drop]:not([data-state='empty']) .dropzone__icon .fa-solid { font-size: 16px; }
.ws[data-compact-drop]:not([data-state='empty']) .dropzone__title { font-size: var(--fs-md); grid-column: 2; }
.ws[data-compact-drop]:not([data-state='empty']) .dropzone__text { grid-column: 2; margin: 0; font-size: var(--fs-sm); }
.ws[data-compact-drop]:not([data-state='empty']) .dropzone .btn, .ws[data-compact-drop]:not([data-state='empty']) .dropzone__hint { display: none; }
.ws[data-state='ready'] #cleanerDropzone, .ws[data-state='ready'] #printDropzone, .ws[data-state='ready'] #compressDropzone, .ws[data-state='done'] #compressDropzone { display: none; }
.ws[data-keep][data-state='done'] .ws-action, .ws[data-keep][data-state='done'] .ws-side { display: grid; }
/* Once a result exists, Download is the one dominant action; running again becomes secondary. */
.ws[data-keep][data-state='done'] .ws-action .btn-primary { --btn-bg: var(--c-surface); --btn-fg: var(--c-text); --btn-line: var(--c-line-strong); }
.ws[data-keep][data-state='done'] .ws-action .btn-primary:hover { background: var(--c-surface-2); border-color: var(--c-line-strong); }
.ws-note { display: none; }
.ws[data-state='ready'] .ws-note { display: grid; }
.sheet-canvas { display: block; max-width: 100%; height: auto; background: #fff; box-shadow: var(--sh-paper); }
.ws-progress { display: grid; gap: var(--s-2); padding: var(--s-5); background: var(--c-surface); border: var(--bw) solid var(--c-line); border-radius: var(--r-md); }
.progress-text { font-size: var(--fs-label); color: var(--c-text-3); }
.result-status { display: flex; align-items: flex-start; gap: var(--s-3); font-size: var(--fs-xl); font-weight: var(--fw-strong); line-height: 1.35; color: var(--c-text); }
.result-status > .fa-solid, .result-status > .fa-regular { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--c-success-soft); color: var(--c-success); font-size: 16px; }
.result-status.is-warning > .fa-solid { background: var(--c-warning-soft); color: var(--c-warning); }

/* ================================================================== 13. TOOL SPECIFICS */
/* Image to PDF: the document, page by page */
.pagelist { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(196px, 224px)); }
.pagelist:empty { display: none; }
.page-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); padding: var(--s-3); background: var(--c-surface); border: var(--bw) solid var(--c-line); border-radius: var(--r-md); }
.page-row__num { position: absolute; top: var(--s-3); left: var(--s-3); z-index: 1; min-width: 26px; height: 22px; padding: 0 6px; border-radius: var(--r-xs); background: var(--c-text); color: var(--c-surface); font-size: var(--fs-xs); font-weight: var(--fw-strong); line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.page-row__thumb { width: 100%; aspect-ratio: 3 / 4; height: auto; object-fit: contain; padding: var(--s-2); border-radius: var(--r-xs); background: var(--c-surface-2); transition: transform var(--t-base) var(--ease); }
.page-row__text { min-width: 0; display: grid; }
.page-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text); font-size: var(--fs-label); font-weight: var(--fw-medium); }
.page-row__meta { font-size: var(--fs-xs); color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.page-row__actions { display: flex; gap: 2px; justify-content: space-between; padding-top: var(--s-2); border-top: var(--bw) solid var(--c-line); }
.page-row__actions .btn { border-color: transparent; background: transparent; }
.page-row__actions .btn:hover { background: var(--c-surface-2); }
.page-row__actions .btn-del:hover { background: var(--c-danger-soft); color: var(--c-danger); }
.page-row__handle { touch-action: none; cursor: grab; }
.page-row.is-dragging { z-index: 5; box-shadow: var(--sh-pop); cursor: grabbing; }
.page-row.is-drop-target { box-shadow: inset 0 0 0 2px var(--c-accent); }
.pagelist-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.pagelist-head__title { font-size: var(--fs-lg); }
.pagelist-head__hint { font-size: var(--fs-sm); color: var(--c-text-3); }
.ws[data-state='empty'] .pagelist-head { display: none; }

/* Compress PDF: before and after, side by side */
.size-compare { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--s-4); padding: var(--s-5); background: var(--c-surface); border: var(--bw) solid var(--c-line); border-radius: var(--r-md); }
.size-compare__item { display: grid; gap: var(--s-1); min-width: 0; }
.size-compare__label { font-size: var(--fs-label); color: var(--c-text-3); }
.size-compare__item dd { text-align: left; font-size: var(--fs-2xl); font-weight: var(--fw-strong); letter-spacing: var(--ls-title); color: var(--c-text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.size-compare__arrow { color: var(--c-text-3); }
.size-compare__foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-6); padding-top: var(--s-3); border-top: var(--bw) solid var(--c-line); font-size: var(--fs-label); color: var(--c-text-3); }
.size-compare__foot > div { display: flex; gap: var(--s-2); }
.size-compare__foot dd { color: var(--c-text); font-weight: var(--fw-strong); font-variant-numeric: tabular-nums; }
.target-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.target-grid .chip { display: grid; justify-items: start; gap: 0; min-height: 52px; padding: var(--s-2) var(--s-3); white-space: normal; text-align: left; font-size: var(--fs-md); color: var(--c-text); }
.target-grid .chip-sub { font-size: var(--fs-xs); }
.target-grid .chip[aria-pressed='true'] { background: var(--c-accent-soft); border-color: var(--c-accent); color: var(--c-accent); box-shadow: inset 0 0 0 1px var(--c-accent); }
.target-grid .chip[aria-pressed='true'] .chip-sub { color: var(--c-text-2); opacity: 1; }
.ws-note__body { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-6) var(--s-4); text-align: center; color: var(--c-text-3); }
.ws-note__body .fa-solid { font-size: 28px; color: var(--c-text-3); margin-bottom: var(--s-2); }
.ws-note__title { font-size: var(--fs-lg); font-weight: var(--fw-strong); color: var(--c-text); }

/* Before and after, side by side when there is room (signature cleaner) */
.compare-pair { display: grid; gap: var(--s-4); }
@media (min-width: 640px) { .compare-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.compare-pane { display: grid; gap: var(--s-2); align-content: start; min-width: 0; }
.compare-pane__label { font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--c-text-3); }
.compare-pane--result .compare-pane__label { color: var(--c-text); }
.compare-pane .ws-preview { min-height: 180px; padding: var(--s-4); }
.compare-pane--result .ws-preview { border-color: var(--c-accent-line); }

/* Previews of a printed sheet or a cleaned signature */
.ws-preview--desk { background: var(--c-desk); padding: var(--s-6) var(--s-5); }
.ws-preview__caption { font-size: var(--fs-sm); color: var(--c-text-3); }
.ws-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }

/* ================================================================== 14. RESUME BUILDER */
.rb-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5); flex-wrap: wrap; max-width: none; margin-bottom: var(--s-5); }
.rb-head__text { flex: 1 1 360px; min-width: 0; }
.rb-head .page-title { font-size: var(--fs-2xl); }
.rb-head .page-lede { margin-top: var(--s-1); font-size: var(--fs-md); color: var(--c-text-3); }
.rb-head__actions { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.rb-head .assurance { margin: 0; align-items: center; }
.rb { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-items: start; }

/* Editor */
.rb-editor { min-width: 0; background: var(--c-surface); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-md); }
.rb-steps { position: sticky; top: var(--h-header); z-index: var(--z-sticky); padding: 0 var(--s-3); background: var(--c-surface); border-radius: var(--r-md) var(--r-md) 0 0; }
.rb-steps .tab { flex: 1; justify-content: center; padding: 0 var(--s-2); }
.editor-tab-pane { display: none; padding: var(--s-5); }
.editor-tab-pane.active { display: block; }
.rb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-4); }
.rb-toolbar__group { display: flex; gap: var(--s-1); margin-left: calc(-1 * var(--s-2)); }
.rb-toolbar .btn { white-space: nowrap; }
.rb-block { display: grid; gap: var(--s-3); margin-bottom: var(--s-6); align-content: start; }
.rb-block + .rb-block { padding-top: var(--s-5); border-top: var(--bw) solid var(--c-line); }
.rb-block__title { font-size: var(--fs-lg); }
.rb-block__hint { margin-top: calc(-1 * var(--s-2)); font-size: var(--fs-label); color: var(--c-text-3); line-height: 1.5; }
.rb-next { display: flex; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-5); padding-top: var(--s-4); border-top: var(--bw) solid var(--c-line); }
.rb-next .btn-primary, .rb-next .btn:last-child:not(:first-child) { margin-left: auto; }
.rb-add-section { margin-top: var(--s-5); }
.rb-tips { margin-top: var(--s-5); }
.tips-body p { font-size: var(--fs-md); line-height: 1.6; }
.rb-startover { margin-top: var(--s-3); margin-left: calc(-1 * var(--s-3)); }
.subsection-title { font-size: var(--fs-label); margin: var(--s-4) 0 calc(-1 * var(--s-1)); }
.subsection-title:first-child { margin-top: 0; }
.tag { margin-left: var(--s-1); padding: 1px 6px; border-radius: var(--r-xs); background: var(--c-surface-2); color: var(--c-text-3); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.tag--req { background: var(--c-accent-soft); color: var(--c-accent); }

/* Sections: an outline, separated by rules */
.acc { border-top: var(--bw) solid var(--c-line); border-bottom: var(--bw) solid var(--c-line); margin: 0 calc(-1 * var(--s-5)); }
.accordion-section + .accordion-section, #optionalSectionsArea > .accordion-section, .accordion-section + #optionalSectionsArea > .accordion-section:first-child { border-top: var(--bw) solid var(--c-line); }
.accordion-header { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 56px; padding: 0 var(--s-5); text-align: left; font-size: var(--fs-lg); font-weight: var(--fw-strong); color: var(--c-text); transition: background-color var(--t-fast) var(--ease); }
.accordion-header > span:first-child { flex: 1; min-width: 0; }
.accordion-header:hover { background: var(--c-surface-2); }
.accordion-header:focus-visible { outline-offset: -2px; }
.accordion-meta { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-label); font-weight: var(--fw-regular); color: var(--c-text-3); }
.accordion-meta.is-empty { color: var(--c-text-3); }
.accordion-header .chevron { font-size: 12px; color: var(--c-text-3); transition: transform var(--t-base) var(--ease); }
.accordion-section.open > .accordion-header { background: var(--c-surface); }
.accordion-section.open > .accordion-header .chevron { transform: rotate(180deg); }
.accordion-content { display: none; padding: 0 var(--s-5) var(--s-6); }
.accordion-section.open > .accordion-content { display: grid; gap: var(--s-4); }

/* Entries: one titled, collapsible unit per job, school, project and so on */
.entries { display: grid; gap: var(--s-3); min-width: 0; }
.accordion-content > *, .entries > *, .entry__body > *, .rb-block > *, .ws-side > *, .ws-custom > * { min-width: 0; }
.entries:empty::before { content: attr(data-empty); display: block; padding: var(--s-4); border: var(--bw) dashed var(--c-line-strong); border-radius: var(--r-md); color: var(--c-text-3); font-size: var(--fs-md); text-align: center; line-height: 1.5; }
.entry { background: var(--c-surface-2); border-radius: var(--r-md); }
.entry__head { display: flex; align-items: center; gap: var(--s-2); min-height: 48px; padding: var(--s-1) var(--s-2) var(--s-1) var(--s-2); }
.entry__toggle { display: flex; align-items: center; gap: var(--s-2); flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 0 var(--s-2); border-radius: var(--r-sm); text-align: left; color: var(--c-text); }
.entry__toggle:hover { background: var(--c-surface-3); }
.entry__toggle::before { content: ''; flex: none; width: 12px; height: 12px; background: var(--c-text-3); -webkit-mask: var(--mask-chevron) center/contain no-repeat; mask: var(--mask-chevron) center/contain no-repeat; transform: rotate(-90deg); transition: transform var(--t-base) var(--ease); }
.entry__toggle[aria-expanded='true']::before { transform: none; }
.entry__num { display: inline-grid; place-items: center; flex: none; min-width: 22px; height: 22px; padding: 0 4px; border-radius: var(--r-xs); background: var(--c-surface); border: var(--bw) solid var(--c-line-strong); color: var(--c-text-2); font-size: var(--fs-xs); font-weight: var(--fw-strong); font-variant-numeric: tabular-nums; }
.entry__title { flex: 1 1 120px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); font-weight: var(--fw-strong); color: var(--c-text); }
.entry__actions { display: flex; align-items: center; gap: 0; flex: none; margin-left: auto; }
.entry__actions .btn { color: var(--c-text-3); }
.entry__actions .btn:hover { color: var(--c-text); background: var(--c-surface-3); }
.entry__actions .btn-danger-ghost:hover { color: var(--c-danger); background: var(--c-danger-soft); }
.entry__sep { width: 1px; height: 18px; margin: 0 var(--s-1); background: var(--c-line-strong); }
.entry__body { display: grid; gap: var(--s-4); padding: var(--s-2) var(--s-4) var(--s-4); }
.entry.is-collapsed > .entry__body { display: none; }
.entry .input, .entry .textarea { background: var(--c-surface); }
.add-entry { --btn-line: var(--c-line-strong); --btn-fg: var(--c-text-2); border-style: dashed; }
.add-entry:hover { border-color: var(--c-accent); color: var(--c-accent); background: var(--c-accent-soft); }
.skill-row-inputs { display: grid; grid-template-columns: minmax(7rem, 32%) minmax(0, 1fr); gap: var(--s-2); }
#skillLabelHint { margin-bottom: var(--s-1); }
.disclosure--quiet { border-top: 0; }
.disclosure--quiet > summary { min-height: 32px; font-size: var(--fs-label); font-weight: var(--fw-regular); color: var(--c-text-3); justify-content: flex-start; }

/* Template list: compare by audience and traits, with the live preview beside it */
.template-filter-bar { margin-bottom: var(--s-1); }
.template-gallery-grid { display: grid; grid-template-columns: minmax(0, 1fr); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-md); overflow: hidden; }
.template-card { position: relative; min-width: 0; }
.template-card + .template-card { border-top: var(--bw) solid var(--c-line); }
.template-card[hidden] { display: none !important; }
.template-select { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: start; gap: var(--s-1) var(--s-4); width: 100%; padding: var(--s-3) calc(var(--h-sm) + var(--s-5)) var(--s-3) var(--s-3); text-align: left; background: var(--c-surface); transition: background-color var(--t-fast) var(--ease); }
.template-select:hover { background: var(--c-surface-2); }
.template-select:focus-visible { outline-offset: -2px; }
.template-card.active .template-select { background: var(--c-accent-soft); box-shadow: inset 3px 0 0 var(--c-accent); }
.template-thumb-wrap { grid-row: 1 / span 3; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #fff; border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-xs); }
.template-thumb-wrap svg { display: block; width: 100%; height: 100%; }
.template-thumb-fallback { padding: var(--s-2); color: var(--c-text-3); font-size: var(--fs-xs); }
.template-meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-1) var(--s-2); }
.template-card-title { font-size: var(--fs-md); font-weight: var(--fw-strong); color: var(--c-text); line-height: 1.3; }
.template-card.active .template-card-title { color: var(--c-accent); }
.template-badge { padding: 1px 6px; border-radius: var(--r-xs); background: var(--c-surface-2); color: var(--c-text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.template-card.active .template-badge { background: var(--c-surface); }
.template-card-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-label); line-height: 1.5; color: var(--c-text-3); }
.template-check { display: none; align-items: center; gap: var(--s-1); font-size: var(--fs-xs); font-weight: var(--fw-strong); color: var(--c-accent); }
.template-check .fa-solid { font-size: 12px; }
.template-card.active .template-check { display: inline-flex; }
.btn-preview-template { position: absolute; top: var(--s-3); right: var(--s-3); background: var(--c-surface); }

/* Section order */
.orderlist { border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-md); overflow: hidden; background: var(--c-surface); }
.section-order-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--s-3); min-height: 48px; padding: var(--s-1) var(--s-2) var(--s-1) var(--s-4); }
.section-order-row + .section-order-row { border-top: var(--bw) solid var(--c-line); }
.section-order-row__name { min-width: 0; overflow-wrap: anywhere; font-weight: var(--fw-medium); color: var(--c-text); }
.section-order-row__actions { display: flex; gap: 2px; }

/* Review: what, where, why, and a Fix that goes there */
.readiness-status-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-4); border-radius: var(--r-md); background: var(--c-success-soft); color: var(--c-success); font-weight: var(--fw-strong); box-shadow: inset 3px 0 0 var(--c-success); }
.readiness-status-bar.readiness-warning { background: var(--c-danger-soft); color: var(--c-danger); box-shadow: inset 3px 0 0 var(--c-danger); }
.readiness-status-text { display: flex; align-items: center; gap: var(--s-2); }
.readiness-status-bar .badge { background: var(--c-surface); color: var(--c-text-2); }
.review-checklist { display: grid; }
.review-group-title { display: flex; align-items: center; gap: var(--s-2); margin: var(--s-5) 0 var(--s-2); font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--c-text); }
.review-group-title--error { color: var(--c-danger); }
.review-group-title--warning { color: var(--c-warning); }
.review-group-title--info { color: var(--c-text); }
.review-group-count { min-width: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--c-surface-3); color: var(--c-text-2); font-size: var(--fs-xs); font-weight: var(--fw-strong); line-height: 20px; text-align: center; }
.review-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--s-3); padding: var(--s-3) 0; border-top: var(--bw) solid var(--c-line); }
.review-group-title + .review-item { border-top: 0; }
.review-item > .fa-solid { margin-top: 3px; color: var(--c-text-3); }
.review-item--error > .fa-solid { color: var(--c-danger); }
.review-item--warning > .fa-solid { color: var(--c-warning); }
.review-item--info > .fa-solid { color: var(--c-text-3); }
.review-item--ok { grid-template-columns: auto 1fr; border-top: 0; } .review-item--ok > .fa-solid { color: var(--c-success); }
.review-item__msg { color: var(--c-text); line-height: 1.5; overflow-wrap: anywhere; }
.review-item__where { margin-top: 2px; font-size: var(--fs-sm); color: var(--c-text-3); }
.keyword-match-result { display: grid; gap: var(--s-2); font-size: var(--fs-md); }
.keyword-match-result:empty { display: none; }
.keyword-heading { font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--c-text); margin-top: var(--s-2); }
.keyword-chips { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); list-style: none; }
.keyword-chips li { padding: 2px var(--s-2); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-xs); background: var(--c-surface-2); color: var(--c-text); font-size: var(--fs-label); overflow-wrap: anywhere; }
.keyword-chips.is-missing li { border-color: var(--c-warning-line); background: var(--c-warning-soft); color: var(--c-warning); }
.keyword-chips.is-found li { border-color: var(--c-success-line); background: var(--c-success-soft); color: var(--c-success); }

/* Download: a publication step, one row per format */
.export-actions { display: grid; border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-md); overflow: hidden; }
.export-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-2) var(--s-4); padding: var(--s-4); background: var(--c-surface); }
.export-row + .export-row { border-top: var(--bw) solid var(--c-line); }
.export-row--primary { background: var(--c-accent-soft); }
.export-row__name { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-md); font-weight: var(--fw-strong); color: var(--c-text); }
.export-row__desc { margin-top: 2px; font-size: var(--fs-label); color: var(--c-text-3); line-height: 1.45; }
.export-row .btn { min-width: 132px; }
.export-print { justify-self: start; margin-top: var(--s-2); margin-left: calc(-1 * var(--s-3)); }
.draft-status-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; font-size: var(--fs-label); color: var(--c-text-3); }
.rb-backup { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* Preview */
.rb-preview { display: flex; flex-direction: column; min-width: 0; background: var(--c-desk); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-md); overflow: hidden; }
.rb-preview__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; min-height: 52px; padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4); border-bottom: var(--bw) solid var(--c-line-strong); background: var(--c-surface); }
.rb-preview__meta { display: flex; align-items: baseline; gap: var(--s-3); min-width: 0; flex-wrap: wrap; }
.rb-template { font-weight: var(--fw-strong); color: var(--c-text); }
.rb-pages { font-size: var(--fs-label); color: var(--c-text-3); }
.rb-preview__tools { display: flex; align-items: center; gap: var(--s-2); }
.preview-empty-note { padding: var(--s-3) var(--s-4); border-bottom: var(--bw) solid var(--c-line); background: var(--c-surface); color: var(--c-text-2); font-size: var(--fs-label); }
.resume-preview-outer { flex: 1; min-height: 0; overflow: auto; padding: var(--s-6); background: var(--c-desk); }
.resume-preview-wrapper { position: relative; display: block; margin: 0 auto; flex: none; }
.resume-visual-page { box-shadow: var(--sh-paper); }
#tmplModalPreviewSheet { pointer-events: none; transform-origin: top left; margin: 0; }
.template-preview-modal-body { display: flex; flex-direction: column; align-items: center; background: var(--c-desk); }
.modal-sample-label { align-self: stretch; margin-bottom: var(--s-4); font-size: var(--fs-label); color: var(--c-text-3); }
.rb-bar { display: none; }

@media (min-width: 1000px) {
  .rb { grid-template-columns: minmax(460px, 560px) minmax(0, 1fr); }
  .rb-preview { position: sticky; top: calc(var(--h-header) + var(--s-4)); height: calc(100vh - var(--h-header) - 2 * var(--s-4)); max-height: 1240px; }
}
@media (max-width: 999px) {
  .page--wide { padding-bottom: calc(var(--s-8) + 64px); }
  .rb[data-view='edit'] .rb-preview { display: none; }
  .rb[data-view='preview'] .rb-editor { display: none; }
  .rb-editor { margin: 0 calc(-1 * var(--gutter)); border-left: 0; border-right: 0; border-radius: 0; }
  .rb-steps { border-radius: 0; }
  .rb-preview { margin: 0 calc(-1 * var(--gutter)); border-left: 0; border-right: 0; border-radius: 0; overflow: visible; }
  .rb-preview__bar { position: sticky; top: var(--h-header); z-index: var(--z-sticky); }
  .resume-preview-outer { padding: var(--s-3); min-height: 60vh; overflow-x: auto; overflow-y: visible; }
  .rb-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky); gap: var(--s-2); padding: var(--s-2) var(--gutter) calc(var(--s-2) + env(safe-area-inset-bottom, 0px)); background: var(--c-surface); border-top: var(--bw) solid var(--c-line-strong); }
  .rb-bar__views { display: flex; flex: 1; gap: 2px; padding: 2px; background: var(--c-surface-2); border: var(--bw) solid var(--c-line); border-radius: var(--r-sm); }
  .rb-bar__views > button { flex: 1; min-height: calc(var(--h-lg) - 6px); border-radius: var(--r-xs); color: var(--c-text-3); font-weight: var(--fw-medium); transition: background-color var(--t-fast) var(--ease); }
  .rb-bar__views > button[aria-selected='true'] { background: var(--c-surface); color: var(--c-text); box-shadow: inset 0 0 0 1px var(--c-line-strong); }
  .rb-bar > .btn { flex: none; min-height: var(--h-lg); }
  body.is-typing .rb-bar { display: none; }
  .rb-head__actions { display: none; }
  .page--wide:has(.rb[data-view='preview']) .rb-head { display: none; }
  .acc { margin: 0 calc(-1 * var(--s-4)); }
  .accordion-header { padding: 0 var(--s-4); }
  .accordion-content { padding: 0 var(--s-4) var(--s-5); }
}
/* ================================================================== 15. RESPONSIVE */
/* Three layout modes, nothing in between:
   - desktop (1000px and wider): settings rail beside the stage, resume editor beside its preview.
   - tablet (640 to 999px): one column; resume Edit and Preview are switched, not squeezed.
   - phone (under 640px): one column with a menu sheet, stacked fields and full-width actions.
   The requirement grid has a fixed column count per mode, so it never reflows between them. */
@media (max-width: 999px) {
  .site-footer__inner { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: 1 / -1; }
  /* The Tools menu spans the header instead of hanging off its button */
  .site-header__inner { position: relative; }
  .site-nav__item { position: static; }
  .menu { left: var(--gutter); right: var(--gutter); top: calc(100% - 2px); width: auto; }

  /* Workspace: document bar, stage, settings, then a sticky action */
  .ws { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: 'head' 'stage' 'side' 'action'; }
  .ws--linear { grid-template-areas: 'req' 'head' 'stage' 'settings' 'action'; }
  .ws-rail { display: contents; }
  .ws[data-simple-empty][data-state='empty'] .ws-side, .ws[data-simple-empty][data-state='empty'] .ws-action { display: none; }
  .ws-head { padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4); }
  .ws-stage, .ws--linear .ws-stage { padding: var(--s-4); border-radius: 0; }
  .ws-req, .ws-settings { padding-inline: var(--s-4); }
  .ws-side { border-top: var(--bw) solid var(--c-line); padding: var(--s-4); }
  .ws-action, .ws--linear .ws-action { padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom, 0px)); border-radius: 0 0 var(--r-md) var(--r-md); box-shadow: 0 -6px 16px rgba(20, 20, 18, .06); }
  .ws[data-state='empty'] .ws-action { position: static; box-shadow: none; }
  .ws[data-state='empty']:not([data-keep]) .ws-action { display: none; }
  .ws[data-state='done']:not([data-keep]) .ws-side { display: none; }
  .ws[data-state='done'] .ws-stage { border-radius: 0 0 var(--r-md) var(--r-md); }
  .dropzone { min-height: 260px; padding: var(--s-6) var(--s-4); }
  .cropper-container-wrapper { height: clamp(260px, 52vh, 420px); }
  body:has(.ws[data-state='ready']) { --toast-lift: 96px; }
  body.is-typing .ws-action { position: static; box-shadow: none; }
  .toolset__list { grid-template-columns: minmax(0, 1fr); }
  .req-grid--t2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .req-grid--t3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Settings: size across the top, limit and format side by side under it */
  .ws-custom { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-custom > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  /* Header: a bar with a menu button; the nav opens as a full-height sheet */
  .site-header__inner { gap: var(--s-3); }
  .site-header .nav-toggle { display: inline-flex; }
  .site-header__tools { margin-left: auto; }
  .site-nav { position: fixed; inset: var(--h-header) 0 0 0; z-index: var(--z-header); display: none; align-items: flex-start; padding: var(--s-2) var(--gutter) calc(var(--s-7) + env(safe-area-inset-bottom, 0px)); background: var(--c-surface); overflow-y: auto; overscroll-behavior: contain; }
  .site-header[data-open='true'] .site-nav { display: block; animation: ar-fade var(--t-base) var(--ease); }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav__list > li { border-bottom: var(--bw) solid var(--c-line); }
  .site-nav__link { width: 100%; min-height: 52px; padding: 0 var(--s-1); font-size: var(--fs-lg); border-radius: 0; }
  .site-nav__link:hover { background: none; }
  .site-nav__link[aria-current='page']::after { left: auto; right: var(--s-1); top: 50%; bottom: auto; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; }
  .site-nav__lang { margin-left: 0; }
  .site-nav__item > .site-nav__link { display: none; }
  .site-nav__item { order: 3; border-bottom: 0 !important; }
  .site-nav__list > li:nth-child(2) { order: 1; }
  .site-nav__list > li:nth-child(3) { order: 2; }
  .site-nav__list > li:nth-child(4) { order: 4; border-top: var(--bw) solid var(--c-line); }
  .menu, .menu[hidden] { position: static; display: block !important; width: auto; background: none; border: 0; box-shadow: none; animation: none; overflow: visible; }
  .menu__group { padding: var(--s-4) 0 0; }
  .menu__group--refs { background: none; border-left: 0; padding: var(--s-2) 0 var(--s-4); }
  .menu__group--tools .menu__title, .menu__group--refs .menu__title { padding: 0 0 var(--s-2); }
  .menu__item { padding: var(--s-2) 0; }
  .menu__item:hover { background: none; }
    .nav-open body { overflow: hidden; }

  .site-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: var(--s-6); gap: var(--s-5) var(--s-4); }
  .page { padding-top: var(--s-5); padding-bottom: var(--s-7); }
  :root { --fs-3xl: 26px; --fs-4xl: 28px; --fs-2xl: 21px; --fs-xl: 18px; --fs-read: 16px; }
  .page-lede { font-size: var(--fs-lg); }
  .page-head { margin-bottom: var(--s-5); }
  .section, .faq-section, .toolset, .related-guides-section, .resource-section, .related-tool { margin-top: var(--s-7); }
  .dialog__foot { flex-direction: column-reverse; }
  .dialog__foot .btn { width: 100%; }
  .field-row, .field-row--3 { grid-template-columns: minmax(0, 1fr); }
  .related-tool { align-items: flex-start; }
  .guide-card-grid, .related-guides-grid { grid-template-columns: minmax(0, 1fr); }
  .size-compare { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); padding: var(--s-4); }
  .size-compare__arrow { display: none; }
  .pagelist { grid-template-columns: minmax(0, 1fr); }
  .page-row { grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: var(--s-1) var(--s-3); }
  .page-row__num { top: var(--s-2); left: var(--s-2); }
  .page-row__thumb { grid-row: 1 / span 2; width: 64px; padding: var(--s-1); }
  .page-row__text { align-self: end; }
  .page-row__actions { grid-column: 1 / -1; justify-content: space-between; }

  /* Workspace */
  .ws[data-compact-drop]:not([data-state='empty']) .dropzone { display: none; }
  .ws-head { min-height: 48px; }
  .ws-status { display: none; }
  .filebar__name { flex: 1 1 calc(100% - 40px); white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .filebar__actions { flex: 1 1 100%; }
  .filebar__actions .btn { flex: 1; }
  .req-grid--t2, .req-grid--t3 { grid-template-columns: minmax(0, 1fr); }
  .ws-req__bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .ws-req__bar .req-summary { grid-column: 1 / -1; grid-row: 2; }
  .choice { min-height: 56px; }
  .ws-custom { grid-template-columns: minmax(0, 1fr); }
  .ws--linear .ws-action { display: grid; justify-content: stretch; }
  .ws--linear .ws-action .btn-lg, .ws-result__actions .btn { width: 100%; min-width: 0; }
  .ws-result__actions { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1 1 100%; }
  .ws[data-state='done'] .ws-result__actions .btn-lg:not(.btn-primary) { min-height: var(--h-md); font-size: var(--fs-md); font-weight: var(--fw-medium); }
  .meta-stats--row { grid-template-columns: minmax(0, 1fr); }
  .meta-stats--row .meta-stat-item { display: flex; }
  .meta-stats--row .meta-stat-item + .meta-stat-item { border-top: var(--bw) solid var(--c-line); }
  .meta-stats--row .meta-stat-val { text-align: right; }
  .target-grid .chip { min-height: 48px; }
  /* Reference tables: one block per row, the first cell as its title */
  .table-wrap[data-stack] { overflow: visible; border-bottom: 0; }
  .table-wrap[data-stack] table, .table-wrap[data-stack] tbody, .table-wrap[data-stack] tr { display: block; }
  .table-wrap[data-stack] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .table-wrap[data-stack] tr { display: grid; gap: var(--s-1); padding: var(--s-3) 0; border-bottom: var(--bw) solid var(--c-line); }
  .table-wrap[data-stack] td { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s-3); min-width: 0; padding: 0; border: 0; }
  .table-wrap[data-stack] td::before { content: attr(data-label); font-size: var(--fs-label); color: var(--c-text-3); }
  .table-wrap[data-stack] td:first-child { grid-template-columns: minmax(0, 1fr); color: var(--c-text); font-weight: var(--fw-strong); }
  .table-wrap[data-stack] td:first-child::before { content: none; }
  /* Requirement against the file: one block per rule, the two values side by side */
  .check-table, .check-table tbody { display: block; }
  .check-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .check-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-1) var(--s-3); padding: var(--s-3); border-bottom: var(--bw) solid var(--c-line); }
  .check-table tbody tr:last-child { border-bottom: 0; }
  .check-table tbody th, .check-table td { width: auto; padding: 0; border: 0; }
  .check-table tbody th { grid-column: 1 / -1; color: var(--c-text); font-weight: var(--fw-strong); }
  .check-table td::before, .check-table td.is-met::before { content: attr(data-label); display: block; width: auto; height: auto; margin: 0 0 2px; background: none; -webkit-mask: none; mask: none; font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--c-text-3); }
  .check-table tbody tr:has(td.is-met) th::after { content: ''; display: inline-block; width: 12px; height: 12px; margin-left: 6px; background: var(--c-success); -webkit-mask: var(--mask-check) center/contain no-repeat; mask: var(--mask-check) center/contain no-repeat; }

  /* Resume */
  .editor-tab-pane { padding: var(--s-4); }
  .rb-toolbar { flex-wrap: wrap; }
  .rb-toolbar .btn { padding-inline: var(--s-2); }
  .rb-editor .field-row, .rb-editor .field-row--3 { grid-template-columns: minmax(0, 1fr); }
  .skill-row-inputs { grid-template-columns: minmax(0, 1fr); }
  .rb-steps { padding: 0 var(--s-1); }
  .rb-steps .tab { padding: 0 var(--s-1); font-size: var(--fs-label); gap: var(--s-1); }
  .rb-head { margin-bottom: var(--s-3); }
  .rb-head .page-lede { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .rb-next .btn { flex: 1; }
  .export-row { grid-template-columns: minmax(0, 1fr); }
  .export-row .btn { width: 100%; }
  .template-select { grid-template-columns: 40px minmax(0, 1fr); gap: 2px var(--s-3); padding-block: 10px; }
  .template-card-desc { -webkit-line-clamp: 2; font-size: var(--fs-sm); }
  .template-filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-filter-bar .chip { justify-content: center; white-space: normal; text-align: center; line-height: 1.25; padding-block: var(--s-1); }
  .accordion-meta { display: none; }
}

/* ================================================================== 16. PRINT AND MOTION */
@media print {
  .site-header, .site-footer, .skip-link, .task-notification, .dialog-backdrop, .faq-section, .rb-howto, .related-tool, .related-guides-section, .resource-section, .toolset, .sr-only, .rb-head, .rb-editor, .form-panel, .preview-toolbar, .rb-bar, .resume-mode-tabs, .preview-empty-note, .noscript-note { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .page, .page--wide { max-width: none !important; width: auto !important; margin: 0 !important; padding: 0 !important; }
  .rb, .rb-preview { display: block !important; height: auto !important; max-height: none !important; overflow: visible !important; border: 0 !important; border-radius: 0 !important; background: #fff !important; }
  .resume-preview-outer { overflow: visible !important; background: #fff !important; padding: 0 !important; }
  a { color: #000; text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .fa-spin { animation: none !important; }
}
