:root {
  color-scheme: light;
  --ink: #173237;
  --muted: #6c7d7d;
  --line: #d8e4e1;
  --soft-line: #e8f0ee;
  --paper: #f7faf8;
  --panel: #ffffff;
  --teal: #0f766e;
  --teal-dark: #0b5d57;
  --teal-pale: #e1f2ee;
  --coral: #dd765e;
  --shadow: 0 20px 55px rgba(17, 58, 58, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar { height: 72px; background: rgba(247, 250, 248, 0.95); border-bottom: 1px solid var(--soft-line); }
.topbar-inner { max-width: 1180px; height: 100%; margin: auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 750; letter-spacing: 0; }
.brand-mark { display: inline-flex; align-items: end; gap: 3px; width: 25px; height: 25px; padding: 5px; border-radius: 8px; background: var(--teal); }
.brand-mark span { display: block; width: 4px; border-radius: 4px; background: #fff; }
.brand-mark span:nth-child(1) { height: 7px; opacity: .72; }
.brand-mark span:nth-child(2) { height: 11px; opacity: .86; }
.brand-mark span:nth-child(3) { height: 15px; }
.install-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 7px; min-height: 36px; border: 1px solid #a9cbc4; border-radius: 6px; padding: 8px 12px; color: var(--teal-dark); background: transparent; font-size: 13px; font-weight: 700; line-height: 1; white-space: nowrap; }
.install-button:hover { background: var(--teal-pale); }
.install-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.install-label-short { display: none; }

.page-shell { max-width: 1180px; margin: auto; padding: 70px 32px 40px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 46px; }
.eyebrow, .section-kicker { margin: 0 0 12px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-size: clamp(38px, 5vw, 65px); line-height: 1.04; letter-spacing: 0; font-weight: 780; }
h1 em { color: var(--teal); font-style: normal; }
.intro-copy { max-width: 420px; margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.intro-note { display: flex; align-items: center; gap: 8px; padding-bottom: 9px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: #55a594; box-shadow: 0 0 0 4px var(--teal-pale); }

.calculator-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .82fr); gap: 20px; align-items: start; }
.form-panel, .result-panel { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.form-panel { padding: 34px; }
.result-panel { min-height: 505px; padding: 34px; color: #fff; background: var(--teal); border-color: var(--teal); box-shadow: 0 20px 55px rgba(15, 118, 110, .18); }
.panel-heading, .subheading-row { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.panel-heading h2, .subheading-row h2 { margin-bottom: 0; font-size: 21px; line-height: 1.2; letter-spacing: 0; }
.panel-step { padding: 5px 9px; border-radius: 4px; color: var(--teal); background: var(--teal-pale); font-size: 11px; font-weight: 800; }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 19px; margin-top: 28px; }
.field { display: block; }
.field-wide { grid-column: span 2; }
.field-label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 720; }
.field-hint { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.input-wrap { display: flex; align-items: center; height: 52px; border: 1px solid var(--line); border-radius: 5px; background: #fbfdfc; transition: border-color .15s, box-shadow .15s; }
.input-wrap:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); }
.input-wrap input { min-width: 0; width: 100%; height: 100%; padding: 0 14px; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 20px; font-weight: 700; }
.input-wrap input::placeholder { color: #a4b4b1; }
.input-wrap input::-webkit-inner-spin-button, .input-wrap input::-webkit-outer-spin-button { margin: 0; }
.input-unit { padding: 0 14px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; }
.today-check { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 66px; margin-top: 22px; padding: 13px 14px; border: 1px solid #cfe0dc; border-radius: 5px; background-color: #fbfdfc; box-shadow: 0 1px 0 rgba(17, 58, 58, .03); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.today-check:hover, .today-check.is-checked { border-color: #8fc2b8; background-color: #f1faf7; }
.check-control { position: relative; display: inline-flex; flex: 0 0 auto; width: 20px; height: 20px; }
.check-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-box { display: block; width: 20px; height: 20px; border: 1.5px solid #a6bbb7; border-radius: 4px; background-color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.check-control input:focus-visible + .check-box { outline: 3px solid rgba(15, 118, 110, .15); outline-offset: 2px; }
.check-control input:checked + .check-box { border-color: var(--teal); background: var(--teal); }
.check-control input:checked + .check-box::after { display: block; width: 5px; height: 10px; margin: 3px 0 0 6px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); content: ""; }
.check-copy { display: grid; gap: 3px; }
.check-copy strong { color: var(--ink); font-size: 13px; font-weight: 720; }
.check-copy small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.overtime-section { margin-top: 38px; padding-top: 30px; border-top: 1px solid var(--soft-line); }
.overtime-section .section-kicker { margin-bottom: 9px; }
.subheading-total { color: var(--teal); font-size: 12px; font-weight: 700; white-space: nowrap; }
.section-description { margin: 10px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.overtime-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.overtime-item { display: flex; align-items: center; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 5px; background: #fbfdfc; }
.overtime-item:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); }
.overtime-item label { padding-left: 11px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.overtime-item input { min-width: 0; width: 100%; height: 100%; padding: 0 5px 0 7px; color: var(--ink); background: transparent; border: 0; outline: 0; text-align: right; font-size: 15px; font-weight: 700; }
.overtime-item span { padding-right: 9px; color: var(--muted); font-size: 11px; }
.overtime-empty { display: flex; align-items: center; gap: 9px; min-height: 44px; color: #8fa19e; font-size: 12px; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border: 1px dashed #a9bbb7; border-radius: 50%; font-size: 17px; line-height: 1; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 34px; padding-top: 19px; border-top: 1px solid var(--soft-line); }
.save-status { color: #7d908c; font-size: 11px; }
.text-button { border: 0; padding: 5px 0; color: var(--coral); background: transparent; font-size: 12px; font-weight: 700; }
.text-button:hover { color: #b95c47; text-decoration: underline; }

.result-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-panel .section-kicker { color: #a9dbd2; margin-bottom: 0; }
.result-badge { padding: 5px 8px; border: 1px solid rgba(255,255,255,.24); border-radius: 4px; color: #d5eeea; font-size: 10px; font-weight: 700; }
.result-panel h2 { margin: 70px 0 18px; color: #fff; font-size: 27px; line-height: 1.18; letter-spacing: 0; }
.result-value-row { display: flex; align-items: baseline; gap: 10px; }
.result-value { color: #fff; font-size: clamp(46px, 5vw, 68px); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0; font-weight: 760; }
.result-unit { color: #c5e7e2; font-size: 14px; font-weight: 600; }
.result-divider { height: 1px; margin: 34px 0 19px; background: rgba(255,255,255,.2); }
.breakdown { display: grid; gap: 11px; }
.breakdown-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #b9ded8; font-size: 12px; }
.breakdown-row strong { color: #fff; font-size: 12px; font-weight: 650; white-space: nowrap; }
.formula { margin: 31px 0 0; color: #a9dbd2; font-size: 11px; line-height: 1.5; }
.goal-summary { margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.2); }
.goal-summary-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; color: #b9ded8; font-size: 12px; }
.goal-summary-row + .goal-summary-row { margin-top: 12px; }
.goal-summary-row strong { color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
.goal-summary-primary strong { font-size: 19px; }
.goal-message { margin: 11px 0 0; color: #a9dbd2; font-size: 11px; line-height: 1.45; }
.result-message { margin-top: 17px; color: #fff; font-size: 12px; font-weight: 650; }

.footer { max-width: 1180px; margin: auto; padding: 0 32px 29px; color: #9aaba8; font-size: 11px; }
.footer-separator { display: inline-block; padding: 0 7px; color: #c4d1ce; }
.install-guide { position: fixed; inset: 0; z-index: 20; display: grid; align-items: end; justify-items: center; padding: 20px; background: rgba(23, 50, 55, .38); }
.install-guide[hidden] { display: none; }
.install-guide-sheet { width: min(100%, 430px); padding: 25px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 20px 55px rgba(17, 58, 58, .2); }
.install-guide-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.install-guide-heading .section-kicker { margin-bottom: 8px; }
.install-guide-heading h2 { margin: 0; font-size: 20px; }
.guide-close { width: 30px; height: 30px; border: 0; border-radius: 50%; color: var(--muted); background: var(--soft-line); font-size: 22px; line-height: 1; }
.guide-close:hover { color: var(--ink); background: var(--teal-pale); }
.install-guide-sheet > p { margin: 20px 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.install-guide-steps { display: flex; align-items: center; gap: 8px; color: var(--teal-dark); font-size: 12px; font-weight: 700; }
.install-guide-steps span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: var(--teal); font-size: 11px; }

@media (max-width: 780px) {
  .topbar { height: 62px; }
  .topbar-inner { padding: 0 20px; }
  .install-button { min-width: 68px; min-height: 38px; padding: 8px 10px; }
  .install-label-full { display: none; }
  .install-label-short { display: inline; }
  .page-shell { padding: 42px 20px 30px; }
  .intro { display: block; margin-bottom: 32px; }
  h1 { font-size: 43px; }
  .intro-copy { font-size: 14px; }
  .intro-note { margin-top: 20px; padding-bottom: 0; }
  .calculator-grid { grid-template-columns: 1fr; gap: 14px; }
  .form-panel, .result-panel { padding: 25px 21px; }
  .result-panel { min-height: 0; }
  .result-panel h2 { margin-top: 38px; }
  .result-value { font-size: 57px; }
  .footer { padding: 0 20px 22px; }
}

@media (max-width: 480px) {
  .install-button svg { width: 17px; height: 17px; }
  .fields-grid { grid-template-columns: 1fr; gap: 17px; }
  .field-wide { grid-column: auto; }
  .overtime-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subheading-row { display: block; }
  .subheading-total { display: block; margin-top: 10px; }
  .result-panel h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  .result-value { transition: opacity .2s ease, transform .2s ease; }
  .result-value.updated { opacity: .65; transform: translateY(-2px); }
}
