/* IPPAI — 見た目
 * 紙色の地、深煎りの黒、青は「押せるもの」と「いまの答え」だけ。赤は「推測」の印だけ。
 * 数字は等幅の太字、見出しは Dela Gothic One。
 */
:root {
  --bg: #F6ECDC;
  --bg-2: #EEE1CB;
  --card: #FFFBF3;
  --ink: #1A0F09;
  --mute: #75604F;
  --line: #E0CFB6;
  --line-2: #CDB797;
  --blue: #2433FF;
  --blue-ink: #2433FF;
  --blue-soft: #E3E5FF;
  --on-blue: #FFFFFF;
  --red: #D8361C;
  --on-red: #FFFFFF;
  --sour: #E9DCA4;
  --bitter: #D9BFA3;
  --esp: #1A0F09;
  --crema: #F3DEB8;
  --roast-1: #C9A57F;
  --roast-2: #94653F;
  --roast-3: #4F3020;
  --bean: #9DB08A;
  --ok: #2E7D4F;
  --shadow: rgba(26, 15, 9, .18);
  --disp: "Dela Gothic One", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --hand: "Yusei Magic", "Hiragino Maru Gothic ProN", sans-serif;
  --tabs-h: 74px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #140C07;
    --bg-2: #22160E;
    --card: #1F150F;
    --ink: #F3DEB8;
    --mute: #B3A08C;
    --line: #3A2B20;
    --line-2: #5A4433;
    --blue: #3341FF;
    --blue-ink: #A6ADFF;
    --blue-soft: #1E2150;
    --sour: #4A4024;
    --bitter: #4A3424;
    --shadow: rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- レイアウト ---- */
.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) max(18px, env(safe-area-inset-right, 0px)) calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 28px) max(18px, env(safe-area-inset-left, 0px));
}
.app.full { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 28px); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt0 { margin-top: 0 !important; }
.view { animation: viewIn .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes viewIn { from { transform: translateY(10px); } to { transform: none; } }

/* ---- 見出し ---- */
.k { margin: 0; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.h1 { margin: 0; font-family: var(--disp); font-weight: 400; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; }
.h2 { margin: 0; font-family: var(--disp); font-weight: 400; font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }
.h3 { margin: 0; font-size: 15px; font-weight: 900; }
.mute { color: var(--mute); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.hand { font-family: var(--hand); color: var(--blue-ink); }
.num { font-family: var(--mono); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.bar { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: -4px 0 8px; }
.bar .title { flex: 1; font-weight: 900; font-size: 16px; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: -10px; border: 0; background: none; color: var(--blue-ink); border-radius: 0; }
.iconbtn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero { padding: 6px 0 4px; }
.hero .h1 { font-size: 34px; }

/* ---- ボタン ---- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 12px 16px;
  border: 0; border-radius: 4px;
  background: var(--blue); color: var(--on-blue);
  font-weight: 900; font-size: 16px; letter-spacing: .04em; text-decoration: none;
  transition: transform .12s, filter .12s;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.sm { min-height: 40px; padding: 8px 12px; font-size: 14px; width: auto; }
.btn.red { background: var(--red); color: var(--on-red); }
.linkbtn { display: inline-block; padding: 10px 4px; border: 0; background: none; color: var(--mute); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.btns { display: flex; flex-direction: column; gap: 8px; }
.btns.two { flex-direction: row; }
.btns.two .btn { flex: 1; }

/* ---- チップ・切り替え ---- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.scrollrow { display: flex; gap: 6px; overflow-x: auto; margin: 0 calc(-1 * max(18px, env(safe-area-inset-right, 0px))) 0 calc(-1 * max(18px, env(safe-area-inset-left, 0px))); padding: 2px max(18px, env(safe-area-inset-right, 0px)) 4px max(18px, env(safe-area-inset-left, 0px)); scrollbar-width: none; }
.scrollrow::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 6px 12px;
  border: 2px solid var(--ink); border-radius: 0; background: transparent;
  font-size: 14px; font-weight: 700; line-height: 1.2; white-space: nowrap;
}
.chip.on { background: var(--ink); color: var(--bg); }
.chip.sm { min-height: 32px; padding: 4px 9px; font-size: 13px; border-width: 1.5px; }
.chip.add { border-style: dashed; color: var(--mute); }
.chip.blue.on { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.seg { display: flex; border: 2px solid var(--ink); }
.seg button { flex: 1; min-height: 40px; border: 0; background: transparent; font-weight: 700; font-size: 14px; }
.seg button + button { box-shadow: inset 2px 0 0 var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.toggle .t { font-weight: 700; }
.switch { position: relative; width: 52px; height: 30px; flex: none; border: 2px solid var(--ink); background: transparent; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; background: var(--ink); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--blue); border-color: var(--blue); }
.switch[aria-checked="true"]::after { transform: translateX(22px); background: var(--on-blue); }

/* ---- カード ---- */
.card { background: var(--card); border: 2px solid var(--ink); padding: 14px; }
.card.soft { border: 1px solid var(--line); }
.card.blue { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.card.dark { background: var(--esp); border-color: var(--esp); color: var(--crema); }
.card .k { margin-bottom: 4px; }
.card.blue .k, .card.dark .k { color: inherit; opacity: .78; }
.section { margin-top: 26px; }
.section > .k { margin-bottom: 8px; }
.divider { height: 0; border-top: 2px solid var(--ink); margin: 6px 0; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.li:first-child { border-top: 2px solid var(--ink); }
.li .main { flex: 1; min-width: 0; }
.li .t { font-weight: 900; line-height: 1.35; }
.li .s { font-size: 12.5px; color: var(--mute); line-height: 1.45; }
.li .go { color: var(--blue-ink); font-weight: 900; }

/* ---- 豆の印 ---- */
.dot {
  flex: none; position: relative; width: 18px; height: 24px; border-radius: 50%;
  background: var(--roast-2); transform: rotate(-20deg);
}
.dot::after { content: ""; position: absolute; left: 44%; top: 14%; bottom: 14%; border-left: 1.6px solid rgba(255, 248, 236, .7); border-radius: 50%; }
.dot.light { background: var(--roast-1); }
.dot.medium_light { background: #B0855A; }
.dot.medium { background: var(--roast-2); }
.dot.medium_dark { background: #6E4528; }
.dot.dark { background: var(--roast-3); }
.dot.unknown { background: var(--line-2); }
.dot.big { width: 26px; height: 34px; }
.badge { display: inline-block; padding: 1px 6px; font-family: var(--mono); font-size: 10px; font-weight: 800; letter-spacing: .06em; border: 1.5px solid currentColor; vertical-align: 1px; }
.badge.decaf { color: var(--blue-ink); }
.badge.fresh-peak { color: var(--ok); }
.badge.fresh-rest { color: var(--mute); }
.badge.fresh-old { color: var(--red); }

/* ---- 写真 ---- */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 78px; height: 96px; background: var(--bg-2) center/cover no-repeat; border: 2px solid var(--ink); }
.thumb button { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: var(--bg); }
.thumb button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.pick { position: relative; overflow: hidden; }
.pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.scanbox { position: relative; display: grid; place-items: center; gap: 6px; min-height: 180px; padding: 20px; background: var(--bg-2); border: 2px dashed var(--line-2); text-align: center; overflow: hidden; }
.scanbox .h2 { font-size: 19px; }
.scanline { position: absolute; left: 0; right: 0; top: 10%; height: 2px; background: var(--blue); box-shadow: 0 0 12px 3px rgba(36, 51, 255, .45); animation: scan 2.4s ease-in-out infinite; }
@keyframes scan { 0%, 100% { top: 8%; } 50% { top: 90%; } }

/* ---- フォーム ---- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > .lbl { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 900; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 2px solid var(--ink); border-radius: 0; background: var(--card);
  font-size: 16px;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.textarea.memo { font-family: var(--hand); font-size: 17px; color: var(--blue-ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.src { font-family: var(--mono); font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 1px 6px; border: 1.5px solid var(--ink); white-space: nowrap; }
.src.inferred { background: var(--red); border-color: var(--red); color: var(--on-red); transform: rotate(-4deg); }
.src.missing { color: var(--mute); border-color: var(--line-2); }
.src.user { background: var(--ink); color: var(--bg); }
.note { padding: 10px 12px; border-left: 4px solid var(--blue); background: var(--blue-soft); font-size: 13.5px; line-height: 1.6; }

/* ---- ホーム ---- */
.nudge { background: var(--esp); color: var(--crema); padding: 14px; }
@media (prefers-color-scheme: dark) {
  .nudge { background: var(--crema); color: var(--esp); }
  .nudge .opts button { border-color: rgba(26, 15, 9, .35); color: var(--esp); }
  .card.dark { background: var(--crema); border-color: var(--crema); color: var(--esp); }
}
.nudge .t { font-weight: 900; font-size: 16px; }
.nudge .s { font-size: 13px; opacity: .85; margin: 2px 0 10px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.opts button { min-height: 42px; border: 1.5px solid rgba(243, 222, 184, .45); background: transparent; color: var(--crema); font-weight: 700; font-size: 14px; }
.opts button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.pending { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid var(--blue); background: var(--blue-soft); text-decoration: none; }
.pending .t { flex: 1; font-weight: 700; font-size: 14px; line-height: 1.45; }
.pending .go { font-weight: 900; color: var(--blue-ink); white-space: nowrap; }
.beanpick { flex: none; width: 200px; display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 2px solid var(--line-2); background: var(--card); text-align: left; }
.beanpick[aria-pressed="true"] { border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.beanpick .t { font-weight: 900; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.beanpick .s { font-size: 11.5px; color: var(--mute); }
.empty { display: flex; flex-direction: column; gap: 12px; padding: 22px 18px; border: 2px dashed var(--line-2); text-align: center; }
.empty .h2 { font-size: 22px; }

/* ---- レシピ ---- */
.ctx { display: inline-flex; align-self: flex-start; padding: 2px 10px; border: 1.5px solid var(--ink); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.temp { display: flex; align-items: flex-start; gap: 4px; line-height: .8; margin: 4px 0 0; }
.temp b { font-family: var(--mono); font-weight: 800; font-size: 112px; letter-spacing: -.07em; line-height: .8; }
.temp span { font-family: var(--mono); font-weight: 800; font-size: 26px; margin-top: 4px; }
.temp em { margin-left: auto; align-self: flex-end; font-style: normal; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--mute); }
.temp.text b { font-family: var(--disp); font-weight: 400; font-size: 30px; letter-spacing: -.02em; line-height: 1.2; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.trio > div { padding: 10px 4px 8px; text-align: center; border-right: 1px solid var(--line-2); }
.trio > div:last-child { border-right: 0; }
.trio b { display: block; font-family: var(--mono); font-weight: 800; font-size: 32px; line-height: 1.05; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.trio span { font-size: 11.5px; color: var(--mute); font-weight: 700; }
.grindcard .t { font-size: 18px; font-weight: 900; }
.grindcard .set { font-family: var(--mono); font-weight: 800; font-size: 15px; color: var(--blue-ink); }
.reasons { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.reasons li { position: relative; padding-left: 18px; font-size: 14.5px; line-height: 1.55; }
.reasons li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; background: var(--blue); }
.trail { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.trail li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: baseline; }
.trail b { display: grid; place-items: center; width: 22px; height: 22px; font-family: var(--mono); font-size: 11px; background: var(--ink); color: var(--bg); }
.steps { margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.steps li:first-child { border-top: 2px solid var(--ink); }
.steps .at { font-family: var(--mono); font-weight: 800; font-size: 14px; }
.steps .lb { font-weight: 900; font-size: 15px; }
.steps .dt { display: block; font-weight: 400; font-size: 12.5px; color: var(--mute); }
.steps .to { font-family: var(--mono); font-weight: 800; font-size: 16px; }
.adjust { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper { display: flex; align-items: stretch; border: 2px solid var(--ink); }
.stepper button { width: 44px; border: 0; background: var(--bg-2); font-size: 20px; font-weight: 900; }
.stepper .v { flex: 1; display: grid; place-items: center; font-family: var(--mono); font-weight: 800; font-size: 18px; padding: 6px 0; }
.stepper .v small { display: block; font-family: var(--body); font-size: 10.5px; font-weight: 700; color: var(--mute); }
details.more { border-top: 2px solid var(--ink); padding-top: 4px; }
details.more summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-weight: 900; font-size: 14px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; font-family: var(--mono); font-size: 20px; }
details.more[open] summary::after { content: "−"; }

/* ---- 抽出中 ---- */
.brew-screen { position: fixed; inset: 0; z-index: 40; background: var(--esp); color: var(--crema); display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 12px) max(20px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 18px) max(20px, env(safe-area-inset-left, 0px)); }
.brew-screen .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brew-screen .k { color: rgba(243, 222, 184, .65); }
.brew-screen .iconbtn { color: var(--crema); margin: 0 -10px 0 0; }
.brew-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 520px; width: 100%; margin: 0 auto; }
.timer { margin: 0; text-align: center; font-family: var(--mono); font-weight: 800; font-size: min(26vw, 140px); line-height: .9; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.timer small { display: block; margin-top: 10px; font-size: 15px; letter-spacing: 0; opacity: .6; font-weight: 700; }
.prog { position: relative; height: 8px; background: rgba(243, 222, 184, .18); }
.prog i { position: absolute; left: 0; top: 0; bottom: 0; background: #A6ADFF; transition: width .25s linear; }
.prog u { position: absolute; top: -5px; width: 2px; height: 18px; background: rgba(243, 222, 184, .5); }
.target { text-align: center; padding: 16px 12px; border: 2px solid rgba(243, 222, 184, .3); }
.target b { display: block; font-family: var(--mono); font-weight: 800; font-size: min(22vw, 104px); line-height: 1; letter-spacing: -.05em; color: #A6ADFF; font-variant-numeric: tabular-nums; }
.target b small { font-size: .32em; margin-left: 4px; }
.target .lb { font-size: 20px; font-weight: 900; margin-top: 8px; }
.target .dt { font-size: 14px; opacity: .8; }
.target.nogram b { font-family: var(--disp); font-weight: 400; font-size: 40px; color: var(--crema); letter-spacing: -.02em; }
.nextstep { text-align: center; font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .08em; opacity: .85; }
.brew-screen .btn.ghost { color: var(--crema); box-shadow: inset 0 0 0 2px var(--crema); }
.brew-note { text-align: center; font-size: 12px; opacity: .6; }

/* ---- 味の地図 ---- */
.tmap { position: relative; width: 100%; max-width: 360px; margin: 4px auto 0; padding: 34px; user-select: none; -webkit-user-select: none; }
.tmap .ax { position: absolute; font-family: var(--disp); font-size: 26px; line-height: 1; }
.tmap .ax small { display: block; font-family: var(--body); font-weight: 700; font-size: 10px; text-align: center; color: var(--mute); }
.tmap .ax.t { top: 0; left: 50%; transform: translateX(-50%); text-align: center; }
.tmap .ax.b { bottom: 0; left: 50%; transform: translateX(-50%); text-align: center; }
.tmap .ax.l { left: 0; top: 50%; transform: translateY(-50%); }
.tmap .ax.r { right: 0; top: 50%; transform: translateY(-50%); }
.tmap .sq { position: relative; width: 100%; aspect-ratio: 1 / 1; border: 3px solid var(--ink); background: linear-gradient(90deg, var(--sour), var(--card) 40%, var(--card) 60%, var(--bitter)); touch-action: none; cursor: crosshair; }
.tmap .sq::before, .tmap .sq::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.tmap .sq::before { left: 33.33%; right: 33.33%; border-left: 1.5px dashed var(--line-2); border-right: 1.5px dashed var(--line-2); }
.tmap .sq::after { top: 33.33%; bottom: 33.33%; border-top: 1.5px dashed var(--line-2); border-bottom: 1.5px dashed var(--line-2); }
.tmap .ring { position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1 / 1; transform: translate(-50%, -50%); border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; text-align: center; font-size: 11px; font-weight: 900; line-height: 1.2; pointer-events: none; transition: background .25s; }
.tmap.center .ring { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.tmap .pin { position: absolute; z-index: 2; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--blue); transform: translate(-50%, -50%); pointer-events: none; transition: left .2s, top .2s; }
.tmap .pin::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 2px solid var(--blue); animation: ping 1.6s ease-out infinite; }
@keyframes ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.tmap .hint { position: absolute; left: 0; right: 0; bottom: 8%; text-align: center; pointer-events: none; font-family: var(--hand); font-size: 17px; color: var(--blue-ink); }
.tmap .trailsvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.tmap .trailsvg polyline { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.tmap .tn { position: absolute; z-index: 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; transform: translate(-50%, -50%); background: var(--mute); color: var(--card); font-family: var(--mono); font-size: 11px; font-weight: 800; }
.tmap .tn.last { background: var(--blue); color: var(--on-blue); width: 30px; height: 30px; }
.tmap.small { max-width: 260px; padding: 26px; }
.tmap.small .ax { font-size: 18px; }
.zone { text-align: center; font-weight: 900; font-size: 15px; min-height: 1.6em; }
.rate { display: flex; gap: 6px; }
.rate button { flex: 1; min-height: 46px; border: 2px solid var(--ink); background: transparent; font-family: var(--mono); font-weight: 800; font-size: 15px; }
.rate button.on { background: var(--ink); color: var(--bg); }
.rate-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--mute); margin-top: 4px; }
.flavgroup { margin-top: 8px; }
.flavgroup .k { margin-bottom: 6px; }

/* ---- 次の一杯 ---- */
.change { border: 3px solid var(--blue); padding: 16px; background: var(--card); }
.change .k { color: var(--blue-ink); }
.change .t { font-family: var(--disp); font-weight: 400; font-size: 32px; line-height: 1.15; letter-spacing: -.02em; margin: 6px 0 4px; }
.change .d { font-family: var(--mono); font-weight: 800; font-size: 20px; color: var(--blue-ink); }
.keep { margin: 0; padding: 0; list-style: none; }
.keep li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.keep li b { font-family: var(--mono); }
.altlist { display: flex; flex-direction: column; gap: 6px; }
.altlist button { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 8px 12px; border: 2px solid var(--ink); background: transparent; text-align: left; font-weight: 700; }
.altlist button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.altlist button span { font-family: var(--mono); font-size: 13px; font-weight: 800; }
.bestmark { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--blue); color: var(--on-blue); font-weight: 900; }

/* ---- 豆のページ ---- */
.fresh { display: grid; grid-template-columns: 17fr 50fr 33fr; gap: 3px; position: relative; margin-top: 6px; }
.fresh span { height: 7px; background: var(--line-2); }
.fresh span.ok { background: var(--ink); }
.fresh i { position: absolute; top: -6px; width: 4px; height: 19px; background: var(--blue); transform: translateX(-50%); }
.fresh-l { display: grid; grid-template-columns: 17fr 50fr 33fr; gap: 3px; font-size: 10.5px; color: var(--mute); margin-top: 3px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 2px solid var(--ink); }
.facts > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts > div:nth-child(odd) { padding-right: 10px; }
.facts .k { font-size: 9.5px; }
.facts b { display: block; font-size: 14.5px; line-height: 1.4; }
.best { background: var(--blue); color: var(--on-blue); padding: 12px 14px; }
.best .k { color: inherit; opacity: .8; }
.best b { display: block; font-family: var(--mono); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.cmp { display: grid; gap: 8px; }
.cmp p { margin: 0; display: grid; grid-template-columns: 52px 1fr; gap: 8px; font-size: 14px; line-height: 1.7; }
.cmp p em { font-style: normal; font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--mute); padding-top: 3px; }
.cmp mark { background: var(--blue); color: var(--on-blue); padding: 0 4px; }

/* ---- ノート ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.stats > div { padding: 10px 6px; text-align: center; border-right: 1px solid var(--line-2); }
.stats > div:last-child { border-right: 0; }
.stats b { display: block; font-family: var(--mono); font-weight: 800; font-size: 26px; line-height: 1.1; }
.stats span { font-size: 11px; color: var(--mute); font-weight: 700; }
.day { margin-top: 22px; }
.day > .k { margin-bottom: 6px; }
.entry { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.entry:first-of-type { border-top: 2px solid var(--ink); }
.entry .top { display: flex; align-items: baseline; gap: 8px; }
.entry .tm { font-family: var(--mono); font-weight: 800; font-size: 13px; }
.entry .t { flex: 1; min-width: 0; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .stars { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; }
.entry .s { font-size: 12.5px; color: var(--mute); margin-top: 2px; }
.entry .memo { font-family: var(--hand); color: var(--blue-ink); font-size: 14px; margin-top: 2px; }
.squares { display: inline-flex; gap: 2px; vertical-align: middle; }
.squares i { width: 9px; height: 9px; border: 1.5px solid var(--ink); }
.squares i.on { background: var(--ink); }

/* ---- タブ ---- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  max-width: 560px; margin: 0 auto;
  padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 8px) max(6px, env(safe-area-inset-left, 0px));
  background: var(--card); border-top: 2px solid var(--ink);
}
@media (min-width: 561px) { .tabs { border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); } }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: flex-end; text-decoration: none; font-size: 10.5px; font-weight: 700; color: var(--mute); }
.tabs a svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a.fab i { display: grid; place-items: center; width: 56px; height: 56px; margin-top: -30px; margin-bottom: 2px; background: var(--blue); color: var(--on-blue); box-shadow: 0 6px 16px -6px var(--blue); }
.tabs a.fab svg { width: 26px; height: 26px; }
.tabs a.fab span { color: var(--blue-ink); }
body.notabs .tabs { display: none; }

/* ---- シートとトースト ---- */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 6, 3, .5); }
.sheet .panel { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: var(--bg); padding: 20px max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 20px) max(18px, env(safe-area-inset-left, 0px)); border-top: 3px solid var(--ink); animation: up .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes up { from { transform: translateY(30px); } to { transform: none; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 16px); z-index: 70; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 16px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 700; box-shadow: 0 8px 24px -8px var(--shadow); }

/* ---- はじめて ---- */
.welcome { min-height: calc(100vh - 60px); display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.welcome .big { font-family: var(--disp); font-weight: 400; font-size: clamp(44px, 13vw, 66px); line-height: 1.04; letter-spacing: -.045em; margin: 10px 0 0; }
.welcome .big span { display: block; }
.welcome .big span + span { color: var(--blue-ink); margin-left: .5em; }
.how { margin: 0; padding: 0; list-style: none; border-top: 3px solid var(--ink); }
.how li { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.how b { font-family: var(--mono); font-size: 13px; }
.how strong { display: block; font-family: var(--disp); font-weight: 400; font-size: 22px; line-height: 1.2; }
.how span { font-size: 13.5px; color: var(--mute); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 10px; border: 2px solid var(--ink); background: transparent; text-align: left; font-weight: 700; font-size: 14px; white-space: nowrap; }
.tile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tile[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.progress { display: flex; gap: 4px; }
.progress i { flex: 1; height: 4px; background: var(--line-2); }
.progress i.on { background: var(--blue); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
