:root {
  /* Mingmist Design Language */
  --void-black: #000000;
  --deep-mist: #0b1628;
  --slate-surface: #2f3847;
  --clear-white: #f2f4f7;
  --archive-silver: #aab7c4;
  --mist-teal: #1b4f4d;

  /* Override the v1.0 palette with quieter, product-led tokens. */
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #e8ecf0;
  --text: #0b1628;
  --muted: #5d6978;
  --border: #d5dbe2;
  --brand: #1b4f4d;
  --brand-strong: #143f3d;
  --brand-soft: #e5eeee;
  --success: #1b4f4d;
  --success-soft: #e5eeee;
  --warning: #725b2a;
  --warning-soft: #f3eee2;
  --danger: #8b3e46;
  --danger-soft: #f5e9eb;
  --shadow: 0 14px 36px rgba(11, 22, 40, .08);
  --radius-sm: 6px;
  --radius: 9px;
  --radius-lg: 12px;
  --v11-header-height: 64px;
}

html[data-theme="dark"] {
  --bg: #000000;
  --surface: #0b1628;
  --surface-2: #172337;
  --text: #f2f4f7;
  --muted: #aab7c4;
  --border: #2f3847;
  --brand: #1b4f4d;
  --brand-strong: #8bb8b5;
  --brand-soft: #102e2d;
  --success: #8bb8b5;
  --success-soft: #102e2d;
  --warning: #d0b171;
  --warning-soft: #332b1e;
  --danger: #e1a2a8;
  --danger-soft: #3a2228;
  --shadow: 0 18px 42px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }
img, svg { display: block; }
button { cursor: pointer; }
main { min-height: calc(100vh - 180px); }
.container { width: min(calc(100% - 48px), 1180px); margin-inline: auto; }
.narrow { width: min(calc(100% - 48px), 820px); margin-inline: auto; }
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1200;
  transform: translateY(-180%);
  padding: 8px 11px;
  background: var(--clear-white);
  color: var(--deep-mist);
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }
.header-inner {
  width: min(calc(100% - 48px), 1180px);
  margin-inline: auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand, .site-nav, .header-actions, .icon-button, .lang-link {
  display: inline-flex;
  align-items: center;
}
.brand, .site-nav a, .lang-link { text-decoration: none; }
.header-actions { gap: 6px; }
.site-nav { gap: 3px; }
.site-nav a, .icon-button, .lang-link {
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 0;
  background: transparent;
}
.icon-button { width: 38px; padding: 0; }
.hero-copy { color: var(--muted); }
.tool-grid { display: grid; }
.tool-card { display: flex; flex-direction: column; text-decoration: none; }
.tool-card .card-link { margin-top: auto; }
.section { padding: 68px 0; }
.section.compact { padding: 44px 0; }
.section-header { margin-bottom: 24px; }
.section-header h2 { margin: 0 0 7px; }
.section-header p { margin: 0; color: var(--muted); }
.page-hero { border-bottom: 1px solid var(--border); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; color: var(--muted); font-size: .88rem; }
.breadcrumb a { text-decoration: none; }
.page-hero h1 { margin: 0; }
.page-hero .lede { margin: 13px 0 0; color: var(--muted); }
.badge-row { display: flex; flex-wrap: wrap; margin-top: 16px; }
.tool-shell { margin: 20px auto 60px; }
.tool-panel { border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.tool-panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tool-panel-header h2 { margin: 0; font-size: 1rem; }
.tool-panel-body { padding: 22px; }
.tool-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tool-layout.single { grid-template-columns: 1fr; }
.tool-layout.asymmetric { grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); }
.field { display: grid; gap: 7px; }
.field + .field { margin-top: 14px; }
.field label, .field-label { font-weight: 650; font-size: .9rem; }
.field-help { color: var(--muted); font-size: .82rem; }
textarea, .text-input, .select-input, .number-input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
}
textarea { min-height: 280px; resize: vertical; padding: 13px; font-family: "SFMono-Regular", Consolas, monospace; line-height: 1.55; font-size: .9rem; }
textarea.compact { min-height: 175px; }
.text-input, .select-input, .number-input { min-height: 42px; padding: 8px 10px; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.checkbox, .radio { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 650;
  text-decoration: none;
}
.dropzone { border: 1px dashed var(--border); text-align: center; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 44px; align-items: start; }
.prose h2 { margin: 42px 0 11px; font-size: 1.55rem; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--muted); }
.prose details { border-top: 1px solid var(--border); padding: 14px 0; }
.prose details:last-child { border-bottom: 1px solid var(--border); }
.prose summary { cursor: pointer; font-weight: 650; }
.side-nav { position: sticky; top: 86px; padding: 14px; border: 1px solid var(--border); background: var(--surface); }
.side-nav strong { display: block; margin-bottom: 7px; }
.side-nav a { display: block; padding: 6px 7px; color: var(--muted); text-decoration: none; font-size: .88rem; }
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); }
.footer-inner { width: min(calc(100% - 48px), 1180px); margin-inline: auto; padding: 28px 0; display: flex; justify-content: space-between; gap: 22px; color: var(--muted); font-size: .86rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 15px; }
.footer-links a { text-decoration: none; }
.hidden { display: none !important; }
::selection { background: var(--mist-teal); color: var(--clear-white); }

/* Header: stable brand environment, not a floating SaaS bar. */
.site-header {
  position: sticky;
  background: var(--deep-mist);
  border-bottom: 1px solid var(--slate-surface);
  box-shadow: none;
  backdrop-filter: none;
}
html[data-theme="dark"] .site-header { background: var(--void-black); }
.header-inner { min-height: var(--v11-header-height); }
.brand { gap: 9px; color: var(--clear-white); font-weight: 680; letter-spacing: -.015em; }
.brand-mark {
  width: 29px;
  height: 29px;
  border: 1px solid var(--archive-silver);
  border-radius: 5px;
  background: transparent;
  color: var(--clear-white);
  box-shadow: none;
  font-size: .82rem;
}
.brand-name { color: var(--clear-white); }
.brand-section { color: var(--archive-silver); font-weight: 520; }
.site-nav a,
.site-header .icon-button,
.site-header .lang-link { color: var(--archive-silver); border-radius: 5px; }
.site-nav a:hover,
.site-header .icon-button:hover,
.site-header .lang-link:hover { background: var(--slate-surface); color: var(--clear-white); }
.site-nav a[aria-current="page"] {
  background: transparent;
  color: var(--clear-white);
  box-shadow: inset 0 -2px 0 var(--mist-teal);
}
.site-header .icon-button svg { width: 18px; height: 18px; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; }
.nav-toggle span { display: block; width: 17px; height: 1.5px; background: currentColor; transition: transform .15s ease, opacity .15s ease; }
.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Home: concise surface, explicit control model. */
.v11-home-hero {
  padding: clamp(54px, 7vw, 82px) 0 48px;
  background: var(--deep-mist);
  color: var(--clear-white);
  border-bottom: 1px solid var(--slate-surface);
}
html[data-theme="dark"] .v11-home-hero { background: var(--void-black); }
.v11-hero-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: clamp(34px, 6vw, 76px); align-items: end; }
.v11-hero-main { min-width: 0; }
.v11-kicker {
  margin: 0 0 14px;
  color: var(--archive-silver);
  font: 650 .76rem/1.2 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.v11-home-hero h1 {
  margin: 0;
  max-width: 760px;
  color: var(--clear-white);
  font-size: clamp(2.35rem, 5.2vw, 4.15rem);
  line-height: 1.04;
  letter-spacing: -.048em;
  font-weight: 700;
}
.v11-home-hero .hero-copy { max-width: 700px; margin: 20px 0 0; color: var(--archive-silver); font-size: clamp(1rem, 1.6vw, 1.13rem); }
.v11-search-shell { position: relative; max-width: 760px; margin-top: 28px; }
.v11-search-shell svg { position: absolute; left: 17px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: #596574; z-index: 1; }
.v11-search-shell input {
  width: 100%;
  min-height: 58px;
  padding: 13px 90px 13px 49px;
  border: 1px solid var(--archive-silver);
  border-radius: 7px;
  background: var(--clear-white);
  color: var(--deep-mist);
  box-shadow: none;
  outline: none;
  font-size: 1rem;
}
.v11-search-shell input:focus { border-color: #ffffff; box-shadow: 0 0 0 3px rgba(27, 79, 77, .65); }
.v11-search-shell kbd {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 7px;
  border: 1px solid #b8c2cd;
  border-radius: 4px;
  background: #e7ebef;
  color: #56616f;
  font: 650 .72rem var(--mono);
}
.quick-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 15px; color: var(--archive-silver); font-size: .87rem; }
.quick-links a { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--clear-white); text-decoration: underline; text-decoration-color: var(--mist-teal); text-underline-offset: 4px; }
.quick-links a:hover { color: #ffffff; text-decoration-thickness: 2px; }

.principle-panel { border: 1px solid var(--slate-surface); background: #101d31; }
html[data-theme="dark"] .principle-panel { background: var(--deep-mist); }
.principle-panel-label { padding: 12px 15px; border-bottom: 1px solid var(--slate-surface); color: var(--archive-silver); font: 650 .7rem var(--mono); letter-spacing: .09em; }
.principle-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 15px; border-bottom: 1px solid var(--slate-surface); }
.principle-row:last-child { border-bottom: 0; }
.principle-index { color: var(--archive-silver); font: 600 .72rem var(--mono); }
.principle-row strong { display: block; color: var(--clear-white); font-size: .92rem; font-weight: 650; }
.principle-row p { margin: 3px 0 0; color: var(--archive-silver); font-size: .8rem; line-height: 1.45; }

/* Sections and hierarchy. */
.v11-section { padding: 50px 0; }
.v11-section + .v11-section { border-top: 1px solid var(--border); }
.v11-section.section-surface { background: var(--surface); }
.v11-section.section-deep { background: var(--deep-mist); color: var(--clear-white); border-top-color: var(--slate-surface); }
html[data-theme="dark"] .v11-section.section-deep { background: var(--deep-mist); }
.section-heading-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 20px; }
.section-heading-row h2 { margin: 0 0 5px; font-size: clamp(1.35rem, 2.5vw, 1.85rem); letter-spacing: -.025em; line-height: 1.2; font-weight: 680; }
.section-heading-row p { margin: 0; color: var(--muted); }
.section-heading-row > a { flex: 0 0 auto; color: var(--brand-strong); font-weight: 650; text-decoration: none; }
.section-heading-row > a:hover { text-decoration: underline; text-underline-offset: 4px; }
.section-deep .section-heading-row p { color: var(--archive-silver); }
.section-deep .section-heading-row > a { color: var(--clear-white); }

.tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tool-card {
  min-height: 152px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
  transition: border-color .14s ease, background .14s ease;
}
.tool-card::before { display: none; }
.tool-card.compact-card { min-height: 136px; }
.tool-card:hover { transform: none; border-color: var(--mist-teal); box-shadow: none; background: color-mix(in srgb, var(--surface) 94%, var(--brand-soft)); }
.tool-card-head { display: flex; align-items: center; min-height: 22px; gap: 8px; }
.tool-card-head .category { min-width: 0; }
.tool-card-icon { display: none; }
.tool-card .category { color: var(--muted); font: 650 .69rem var(--mono); letter-spacing: .075em; text-transform: uppercase; }
.tool-flags { display: inline-flex; gap: 10px; margin-left: auto; }
.mini-badge { padding: 0; border-radius: 0; background: transparent; color: var(--muted); font: 650 .67rem var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.mini-badge.new { background: transparent; color: var(--brand-strong); }
.tool-card h3 { margin: 12px 0 6px; font-size: 1.04rem; line-height: 1.3; letter-spacing: -.015em; font-weight: 670; }
.tool-card p { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.48; }
.tool-format { display: inline-flex; width: fit-content; margin-top: 12px; color: var(--muted); font: 600 .7rem var(--mono); }
.tool-card .card-link { padding-top: 12px; color: var(--brand-strong); font-size: .82rem; font-weight: 650; }
.tool-card:hover .card-link { transform: none; }

.featured-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; }
.featured-tool {
  min-height: 228px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
.featured-tool:hover { border-color: var(--mist-teal); }
.featured-tool .module-index { color: var(--muted); font: 650 .72rem var(--mono); letter-spacing: .08em; }
.featured-tool h3 { margin: 42px 0 8px; font-size: clamp(1.45rem, 2.7vw, 2rem); letter-spacing: -.03em; font-weight: 680; }
.featured-tool p { margin: 0; max-width: 620px; color: var(--muted); }
.featured-tool .card-link { margin-top: auto; padding-top: 22px; color: var(--brand-strong); font-weight: 650; }

.category-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--border); border-right: 0; }
.category-card { min-height: 152px; padding: 17px; border: 0; border-right: 1px solid var(--border); border-radius: 0; background: var(--surface); text-decoration: none; }
.category-card:hover { transform: none; background: var(--brand-soft); }
.category-card .category-index { color: var(--muted); font: 650 .72rem var(--mono); }
.category-card strong { display: block; margin: 40px 0 6px; font-weight: 670; }
.category-card span:last-child { color: var(--muted); font-size: .82rem; }

.ownership-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--slate-surface); border-right: 0; }
.ownership-item { padding: 20px; border-right: 1px solid var(--slate-surface); }
.ownership-item span { display: block; color: var(--archive-silver); font: 600 .68rem var(--mono); letter-spacing: .08em; }
.ownership-item strong { display: block; margin-top: 12px; color: var(--clear-white); font-size: .95rem; font-weight: 650; }
.ownership-item p { margin: 5px 0 0; color: var(--archive-silver); font-size: .82rem; }

/* Directory */
.directory-hero-v11 { padding: 46px 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.directory-hero-v11 h1 { margin: 0; font-size: clamp(2rem, 4.2vw, 3.15rem); letter-spacing: -.038em; font-weight: 700; }
.directory-hero-v11 .hero-copy { max-width: 720px; margin-top: 12px; }
.directory-toolbar { position: sticky; top: calc(var(--v11-header-height) + 8px); z-index: 12; padding: 10px; margin-bottom: 32px; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(12px); }
.directory-toolbar .search-box { max-width: none; }
.directory-toolbar .search-box input { min-height: 48px; border-radius: 6px; box-shadow: none; }
.directory-toolbar-row { display: flex; align-items: center; gap: 12px; }
.directory-toolbar-row .search-box { flex: 1; }
.filter-count { flex: 0 0 auto; color: var(--muted); font: 600 .78rem var(--mono); }
.category-pills { display: flex; gap: 0; overflow-x: auto; margin-top: 10px; border-top: 1px solid var(--border); scrollbar-width: thin; }
.category-pills a { flex: 0 0 auto; padding: 9px 12px 2px; border: 0; border-right: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--muted); text-decoration: none; font-size: .8rem; font-weight: 600; }
.category-pills a:hover { color: var(--text); }
.tool-category { margin-top: 44px; scroll-margin-top: 146px; }
.tool-category:first-of-type { margin-top: 0; }
.tool-category .section-header { margin-bottom: 16px; }

/* Command palette */
.command-open { overflow: hidden; }
.command-palette { position: fixed; inset: 0; z-index: 1000; }
.command-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .68); backdrop-filter: blur(2px); }
.command-dialog { position: relative; width: min(calc(100% - 30px), 740px); max-height: min(720px, calc(100vh - 64px)); margin: 38px auto 0; overflow: hidden; border: 1px solid var(--slate-surface); border-radius: 8px; background: var(--surface); box-shadow: 0 28px 72px rgba(0,0,0,.35); }
.command-input-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.command-input-row svg { width: 19px; height: 19px; color: var(--muted); }
.command-input-row input { min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: 1rem; }
.command-input-row kbd { padding: 4px 7px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); color: var(--muted); font: 600 .7rem var(--mono); }
.command-results { max-height: min(560px, calc(100vh - 180px)); overflow: auto; padding: 5px; }
.command-result { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px; border-radius: 5px; text-decoration: none; }
.command-result.active, .command-result:hover { background: var(--brand-soft); }
.command-category { color: var(--muted); font: 600 .68rem var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.command-result strong, .command-result small { display: block; }
.command-result small { margin-top: 2px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.command-result .tool-format { margin: 0; white-space: nowrap; }
.command-empty { padding: 34px 20px; color: var(--muted); text-align: center; }
.command-dialog footer { padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: .76rem; }

/* Tool pages */
.page-hero { background: var(--surface); }
.tool-page-hero { padding: 32px 0 22px; }
.tool-page-hero h1 { font-size: clamp(1.85rem, 3.8vw, 2.65rem); letter-spacing: -.035em; font-weight: 700; }
.tool-page-hero .lede { max-width: 760px; }
.badge-row { gap: 0; }
.badge { padding: 0 10px 0 0; border-radius: 0; background: transparent; color: var(--muted); font: 600 .72rem var(--mono); }
.badge + .badge { padding-left: 10px; border-left: 1px solid var(--border); }
.badge.safe { background: transparent; color: var(--brand-strong); }
.tool-shell { margin-top: 22px; }
.tool-panel { border-radius: 9px; box-shadow: none; }
.tool-panel-header { min-height: 54px; background: var(--surface-2); }
.tool-panel-header h2 { font-weight: 650; }
.tool-panel-body { padding: clamp(16px, 3vw, 24px); }
.button { border-radius: 6px; box-shadow: none; }
.button:hover { transform: none; }
.button.primary { border-color: var(--mist-teal); background: var(--mist-teal); color: var(--clear-white); }
html[data-theme="dark"] .button.primary { color: var(--clear-white); }
textarea, .text-input, .select-input, .number-input,
.field > input[type="text"], .field > input[type="number"], .field > input[type="color"], .field > select,
.control-grid input[type="text"], .control-grid input[type="number"], .control-grid input[type="color"], .control-grid select { border-radius: 6px; }
.dropzone { padding: 26px 20px; border-radius: 7px; background: var(--surface-2); transition: border-color .15s ease, background .15s ease; }
.dropzone.drag-over { border-color: var(--mist-teal); background: var(--brand-soft); transform: none; }
.related-tools-section { padding: 18px 0 52px; }
.related-tools-section h2 { margin: 0 0 15px; font-size: 1.35rem; letter-spacing: -.02em; }
.related-tools-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.related-tools-grid .tool-card { min-height: 132px; }

/* New tool controls */
.v11-result-list { display: grid; gap: 8px; margin-top: 18px; }
.v11-result-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.v11-result-row strong, .v11-result-row small { display: block; overflow-wrap: anywhere; }
.v11-result-row small { margin-top: 3px; color: var(--muted); }
.range-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.range-row output { min-width: 44px; color: var(--muted); font: 600 .8rem var(--mono); }
input[type="range"] { width: 100%; accent-color: var(--mist-teal); }
.crop-preview-wrap { min-height: 260px; display: grid; place-items: center; overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: 7px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 50% / 18px 18px; }
#crop-preview { max-width: 100%; height: auto; box-shadow: 0 8px 22px rgba(0,0,0,.14); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.metric-card { min-height: 96px; padding: 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.metric-card span { display: block; color: var(--muted); font-size: .78rem; }
.metric-card strong { display: block; margin-top: 10px; font-size: 1.55rem; letter-spacing: -.025em; }
.diff-result { max-height: 560px; overflow: auto; margin-top: 18px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-family: var(--mono); font-size: .82rem; }
.diff-line { display: grid; grid-template-columns: 28px 48px minmax(0, 1fr); min-height: 29px; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.diff-line:last-child { border-bottom: 0; }
.diff-line span, .diff-line code { padding: 5px 7px; }
.diff-line code { white-space: pre-wrap; overflow-wrap: anywhere; background: transparent; }
.diff-mark, .diff-number { color: var(--muted); text-align: right; user-select: none; }
.diff-line.add { background: var(--success-soft); }
.diff-line.remove { background: var(--danger-soft); }
.diff-line.add .diff-mark { color: var(--success); }
.diff-line.remove .diff-mark { color: var(--danger); }

/* Category pages */
.category-landing-hero { padding: 46px 0 30px; background: var(--surface); border-bottom: 1px solid var(--border); }
.category-landing-grid { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 28px; align-items: start; }
.category-landing-hero .category-symbol { width: 92px; height: 92px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--muted); font: 650 .85rem var(--mono); }
.category-landing-hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 4.3vw, 3.25rem); letter-spacing: -.04em; font-weight: 700; }
.category-landing-hero p { max-width: 720px; margin: 0; color: var(--muted); font-size: 1.02rem; }
.category-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 24px; border: 1px solid var(--border); border-right: 0; }
.category-benefit { padding: 14px; border: 0; border-right: 1px solid var(--border); border-radius: 0; background: var(--bg); }
.category-benefit strong { display: block; margin-bottom: 4px; font-size: .9rem; }
.category-benefit span { color: var(--muted); font-size: .82rem; }

.site-footer { background: var(--deep-mist); border-top-color: var(--slate-surface); }
html[data-theme="dark"] .site-footer { background: var(--void-black); }
.site-footer .footer-inner { color: var(--archive-silver); }
.site-footer a:hover { color: var(--clear-white); }

@media (max-width: 1020px) {
  .v11-hero-layout { grid-template-columns: 1fr; align-items: start; }
  .principle-panel { max-width: 760px; }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 0; }
  .category-card { border-bottom: 1px solid var(--border); }
  .ownership-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 0; }
  .ownership-item { border-bottom: 1px solid var(--slate-surface); }
  .related-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  :root { --v11-header-height: 58px; }
  .header-inner { min-height: 58px; padding-block: 8px; flex-wrap: nowrap; }
  .header-actions { display: flex; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none !important;
    position: absolute;
    top: calc(100% + 1px);
    left: 10px;
    right: 10px;
    padding: 7px;
    border: 1px solid var(--slate-surface);
    border-radius: 7px;
    background: var(--deep-mist);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
  }
  .site-header.nav-open .site-nav { display: flex !important; }
  .site-nav a { justify-content: flex-start; min-height: 40px; padding: 8px 10px; }
  .brand-section { display: none; }
  .featured-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-toolbar { top: 66px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-benefits { grid-template-columns: 1fr; border-right: 1px solid var(--border); border-bottom: 0; }
  .category-benefit { border-right: 0; border-bottom: 1px solid var(--border); }
  .category-landing-grid { grid-template-columns: 1fr; gap: 18px; }
  .category-landing-hero .category-symbol { width: 72px; height: 56px; }
  .tool-panel .actions {
    position: sticky;
    bottom: 8px;
    z-index: 8;
    padding: 9px;
    margin: 18px -5px -5px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 22px rgba(0,0,0,.12);
  }
}

@media (max-width: 560px) {
  .lang-link { padding-inline: 7px; }
  .v11-home-hero { padding-top: 44px; }
  .v11-home-hero h1 { font-size: clamp(2.15rem, 11vw, 3.25rem); }
  .v11-search-shell input { min-height: 56px; padding-right: 54px; }
  .v11-search-shell kbd { font-size: 0; padding: 5px; }
  .v11-search-shell kbd::after { content: "⌘K"; font-size: .68rem; }
  .tool-grid, .related-tools-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; border-right: 1px solid var(--border); }
  .category-card { border-right: 0; }
  .ownership-strip { grid-template-columns: 1fr; border-right: 1px solid var(--slate-surface); }
  .ownership-item { border-right: 0; }
  .section-heading-row { align-items: start; }
  .section-heading-row > a { font-size: .84rem; }
  .directory-toolbar-row { align-items: stretch; flex-direction: column; }
  .filter-count { padding-left: 4px; }
  .command-dialog { margin-top: 10px; max-height: calc(100vh - 20px); }
  .command-result { grid-template-columns: 72px minmax(0, 1fr); }
  .command-result .tool-format { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .v11-result-row { align-items: stretch; flex-direction: column; }
  .v11-result-row .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* PDF compression workflows */
.compression-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 20px;
  align-items: start;
}
.compression-source,
.compression-settings {
  min-width: 0;
}
.compression-source-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.compression-source-meta span { color: var(--muted); font-size: .82rem; }
.compression-source-meta strong { font: 650 .84rem var(--mono); }
.target-rule {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--slate-surface);
  background: var(--deep-mist);
  color: var(--clear-white);
}
.target-rule > span {
  font: 700 1.65rem/1 var(--mono);
  letter-spacing: -.05em;
}
.target-rule strong { display: block; font-size: .9rem; }
.target-rule p { margin: 4px 0 0; color: var(--archive-silver); font-size: .82rem; }
.compression-policy {
  padding: 15px 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.compression-policy > strong { display: block; margin-bottom: 9px; }
.compression-policy ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: .88rem; }
.compression-policy li + li { margin-top: 5px; }
.compression-advanced { margin-top: 14px; }
.compression-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 17px;
}
.compression-progress progress {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--surface-2);
}
.compression-progress progress::-webkit-progress-bar { background: var(--surface-2); }
.compression-progress progress::-webkit-progress-value { background: var(--mist-teal); }
.compression-progress progress::-moz-progress-bar { background: var(--mist-teal); }
.compression-progress span { color: var(--muted); font: 600 .76rem var(--mono); }
.compression-attempts {
  display: grid;
  gap: 7px;
  margin-top: 20px;
}
.compression-attempt {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.compression-attempt > span {
  width: 8px;
  height: 8px;
  background: var(--archive-silver);
}
.compression-attempt[data-state="running"] > span { background: var(--warning); animation: compression-pulse 1s ease-in-out infinite; }
.compression-attempt[data-state="success"] > span { background: var(--mist-teal); }
.compression-attempt[data-state="warning"] > span { background: var(--warning); }
.compression-attempt strong,
.compression-attempt small { display: block; }
.compression-attempt strong { font-size: .86rem; }
.compression-attempt small { margin-top: 2px; color: var(--muted); font-size: .77rem; }
.compression-attempt b { color: var(--muted); font: 650 .75rem var(--mono); }
.compression-result {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--slate-surface);
  background: var(--surface);
}
.compression-result-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border);
}
.compression-result-head span,
.compression-metrics span { color: var(--muted); font-size: .76rem; }
.compression-result-head strong { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.target-state {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--border);
  color: var(--muted) !important;
  font: 650 .72rem var(--mono);
}
.target-state.pass { border-color: var(--mist-teal); color: var(--brand-strong) !important; }
.target-state.fail { border-color: var(--danger); color: var(--danger) !important; }
.compression-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
  border: 1px solid var(--border);
  border-right: 0;
}
.compression-metrics > div {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
}
.compression-metrics strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  font-size: .92rem;
}
.compression-result-note { margin: 13px 0 0; color: var(--muted); font-size: .82rem; }
@keyframes compression-pulse { 50% { opacity: .35; } }

@media (max-width: 860px) {
  .compression-workspace { grid-template-columns: 1fr; }
  .compression-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 0; }
  .compression-metrics > div { border-bottom: 1px solid var(--border); }
}

@media (max-width: 520px) {
  .target-rule { grid-template-columns: 1fr; gap: 8px; }
  .compression-progress { grid-template-columns: 1fr; }
  .compression-attempt { grid-template-columns: 10px minmax(0, 1fr); }
  .compression-attempt b { grid-column: 2; }
  .compression-result-head { flex-direction: column; }
  .compression-metrics { grid-template-columns: 1fr; border-right: 1px solid var(--border); }
  .compression-metrics > div { border-right: 0; }
}
