:root {
  color-scheme: light;
  --ink: #1c2925;
  --muted: #707c75;
  --line: #e3e7df;
  --paper: #f5f6f2;
  --card: #fff;
  --green: #255649;
  --green-dark: #163d33;
  --green-soft: #e5eee8;
  --lime: #d9e9ad;
  --orange: #b96736;
  --shadow: 0 16px 48px rgba(29, 48, 39, .07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 84% 0%, rgba(217, 233, 173, .26), transparent 32rem),
    var(--paper);
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }

.page-shell { width: min(1440px, calc(100% - 56px)); margin: 0 auto; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(36, 67, 54, .11); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; color: #f1f4e9; background: var(--green-dark); font: 700 19px Georgia, serif; }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.brand-name span { color: var(--muted); font-weight: 500; }
.primary-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid rgba(36,67,54,.08); border-radius: 12px; background: rgba(255,255,255,.48); }
.nav-link { padding: 8px 12px; border-radius: 8px; color: #68766d; font-size: 11px; text-decoration: none; white-space: nowrap; transition: color .2s, background .2s; }
.nav-link:hover { color: var(--green-dark); background: rgba(255,255,255,.75); }
.nav-link.active { color: var(--green-dark); background: #fff; box-shadow: 0 1px 4px rgba(22,61,51,.08); font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.language-toggle { min-width: 43px; min-height: 32px; padding: 0 10px; border: 1px solid #dbe3da; border-radius: 9px; color: var(--green-dark); background: rgba(255,255,255,.72); font-size: 11px; font-weight: 700; letter-spacing: .03em; transition: border .2s, background .2s; }
.language-toggle:hover { border-color: #9cb4a1; background: #fff; }
.language-toggle:focus-visible { outline: 3px solid rgba(66,119,90,.24); outline-offset: 2px; }
.local-badge { display: flex; align-items: center; gap: 8px; color: #56685d; font-size: 12px; letter-spacing: .02em; white-space: nowrap; }
.local-badge > span:first-child { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #7da687; box-shadow: 0 0 0 4px rgba(125,166,135,.13); }

.intro-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 35px 0 26px; }
.eyebrow { margin: 0 0 10px; color: #718078; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
h1 { margin: 0; font-size: clamp(23px, 2.6vw, 31px); line-height: 1.2; letter-spacing: -.045em; font-weight: 650; }
.intro-copy { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.extended-switch { display: flex; align-items: center; gap: 13px; padding: 11px 14px; border: 1px solid #dbe3da; border-radius: 14px; background: rgba(255,255,255,.72); cursor: pointer; transition: border .2s, box-shadow .2s; }
.extended-switch:hover { border-color: #9cb4a1; box-shadow: 0 5px 18px rgba(34,75,55,.08); }
.switch-copy { display: flex; flex-direction: column; gap: 2px; }
.switch-copy strong { font-size: 12px; font-weight: 650; }
.switch-copy small { color: var(--muted); font-size: 10px; }
.extended-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { display: block; width: 39px; height: 23px; padding: 3px; border-radius: 999px; background: #d5dbd4; transition: background .2s; }
.switch-track span { display: block; width: 17px; height: 17px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .2s; }
.extended-switch input:checked + .switch-track { background: var(--green); }
.extended-switch input:checked + .switch-track span { transform: translateX(16px); }
.extended-switch input:focus-visible + .switch-track { outline: 3px solid rgba(66,119,90,.24); outline-offset: 2px; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.78fr) minmax(265px, .8fr); gap: 20px; align-items: start; }
.form-card, .result-card { border: 1px solid rgba(31, 70, 50, .1); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.form-card { padding: 25px 28px 22px; }
.form-heading { display: flex; align-items: center; gap: 13px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.step-mark { display: grid; place-items: center; flex: 0 0 auto; width: 35px; height: 35px; border-radius: 12px; color: var(--green-dark); background: var(--green-soft); font-size: 11px; font-weight: 750; letter-spacing: .04em; }
.form-heading-copy { min-width: 0; }
.form-heading h2 { margin: 0; font-size: 16px; font-weight: 680; letter-spacing: -.02em; }
.form-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.count-pill { margin-left: auto; padding: 6px 9px; border: 1px solid #e0e8dc; border-radius: 100px; color: #526c58; background: #f7faf4; font-size: 10px; white-space: nowrap; }
.muted-pill { color: #727e75; background: #f6f7f4; border-color: #e7e9e4; }
.section-label { display: flex; justify-content: space-between; gap: 12px; margin: 20px 0 12px; color: #526057; font-size: 11px; font-weight: 700; }
.section-label span + span { color: #929b94; font-size: 10px; font-weight: 500; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px 12px; }
.field { min-width: 0; }
.field-age { grid-column: span 3; max-width: calc((100% - 24px) / 3); }
.field label { display: block; min-height: 17px; margin-bottom: 5px; color: #526057; font-size: 10px; font-weight: 620; }
.field label em { color: #ba7653; font-style: normal; }
.input-shell { display: flex; align-items: center; width: 100%; height: 39px; overflow: hidden; border: 1px solid #dfe5dd; border-radius: 9px; background: #fcfdfb; transition: border .16s, box-shadow .16s, background .16s; }
.input-shell:focus-within { border-color: #6e9b7f; background: #fff; box-shadow: 0 0 0 3px rgba(74,126,88,.12); }
.input-shell input { width: 100%; min-width: 0; height: 100%; padding: 0 10px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; font-variant-numeric: tabular-nums; }
.input-shell input::placeholder { color: #b5bdb6; }
.input-shell > span { flex: 0 0 auto; padding: 0 9px 0 4px; color: #929d95; font-size: 9px; white-space: nowrap; }
.input-shell select { flex: 0 0 auto; max-width: 84px; height: 100%; padding: 0 20px 0 5px; border: 0; border-left: 1px solid #e5e8e1; outline: 0; color: #78827b; background: #f7f8f5; font-size: 9px; }
.input-shell.has-select input { padding-right: 3px; }
.history-label { margin-top: 23px; padding-top: 17px; border-top: 1px solid var(--line); }
.history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.history-field { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; min-height: 38px; padding: 5px 8px 5px 10px; border: 1px solid #e1e6de; border-radius: 9px; background: #fcfdfb; }
.history-field > span { color: #566159; font-size: 10px; line-height: 1.3; }
.history-field select { width: 66px; min-width: 60px; padding: 6px 3px; border: 0; border-radius: 5px; outline-color: #6e9b7f; color: #4b5c50; background: #f0f4ee; font-size: 10px; }
.section-divider { height: 1px; margin: 23px 0 20px; background: var(--line); }
.extended-heading { border-bottom: 0; padding-bottom: 13px; }
.secondary-mark { color: #735a36; background: #f4ecda; }
.extended-note { margin: 0 0 15px; padding: 10px 12px; border-radius: 9px; color: #6b6859; background: #faf7eb; font-size: 10px; line-height: 1.6; }
.submit-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.form-error { margin: 0; color: #a34c36; font-size: 11px; line-height: 1.5; }
.submit-button { display: inline-flex; align-items: center; justify-content: center; gap: 23px; min-width: 176px; min-height: 44px; padding: 0 17px; border: 0; border-radius: 11px; color: #f4f6ec; background: var(--green-dark); font-size: 12px; font-weight: 650; transition: transform .16s, background .16s, box-shadow .16s; }
.submit-button:hover { transform: translateY(-1px); background: #205344; box-shadow: 0 7px 18px rgba(27,74,55,.17); }
.submit-button:focus-visible { outline: 3px solid #91b39b; outline-offset: 2px; }
.submit-button:disabled { cursor: wait; opacity: .68; transform: none; }

.result-card { position: sticky; top: 18px; min-height: 345px; overflow: hidden; padding: 22px; color: #edf4e9; background: var(--green-dark); box-shadow: 0 18px 46px rgba(18, 59, 45, .18); }
.result-card::before { position: absolute; right: -66px; top: 70px; width: 218px; height: 218px; border: 1px solid rgba(232,243,220,.12); border-radius: 50%; content: ""; }
.result-card::after { position: absolute; right: -18px; top: 118px; width: 122px; height: 122px; border: 1px solid rgba(232,243,220,.1); border-radius: 50%; content: ""; }
.result-topline, .result-main, .result-delta, .classification, .result-foot, .loading-message { position: relative; z-index: 1; }
.result-topline { display: flex; align-items: center; justify-content: space-between; }
.result-kicker { margin: 0; color: #b5c7b9; font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.model-tag { padding: 5px 8px; border: 1px solid rgba(224,238,215,.23); border-radius: 99px; color: #d7e6d4; font-size: 9px; letter-spacing: .08em; }
.result-main { margin: 39px 0 29px; }
.result-main h2 { margin: 0 0 8px; color: #cad9cb; font-size: 11px; font-weight: 500; }
.age-display { display: flex; align-items: baseline; gap: 8px; min-height: 79px; }
.age-display > span { color: #f2f4e6; font-size: clamp(58px, 7vw, 78px); font-weight: 500; letter-spacing: -.075em; line-height: 1; font-variant-numeric: tabular-nums; }
.age-display small { color: #afc0b2; font-size: 13px; }
.result-caption { margin: 9px 0 0; color: #b1c1b5; font-size: 11px; }
.result-delta { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid rgba(230,240,226,.15); border-bottom: 1px solid rgba(230,240,226,.15); color: #b9cabb; font-size: 10px; }
.result-delta strong { color: #edf4e9; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.classification { display: inline-flex; align-items: center; gap: 8px; margin-top: 15px; padding: 7px 9px; border-radius: 8px; color: #d9e8d6; background: rgba(226,239,219,.1); font-size: 10px; }
.class-dot { width: 6px; height: 6px; border-radius: 50%; background: #cfdd9c; }
.result-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 23px; }
.mini-stat { display: flex; flex-direction: column; gap: 4px; padding: 9px 10px; border: 1px solid rgba(234,243,228,.12); border-radius: 9px; background: rgba(255,255,255,.035); }
.mini-stat span { color: #a9bdad; font-size: 9px; }
.mini-stat strong { color: #e2ece1; font-size: 10px; font-weight: 600; }
.loading-message { margin: 12px 0 0; color: #d2dfd2; font-size: 10px; line-height: 1.5; }
.notice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 17px 0 30px; }
.notice-item { display: flex; align-items: start; gap: 9px; padding: 12px 14px; border: 1px solid rgba(31,70,50,.08); border-radius: 12px; background: rgba(255,255,255,.55); }
.notice-icon { display: grid; place-items: center; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 7px; color: #58725e; background: #e8efe6; font-size: 11px; font-weight: 700; }
.notice-item p { margin: 0; color: #79827b; font-size: 9px; line-height: 1.6; }
.notice-item strong { color: #46554a; font-size: 10px; font-weight: 650; }
.version-notice .notice-icon { color: #997042; background: #f2ead9; }
.acknowledgement { margin: 0 0 22px; padding: 16px 18px; border: 1px solid rgba(31,70,50,.09); border-radius: 12px; background: rgba(255,255,255,.62); }
.acknowledgement-title { margin: 0 0 5px; color: #46554a; font-size: 11px; font-weight: 700; }
.acknowledgement-copy { margin: 0; color: #79827b; font-size: 10px; line-height: 1.65; }
.acknowledgement-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 9px; }
.acknowledgement-links a { color: #426a52; font-size: 10px; text-underline-offset: 2px; }
.acknowledgement-links a:hover { color: #234d39; }
.footer { display: flex; flex-direction: column; gap: 14px; padding: 20px 0 24px; border-top: 1px solid rgba(36,67,54,.11); color: #89928a; font-size: 10px; line-height: 1.6; }
.footer-credits { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.footer-support { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.footer-label { color: #738078; }
.footer-partner { display: inline-flex; align-items: center; gap: 7px; color: #426a52; font-size: 12px; font-weight: 650; text-decoration: none; }
.footer-partner:hover { color: #234d39; text-decoration: underline; text-underline-offset: 3px; }
.footer-partner:focus-visible { outline: 2px solid #426a52; outline-offset: 4px; border-radius: 3px; }
.footer-author { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin: 0; color: #738078; }
.footer-author strong { color: #46554a; font-size: 11px; font-weight: 650; }
.footer-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 18px; font-size: 9px; }

[hidden] { display: none !important; }

@media (max-width: 980px) {
  .page-shell { width: min(100% - 36px, 760px); }
  .workspace-grid { grid-template-columns: 1fr; }
  .result-card { position: relative; top: auto; grid-row: 1; min-height: 0; }
  .result-main { margin: 24px 0 18px; }
  .age-display { min-height: 68px; }
  .result-foot { margin-top: 15px; }
  .notice-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .page-shell { width: calc(100% - 24px); }
  .topbar { height: auto; min-height: 62px; flex-wrap: wrap; gap: 8px 10px; padding: 10px 0; }
  .brand { gap: 7px; }
  .brand-name { font-size: 12px; }
  .primary-nav { order: 3; flex: 1 0 100%; justify-content: center; }
  .nav-link { flex: 1; padding: 8px 6px; text-align: center; }
  .topbar-actions { gap: 10px; }
  .local-badge { gap: 6px; font-size: 10px; }
  .intro-row { align-items: start; flex-direction: column; padding: 27px 0 17px; gap: 17px; }
  .intro-copy { max-width: 34em; font-size: 12px; line-height: 1.55; }
  .extended-switch { align-self: stretch; justify-content: space-between; padding: 10px 12px; }
  .switch-copy { flex: 1; }
  .form-card { padding: 18px 14px 15px; border-radius: 16px; }
  .form-heading { gap: 10px; }
  .form-heading h2 { font-size: 14px; }
  .form-heading p { font-size: 10px; }
  .count-pill { padding: 5px 7px; font-size: 9px; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 9px; }
  .field-age { grid-column: span 2; max-width: calc((100% - 9px) / 2); }
  .field label { min-height: 25px; font-size: 9px; line-height: 1.35; }
  .input-shell { height: 38px; }
  .input-shell input { padding: 0 8px; font-size: 12px; }
  .input-shell > span { padding-right: 7px; font-size: 8px; }
  .input-shell select { max-width: 78px; padding-left: 4px; font-size: 8px; }
  .history-grid { grid-template-columns: 1fr; gap: 7px; }
  .history-field { min-height: 40px; }
  .history-field > span { font-size: 10px; }
  .submit-row { align-items: stretch; flex-direction: column-reverse; }
  .submit-button { width: 100%; }
  .result-card { padding: 19px; border-radius: 16px; }
  .result-main { margin: 25px 0 17px; }
  .age-display > span { font-size: 65px; }
  .footer-credits { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-meta { flex-direction: column; }
  .notice-grid { margin-bottom: 20px; }
}

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