:root {
  --bg: #FBFBF9;
  --panel: #EEF2EC;
  --card: #FFFFFF;
  --ink: #1D2420;
  --muted: #56615A;
  --green: #2F7A4F;
  --green-soft: #9BB8A5;
  --done-num: #DCE6DF;
  --line: #E3E9E4;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: 'Figtree', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; color: inherit; }
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 22px 26px; gap: 16px; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; }
.title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.title h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title span { font-size: 16px; color: var(--muted); white-space: nowrap; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px 0 14px;
  border-radius: 999px; background: var(--green); color: #fff; border: none;
}
.chip .n { font-size: 15px; font-weight: 600; }
.chip .t { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chip .x { width: 32px; height: 32px; border-radius: 999px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; }

/* body */
.main { flex: 1; min-height: 0; display: flex; gap: 16px; }
.ings {
  width: 286px; flex: none; background: var(--panel); border-radius: 22px; padding: 14px 12px;
  display: flex; flex-direction: column; overflow-y: auto;
}
.label { font-size: 13px; font-weight: 700; color: var(--green); letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px 8px; }
.ing {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border: none;
  border-radius: 12px; background: transparent; text-align: left; font-size: 17px; width: 100%;
}
.ing b { min-width: 62px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ing span { font-weight: 500; }
.ing.got { color: var(--muted); text-decoration: line-through; }

.steps {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto;
  padding: 4px 4px 28px 0; scroll-padding: 12px 0 40px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 44px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 44px), transparent 100%);
}
.ings, .steps { scrollbar-width: thin; scrollbar-color: #C9D4CC transparent; overscroll-behavior: contain; }
.step {
  flex: none; min-height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 6px;
  border-radius: 18px; border: 2px solid transparent;
}
.step.cur { background: var(--card); border-color: var(--green); }
.step .go {
  flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: 14px; border: none;
  background: transparent; text-align: left; padding: 8px 6px;
}
.num {
  width: 36px; height: 36px; flex: none; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; background: var(--panel);
}
.step .txt { font-size: 21px; font-weight: 500; line-height: 1.25; }
.step.done .go { color: var(--muted); }
.step.done .num { background: var(--done-num); color: var(--muted); }
.step.cur .num { background: var(--green); color: #fff; }
.step.cur .txt { font-weight: 700; }
.tbtn {
  height: 46px; min-width: 92px; padding: 0 14px; flex: none; border-radius: 999px;
  border: 2px solid var(--green-soft); background: #fff; color: var(--green);
  font-size: 17px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tbtn.run { background: var(--green); border-color: var(--green); color: #fff; font-size: 19px; font-variant-numeric: tabular-nums; }
.finish {
  flex: none; height: 60px; margin-top: 6px; border-radius: 18px; border: 2px dashed var(--green-soft);
  background: transparent; color: var(--green); font-size: 18px; font-weight: 700;
}
.finish.arm { background: var(--green); color: #fff; border-style: solid; }

/* empty */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.empty .clock { font-size: 120px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.empty p { margin: 0; font-size: 22px; color: var(--muted); }

/* alarm */
.alarm {
  position: fixed; inset: 0; background: var(--green); color: #fff; padding: 40px 56px;
  display: flex; flex-direction: column; z-index: 10;
}
.alarm .head { display: flex; align-items: center; gap: 14px; font-size: 16px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.bell { position: relative; width: 44px; height: 44px; }
.bell i { position: absolute; inset: 0; border-radius: 999px; background: #fff; animation: ring 1.6s ease-out infinite; }
.bell b { position: relative; width: 44px; height: 44px; border-radius: 999px; background: #fff; color: var(--green); display: flex; align-items: center; justify-content: center; }
@keyframes ring { 0% { transform: scale(1); opacity: .45 } 100% { transform: scale(1.8); opacity: 0 } }
.alarm .big { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.alarm .big strong { font-size: 110px; font-weight: 800; line-height: .95; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.alarm .big span { font-size: 32px; font-weight: 600; }
.alarm .btns { display: flex; gap: 16px; flex-wrap: wrap; }
.alarm .btns button { height: 76px; padding: 0 36px; border-radius: 999px; font-size: 22px; font-weight: 800; }
.alarm .stop { border: none; background: #fff; color: var(--green); }
.alarm .snz { border: 2.5px solid #fff; background: transparent; color: #fff; }

.offline { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); background: #1D2420; color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 14px; z-index: 20; }

/* phones */
@media (max-width: 720px) {
  #app { padding: 14px; gap: 12px; }
  .top { flex-wrap: wrap; }
  .title { flex-wrap: wrap; }
  .title h1 { white-space: normal; }
  .main { flex-direction: column; }
  .ings { width: auto; max-height: 34vh; flex: none; }
  .step .txt { font-size: 18px; }
  .alarm { padding: 28px 22px; }
  .alarm .big strong { font-size: 64px; }
  .empty .clock { font-size: 80px; }
}
