:root {
    --canvas: #f7f5f1;
    --ink: #26332e;
    --action: #24574c;
    --soft: #dde9e2;
    --surface: #fff;
    --muted: #596560;
    --border: #a2ada5;
    --focus: #6d3b83;
    --accent: #9b613e;
    --space-section: clamp(24px, 4vw, 40px);
    color-scheme: light;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
    line-height: 1.6;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--action); font-weight: 600; text-decoration: none; text-underline-offset: .2em; }
a:hover, a:focus-visible { text-decoration: underline; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
/* Content destinations keep focus for navigation/announcements, without a container ring. */
[tabindex="-1"]:focus { outline: none; }
.container { width: min(100% - 32px, 1100px); margin-inline: auto; }
.prose { max-width: 70ch; }
.prose > * + h2 { margin-block-start: var(--space-section); }
.prose > * + h3 { margin-block-start: 24px; }
.source-links a { display: flex; align-items: center; min-height: 48px; padding-block: 4px; }
.contact-card { margin-block: 24px; }
.contact-address { font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.contact-address a { display: inline-flex; align-items: center; min-height: 48px; }
.email-contact { overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 16px; }
h2 { font-size: 1.45rem; margin: 0 0 16px; }
p { margin: 0 0 16px; }
.eyebrow { color: var(--muted); font-size: .8rem; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 24px; height: 2px; flex-shrink: 0; background: var(--accent); }
.site-header { border-top: 3px solid var(--action); border-bottom: 1px solid var(--border); background: #fcfbf8; }
.header-inner { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-block: 16px; }
.wordmark { font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 400; color: var(--ink); text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.desktop-navigation { display: none; }
.mobile-navigation { margin-left: auto; }
.mobile-navigation summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--action); font-weight: 600; list-style: none; cursor: pointer; }
.mobile-navigation summary::-webkit-details-marker { display: none; }
.mobile-navigation summary:hover, .mobile-navigation[open] summary { background: var(--soft); border-color: var(--action); }
.menu-icon { position: relative; display: block; width: 18px; height: 2px; background: currentColor; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; inset: 0; background: currentColor; }
.menu-icon::before { transform: translateY(-6px); }
.menu-icon::after { transform: translateY(6px); }
.mobile-navigation[open] .menu-icon { background: transparent; }
.mobile-navigation[open] .menu-icon::before { transform: rotate(45deg); }
.mobile-navigation[open] .menu-icon::after { transform: rotate(-45deg); }
.mobile-navigation nav { position: absolute; z-index: 5; top: calc(100% + 8px); inset-inline: 0; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 112px); max-height: calc(100dvh - 112px); overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 12px 32px rgb(38 51 46 / 16%); }
.mobile-navigation nav a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 14px; border-radius: 8px; }
.mobile-navigation nav a::after { content: "→"; }
.mobile-navigation nav a:hover, .mobile-navigation nav a:focus-visible { background: var(--soft); }
.home-intro h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); }
.home-tools h3 { font-size: 1.4rem; margin: 0 0 12px; }
.home-tools .card { padding: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.site-nav a, .site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
.main-content { min-height: 55vh; padding-block: 32px 48px; }
.main-content > * + * { margin-block-start: var(--space-section); }
.main-content > [hidden] { display: none; }
.main-content > .visually-hidden { margin: -1px; }
.main-content > .prose:first-child { padding-block-end: 8px; }
.main-content > .prose:first-child p:last-child { margin-bottom: 0; }
.site-footer { border-top: 1px solid var(--border); padding-block: 32px; color: var(--muted); background: #eeeee6; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.developer-credit { margin: 16px 0 0; }
.developer-credit a { display: inline-flex; align-items: center; min-height: 44px; }
.skip-link { position: absolute; left: 16px; top: 8px; z-index: 10; transform: translateY(-180%); padding: 12px; background: var(--surface); }
.skip-link:focus { transform: none; }
.tool-grid { display: grid; gap: 16px; margin-block: 24px 32px; max-width: 900px; }
.tool-grid > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: clamp(20px, 3vw, 28px); box-shadow: 0 4px 16px rgb(38 51 46 / 4%); }
.card-featured { background: linear-gradient(135deg, #e7efe9, var(--soft)); }
.card > :last-child { margin-block-end: 0; }
.home-tools .card { display: flex; flex-direction: column; align-items: flex-start; border-top: 3px solid var(--action); }
.home-tools .card + .card { border-top-color: var(--accent); }
.home-tools .button { margin-top: auto; }
.home-tools p { margin-bottom: 20px; }
.body-guide { display: grid; gap: 24px; margin-block: 24px 32px; }
.body-guide > * { min-width: 0; }
.body-diagram { margin: 24px 0; }
.body-diagram svg { display: block; width: 100%; }
.body-diagram figcaption { color: var(--muted); margin-top: 8px; }
.measurement-line.active { stroke: var(--focus); stroke-width: 6px; }
.measurement-step { margin-bottom: 16px; }
.color-form { max-width: 650px; margin-block: 24px 32px; }
.legacy-article .card { margin-block: 16px; }
.legacy-figure { max-width: 480px; margin: 24px auto; }
.legacy-figure img { display: block; width: 100%; height: auto; }
.legacy-article section { margin-block: 32px; }
.outfit-grid { display: grid; gap: 16px; margin-block: 24px 32px; }
.outfit-grid > * { min-width: 0; }
.outfit-role { padding-block: 10px; border-bottom: 1px solid var(--border); }
.outfit-role dt { font-weight: 600; }
.outfit-role dd { margin: 4px 0 0; display: flex; align-items: center; gap: 12px; }
.swatch { flex: 0 0 28px; height: 28px; border: 1px solid var(--ink); border-radius: 5px; }
.step-controls { margin-bottom: 24px; }
.button:disabled { cursor: default; opacity: .65; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 10px 20px; border: 2px solid var(--action); border-radius: 8px; background: var(--action); color: white; font: inherit; font-weight: 600; text-decoration: none; text-align: center; cursor: pointer; overflow-wrap: anywhere; }
.button:hover { background: var(--ink); border-color: var(--ink); text-decoration: none; }
.button-secondary { background: var(--surface); color: var(--action); }
.button-secondary:hover { background: var(--soft); border-color: var(--action); }
.field { margin-block: 16px 24px; }
.tool-grid > .field { margin: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.field input, .field select, .field textarea { flex-shrink: 0; }
form > select + .button, form > input:not([type="hidden"]) + .button { margin-block-start: 20px; }
.mode-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 24px; }
.mode-links a { min-height: 44px; display: inline-flex; align-items: center; }
.mode-links [aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-thickness: 3px; }
label, legend { font-weight: 600; }
label { display: block; margin-bottom: 8px; }
input, select, textarea { width: 100%; max-width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--muted); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
input[type="radio"], input[type="checkbox"] { width: 24px; min-height: 24px; accent-color: var(--action); }
fieldset { margin: 0 0 24px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.field-hint, .source-note { color: var(--muted); font-size: .95rem; margin-top: 8px; }
.field-error { font-weight: 600; color: #873025; }
.notice, .error-summary { padding: 16px; border: 2px solid var(--action); border-radius: 8px; }
.error-summary { border-color: #873025; margin-bottom: 24px; }
.notice p:last-child, .error-summary p:last-child { margin-bottom: 0; }
.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
caption { text-align: left; padding: 16px; font-weight: 600; }
thead { background: #edf2ee; }
tbody tr:nth-child(even) { background: #f8faf8; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; border-top: 1px solid var(--border); }
th { font-weight: 600; }
@media (max-width: 767px) {
    .compact-reference-table table { table-layout: fixed; font-size: .8125rem; }
    .compact-reference-table caption { padding: 12px 10px; font-size: .875rem; }
    .compact-reference-table th, .compact-reference-table td { padding: 10px 4px; text-align: center; overflow-wrap: anywhere; }
    .ring-size-table thead th:first-child, .ring-size-table thead th:last-child { width: 20%; }
    .ring-size-table thead th:nth-child(2) { width: 34%; }
    .ring-size-table thead th:nth-child(3) { width: 26%; }
}
@media (min-width: 768px) {
    .header-inner { justify-content: space-between; }
    .desktop-navigation { display: flex; }
    .mobile-navigation { display: none; }
    .main-content { padding-block: 48px 64px; }
    .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    .body-guide { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
    .outfit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
