:root {
  color-scheme: light;
  --paper: #f7f6f0;
  --surface: #fdfcf7;
  --ink: #213c33;
  --muted: #5f6b60;
  --line: #d6d9cd;
  --forest: #173d33;
  --apricot: #ffb47d;
  --serif: "Baskervville", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: url("./assets/grain.png") repeat, var(--paper); }
button, input { font: inherit; }
button, summary, label { -webkit-tap-highlight-color: transparent; }
button, summary { touch-action: manipulation; }
button { cursor: pointer; }
button:focus-visible, summary:focus-visible, input:focus-visible + span {
  outline: 3px solid #bb642e;
  outline-offset: 3px;
}
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
[hidden] { display: none !important; }
.sr-only, .segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.page-width { width: min(calc(100% - 5rem), 66rem); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 4.15rem; display: flex; align-items: center; justify-content: space-between; }
.masthead { padding-top: env(safe-area-inset-top); }
.header-actions { display: flex; gap: .65rem; align-items: center; }
.install-control {
  display: inline-flex; align-items: center; justify-content: center; gap: .38rem;
  min-height: 44px; padding: .3rem .55rem; border: 1px solid var(--line); border-radius: .55rem;
  color: var(--ink); background: var(--surface); font-size: .82rem; font-weight: 650;
}
.install-mark { line-height: 1; color: #9a572e; font-size: 1.05rem; }
.install-dialog {
  width: min(24rem, calc(100% - 2rem)); max-height: calc(100% - 3rem); overflow-y: auto;
  padding: 1.5rem; border: 1px solid var(--line); border-radius: 1rem;
  color: var(--ink); background: var(--surface); box-shadow: 0 1rem 4rem #173d3333;
}
.install-dialog::backdrop { background: #172c25a8; }
.install-dialog img { border-radius: .7rem; }
.install-dialog h2 { margin: .75rem 0 .6rem; font-size: 1.2rem; }
.install-dialog ol { margin: .7rem 0; padding-left: 1.55rem; line-height: 1.65; }
.install-dialog li + li { margin-top: .32rem; }
.install-dialog p { color: var(--muted); font-size: .88rem; line-height: 1.6; }
.install-dialog button {
  width: 100%; min-height: 44px; border: 0; border-radius: .55rem;
  font-weight: 650; background: var(--forest); color: var(--surface);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; }
.brand > span { font: italic bold 1.85rem/1 var(--serif); letter-spacing: -.08em; }
.brand img { width: 2.3rem; height: 2.3rem; }
.brand-period { color: #ac592c; }
.sound-control {
  min-height: 44px; display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .15rem .35rem .65rem; border: 0; background: transparent; color: var(--ink);
  font-size: .875rem; font-weight: 640;
}
.glyph {
  display: inline-block; width: 1.25rem; height: 1.25rem; flex: none;
  background: center / contain no-repeat;
}
.speaker { background-image: url("./assets/sound.png"); }
.sound-control[aria-pressed="false"] .speaker { background-image: url("./assets/silent.png"); }
.switch-track {
  width: 2rem; height: 1.15rem; display: flex; align-items: center;
  padding: 3px; border-radius: 1rem; background: #69746a;
}
.switch-track > span { width: .79rem; height: .79rem; border-radius: 100%; background: var(--surface); transition: transform .15s; }
[aria-pressed="true"] .switch-track { background: var(--forest); }
[aria-pressed="true"] .switch-track > span { transform: translateX(.81rem); background: #ffbf8c; }
.intro { display: flex; align-items: center; justify-content: space-between; position: relative; padding: 1.55rem 1rem 1.5rem 0; gap: 1rem; }
.intro-copy { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: .7rem; color: #536653; font-size: .75rem; line-height: 1.4; font-weight: 750; letter-spacing: .16em; }
.eyebrow .rule { width: 1.65rem; height: 2px; background: #b6663b; }
.slash { color: #a3a995; font-weight: 450; }
h1 { display: flex; align-items: baseline; gap: .85rem; margin: .27rem 0 .36rem; font: 650 clamp(2rem, 3.5vw, 3rem)/1.3 "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif; letter-spacing: -.055em; }
.method-num { font: italic 500 1.56em/1 var(--serif); letter-spacing: -.085em; padding-right: .06em; }
.method-facts { margin: .58rem 0 0; display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .9rem; font-weight: 500; }
.method-facts > span { color: #a6aa9e; font-size: .75em; }
.dripper { width: clamp(9rem, 16vw, 12.8rem); height: auto; display: block; margin-right: .4rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); grid-template-areas: "timer recipe" "timer schedule"; gap: 1rem 1.4rem; align-items: stretch; }
.paper { background: var(--surface); border: 1px solid var(--line); border-radius: .85rem; min-width: 0; }
.recipe { grid-area: recipe; }
.recipe summary, .schedule h2 { display: flex; align-items: center; gap: .55rem; margin: 0; }
.recipe summary { padding: 1rem 1.35rem .95rem; }
.section-title, .note-title { display: inline-flex; align-items: center; gap: .57rem; font-weight: 700; }
.section-title { font-size: 1.1rem; letter-spacing: .015em; }
.sliders { background-image: url("./assets/sliders.png"); }
.timeline { background-image: url("./assets/timeline.png"); }
.book { background-image: url("./assets/book.png"); }
.droplet { background-image: url("./assets/drop.png"); }
.settings-summary { margin-left: auto; font-size: .875rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.recipe[open] .settings-summary { visibility: hidden; }
.chevron { width: .58rem; height: .58rem; border-bottom: 1.5px solid #667566; border-right: 1.5px solid #667566; transform: translateY(-2px) rotate(45deg); margin-inline: .4rem .12rem; flex: none; }
details[open] > summary .chevron { transform: translateY(2px) rotate(225deg); }
.recipe-body { padding: 0 1.35rem 1rem; }
.option-group { display: grid; grid-template-columns: minmax(7rem, .88fr) minmax(0, 1.55fr); align-items: center; margin: 0; padding: 0; border: 0; min-width: 0; }
.option-group + .option-group { margin-top: .42rem; }
.option-group legend { display: contents; font-size: .9rem; font-weight: 600; }
.segmented { display: grid; gap: 2px; padding: 3px; background: #ebece3; border-radius: .53rem; }
.dose-options { grid-template-columns: repeat(3, 1fr); }
.ratio-options { grid-template-columns: repeat(2, 1fr); }
.segmented label { cursor: pointer; position: relative; display: grid; min-height: 2.27rem; }
.segmented label > span {
  display: flex; gap: .19em; align-items: baseline; justify-content: center; align-content: center; flex-wrap: wrap;
  border-radius: .36rem; font-size: 1rem; font-weight: 650; line-height: 1.05; font-variant-numeric: tabular-nums;
}
.segmented small { font-size: .78em; font-weight: 500; }
.segmented input:checked + span { background: var(--forest); color: #fffdf1; }
fieldset:disabled .segmented label { cursor: default; }
.water-total { display: flex; align-items: center; justify-content: space-between; padding-top: .7rem; margin-top: .75rem; border-top: 1px dashed #c9cdbf; }
.water-total > span { display: flex; align-items: center; gap: .45rem; font-size: .875rem; font-weight: 650; }
.water-total .glyph { width: 1.12rem; height: 1.12rem; }
.water-total strong { font-size: 1.5rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.water-total small { font-size: .86rem; font-weight: 500; }
.recipe-lock { margin: .65rem 0 0; font-size: .82rem; line-height: 1.5; color: var(--muted); }
.timer-card {
  grid-area: timer; min-width: 0; display: flex; flex-direction: column; position: relative; isolation: isolate;
  padding: 1.45rem 1.65rem 1.6rem; border-radius: 1rem;
  color: #f7f4e6; background: radial-gradient(ellipse at 50% 34%, #254d40, #173c32 70%);
  box-shadow: inset 0 0 0 1px #183b30;
}
.timer-card::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: url("./assets/grain.png") repeat; opacity: .6; pointer-events: none; }
.timer-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.status { display: flex; align-items: center; gap: .48rem; color: #e2ead8; font-size: .84rem; letter-spacing: .045em; font-weight: 650; }
.status-light { width: .48rem; height: .48rem; background: #b4c69d; border-radius: 50%; box-shadow: 0 0 0 3px #b4c69d17; }
[data-state="running"] .status-light, [data-cue="true"] .status-light { background: var(--apricot); box-shadow: 0 0 0 3px #ffb47d24; }
[data-state="paused"] .status-light { background: #bbbdad; }
.pour-index { font: 600 .76rem/1.2 var(--sans); letter-spacing: .13em; color: #b7c7b5; }
.pour-index b { color: #faf5e4; font-weight: 650; }
.fraction { margin: 0 .38rem; color: #95a891; }
.instrument { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: .25rem 0 1.05rem; min-height: 15.9rem; }
.dial { position: relative; width: min(100%, 19.8rem); aspect-ratio: 300 / 224; flex: none; }
.dial canvas { display: block; width: 100%; height: 100%; }
.dial-center { position: absolute; top: 32%; left: 10%; right: 10%; text-align: center; display: flex; flex-direction: column; align-items: center; }
.clock-label { color: #d2dfce; font-size: .82rem; letter-spacing: .12em; font-weight: 550; }
#clock { display: block; color: #fff7e6; font: 400 clamp(4.4rem, 6.5vw, 6.1rem)/1.06 var(--serif); letter-spacing: -.065em; font-variant-numeric: lining-nums tabular-nums; padding-right: .06em; }
.dial-caption { margin-top: .17rem; color: #bbcbb8; font-size: .83rem; line-height: 1.25; font-variant-numeric: tabular-nums; letter-spacing: .045em; }
[data-cue="true"] #clock, [data-cue="true"] .clock-label { color: #ffc69a; }
.next-cue { color: #f2e5c9; margin: .26rem 0 0; line-height: 1.5; font-size: .92rem; font-weight: 550; font-variant-numeric: tabular-nums; text-align: center; }
.targets { display: grid; grid-template-columns: 1fr 1fr; padding: .8rem .3rem; border-top: 1px solid #9fb3a14d; border-bottom: 1px solid #9fb3a14d; }
.targets > div { display: flex; flex-direction: column; gap: .12rem; align-items: center; }
.targets > div + div { border-left: 1px solid #9fb3a14d; }
.target-label { font-size: .84rem; line-height: 1.4; color: #c1d0bd; font-weight: 550; }
.target-value { line-height: 1.05; color: #fff5e2; }
.target-value strong { font: 500 2.25rem/1.08 var(--serif); letter-spacing: -.035em; font-variant-numeric: lining-nums tabular-nums; }
.target-value > span { font-size: 1rem; }
.timer-actions { display: flex; align-items: stretch; gap: .6rem; margin-top: 1.05rem; }
.primary, .reset { min-height: 3.15rem; display: inline-flex; justify-content: center; align-items: center; border-radius: .57rem; }
.primary { flex: 1; gap: .64rem; border: 1px solid #ffc292; background: var(--apricot); color: #293a2f; font-size: 1rem; font-weight: 750; letter-spacing: .035em; }
.primary:active, .reset:active { transform: translateY(1px); }
.primary:focus-visible, .reset:focus-visible { outline-color: #ffd0a8; }
.action-icon { width: 0; height: 0; border-block: .37rem solid transparent; border-left: .6rem solid currentColor; }
[data-state="running"] .action-icon { width: .62rem; height: .79rem; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.reset { border: 1px solid #91a68f; width: 3.2rem; flex: none; background: transparent; }
.reset-glyph { background-image: url("./assets/reset.png"); }
.schedule { grid-area: schedule; padding: 1.05rem 1.35rem .75rem; }
.schedule h2 { margin-bottom: .72rem; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; font-variant-numeric: lining-nums tabular-nums; }
th, td { padding: 0 .35rem; line-height: 1.15; }
thead { text-align: right; font-size: .79rem; color: var(--muted); }
thead th { font-weight: 550; padding-bottom: .45rem; border-bottom: 1px solid var(--line); }
th:first-child { width: 2.75rem; text-align: left; padding-left: .2rem; }
th:nth-child(2), td:nth-child(2) { text-align: left; }
tbody td, tfoot td { height: 1.98rem; text-align: right; }
tbody td:nth-child(2), tfoot td:nth-child(2) { font-weight: 620; }
tbody td:last-child { font-weight: 680; }
tbody td:not(:nth-child(2)), tfoot td:last-child { white-space: nowrap; }
td small { font-size: .82em; font-weight: 450; }
tbody th { position: relative; }
.step-no { display: inline-grid; place-items: center; width: 1.47rem; height: 1.18rem; border-radius: .26rem; background: #eef0e7; color: #566455; font-size: .75rem; font-weight: 700; letter-spacing: .035em; }
tr[data-current="true"] .step-no { background: #f8ceac; color: #55381c; }
tr[data-current="true"] { background: #f6f2e7; }
tr[data-past="true"] .step-no { background: #dce7d8; }
tfoot td, tfoot th { border-top: 1px solid var(--line); color: #506452; padding-top: .28rem; height: 2.12rem; }
tfoot td:last-child { font-size: .82rem; font-weight: 600; }
.end-mark { display: block; width: 1.47rem; height: 1.12rem; background: url("./assets/finish.png") center / contain no-repeat; }
.brew-note { margin: 1.15rem 0 1.7rem; color: var(--muted); }
.brew-note summary { min-height: 44px; width: max-content; max-width: 100%; display: flex; align-items: center; gap: .55rem; font-size: .88rem; }
.note-title { font-weight: 550; gap: .45rem; }
.note-title .glyph { width: 1rem; height: 1rem; }
.brew-note .chevron { width: .44rem; height: .44rem; margin-left: .15rem; }
.brew-note dl { margin: .2rem 0 .7rem; padding-left: 1.43rem; }
.brew-note dl div { display: flex; gap: .65rem; margin: .32rem 0; flex-wrap: wrap; font-size: .9rem; }
.brew-note dt { font-weight: 650; }
.brew-note dd { margin: 0; }
@media (hover: hover) {
  .primary:hover { background: #ffc18e; }
  .sound-control:hover, summary:hover .section-title, .brew-note summary:hover { color: #97512b; }
  .segmented input:not(:checked):not(:disabled) + span:hover { background: #dce1d3; }
}
@media (max-width: 56rem) and (min-width: 45.01rem) {
  .page-width { width: calc(100% - 2.5rem); }
  .workspace { gap: .8rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .option-group { grid-template-columns: minmax(6.5rem, .8fr) minmax(0, 1.4fr); }
  .timer-card { padding-inline: 1.2rem; }
  .recipe summary, .recipe-body, .schedule { padding-inline: 1rem; }
}
@media (max-width: 45rem) {
  .header-actions { gap: .35rem; }
  .install-control { font-size: .77rem; padding-inline: .4rem; gap: .12rem; }
  .page-width { width: min(calc(100% - 2rem), 32rem); }
  .masthead-inner { min-height: 3.35rem; }
  .brand img { width: 1.9rem; height: 1.9rem; }
  .brand > span { font-size: 1.55rem; }
  .sound-control { font-size: .82rem; }
  .intro { padding: 1.03rem 0 1rem; gap: .45rem; }
  .eyebrow { gap: .4rem; font-size: .75rem; letter-spacing: .10em; }
  .eyebrow .rule { width: 1.1rem; }
  h1 { gap: .46rem; font-size: clamp(1.45rem, 6vw, 2rem); margin: .25rem 0; }
  .method-num { font-size: 1.52em; }
  .method-facts { gap: .39rem; margin: .35rem 0 0; font-size: .81rem; }
  .dripper { width: clamp(4.5rem, 19.5vw, 7.4rem); margin: 0; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "recipe" "timer" "schedule"; gap: .68rem; }
  .recipe summary { padding: .79rem 1rem; min-height: 3rem; }
  .recipe-body { padding: .1rem 1rem .8rem; }
  .section-title { font-size: 1rem; }
  .option-group { grid-template-columns: minmax(7rem, .8fr) minmax(0, 1.3fr); }
  .segmented label { min-height: 2.75rem; }
  .timer-card { padding: 1.04rem 1.1rem 1.05rem; }
  .instrument { padding: .27rem 0 .75rem; min-height: 0; }
  .dial { width: min(100%, 15.5rem); }
  #clock { font-size: 4.52rem; }
  .dial-center { top: 27.5%; }
  .clock-label, .dial-caption { font-size: .78rem; }
  .next-cue { margin-top: .22rem; font-size: .88rem; }
  .targets { padding: .55rem 0; }
  .target-label { font-size: .79rem; }
  .target-value strong { font-size: 1.85rem; }
  .timer-actions { margin-top: .8rem; }
  .schedule { padding: 1.02rem 1.05rem .75rem; }
  tbody td { height: 2.08rem; }
  .brew-note { margin: .6rem 0 max(1.2rem, env(safe-area-inset-bottom)); }
}
@media (max-width: 23rem) {
  .install-prefix { display: none; }
  .page-width { width: calc(100% - 1.45rem); }
  .intro { gap: .2rem; }
  .dripper { width: 3.9rem; }
  .option-group { grid-template-columns: minmax(6.4rem, .8fr) minmax(0, 1.2fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
