:root {
  --blue: #123e74;
  --blue-2: #1765a8;
  --green: #278a45;
  --yellow: #f0c529;
  --purple: #7b1fa2;
  --red: #c62828;
  --ink: #1e2933;
  --muted: #65717c;
  --surface: #ffffff;
  --background: #eef3f7;
  --border: #d6e0e8;
  --shadow: 0 12px 30px rgba(24, 49, 73, .11);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--background);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #e8f0f7 0, #f7f9fb 260px); }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  min-height: 84px;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px;
  background: linear-gradient(135deg, #0d315c, #1765a8);
  color: white; box-shadow: 0 5px 18px rgba(9, 40, 70, .22);
}
.topbar h1 { margin: 0; font-size: clamp(1.3rem, 5vw, 1.85rem); line-height: 1.15; }
.eyebrow { margin: 0 0 2px; font-size: .72rem; letter-spacing: .16em; font-weight: 800; opacity: .78; }
.back-button { min-width: 84px; border: 1px solid rgba(255,255,255,.45); border-radius: 10px; padding: 9px 10px; background: rgba(255,255,255,.13); color: white; font-weight: 700; }
.hidden { display: none !important; }


.app-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #ffffff;
  opacity: 1;
  visibility: visible;

  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.app-splash img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-splash.splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}



.app-shell { width: min(760px, 100%); margin: 0 auto; padding: 18px 14px max(32px, env(safe-area-inset-bottom)); }
.screen { display: none; animation: screen-in .2s ease-out; }
.screen.active { display: block; }
@keyframes screen-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.intro-card, .section-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.intro-card h2, .section-card h2 { margin: 0 0 7px; color: var(--blue); font-size: 1.18rem; }
.intro-card p, .hint { margin: 0; color: var(--muted); line-height: 1.45; }
.menu-grid { display: grid; gap: 11px; }
.menu-button { width: 100%; min-height: 58px; border: 0; border-radius: 13px; padding: 12px 15px; font-size: 1rem; font-weight: 800; letter-spacing: .025em; box-shadow: 0 5px 12px rgba(20, 50, 70, .16); transition: transform .1s, filter .1s; }
.menu-button:active, .action:active { transform: translateY(1px); filter: brightness(.94); }
.green { background: var(--green); color: white; }
.yellow { background: var(--yellow); color: #202020; }
.purple { background: var(--purple); color: white; }
.blue { background: var(--blue-2); color: white; }
.red { background: var(--red); color: white; }
.logo-link { display: flex; flex-direction: column; align-items: center; gap: 5px; margin: 24px auto 6px; text-decoration: none; color: var(--blue); font-weight: 800; }
.logo-link img { display: block;
    max-width: 160px;
    width: 100%;
    ; height: auto; }


.field-row, .result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 52px; padding: 7px 0; border-bottom: 1px solid #e8edf1; }
.field-row:last-child, .result-row:last-child { border-bottom: 0; }
.field-row > span:first-child, .result-row > span { line-height: 1.3; }
input { width: 116px; min-height: 44px; border: 1px solid #b8c8d5; border-radius: 10px; padding: 9px 10px; background: #fbfdff; text-align: right; color: var(--ink); }
input:focus { outline: 3px solid rgba(23, 101, 168, .18); border-color: var(--blue-2); }
.input-with-unit { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.input-with-unit b { min-width: 29px; font-size: .86rem; }
.short-input { width: 116px; }
.button-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.button-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.action { min-height: 50px; border: 0; border-radius: 11px; padding: 10px; font-weight: 800; box-shadow: 0 4px 10px rgba(20, 50, 70, .14); }
.results output { min-width: 112px; border-radius: 9px; padding: 9px 10px; background: #edf6ff; color: var(--blue); font-weight: 800; text-align: right; white-space: nowrap; }
.result-row.prominent { margin-top: 10px; font-weight: 700; }
.result-row.prominent output { background: #dff1e4; color: #166534; font-size: 1.08rem; }
.result-group { margin-top: 14px; }
.result-group h3, .subheading { margin: 0; padding: 9px 11px; border-radius: 8px; background: #eef3f7; color: #38536b; font-size: .92rem; }
.advice-box { margin-top: 13px; border: 1px solid var(--border); border-left: 5px solid var(--blue-2); border-radius: 10px; padding: 13px; background: #fafcff; }
.advice-box h3 { margin: 0 0 6px; color: var(--blue); }
.advice-box p { margin: 0; line-height: 1.48; }
.notice { margin: 14px 0 0; padding: 13px; border-radius: 10px; background: #fff7da; border: 1px solid #efd777; line-height: 1.45; }
.check-row { display: flex; gap: 11px; align-items: flex-start; margin-top: 13px; line-height: 1.4; }
.check-row input { width: 22px; min-height: 22px; margin: 0; accent-color: var(--blue-2); }
.vent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.vent-grid input { width: 100%; }
.vent-grid.labels { color: var(--muted); text-align: center; font-size: .82rem; font-weight: 700; }
.prose h3 { color: var(--blue); margin-bottom: 5px; }
.prose p { line-height: 1.55; margin-top: 0; }
.website-button { display: block; margin-top: 18px; border-radius: 11px; padding: 14px; background: var(--blue-2); color: white; text-align: center; text-decoration: none; font-weight: 800; }
.toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 50; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; width: min(420px, calc(100% - 30px)); padding: 13px 15px; border-radius: 11px; background: #252b31; color: white; text-align: center; box-shadow: 0 8px 25px rgba(0,0,0,.28); transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.startup-splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: white; opacity: 1; transition: opacity .25s; }
.startup-splash img { width: min(100%, 640px); height: 100%; object-fit: contain; }
.startup-splash.hide { opacity: 0; pointer-events: none; }
@media (min-width: 620px) { .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .menu-button:last-child { grid-column: 1 / -1; } .app-shell { padding-top: 24px; } }
@media (max-width: 420px) { .button-row.three { grid-template-columns: 1fr; } .field-row, .result-row { gap: 8px; } input { width: 104px; } .topbar { padding-left: 12px; padding-right: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
