:root {
  --forest: #164f9f;
  --forest-deep: #0c3e86;
  --sage: #5e83b9;
  --mint: #dceafa;
  --cream: #f2f6fb;
  --paper: rgba(255, 255, 255, .82);
  --orange: #195baa;
  --orange-dark: #0c438c;
  --ink: #15233a;
  --muted: #65738a;
  --line: rgba(67, 105, 151, .18);
  --shadow: 0 18px 44px rgba(16, 52, 91, .15), inset 0 1px 0 rgba(255, 255, 255, .8);
}

* { box-sizing: border-box; }

html { background: var(--cream); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 32%, rgba(80, 148, 206, .13), transparent 31%),
    radial-gradient(circle at 88% 78%, rgba(115, 176, 218, .14), transparent 30%),
    linear-gradient(145deg, #f4f8fc 0%, #eaf2fa 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; }

.topbar {
  height: 88px;
  width: 100%;
  margin: 0;
  padding: 13px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(120deg, rgba(12, 62, 134, .96), rgba(21, 87, 176, .88) 55%, rgba(39, 111, 196, .82));
  box-shadow: 0 9px 30px rgba(7, 40, 84, .25);
  position: relative;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.6px;
}

.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy small { color: rgba(255,255,255,.86); font-size: 10px; line-height: 1; letter-spacing: 1.8px; text-transform: uppercase; font-weight: 800; }
.brand-copy > span { line-height: 1.08; font-weight: 750; }

.icon-button, .back-button, .more-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .32);
  color: #fff;
  background: rgba(255, 255, 255, .12);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(5,35,76,.22), inset 0 1px 0 rgba(255,255,255,.26);
  backdrop-filter: blur(16px);
  transition: transform .2s, background .2s;
}
.icon-button:hover { transform: translateY(-2px); background: rgba(255,255,255,.22); }
.back-button:hover, .more-button:hover { transform: translateY(-2px); background: white; }
.icon-button svg, .back-button svg, .more-button svg { width: 21px; height: 21px; fill: currentColor; }
.back-button svg, .more-button svg { fill: none; stroke: currentColor; stroke-width: 2; }
.sound-on { display: none; }
.sound-enabled .sound-on { display: block; }
.sound-enabled .sound-off { display: none; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.maintenance-menu { position: absolute; top: 76px; right: 32px; width: min(360px, calc(100vw - 36px)); padding: 12px; color: var(--ink); background: rgba(247,251,255,.94); border: 1px solid rgba(255,255,255,.9); border-radius: 22px; box-shadow: 0 22px 55px rgba(5,35,76,.28), inset 0 1px 0 #fff; backdrop-filter: blur(22px); }
.menu-heading { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 13px; }
.menu-heading small { color: #5e7fac; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.menu-heading strong { font-size: 18px; letter-spacing: -.4px; }
.menu-item { width: 100%; min-height: 64px; padding: 9px 10px; display: grid; grid-template-columns: 40px 1fr 22px; align-items: center; gap: 10px; text-align: left; color: var(--ink); background: transparent; border: 0; border-radius: 14px; cursor: pointer; transition: background .2s, transform .2s; }
.menu-item:hover:not(:disabled) { background: #e4effb; transform: translateX(2px); }
.menu-item.active { background: linear-gradient(120deg, #e7f1fc, #d5e7f8); }
.menu-item:disabled { cursor: default; opacity: .58; }
.menu-item-icon { width: 38px; height: 38px; display: grid; place-items: center; font-size: 19px; background: rgba(255,255,255,.76); border: 1px solid rgba(72,113,163,.12); border-radius: 12px; }
.menu-item > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; }
.menu-item strong { font-size: 13px; }
.menu-item small { color: var(--sage); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; }
.menu-item > svg { width: 18px; fill: none; stroke: #3d6fae; stroke-width: 2; }
.menu-divider { height: 1px; margin: 7px 10px; background: rgba(61,111,174,.13); }

main { max-width: 1120px; margin: 0 auto; padding: 62px 32px 80px; }
.home-view { max-width: 850px; margin: 0 auto; }

.eyebrow {
  text-transform: uppercase;
  color: #436fa9;
  font-size: 12px;
  letter-spacing: 2.1px;
  font-weight: 700;
  margin-bottom: 15px;
}

h1 {
  margin: 0;
  color: var(--forest);
  font-family: inherit;
  font-size: clamp(42px, 6vw, 65px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -2.6px;
}
h1 em { font-weight: inherit; font-style: normal; color: #5482bd; }
.intro { max-width: 580px; margin: 25px 0 42px; font-size: 17px; line-height: 1.7; color: var(--muted); }

.task-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 292px;
  overflow: hidden;
  background: var(--paper);
  background: linear-gradient(120deg, rgba(255,255,255,.9), rgba(226,238,251,.72));
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.task-art { display: grid; place-items: center; background: linear-gradient(140deg, #0f4a98, #2e75c6); position: relative; overflow: hidden; }
.task-art::before, .task-art::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.task-art::before { width: 250px; height: 250px; left: -110px; top: -110px; }
.task-art::after { width: 190px; height: 190px; right: -100px; bottom: -90px; }
.task-art svg { width: 145px; position: relative; z-index: 1; }
.drop-back { fill: rgba(255,255,255,.9); }
.drop-line { fill: none; stroke: #83b6e2; stroke-width: 5; stroke-linecap: round; }
.spark { fill: #c6e7ff; }
.task-content { padding: 34px 38px; display: flex; flex-direction: column; align-items: flex-start; }
.task-meta { width: 100%; display: flex; justify-content: space-between; color: var(--sage); font-size: 12px; text-transform: uppercase; letter-spacing: 1.1px; font-weight: 700; }
.task-content h2 { margin: 19px 0 8px; font-family: inherit; font-size: 30px; font-weight: 750; letter-spacing: -1px; }
.task-content > p { margin: 0 0 25px; color: var(--muted); line-height: 1.55; }

.primary-button, .next-button {
  border: 0;
  border-radius: 999px;
  color: white;
  background: var(--orange);
  min-height: 52px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(12, 67, 140, .24), inset 0 1px 0 rgba(255,255,255,.2);
  transition: transform .2s, background .2s, opacity .2s;
}
.primary-button:hover, .next-button:not(:disabled):hover { background: var(--orange-dark); transform: translateY(-2px); }
.primary-button svg, .next-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.home-progress { width: 100%; margin: -3px 0 20px; }
.home-progress-copy { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 12px; color: var(--muted); }
.home-progress-copy strong { color: var(--forest); }
.progress-track { height: 6px; background: var(--mint); border-radius: 5px; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--orange); border-radius: inherit; transition: width .4s; }

.guide-view { max-width: 760px; margin: -26px auto 0; }
.guide-head { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 18px; padding: 12px; border-radius: 22px; background: linear-gradient(120deg, rgba(255,255,255,.86), rgba(226,238,251,.7)); border: 1px solid rgba(255,255,255,.8); box-shadow: 0 7px 20px rgba(16,52,91,.13), inset 0 1px 0 rgba(255,255,255,.86); backdrop-filter: blur(18px); }
.guide-head .back-button, .guide-head .more-button { color: var(--forest); background: rgba(255,255,255,.72); border-color: rgba(36,83,140,.15); box-shadow: none; }
.guide-title { text-align: center; display: flex; flex-direction: column; gap: 3px; }
.guide-title span { font-family: inherit; font-size: 19px; font-weight: 750; letter-spacing: -.5px; }
.guide-title small { color: #4f73a3; font-size: 11px; line-height: 1.2; font-weight: 700; }
.guide-title strong { font-size: 11px; color: var(--sage); letter-spacing: 1px; text-transform: uppercase; }
.phase-progress { margin: 25px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.phase-segment { height: 5px; border-radius: 5px; background: #d5e0ee; overflow: hidden; }
.phase-segment span { display: block; height: 100%; background: var(--orange); transform-origin: left; transition: transform .35s ease; }

.step-stage { min-height: 520px; padding: 40px 10px 28px; display: flex; flex-direction: column; align-items: center; text-align: center; border-radius: 30px; transition: background .3s; }
.step-visual { width: 140px; height: 140px; border-radius: 50%; background: linear-gradient(140deg, rgba(255,255,255,.92), rgba(207,226,246,.82)); display: grid; place-items: center; margin-bottom: 24px; position: relative; border: 1px solid rgba(255,255,255,.9); box-shadow: 0 14px 34px rgba(16,52,91,.14), inset 0 1px 0 #fff; }
.step-visual::after { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(23,59,53,.1); border-radius: 50%; }
.step-visual svg { width: 75px; height: 75px; fill: none; stroke: var(--forest); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; position: relative; z-index: 1; }
.water-type-badge { margin: -8px 0 12px; padding: 7px 13px; border-radius: 999px; font-size: 11px; line-height: 1; letter-spacing: 1.4px; font-weight: 800; }
.step-number { color: #0c4b98; font-size: 14px; line-height: 1; letter-spacing: 1.7px; font-weight: 800; padding: 9px 14px; border-radius: 999px; background: rgba(255,255,255,.78); border: 1px solid rgba(70,119,177,.18); box-shadow: 0 6px 16px rgba(16,52,91,.08); }
.step-stage h2 { max-width: 650px; margin: 10px 0 13px; font-family: inherit; font-size: clamp(29px, 5vw, 40px); font-weight: 750; letter-spacing: -1.4px; line-height: 1.13; }
.instruction-lead { max-width: 560px; margin: 3px 0 10px; padding: 11px 15px; display: flex; align-items: center; gap: 10px; color: #174f96; text-align: left; background: rgba(221,236,252,.82); border: 1px solid #b8d2ee; border-radius: 13px; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.instruction-lead svg { flex: 0 0 auto; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.instruction-lead strong { font-size: 14px; line-height: 1.35; }
.instruction-lead:has(+ .instruction-followup) { margin-bottom: 9px; border-radius: 13px; border-bottom-color: #b8d2ee; }
.step-detail { max-width: 560px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; white-space: pre-line; }
.step-detail.instruction-note { margin: 0 0 6px; padding: 11px 15px; color: #174f96; font-size: 14px; line-height: 1.45; font-weight: 700; text-align: left; background: rgba(221,236,252,.82); border: 1px solid #b8d2ee; border-radius: 13px; box-shadow: inset 0 1px 0 rgba(255,255,255,.65); }
.step-detail.instruction-standalone { position: relative; padding-left: 39px; }
.step-detail.instruction-standalone::before { content: "i"; position: absolute; left: 14px; top: 12px; width: 17px; height: 17px; display: grid; place-items: center; color: white; background: #3473b9; border-radius: 50%; font-size: 11px; font-weight: 800; font-style: normal; }
.amount-badge { margin-top: 22px; padding: 9px 17px; border-radius: 999px; background: rgba(255,255,255,.76); color: var(--orange-dark); border: 1px solid rgba(60,105,160,.14); box-shadow: 0 6px 16px rgba(16,52,91,.09); font-weight: 700; font-size: 13px; }

.timer-card { margin-top: 24px; background: linear-gradient(120deg, #0c3e86, #246bb9); color: white; border-radius: 18px; padding: 17px 22px; display: grid; grid-template-columns: 1fr auto; text-align: left; align-items: center; gap: 2px 30px; box-shadow: var(--shadow); }
.timer-card span { color: #b9cdc5; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.timer-card strong { font-size: 27px; font-variant-numeric: tabular-nums; }
.timer-card button { grid-column: 2; grid-row: 1 / 3; border: 0; background: var(--orange); color: white; border-radius: 9px; padding: 10px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }

.guide-actions { max-width: 560px; margin: 0 auto; display: grid; gap: 16px; }
.subcheck-list { display: grid; gap: 13px; }
.subcheck-control { min-height: 58px; display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: linear-gradient(120deg, rgba(255,255,255,.88), rgba(226,238,251,.72)); border: 1px solid rgba(255,255,255,.84); border-radius: 18px; box-shadow: 0 7px 20px rgba(16,52,91,.1), inset 0 1px 0 rgba(255,255,255,.9); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.subcheck-control:hover { transform: translateY(-1px); }
.subcheck-control:has(input:checked) { border-color: #8db5df; background: linear-gradient(120deg, #f7fbff, #dbeafa); }
.subcheck-control input { position: absolute; opacity: 0; pointer-events: none; }
.subcheck-control input:checked + .checkmark { background: var(--forest); border-color: var(--forest); }
.subcheck-control input:checked + .checkmark svg { opacity: 1; transform: scale(1); }
.subcheck-control > span:last-child { font-weight: 600; line-height: 1.4; }

.guide-view[data-water-theme="cold"] .step-stage { background: radial-gradient(circle at 50% 30%, rgba(73,145,216,.12), transparent 58%); }
.guide-view[data-water-theme="cold"] .water-type-badge { color: #0c4b98; background: #dcecff; border: 1px solid #aacced; }
.guide-view[data-water-theme="cold"] .step-number { color: #0c4b98; border-color: #aacced; }

.guide-view[data-water-theme="hot"] .step-stage { background: radial-gradient(circle at 50% 30%, rgba(207,72,72,.12), transparent 58%); }
.guide-view[data-water-theme="hot"] .step-visual { background: linear-gradient(140deg, rgba(255,255,255,.94), rgba(250,218,218,.88)); border-color: #fff3f3; box-shadow: 0 14px 34px rgba(151,45,45,.14), inset 0 1px 0 #fff; }
.guide-view[data-water-theme="hot"] .step-visual svg { stroke: #bb3434; }
.guide-view[data-water-theme="hot"] .water-type-badge { color: #a92727; background: #ffe1e1; border: 1px solid #efb0b0; }
.guide-view[data-water-theme="hot"] .step-number { color: #a92727; border-color: #efb0b0; }
.guide-view[data-water-theme="hot"] .instruction-lead { color: #a92727; background: rgba(255,225,225,.84); border-color: #efb0b0; }
.guide-view[data-water-theme="hot"] .step-detail.instruction-note { color: #a92727; background: rgba(255,225,225,.84); border-color: #efb0b0; }
.guide-view[data-water-theme="hot"] .step-detail.instruction-standalone::before { background: #bb3434; }
.guide-view[data-water-theme="hot"] .confirm-control input:checked + .checkmark,
.guide-view[data-water-theme="hot"] .subcheck-control input:checked + .checkmark { background: #bb3434; border-color: #bb3434; }
.guide-view[data-water-theme="hot"] .next-button:not(:disabled) { background: #c84848; box-shadow: 0 8px 22px rgba(180,50,50,.24), inset 0 1px 0 rgba(255,255,255,.2); }
.guide-view[data-water-theme="hot"] .next-button:not(:disabled):hover { background: #ae3030; }
.confirm-control { min-height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 18px; background: linear-gradient(120deg, rgba(255,255,255,.88), rgba(226,238,251,.72)); border: 1px solid rgba(255,255,255,.84); border-radius: 18px; box-shadow: 0 7px 20px rgba(16,52,91,.1), inset 0 1px 0 rgba(255,255,255,.9); cursor: pointer; transition: border-color .2s, background .2s; }
.confirm-control:has(input:checked) { border-color: #8db5df; background: linear-gradient(120deg, #f7fbff, #dbeafa); }
.confirm-control input { position: absolute; opacity: 0; pointer-events: none; }
.checkmark { flex: 0 0 auto; width: 27px; height: 27px; border: 2px solid #b5c1b8; border-radius: 8px; display: grid; place-items: center; color: white; transition: background .2s, border .2s; }
.checkmark svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; opacity: 0; transform: scale(.5); transition: .2s; }
.confirm-control input:checked + .checkmark { background: var(--forest); border-color: var(--forest); }
.confirm-control input:checked + .checkmark svg { opacity: 1; transform: scale(1); }
.confirm-control > span:last-child { font-weight: 600; }
.next-button { width: 100%; }
.next-button:disabled { background: #b8c5d5; color: rgba(255,255,255,.9); box-shadow: none; cursor: not-allowed; }
.previous-link { justify-self: center; border: 0; background: transparent; padding: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.previous-link:disabled { visibility: hidden; }

.complete-view { max-width: 650px; margin: 30px auto 0; text-align: center; }
.complete-burst { display: grid; place-items: center; margin-bottom: 28px; }
.complete-icon { width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(140deg, #0d438e, #2f78c8); display: grid; place-items: center; box-shadow: 0 0 0 13px var(--mint), 0 18px 40px rgba(12,62,134,.2); }
.complete-icon svg { width: 67px; fill: none; stroke: white; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.complete-view > p { color: var(--muted); font-size: 17px; margin: 24px auto 30px; }
.complete-stats { display: flex; justify-content: center; gap: 60px; margin-bottom: 32px; }
.complete-stats div { display: flex; flex-direction: column; }
.complete-stats strong { font-family: inherit; font-weight: 800; font-size: 35px; }
.complete-stats span { color: var(--muted); font-size: 12px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--forest-deep); color: white; padding: 12px 18px; border-radius: 9px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }
.step-stage.swap { animation: swap .28s ease; }
@keyframes swap { from { opacity: .1; transform: translateX(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 700px) {
  .topbar { height: 84px; padding: 13px 24px; }
  .maintenance-menu { top: 73px; right: 18px; }
  main { padding: 35px 18px 55px; }
  h1 { font-size: 43px; }
  .intro { margin: 20px 0 28px; font-size: 15px; }
  .task-card { grid-template-columns: 1fr; }
  .task-art { min-height: 175px; }
  .task-art svg { width: 115px; }
  .task-content { padding: 27px 25px 28px; }
  .task-content h2 { font-size: 27px; }
  .primary-button { width: 100%; }
  .guide-view { margin-top: -13px; }
  .guide-head { gap: 8px; }
  .guide-title span { font-size: 16px; }
  .guide-title small { font-size: 10px; }
  .step-stage { min-height: auto; padding: 22px 6px 18px; }
  .step-visual { width: 92px; height: 92px; margin-bottom: 15px; }
  .step-visual svg { width: 49px; height: 49px; }
  .water-type-badge { margin: -2px 0 9px; padding: 6px 11px; }
  .step-number { font-size: 12px; padding: 8px 12px; }
  .step-stage h2 { font-size: 27px; margin: 9px 0 10px; }
  .instruction-lead { margin: 2px 0 9px; padding: 9px 12px; }
  .instruction-lead strong { font-size: 13px; }
  .step-detail { font-size: 13px; line-height: 1.55; }
  .step-detail.instruction-note { padding: 9px 12px; font-size: 13px; line-height: 1.4; }
  .step-detail.instruction-standalone { padding-left: 36px; }
  .step-detail.instruction-standalone::before { left: 12px; top: 10px; }
  .amount-badge { margin-top: 14px; }
  .complete-stats { gap: 35px; }
}

@media (max-width: 390px) {
  .brand { font-size: 20px; }
  h1 { font-size: 39px; }
  .step-stage { min-height: auto; }
}

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