:root {
  color-scheme: light;
  --paper: #f6f4ea;
  --ink: #202d25;
  --muted: #556359;
  --line: #dadfd0;
  --green: #203c2e;
  --lime: #dced9c;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
button, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #617d3c; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(100%, 960px); margin: auto; padding: max(44px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left)); }
.masthead, .brand, .timer-head, .dose-row, footer, .sound, .utility { display: flex; align-items: center; }
.masthead, .timer-head, .dose-row, footer { justify-content: space-between; }
.masthead { gap: 14px; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.brand { gap: 13px; }
.brand img { border-radius: 14px; }
h1 { margin: 0; font: 400 clamp(1.8rem, 5vw, 2.45rem)/1 Georgia, serif; letter-spacing: -.055em; }
.brand p { margin: 5px 0 0; font-size: .85rem; color: var(--muted); }
.outline, .primary, .start, .reset { min-height: 44px; padding: 0 14px; border-radius: 10px; font-weight: 700; }
.outline { background: transparent; color: var(--green); border: 1px solid #aebaa6; white-space: nowrap; }
.outline:hover { background: #e9eddf; }
.outline:disabled { opacity: .55; }
.workspace { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: stretch; }
.timer {
  background: radial-gradient(ellipse at 50% 32%, #345440, transparent 65%), var(--green);
  color: #fffdf1;
  border-radius: 24px;
  min-width: 0;
  padding: 22px 24px 13px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.timer :focus-visible { outline-color: var(--lime); }
.timer-head { gap: 10px; }
.round-label { background: #fffdf11c; border: 1px solid #fffdf136; padding: 6px 11px; border-radius: 20px; font-size: .86rem; }
.brew-spec { color: #e4edda; font-size: .9rem; font-variant-numeric: tabular-nums; text-align: right; }
.clock { --remaining: 100%; width: min(100%, 252px); aspect-ratio: 1; position: relative; margin: auto; display: grid; place-items: center; }
.ring {
  position: absolute; inset: 8px; border-radius: 50%;
  background: conic-gradient(var(--lime) var(--remaining), #fffdf13a 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}
.clock[data-phase="done"] .ring { background: var(--lime); }
.clock-face { text-align: center; }
.digits { font: 400 clamp(3.5rem, 12vw, 5.25rem)/.95 Georgia, serif; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.065em; padding-right: .065em; }
.phase { margin-top: 12px; color: var(--lime); font-size: .9rem; font-weight: 700; }
.instruction { text-align: center; color: #f0f3e7; font-size: .94rem; margin: 8px 0 14px; line-height: 1.55; }
.timer-controls { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.start, .reset { min-height: 48px; }
.start { border: 1px solid var(--lime); background: var(--lime); color: #1a3226; }
.start:hover { background: #ecf8c4; }
.reset { border: 1px solid #fffdf160; color: #fffdf1; background: transparent; }
.reset:disabled { opacity: .52; }
.next { min-height: 44px; background: none; border: 0; color: #fffdf1; padding: 0 10px; align-self: center; margin-top: 3px; }
.next:disabled { opacity: .48; }
.next span { margin-left: 5px; }
.side { display: grid; gap: 14px; grid-template-rows: auto 1fr; min-width: 0; }
.panel { background: #fffdf6; border: 1px solid var(--line); border-radius: 20px; padding: 17px 18px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
.dose-row { min-height: 38px; gap: 14px; }
.number-control { display: flex; align-items: center; color: var(--muted); gap: 6px; }
input[type="number"] { width: 100%; min-width: 0; padding: 8px; min-height: 44px; border-radius: 8px; border: 1px solid #aebaa6; background: #fffdf8; color: var(--ink); }
#leaves { width: 75px; text-align: center; }
.water { color: var(--green); font-variant-numeric: tabular-nums; }
.ratio { margin: 5px 0 0; color: var(--muted); font-size: .85rem; }
.rounds ol { display: grid; gap: 5px; list-style: none; padding: 0; margin: 0; }
.round-choice { width: 100%; display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; min-height: 44px; text-align: left; padding: 4px 9px; color: var(--ink); border: 1px solid transparent; border-radius: 9px; background: transparent; }
.round-choice:hover, .round-choice[aria-pressed="true"] { background: #edf2dd; }
.round-choice[aria-pressed="true"] { border-color: #c6d4ad; font-weight: 700; }
.round-choice:disabled { cursor: default; }
.round-number { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e5eadc; font-size: .8rem; }
.round-choice[aria-pressed="true"] .round-number { background: var(--green); color: #fffdf1; }
.round-spec { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
footer { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 10px; gap: 0 18px; flex-wrap: wrap; font-size: .86rem; }
.sound, .utility { gap: 14px; flex-wrap: wrap; }
.sound label { display: inline-flex; align-items: center; min-height: 44px; gap: 5px; }
.sound input { accent-color: var(--green); width: 16px; height: 16px; }
.offline { color: var(--muted); }
.offline::before { content: "●"; margin-right: 6px; color: #53743e; font-size: .72em; }
.text-button { background: none; border: 0; padding: 2px 0; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; color: var(--green); }
.feedback { color: var(--muted); font-size: .88rem; margin: 0; }
dialog { width: min(460px, calc(100% - 28px)); max-height: 90vh; border: 1px solid var(--line); border-radius: 19px; padding: 20px; color: var(--ink); background: #fffdf6; }
dialog::backdrop { background: #13291db3; }
dialog p { line-height: 1.55; }
fieldset { min-inline-size: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 0 0 12px; }
legend { padding: 0 5px; color: var(--muted); font-size: .88rem; }
.form-row, .form-table > div { display: grid; gap: 8px; align-items: center; }
.form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row input { margin-top: 4px; }
.form-table > div { grid-template-columns: 2.25rem repeat(2, minmax(0, 1fr)); margin-bottom: 5px; }
.form-table > div:last-child { margin-bottom: 0; }
.form-head { color: var(--muted); font-size: .85rem; }
.dialog-controls { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
#defaults { margin-right: auto; }
.primary { color: white; background: var(--green); border: 1px solid var(--green); }
.primary:hover { background: #355541; }
@media (max-width: 660px) {
  .shell { padding: max(17px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .masthead { padding-bottom: 13px; margin-bottom: 13px; }
  .workspace { grid-template-columns: 1fr; gap: 13px; }
  .timer { padding: 14px 14px 6px; border-radius: 19px; }
  .clock { width: min(100%, 214px); margin: 3px auto 0; }
  .side { gap: 10px; }
  .panel { padding: 13px; border-radius: 16px; }
  footer { margin-top: 14px; padding-top: 5px; }
}
