:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  color: #203d37;
  background: #e7ede7;
  --paper: #f8f9f4;
  --ink: #203d37;
  --muted: #536a61;
  --green: #165d4d;
  --line: #d6dfd6;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; line-height: 1.55; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; min-height: 44px; touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 3px solid #287c96; outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { list-style: none; padding: 0; }
[hidden] { display: none !important; }
svg { display: block; }
.symbols { position: absolute; width: 0; height: 0; }
.icon { flex: none; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app {
  display: flex; flex-direction: column; width: 100%; max-width: 430px;
  height: 100vh; height: 100dvh; margin: auto;
  background: var(--paper);
}
.mast, main, .dock {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.mast {
  display: flex; flex: none; align-items: center; gap: 11px;
  padding-top: calc(13px + env(safe-area-inset-top)); padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.brand { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: #dcead9; color: var(--green); }
.brand svg { width: 32px; height: 32px; }
.brand-copy { flex: 1; min-width: 0; }
.brand-name { font-size: 1.16rem; font-weight: 800; letter-spacing: .045em; line-height: 1.4; }
.sub { color: var(--muted); font-size: .9375rem; }
.icon-button {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; color: #3c594f;
}
button:active { filter: brightness(.96); }
main { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; overscroll-behavior-y: contain; padding-top: 16px; padding-bottom: 24px; }
.search-panel {
  position: relative; isolation: isolate; overflow: hidden; padding: 20px 17px 17px;
  border-radius: 22px; background: linear-gradient(110deg, #114e42, #236652); color: white;
}
.search-panel h1 { position: relative; font-size: 1.8rem; letter-spacing: .05em; }
.search-panel p { position: relative; color: #e3f2df; font-size: .9375rem; margin: 3px 0 16px; }
.hero-art { position: absolute; right: -8px; top: -7px; width: 39%; height: 117px; z-index: -1; }
.searching .search-panel > :not(.search-box) { display: none; }
.search-box {
  display: flex; align-items: center; gap: 10px; padding: 0 6px 0 14px; position: relative;
  min-height: 52px; border-radius: 13px; background: #fff; color: var(--green); box-shadow: 0 2px 5px #07291b19;
}
.search-box:focus-within { outline: 3px solid #b6daba; outline-offset: 2px; }
#query { min-width: 0; flex: 1; height: 52px; background: transparent; border: 0; padding: 0; outline: 0; color: var(--ink); }
#query::placeholder { color: #61756c; opacity: 1; }
#clear { display: grid; place-items: center; flex: none; width: 44px; }
.section-title { display: flex; align-items: center; gap: 9px; font-size: 1.08rem; letter-spacing: .025em; }
.section-title .icon { width: 18px; height: 18px; color: var(--green); }
#favorites { margin: 22px 0 20px; }
.pin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.pin-card {
  display: flex; flex-direction: column; align-items: stretch; justify-content: space-between;
  width: 100%; min-height: 92px; height: 100%; padding: 12px 13px; text-align: left;
  border: 1px solid #cadaca; border-radius: 15px; background: linear-gradient(120deg, #f1f6ea, #e8f1e6);
}
.pin-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: #42634e; }
.pin-top .icon { width: 16px; height: 16px; fill: #c7d9bf; }
.pin-card strong { font-size: 1rem; overflow-wrap: anywhere; margin-top: 9px; }
.pin-meta { font-size: .9375rem; font-weight: 600; }
.empty { padding: 18px 14px; font-size: .9375rem; color: var(--muted); }
#recent-title { margin-bottom: 10px; }
.count { font-size: .9375rem; background: #e1ecdf; color: #355b48; padding: 0 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
#matches { margin: 18px 0 10px; }
.drug-list { border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.drug-list li + li { border-top: 1px solid #e6ebe4; }
.drug-row {
  display: flex; gap: 11px; align-items: center; width: 100%;
  padding: 12px; min-height: 65px; text-align: left; border-radius: 14px;
}
.row-copy { display: grid; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-copy strong { font-size: 1rem; font-weight: 690; }
.strength { white-space: nowrap; }
.arrow { width: 16px; height: 16px; color: #75897b; }
.dock {
  flex: none; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: #f6f8f2;
}
.disclosure { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 8px; font-size: .9375rem; color: #516559; text-align: center; }
.disclosure .icon { height: 16px; width: 16px; }
.disclosure span:last-child { display: inline-flex; align-items: center; gap: 5px; }
#next {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 6px; min-height: 46px; border-radius: 13px; background: var(--green); color: #fff; font-weight: 700;
}
.drug-head { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; }
.drug-head > div { flex: 1; min-width: 0; }
#drug-name { font-weight: 750; font-size: 1.12rem; overflow-wrap: anywhere; }
#split { display: flex; align-items: center; gap: 6px; font-size: .9375rem; color: var(--muted); }
#pin[aria-pressed="true"] { color: var(--green); background: #e7efdf; border-color: #c0d4bd; }
#pin[aria-pressed="true"] .icon { fill: #c2d9b9; }
.verdict {
  --tint: #eaf1f0; --accent: #365f67; --edge: #c6d9d7;
  color: var(--accent); border: 1px solid var(--edge); background: var(--tint);
  border-radius: 19px; padding: 15px 14px 13px;
}
.verdict[data-kind="yes"] { --tint: #e2f2e5; --accent: #185b3c; --edge: #bad7bd; }
.verdict[data-kind="no"] { --tint: #fcebe6; --accent: #913c32; --edge: #efc6be; }
.verdict[data-kind="refer"] { --tint: #fff1c9; --accent: #754d0c; --edge: #e7cf89; }
.verdict-title { display: flex; align-items: center; gap: 9px; }
.verdict-title > .icon { width: 33px; height: 33px; stroke-width: 2; }
#verdict-title { font-size: clamp(1.56rem, 7vw, 1.78rem); line-height: 1.35; font-weight: 800; letter-spacing: -.035em; }
#verdict-title small { font-size: .69em; white-space: nowrap; }
#reason { margin-top: 8px; font-size: .98rem; }
#praise { display: flex; align-items: center; gap: 7px; border-top: 1px solid var(--edge); margin-top: 10px; padding-top: 8px; font-size: .9375rem; font-weight: 650; }
#praise .icon { width: 18px; height: 18px; }
[data-effects="off"] #praise, [data-effects="quiet"] #praise .icon { display: none; }
@keyframes nod { 50% { transform: scale(1.15) rotate(-8deg); } }
@media (prefers-reduced-motion: no-preference) {
  [data-effects="normal"] #praise.flash .icon { animation: nod .28s ease-out; }
}
.prescription { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.switch { display: flex; flex-wrap: wrap; gap: 4px; }
.switch .choice { min-width: 44px; min-height: 44px; padding: 5px 8px; white-space: nowrap; }
.switch .choice[aria-pressed="true"] { padding: 4px 7px; }
.question, .result-card { margin-top: 16px; }
.question h3, .result-card h3 { font-size: 1rem; }
/* 答えのボタンは横に並べたままにする。縦に並べると、2度押しの2回目が別の答えに当たる（第1段階 review-2 の R2-01）。 */
.choices { display: grid; grid-template-columns: 1fr 1.7fr 1fr; gap: 5px; margin-top: 8px; }
.choices .choice { white-space: pre-line; line-height: 1.3; }
/* 一包化の答えは短い 3 つなので、幅をほぼそろえる。「入っていない」を語の途中で折り返さない（第2段階 決定反映 review-1 の D1-03）。 */
#bundle-answers { grid-template-columns: 1.2fr 1fr 1fr; }
.choice, .day-button {
  border: 1px solid #c5d2c8; border-radius: 10px; background: #fff; padding: 5px 3px;
  font-size: .9375rem; font-weight: 650; min-height: 46px;
}
.choice[aria-pressed="true"], .day-button[aria-pressed="true"] {
  background: #e4efdf; color: #1e513a; border: 2px solid #437458; padding: 4px 2px;
}
.result-card { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.days-head, .memo-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.day-input { display: flex; gap: 6px; align-items: center; }
.day-input input { width: 5em; min-height: 44px; text-align: center; background: var(--paper); border: 1px solid #c9d5cb; border-radius: 9px; }
.day-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 9px 0; }
.formula { color: var(--muted); font-size: .9375rem; }
#score { display: block; color: var(--green); font-weight: normal; font-size: .9375rem; }
#days-error { color: #893c32; font-size: .9375rem; }
#notices { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); font-size: .9375rem; color: var(--muted); }
#points[hidden] + #notices { margin-top: 0; padding-top: 0; border-top: 0; }
.memo-head h3 { display: flex; align-items: center; gap: 6px; }
.copy { display: flex; gap: 5px; align-items: center; justify-content: center; padding: 6px 10px; min-width: 44px; border: 1px solid #c3d4c4; border-radius: 10px; background: #f0f5ec; color: var(--green); font-size: .9375rem; font-weight: 650; }
.copy .icon { width: 16px; height: 16px; }
#memo-text { margin-top: 8px; font-size: .9375rem; white-space: pre-line; user-select: text; }
#copy-feedback { color: var(--green); font-size: .9375rem; }
#facts h3 { margin-bottom: 4px; }
.fact { padding: 9px 0; }
.fact + .fact { border-top: 1px solid #e4eae2; }
.fact:last-child { padding-bottom: 0; }
.fact dt { font-size: .9375rem; color: var(--muted); }
.fact dd { font-weight: 650; font-size: 1rem; }
.verified { display: flex; align-items: baseline; }
.fact .note { font-weight: 400; font-size: .9375rem; color: var(--muted); }
dialog { width: min(calc(100% - 32px), 390px); border: 1px solid var(--line); border-radius: 22px; padding: 20px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #19392f68; }
.settings-head { display: flex; justify-content: space-between; align-items: center; }
.settings-head h2 { font-size: 1.2rem; }
#settings p { margin: 8px 0; }
.effect-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 540px) {
  body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(#bccabe 1px, transparent 1px) 0 0 / 19px 19px, #e7ede7; }
  .app { height: min(910px, calc(100dvh - 36px)); border-radius: 24px; overflow: hidden; border: 1px solid #bbcbbf; box-shadow: 0 12px 48px #204c3324; }
}

.pin-meta, #maker, #source { overflow-wrap: anywhere; }
#report { margin-top: 8px; }
#report-link, #about { display: inline-flex; align-items: center; min-height: 44px; font-size: .9375rem; color: var(--green); }
#report-link.prominent { padding: 8px 12px; border-radius: 10px; font-weight: 650; background: var(--green); color: #fff; }
#report-note { margin-top: 4px; }
#about { display: flex; margin: auto; text-decoration: underline; }
.dock.stale { background: #fff1c9; }
#date-warning { color: #754d0c; text-align: center; font-size: .9375rem; }
#intro p, #intro dt { margin-top: 8px; }
#intro dt { font-weight: 650; }
