:root {
  color-scheme: light;
  --bg: #f5f7f7;
  --surface: #ffffff;
  --surface-secondary: #f0f3f3;
  --text: #172127;
  --text-muted: #64717a;
  --border: #dce4e8;
  --border-strong: #b8c4ca;
  --brand: #176b7f;
  --brand-hover: #105667;
  --accent: #e57432;
  --danger: #b42318;
  --focus: #236bd7;
  --content-max: 76rem;
  --radius-md: 0.65rem;
  --radius-lg: 0.9rem;
  --radius-xl: 1.2rem;
  --shadow-card: 0 0.0625rem 0.125rem rgb(24 39 47 / 4%), 0 0.35rem 1.1rem rgb(24 39 47 / 5%);
  --shadow-popover: 0 0.875rem 2.5rem rgb(20 35 43 / 14%);
  --shadow-dialog: 0 1.5rem 4rem rgb(12 23 29 / 22%);
  font-family: "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f161a;
  --surface: #172126;
  --surface-secondary: #202d33;
  --text: #edf4f6;
  --text-muted: #a7b5bc;
  --border: #2b3a41;
  --border-strong: #4a5c64;
  --brand: #79bfd0;
  --brand-hover: #9fd5e1;
  --accent: #ef8b49;
  --danger: #ff7b72;
  --focus: #8eb8ff;
  --shadow-card: 0 0.0625rem 0 rgb(255 255 255 / 3%), 0 0.75rem 2rem rgb(0 0 0 / 18%);
  --shadow-popover: 0 0.875rem 2.5rem rgb(0 0 0 / 38%);
  --shadow-dialog: 0 1.5rem 4rem rgb(0 0 0 / 52%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 0; margin: 0; background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body[data-menu-open="true"] { overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
svg { display: block; }
a { color: var(--brand); text-decoration-thickness: 0.08em; text-underline-offset: 0.16em; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 0.1875rem solid var(--focus); outline-offset: 0.125rem; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

.shell { width: min(var(--content-max), calc(100% - 4rem)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 50; top: 0.75rem; left: 0.75rem; transform: translateY(-160%); padding: 0.6rem 0.9rem; border-radius: var(--radius-md); background: var(--text); color: var(--surface); transition: transform 120ms ease; }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent); background: color-mix(in srgb, var(--surface) 97%, transparent); }
.header-row { position: relative; display: flex; min-height: 4.1875rem; align-items: center; gap: 1rem; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 0.55rem; min-width: 0; color: var(--text); font-size: 1rem; font-weight: 700; letter-spacing: -0.015em; text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark { display: block; width: 2.125rem; height: 2.125rem; flex: 0 0 2.125rem; }
.brand-wordmark { white-space: nowrap; }
.brand-wordmark span:last-child { color: var(--brand); }
.desktop-nav { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.desktop-nav a, .header-actions a, .theme-toggle { color: var(--text); font-size: 0.875rem; font-weight: 600; text-decoration: none; }
.desktop-nav a { border-radius: var(--radius-md); padding: 0.55rem 0.7rem; }
.desktop-nav a:hover { background: var(--surface-secondary); color: var(--brand); }
.desktop-nav a[aria-current="page"] { background: var(--surface-secondary); color: var(--brand); }
.header-actions a:hover { color: var(--brand); }
.header-actions { display: flex; min-height: 2.5rem; align-items: center; gap: 0.5rem; }
.icon-button, button.theme-toggle, .language-switch { display: inline-flex; height: 2.5rem; min-height: 2.5rem; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--text); line-height: 1; }
.icon-button, button.theme-toggle { width: 2.5rem; min-width: 2.5rem; flex: 0 0 2.5rem; padding: 0; }
.icon-button:hover, .theme-toggle:hover { border-color: var(--border); background: var(--surface-secondary); }
.icon-button svg, .theme-toggle svg { width: 1.125rem; height: 1.125rem; }
.theme-toggle > [data-theme-icon] { display: grid; width: 1.25rem; height: 1.25rem; place-items: center; line-height: 0; }
.theme-toggle > [data-theme-icon][hidden] { display: none; }
.theme-toggle > [data-theme-icon] svg { width: 1.125rem; height: 1.125rem; }
button.theme-toggle { border-color: var(--border); background: var(--surface-secondary); }
.desktop-theme, .desktop-language { display: inline-flex; }
.language-switch { min-width: 2.75rem; flex: 0 0 auto; gap: 0.55rem; border-color: var(--border); padding-inline: 0.65rem; background: var(--surface-secondary); }
.language-switch:hover { border-color: var(--brand); }
.language-switch-name { display: none; }
.support-link { display: inline-flex; min-height: 2.5rem; align-items: center; padding: 0.4rem 0.55rem; color: var(--brand) !important; font-size: 0.875rem; font-weight: 650; text-decoration: none; }
.support-link:hover { color: var(--brand-hover) !important; text-decoration: underline; }
.search-trigger, .mobile-menu-trigger { display: none; }
.site-search { position: relative; }
.header-search { position: relative; width: min(17.5rem, 26vw); margin-left: 0.25rem; }
.header-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.search-control { display: flex; min-height: 2.5rem; align-items: center; gap: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0 0.75rem; background: var(--surface-secondary); transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease; }
.search-control:focus-within { border-color: var(--brand); box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--brand) 18%, transparent); }
.search-control input { width: 100%; min-width: 0; min-height: 2.35rem; border: 0; padding: 0.35rem 0; background: transparent; color: var(--text); outline: 0; }
.search-control input::placeholder { color: var(--text-muted); }
.search-control > svg, .search-control > span { width: 1rem; height: 1rem; flex: 0 0 1rem; color: var(--text-muted); }
.search-control > span { display: grid; place-items: center; }
.search-control > span svg { width: 100%; height: 100%; }
.search-results { position: absolute; z-index: 30; top: calc(100% + 0.5rem); right: 0; width: min(25rem, calc(100vw - 2rem)); max-height: 26rem; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.55rem; background: var(--surface); box-shadow: var(--shadow-popover); }
.search-results ul { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; }
.search-results li + li { margin-top: 0.125rem; }
.search-results a { display: grid; gap: 0.1rem; padding: 0.7rem 0.75rem; border-radius: var(--radius-md); color: var(--text); text-decoration: none; }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--surface-secondary); }
.search-results a strong { color: var(--text); font-size: 0.9rem; }
.search-results a span { color: var(--brand); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.search-results a small { color: var(--text-muted); font-size: 0.78rem; line-height: 1.35; }
.search-results > p { margin: 0; padding: 0.9rem 0.4rem; color: var(--text-muted); font-size: 0.9rem; }
.mobile-drawer { position: absolute; z-index: 25; top: calc(100% + 0.625rem); right: max(1rem, calc((100vw - var(--content-max)) / 2)); display: grid; gap: 0.75rem; width: min(21.25rem, calc(100vw - 2rem)); padding: 0.85rem 1rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-dialog); }
.mobile-drawer[hidden], .site-header .header-search[hidden] { display: none; }
.mobile-drawer nav { display: grid; gap: 0.1rem; padding-top: 2.5rem; }
.mobile-drawer .drawer-close { position: absolute; top: 0.65rem; right: 0.65rem; }
.mobile-drawer nav a { display: block; padding: 0.7rem 0.75rem; border-radius: var(--radius-md); color: var(--text); font-weight: 650; text-decoration: none; }
.mobile-drawer nav a:hover, .mobile-drawer nav a[aria-current="page"] { background: var(--surface-secondary); color: var(--brand); }
.mobile-drawer .drawer-actions { display: grid; gap: 0.4rem; border-top: 1px solid var(--border); padding-top: 0.8rem; }
.mobile-drawer .support-link { justify-content: flex-start; padding-inline: 0.5rem; }
.mobile-drawer .theme-toggle, .mobile-drawer .language-switch { justify-content: flex-start; width: 100%; border: 0; padding-inline: 0.5rem; background: transparent; }
.mobile-drawer .theme-toggle:hover, .mobile-drawer .language-switch:hover { background: var(--surface-secondary); }
.mobile-drawer .language-switch-name { display: inline; color: var(--text); font-weight: 600; }
.mobile-drawer .language-switch-code { min-width: 1.6rem; color: var(--text-muted); font-size: 0.75rem; font-weight: 700; }
.mobile-drawer .mobile-theme { gap: 0.65rem; }
.mobile-drawer .mobile-theme .sr-only { position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal; }
.mobile-drawer-backdrop { position: fixed; z-index: 24; inset: 4rem 0 0; background: rgb(0 0 0 / 18%); }
.mobile-drawer-backdrop[hidden] { display: none; }

.breadcrumbs { padding-top: 1rem; color: var(--text-muted); font-size: 0.8rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem; max-width: 100%; padding: 0; margin: 0; list-style: none; overflow-wrap: anywhere; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 0.25rem; color: var(--border-strong); }
.breadcrumbs a { color: inherit; }
main { padding-block: 1.5rem 5rem; }
main:focus { outline: 0; }
.page-header { width: min(var(--content-max), calc(100% - 4rem)); margin: 0 auto 2rem; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: clamp(1.25rem, 3vw, 2rem) 0 1.5rem; background: transparent; box-shadow: none; }
.page-header--simple { display: grid; min-height: calc(100vh - 12rem); place-items: center; margin-bottom: 0; border-bottom: 0; }
.page-header--simple > div { width: min(42rem, 100%); text-align: center; }
.page-header h1, .article-header h1 { max-width: 27ch; margin: 0; font-size: clamp(2rem, 3.2vw, 2.65rem); line-height: 1.1; letter-spacing: -0.032em; }
.page-header p, .article-header .lead { max-width: 50rem; margin: 0.7rem 0 0; color: var(--text-muted); font-size: 1.05rem; }
.page-header--simple h1 { max-width: 100%; }
.eyebrow { margin: 0 0 0.4rem; color: var(--brand); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.content-section { width: min(var(--content-max), calc(100% - 4rem)); margin: 2.75rem auto 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.022em; }
.section-heading a { display: inline-flex; flex: 0 0 auto; align-items: center; padding: 0.25rem 0; background: transparent; font-size: 0.84rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.section-heading a:hover { text-decoration: underline; }
.home-intro { width: min(var(--content-max), calc(100% - 4rem)); margin: 0 auto; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(1.75rem, 3vw, 2.5rem); background: transparent; box-shadow: none; }
.home-intro h1 { max-width: 28ch; margin: 0; font-size: clamp(2rem, 3.35vw, 2.7rem); line-height: 1.08; letter-spacing: -0.038em; }
.home-intro > p { max-width: 50rem; margin: 0.8rem 0 0; color: var(--text-muted); font-size: 1.04rem; }
.tool-list, .article-list { display: grid; gap: 0.75rem; }
.home-section .tool-list, .home-section .article-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 0.0625rem 0.125rem rgb(24 39 47 / 3%); }
.tool-row, .article-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; min-width: 0; padding: 1.05rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); text-decoration: none; box-shadow: 0 0.0625rem 0.125rem rgb(24 39 47 / 3%); transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease; }
.tool-row:hover, .article-row:hover { border-color: color-mix(in srgb, var(--brand) 48%, var(--border)); color: var(--text); box-shadow: var(--shadow-card); transform: translateY(-0.0625rem); }
.home-section .tool-row, .home-section .article-row { border: 0; border-radius: 0; background: transparent; box-shadow: none; transform: none; }
.home-section .tool-row:nth-child(even), .home-section .article-row:nth-child(even) { border-left: 1px solid var(--border); }
.home-section .tool-row:nth-child(n + 3), .home-section .article-row:nth-child(n + 3) { border-top: 1px solid var(--border); }
.home-section .tool-row:hover, .home-section .article-row:hover { background: var(--surface-secondary); box-shadow: none; transform: none; }
.tool-icon { display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border: 0; border-radius: var(--radius-md); background: color-mix(in srgb, var(--brand) 11%, var(--surface)); color: var(--brand); }
.tool-icon svg { width: 1.2rem; height: 1.2rem; }
.tool-row h2, .article-row h2 { margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.28; letter-spacing: -0.01em; }
.tool-row > span:nth-child(2), .article-row-copy, .category-row .article-row-copy, .footer-grid > div, .result-metric dt, .result-metric dd { min-width: 0; overflow-wrap: anywhere; }
.tool-row p, .article-row p { display: -webkit-box; overflow: hidden; margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.875rem; line-height: 1.42; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.row-meta { color: var(--text-muted); font-size: 0.75rem; }
.row-arrow { display: none; }
.tool-row:hover h2, .article-row:hover h2, .category-row:hover h2 { color: var(--brand); }
.article-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.article-row .row-meta { grid-column: 2; grid-row: 1; }
.article-row .row-arrow { grid-column: 2; grid-row: 2; justify-self: end; }
.article-row .article-row-copy { min-width: 0; }
.topic-group { position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.15rem; background: var(--surface); box-shadow: 0 0.0625rem 0.125rem rgb(24 39 47 / 3%); }
.topic-group h3 { margin: 0 0 0.65rem; font-size: 1rem; letter-spacing: -0.01em; }
.topic-group p { margin: 0 0 0.5rem; color: var(--text-muted); font-size: 0.875rem; }
.topic-group ul { display: grid; gap: 0.25rem; padding: 0; margin: 0; list-style: none; }
.topic-group a { font-size: 0.875rem; }
.topic-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 1.6rem 2rem; }
.home-section .topic-group { border: 0; border-top: 2px solid color-mix(in srgb, var(--brand) 55%, var(--border)); border-radius: 0; padding: 1rem 0 0; background: transparent; box-shadow: none; }
.category-links { display: grid; gap: 0.35rem; }
.category-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); text-decoration: none; }
.category-row:hover { border-color: color-mix(in srgb, var(--brand) 48%, var(--border)); background: var(--surface-secondary); color: var(--text); }
.category-row h2 { margin: 0; font-size: 0.95rem; font-weight: 650; }
.category-row p { display: -webkit-box; overflow: hidden; margin: 0.18rem 0 0; color: var(--text-muted); font-size: 0.8rem; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.category-links .category-row:hover { color: var(--brand); }
.topic-group .category-row { border: 0; padding: 0.48rem 0; background: transparent; }
.topic-group .category-row:hover { background: transparent; color: var(--brand); text-decoration: underline; text-underline-offset: 0.18em; }
.topic-group .category-row h2 { font-weight: 600; }
.topic-group .category-row .row-meta { display: none; }
.topic-group .category-row p { display: none; }
.topic-group .category-row .row-arrow { display: none; }
.article-list .row-meta, .topic-list .row-meta { display: none; }

.catalog-list { width: min(var(--content-max), calc(100% - 4rem)); margin-inline: auto; }
.catalog-list .tool-list, .catalog-list .article-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.catalog-list .tool-row, .catalog-list .article-row { min-height: 5.25rem; border: 0; border-radius: 0; box-shadow: none; transform: none; }
.catalog-list .tool-row:nth-child(even), .catalog-list .article-row:nth-child(even) { border-left: 1px solid var(--border); }
.catalog-list .tool-row:nth-child(n + 3), .catalog-list .article-row:nth-child(n + 3) { border-top: 1px solid var(--border); }
.catalog-list .tool-row:hover, .catalog-list .article-row:hover { background: var(--surface-secondary); box-shadow: none; transform: none; }
.topic-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.topic-list .category-row { min-height: 5rem; align-items: center; border: 0; border-radius: 0; padding: 1rem; background: transparent; }
.topic-list .category-row:nth-child(even) { border-left: 1px solid var(--border); }
.topic-list .category-row:nth-child(n + 3) { border-top: 1px solid var(--border); }
.topic-list .category-row:hover { background: var(--surface-secondary); }

.calculator-page { width: min(var(--content-max), calc(100% - 4rem)); margin-inline: auto; }
.calculator-page > .page-header { width: auto; margin-bottom: 1.5rem; }
.calculator-workspace { display: grid; grid-template-columns: minmax(0, 7fr) minmax(20rem, 5fr); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-card); }
.calc-form-column, .calc-result-column { min-width: 0; padding: clamp(1.25rem, 3vw, 2rem); }
.calc-result-column { border-left: 1px solid var(--border); background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.calc-form-column h2, .calc-result-column h2 { margin: 0; font-size: 1.25rem; line-height: 1.2; }
.calculator-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.field { display: grid; min-width: 0; gap: 0.35rem; }
.field label { color: var(--text); font-size: 0.875rem; font-weight: 650; line-height: 1.35; }
.field label span { color: var(--text-muted); font-weight: 400; }
.field-control { display: flex; min-width: 0; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-secondary); transition: border-color 140ms ease, box-shadow 140ms ease; }
.field-control:focus-within { border-color: var(--brand); box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--brand) 18%, transparent); }
.field-control input, .field-control select, .field > input, .field > select { width: 100%; min-width: 0; min-height: 2.75rem; border: 0; border-radius: inherit; padding: 0.58rem 0.75rem; background: transparent; color: var(--text); outline: 0; }
.field-control:has(select) { position: relative; }
.field-control:has(select)::after { position: absolute; top: 50%; right: 0.95rem; width: 0.48rem; height: 0.48rem; border-right: 0.125rem solid var(--text-muted); border-bottom: 0.125rem solid var(--text-muted); content: ""; pointer-events: none; transform: translateY(-70%) rotate(45deg); }
.field-control select { appearance: none; -webkit-appearance: none; padding-right: 2.75rem; color-scheme: light; cursor: pointer; }
.field-control select option, .field-control select optgroup { background: var(--surface); color: var(--text); }
:root[data-theme="dark"] .field-control select { color-scheme: dark; }
.field-unit { flex: 0 0 auto; border-left: 1px solid var(--border); padding: 0 0.65rem; color: var(--text-muted); font-size: 0.8rem; }
.field-hint { margin: 0; color: var(--text-muted); font-size: 0.78rem; line-height: 1.35; }
.primary-button { display: inline-flex; min-height: 2.875rem; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-md); padding: 0.68rem 1.1rem; background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; box-shadow: 0 0.125rem 0.35rem color-mix(in srgb, var(--brand) 28%, transparent); }
.primary-button:hover { background: var(--brand-hover); color: #fff; }
.secondary-button { display: inline-flex; min-height: 2.875rem; align-items: center; justify-content: center; border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: 0.65rem 1.05rem; background: var(--surface); color: var(--text); font-weight: 700; text-decoration: none; }
.secondary-button:hover { border-color: var(--brand); background: var(--surface-secondary); color: var(--brand); }
.simple-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.65rem; margin-top: 1.25rem; }
.form-status { min-height: 1.3rem; margin: 0.75rem 0 0; color: var(--text-muted); font-size: 0.85rem; }
.form-status.is-error { color: var(--danger); font-weight: 650; }
.result-panel { min-height: 12rem; }
.result-kicker { margin: 0 0 0.65rem; color: var(--text-muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.result-empty { color: var(--text-muted); font-size: 0.95rem; }
.result-primary-label { margin: 0; color: var(--text-muted); font-size: 0.85rem; }
.result-primary { margin: 0.25rem 0 1rem; color: var(--text); font-size: clamp(2.15rem, 4vw, 2.65rem); font-variant-numeric: tabular-nums lining-nums; font-weight: 750; letter-spacing: -0.04em; line-height: 1.05; }
.result-metrics { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--border); }
.result-metric { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.result-metric dt { color: var(--text-muted); }
.result-metric dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums lining-nums; font-weight: 650; text-align: right; }
.result-note { margin: 1rem 0 0; color: var(--text-muted); font-size: 0.82rem; }
.result-copy { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.55rem 0.75rem; background: var(--surface); color: var(--text); font-size: 0.82rem; font-weight: 650; }
.result-copy[hidden] { display: none; }
.result-copy svg { width: 1rem; height: 1rem; flex: 0 0 1rem; }
.result-copy:hover { border-color: var(--brand); color: var(--brand); }
.formula-card, .faq-section, .related-materials { margin-top: 2rem; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 1.5rem 0 0; background: transparent; }
.formula-card h2, .faq-section h2, .related-section h2 { margin: 0 0 0.55rem; font-size: 1.35rem; line-height: 1.2; }
.formula-card p { max-width: 50rem; margin: 0.45rem 0; color: var(--text-muted); }
.formula-card .example { margin-bottom: 0; }
.faq-section details { border-bottom: 1px solid var(--border); padding: 0.9rem 0; }
.faq-section details:last-child { border-bottom: 0; }
.faq-section summary { display: flex; min-height: 2.75rem; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; font-weight: 650; list-style: none; }
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after { width: 1.5rem; height: 1.5rem; flex: 0 0 1.5rem; border: 1px solid var(--border); border-radius: 50%; content: "+"; color: var(--brand); font-size: 1rem; font-weight: 500; line-height: 1.35rem; text-align: center; }
.faq-section details[open] summary::after { content: "−"; }
.faq-section p { max-width: 50rem; margin: 0.6rem 0 0; color: var(--text-muted); }
.related-materials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.related-section ul { padding: 0; margin: 0; border-top: 1px solid var(--border); list-style: none; }
.related-section li { margin: 0; border-bottom: 1px solid var(--border); }
.related-section a { display: block; padding: 0.65rem 0; font-weight: 600; text-decoration: none; }
.related-section a:hover { text-decoration: underline; }
.empty-note { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; background: var(--surface); color: var(--text-muted); }
.locale-notice { width: min(var(--content-max), calc(100% - 4rem)); margin: 0 auto 1rem; border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--radius-md); padding: 0.75rem 0.9rem; background: var(--surface); color: var(--text-muted); font-size: 0.9rem; }

.article-layout { display: block; width: min(49rem, calc(100% - 4rem)); margin-inline: auto; }
.article-body { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: clamp(1.5rem, 5vw, 3rem); background: var(--surface); box-shadow: var(--shadow-card); }
.article-header { width: auto; margin: 0 0 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.article-header h1 { max-width: 24ch; }
.article-header .lead { max-width: 52rem; font-size: 1.08rem; line-height: 1.65; }
.article-meta { margin: 0.75rem 0 0; color: var(--text-muted); font-size: 0.82rem; }
.article-body > p, .article-body > ul, .article-body > ol, .article-body > h2, .article-body > h3, .article-body > table, .article-body > blockquote { max-width: 45rem; }
.article-body p { margin: 0 0 1.15rem; font-size: 1.06rem; line-height: 1.7; }
.article-body h2 { margin: 2.5rem 0 0.75rem; font-size: clamp(1.4rem, 3vw, 1.7rem); line-height: 1.25; letter-spacing: -0.02em; }
.article-body h3 { margin: 2rem 0 0.65rem; font-size: 1.22rem; line-height: 1.3; }
.article-body ul, .article-body ol { padding-left: 1.35rem; margin: 0 0 1.25rem; }
.article-body li { margin-bottom: 0.55rem; line-height: 1.65; }
.article-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin-bottom: 1.25rem; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 0.55rem 0.7rem; text-align: left; }
.ad-slot { border: 1px dashed var(--border); background: var(--surface-secondary); color: var(--text-muted); }
.ad-slot--top { min-height: 5.5rem; }
.ad-slot--article { min-height: 5.5rem; }
.ad-slot--sidebar { min-height: 15rem; }
.ad-slot--calculator { min-height: 5.5rem; }

.service-page { width: min(54rem, calc(100% - 4rem)); margin-inline: auto; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: clamp(1.5rem, 5vw, 3rem); background: var(--surface); box-shadow: var(--shadow-card); }
.service-page h1 { margin: 0; font-size: clamp(2rem, 3.5vw, 2.75rem); line-height: 1.08; letter-spacing: -0.035em; }
.service-page .lead { max-width: 46rem; margin: 0.75rem 0 2rem; color: var(--text-muted); font-size: 1.08rem; line-height: 1.65; }
.service-page h2 { margin: 2rem 0 0.55rem; font-size: 1.45rem; }
.service-page p { max-width: 46rem; margin: 0 0 1rem; line-height: 1.7; }
.category-page { width: min(var(--content-max), calc(100% - 4rem)); margin-inline: auto; }
.category-page > .page-header { width: auto; margin-bottom: 2rem; }
.category-page > .content-section { width: 100%; }
.category-section { margin-top: 2rem; }
.category-section h2 { margin: 0 0 0.75rem; font-size: 1.45rem; }
.category-page .tool-list, .category-page .article-list { gap: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.category-page .tool-row, .category-page .article-row { border: 0; border-radius: 0; box-shadow: none; transform: none; }
.category-page .tool-row + .tool-row, .category-page .article-row + .article-row { border-top: 1px solid var(--border); }
.category-page .tool-row:hover, .category-page .article-row:hover { background: var(--surface-secondary); box-shadow: none; transform: none; }
.notice-block { margin-top: 1.5rem; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-md); padding: 0.9rem 1rem; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.notice-block strong { display: block; margin-bottom: 0.3rem; }
.notice-block p { margin: 0; color: var(--text-muted); }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2.5rem 0 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr)); gap: 2rem; width: min(var(--content-max), calc(100% - 4rem)); margin-inline: auto; }
.footer-brand { margin-bottom: 0.7rem; }
.site-footer p { max-width: 25rem; margin: 0; color: var(--text-muted); font-size: 0.875rem; line-height: 1.55; }
.site-footer h2 { margin: 0 0 0.6rem; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.site-footer a:not(.brand) { display: block; width: fit-content; max-width: 100%; margin: 0.4rem 0; overflow-wrap: anywhere; font-size: 0.875rem; }
.footer-more { margin-top: 0.7rem !important; font-weight: 650; }

@media (max-width: 74rem) {
  .header-search { display: none; }
  .search-trigger { display: inline-flex; }
  .site-header.is-search-open .header-search { position: absolute; z-index: 22; top: calc(100% + 0.5rem); left: 1rem; right: 1rem; display: block; width: auto; margin: 0; }
  .topic-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 62rem) {
  .shell, .page-header, .content-section, .home-intro, .catalog-list, .calculator-page, .category-page, .footer-grid { width: min(var(--content-max), calc(100% - 3rem)); }
  .locale-notice { width: calc(100% - 3rem); }
  .desktop-nav, .desktop-support, .desktop-language, .header-actions > button.desktop-theme, .header-actions > .language-switch { display: none; }
  .mobile-menu-trigger { display: inline-flex; }
  .header-actions { margin-left: auto; }
  .header-row { min-height: 3.6875rem; gap: 0.35rem; }
  .mobile-drawer-backdrop { inset: 3.5rem 0 0; }
  .article-layout { width: min(49rem, calc(100% - 3rem)); }
  .catalog-list .tool-list, .catalog-list .article-list { grid-template-columns: 1fr; }
  .catalog-list .tool-row:nth-child(n), .catalog-list .article-row:nth-child(n) { border-top: 0; border-left: 0; }
  .catalog-list .tool-row + .tool-row, .catalog-list .article-row + .article-row { border-top: 1px solid var(--border); }
}

@media (min-width: 63rem) {
  .mobile-drawer, .mobile-drawer-backdrop { display: none !important; }
  .header-actions > .language-switch { display: inline-flex; }
  .header-actions > button.desktop-theme { display: inline-flex; }
}

@media (max-width: 52rem) {
  .calculator-workspace { grid-template-columns: 1fr; }
  .calc-result-column { border-top: 1px solid var(--border); border-left: 0; }
  .topic-list, .topic-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 44rem) {
  .home-section .tool-list, .home-section .article-list { grid-template-columns: 1fr; }
  .home-section .tool-row:nth-child(n), .home-section .article-row:nth-child(n) { border-top: 0; border-left: 0; }
  .home-section .tool-row + .tool-row, .home-section .article-row + .article-row { border-top: 1px solid var(--border); }
}

@media (max-width: 36rem) {
  .shell, .page-header, .content-section, .home-intro, .catalog-list, .calculator-page, .category-page, .footer-grid { width: calc(100% - 2rem); }
  .locale-notice { width: calc(100% - 2rem); }
  .header-row { gap: 0.25rem; }
  .brand { gap: 0.4rem; font-size: 0.95rem; }
  .brand-mark { width: 1.9rem; height: 1.9rem; flex-basis: 1.9rem; }
  .icon-button, button.theme-toggle, .language-switch { min-height: 2.75rem; }
  .icon-button, button.theme-toggle { width: 2.75rem; min-width: 2.75rem; flex-basis: 2.75rem; }
  .mobile-drawer { position: fixed; top: 4rem; right: 0.5rem; left: 0.5rem; width: auto; max-height: calc(100dvh - 4.5rem); overflow-y: auto; }
  .mobile-drawer .support-link { min-height: 2.75rem; }
  .mobile-drawer-backdrop { inset: 3.5rem 0 0; }
  .breadcrumbs { padding-top: 0.9rem; }
  .breadcrumbs li { display: none; }
  .breadcrumbs li:nth-last-child(2) { display: block; }
  .breadcrumbs li:nth-last-child(2)::before { content: "← "; }
  .breadcrumbs li:nth-last-child(2)::after { display: none; }
  main { padding-top: 1.1rem; }
  .home-intro { border-radius: 0; padding: 1rem 0 1.5rem; }
  .home-intro h1 { font-size: 2rem; }
  .page-header h1, .article-header h1, .service-page h1 { font-size: 2rem; }
  .page-header p, .article-header .lead { font-size: 1rem; }
  .content-section { margin-top: 2rem; }
  .section-heading { align-items: flex-start; gap: 0.75rem; }
  .section-heading a { font-size: 0.8rem; }
  .home-section .tool-list, .home-section .article-list, .topic-list, .calculator-grid, .related-materials { grid-template-columns: 1fr; }
  .home-section .tool-row:nth-child(n), .home-section .article-row:nth-child(n) { border-top: 0; border-left: 0; }
  .home-section .tool-row + .tool-row, .home-section .article-row + .article-row { border-top: 1px solid var(--border); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .tool-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.7rem; padding: 0.9rem; }
  .tool-row p, .article-row p { white-space: normal; }
  .article-row { grid-template-columns: minmax(0, 1fr) auto; }
  .primary-button { width: 100%; }
  .simple-actions { flex-direction: column; }
  .simple-actions .secondary-button { width: 100%; }
  .calculator-workspace { border-radius: var(--radius-lg); }
  .calc-form-column, .calc-result-column { padding: 1rem; }
  .calculator-grid { margin-top: 1rem; }
  .article-layout { width: calc(100% - 2rem); }
  .article-body { border-radius: var(--radius-lg); padding: 1.25rem; }
  .article-body p { font-size: 1.06rem; }
  .footer-grid { gap: 1.5rem 1rem; }
  .topic-groups { grid-template-columns: 1fr; gap: 0.75rem; }
  .topic-list .category-row:nth-child(n) { border-top: 0; border-left: 0; }
  .topic-list .category-row + .category-row { border-top: 1px solid var(--border); }
  .page-header { border-radius: 0; padding: 1rem 0 1.25rem; }
  .service-page { border-radius: var(--radius-lg); padding: 1.25rem; }
}

@media (max-width: 22.5rem) {
  .brand-wordmark { display: none; }
  .header-row { justify-content: flex-end; }
  .brand { margin-right: auto; }
  .section-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
  .section-heading a { justify-self: start; white-space: normal; text-align: left; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > :first-child { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
