:root {
  color-scheme: dark;
  --bg: #0c0d0d;
  --surface: #141616;
  --surface-2: #1b1e1d;
  --line: #303432;
  --text: #f3efe6;
  --muted: #9b9e99;
  --lime: #b8ff34;
  --lime-soft: rgba(184, 255, 52, 0.12);
  --danger: #ff736a;
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    var(--bg);
  background-size: 64px 64px;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.page-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: .12em;
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 750; }
.brand-mark { width: 14px; height: 14px; display: inline-block; background: var(--lime); box-shadow: 0 0 22px rgba(184,255,52,.45); }
.privacy-note { color: var(--muted); letter-spacing: .03em; }
.privacy-note span { color: var(--lime); margin-right: 7px; }

.hero { padding: 96px 0 62px; }
.eyebrow, .step { margin: 0 0 18px; color: var(--lime); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.hero h1 { max-width: 970px; margin: 0; font-size: clamp(52px, 8vw, 108px); line-height: .95; letter-spacing: -.065em; font-weight: 650; }
.hero h1 em { color: var(--lime); font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.hero-copy { max-width: 710px; margin: 34px 0 0; color: #c3c5c0; font-size: 17px; line-height: 1.8; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .88em; color: #d9e8be; }
.rate-strip { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; width: fit-content; background: rgba(12,13,13,.8); }
.rate-strip span { padding: 11px 18px; color: var(--muted); font-size: 12px; border-right: 1px solid var(--line); }
.rate-strip span:first-child { color: var(--text); font-weight: 700; }
.rate-strip span:last-child { border-right: 0; }
.rate-strip b { color: var(--text); }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(20,22,22,.96); }
.calculator-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 18px; }
.input-panel, .result-panel { min-height: 600px; padding: 30px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.step { margin-bottom: 9px; }
.text-button { padding: 4px 0; border: 0; border-bottom: 1px solid #6c716d; background: none; color: #c9ccc7; font-size: 12px; }
.text-button:hover { color: var(--lime); border-color: var(--lime); }

textarea {
  width: 100%; min-height: 378px; resize: vertical; margin-top: 27px; padding: 20px;
  border: 1px solid #373b39; border-radius: 13px; outline: none;
  background: #0e100f; color: #e9eee4; font: 13px/1.65 "SFMono-Regular", Consolas, monospace;
  transition: border-color .18s, box-shadow .18s;
}
textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
textarea::placeholder { color: #5f645f; }
.input-hint { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.input-actions { display: flex; gap: 10px; margin-top: 20px; }
.primary-button, .secondary-button { min-height: 48px; padding: 0 20px; border-radius: 11px; font-weight: 750; }
.primary-button { flex: 1; border: 1px solid var(--lime); background: var(--lime); color: #11140d; }
.primary-button:hover { background: #c6ff5d; }
.secondary-button { border: 1px solid #3d413f; background: transparent; color: #c4c7c3; }
.secondary-button:hover { border-color: #777d78; color: var(--text); }
.error-message { min-height: 20px; margin: 10px 0 0; color: var(--danger); font-size: 12px; }

.result-panel { position: relative; overflow: hidden; }
.result-panel::after { content: ""; position: absolute; width: 340px; height: 340px; right: -180px; top: -180px; border: 1px solid rgba(184,255,52,.2); border-radius: 50%; pointer-events: none; }
.status-pill { padding: 7px 11px; border: 1px solid #3a3e3b; border-radius: 999px; color: var(--muted); font-size: 11px; }
.status-pill.ready { border-color: rgba(184,255,52,.35); color: var(--lime); background: var(--lime-soft); }
.empty-state { height: 450px; display: grid; place-content: center; justify-items: center; color: var(--muted); font-size: 13px; }
.empty-orbit { width: 96px; height: 96px; display: grid; place-items: center; border: 1px solid #343835; border-radius: 50%; margin-bottom: 18px; }
.empty-orbit::before { content: ""; width: 46px; height: 46px; border: 1px solid #474c47; border-radius: 50%; }
.empty-orbit span { position: absolute; width: 8px; height: 8px; background: var(--lime); border-radius: 50%; transform: translate(45px, -17px); box-shadow: 0 0 16px var(--lime); }
.results { padding-top: 50px; }
.result-label { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.price-jpy { font-size: clamp(64px, 9vw, 104px); font-weight: 700; letter-spacing: -.07em; line-height: 1; color: var(--lime); }
.price-meta { display: flex; gap: 12px; align-items: center; margin-top: 13px; color: #c3c6c1; font: 12px/1.4 "SFMono-Regular", Consolas, monospace; }
.price-meta span + span { padding-left: 12px; border-left: 1px solid #484c49; color: var(--muted); }
.estimate-note { min-height: 40px; max-width: 610px; margin: 22px 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric-card { padding: 16px; border: 1px solid #353936; border-radius: 12px; background: var(--surface-2); }
.metric-card span { display: block; min-height: 28px; color: var(--muted); font-size: 9px; letter-spacing: .09em; line-height: 1.35; }
.metric-card strong { display: block; margin-top: 12px; font-size: 18px; }
.metric-card small { display: block; margin-top: 6px; color: var(--muted); }
.metric-hit { border-color: rgba(184,255,52,.26); background: linear-gradient(180deg, var(--lime-soft), var(--surface-2)); }
.usage-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.usage-summary div { padding: 0 14px; border-right: 1px solid var(--line); }
.usage-summary div:first-child { padding-left: 0; }
.usage-summary div:last-child { border: 0; }
.usage-summary span { display: block; color: var(--muted); font-size: 10px; }
.usage-summary strong { display: block; margin-top: 6px; font-size: 15px; }

.comparison-section { margin-top: 18px; padding: 34px 30px 30px; }
.comparison-heading { display: grid; grid-template-columns: 1fr minmax(280px, .75fr); align-items: end; gap: 50px; }
.comparison-heading h2 { margin: 0; font-size: clamp(34px, 4vw, 54px); line-height: 1.02; letter-spacing: -.045em; }
.comparison-heading > p { margin: 0 0 5px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.comparison-heading > p span { display: block; margin-top: 8px; color: #d2d5cf; font: 10px "SFMono-Regular", Consolas, monospace; letter-spacing: .04em; }
.model-comparison-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 34px; }
.model-card { min-width: 0; padding: 21px; border: 1px solid #353936; border-radius: 14px; background: var(--surface-2); }
.model-card.is-baseline { border-color: rgba(184,255,52,.42); background: linear-gradient(145deg, rgba(184,255,52,.14), var(--surface-2) 62%); }
.model-card-header { min-height: 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.model-vendor { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.model-badge { padding: 4px 7px; border: 1px solid #444946; border-radius: 999px; color: #bec2bc; font: 8px "SFMono-Regular", Consolas, monospace; letter-spacing: .06em; white-space: nowrap; }
.is-baseline .model-badge { border-color: rgba(184,255,52,.35); color: var(--lime); }
.model-card h3 { min-height: 48px; margin: 16px 0 0; font-size: 19px; line-height: 1.25; letter-spacing: -.02em; }
.model-price { display: block; margin-top: 18px; font-size: clamp(32px, 3.4vw, 46px); line-height: 1; letter-spacing: -.055em; }
.is-baseline .model-price { color: var(--lime); }
.model-price-meta { display: flex; gap: 10px; margin-top: 10px; color: var(--muted); font: 10px "SFMono-Regular", Consolas, monospace; }
.model-price-meta span + span { padding-left: 10px; border-left: 1px solid #494e4b; color: #d4d7d1; }
.model-rates { margin: 22px 0 0; padding-top: 15px; border-top: 1px solid #353a37; color: #c6cac4; font: 8px/1.6 "SFMono-Regular", Consolas, monospace; white-space: normal; }
.model-note { min-height: 30px; margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.comparison-note { margin: 18px 0 0; color: #7e827e; font-size: 10px; line-height: 1.7; }

.users-section { margin-top: 18px; padding: 30px; }
.table-wrap { overflow-x: auto; margin-top: 26px; }
table { width: 100%; border-collapse: collapse; min-width: 800px; }
th { padding: 0 14px 12px; text-align: right; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .06em; }
td { padding: 17px 14px; border-top: 1px solid var(--line); text-align: right; font: 13px "SFMono-Regular", Consolas, monospace; }
th:first-child, td:first-child { padding-left: 0; text-align: left; }
th:last-child, td:last-child { padding-right: 0; }
td:first-child { color: var(--lime); font-weight: 700; }
td small { color: var(--muted); }

.settings-section { margin-top: 18px; }
.settings-panel { padding: 0 30px; }
summary { min-height: 90px; display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; font-size: 17px; font-weight: 700; }
summary::-webkit-details-marker { display: none; }
summary .step { display: block; margin-bottom: 5px; }
.summary-action { color: var(--muted); font-size: 12px; font-weight: 500; }
.settings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 4px 0 24px; }
.settings-grid label { color: var(--muted); font-size: 11px; }
.settings-grid label span { float: right; color: var(--lime); }
.settings-grid input { width: 100%; margin-top: 8px; padding: 13px; border: 1px solid #3a3e3b; border-radius: 9px; background: #0e100f; color: var(--text); outline: none; }
.settings-grid input:focus { border-color: var(--lime); }
.settings-note { margin: 0; padding: 0 0 26px; color: var(--muted); font-size: 11px; }

.method-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; padding: 100px 0; }
.method-section h2 { margin: 0; font-size: clamp(36px, 5vw, 64px); line-height: 1.05; letter-spacing: -.05em; }
.method-copy { padding-top: 26px; }
.method-copy p { margin: 0; padding: 19px 0; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.75; }
.method-copy b { color: var(--text); }
footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; padding: 34px 0 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.6; }
footer p { margin: 0; max-width: 580px; }
.source-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 22px; }
.source-links a { text-underline-offset: 4px; }
.source-links a:hover { color: var(--lime); }

.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; }

@media (max-width: 900px) {
  .calculator-grid, .method-section { grid-template-columns: 1fr; }
  .input-panel, .result-panel { min-height: auto; }
  .comparison-heading { grid-template-columns: 1fr; gap: 22px; }
  .model-comparison-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: repeat(2, 1fr); }
  .method-section { gap: 34px; }
  footer { flex-direction: column; }
}

@media (max-width: 620px) {
  .page-shell { width: min(100% - 24px, 1240px); }
  .site-header { min-height: 66px; }
  .privacy-note { font-size: 0; }
  .privacy-note span { font-size: 10px; }
  .hero { padding: 68px 0 44px; }
  .hero h1 { font-size: clamp(46px, 15vw, 72px); }
  .hero-copy { font-size: 15px; }
  .rate-strip { border-radius: 14px; }
  .rate-strip span { width: 50%; border-bottom: 1px solid var(--line); }
  .rate-strip span:nth-child(2) { border-right: 0; }
  .rate-strip span:nth-child(3), .rate-strip span:nth-child(4) { border-bottom: 0; }
  .input-panel, .result-panel, .comparison-section, .users-section { padding: 21px; }
  textarea { min-height: 320px; }
  .breakdown { grid-template-columns: 1fr; }
  .metric-card { display: grid; grid-template-columns: 1fr auto; align-items: end; }
  .metric-card span { min-height: 0; grid-column: 1 / -1; }
  .metric-card strong { margin-top: 8px; }
  .usage-summary { grid-template-columns: 1fr; }
  .usage-summary div, .usage-summary div:first-child { padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .usage-summary div:last-child { border-bottom: 0; }
  .model-comparison-grid { grid-template-columns: 1fr; }
  .model-card h3, .model-note { min-height: 0; }
  .model-price { font-size: 42px; }
  .settings-panel { padding: 0 20px; }
  .settings-grid { grid-template-columns: 1fr; }
  .source-links { flex-direction: column; gap: 8px; white-space: normal; }
}
