:root {
  --bg: #eef5fa;
  --bg2: #dfeef6;
  --card: #ffffff;
  --ink: #0e2330;
  --sub: #5c7688;
  --line: #e0ebf2;
  --line2: #eef4f8;
  --teal: #0fa3bd;
  --teal-d: #0b7f96;
  --navy: #0c3a57;
  --navy-d: #082a41;
  --coral: #ff6f5e;
  --coral-d: #ec5544;
  --ok: #12a06a;
  --warn: #e08a12;
  --ng: #e0483c;
  --best: #08a49a;
  --gold: #ffcf47;
  --shadow: 0 6px 26px rgba(12,58,87,.10);
  --shadow-s: 0 2px 10px rgba(12,58,87,.08);
  --shadow-l: 0 14px 40px rgba(12,58,87,.16);
  --r: 20px;
  --r-s: 13px;
  --r-xs: 9px;
  --font-body: "BIZ UDPGothic", system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
  --font-head: "Zen Maru Gothic", "BIZ UDPGothic", system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  background: radial-gradient(1200px 500px at 50% -120px, #dff0f8 0%, var(--bg) 45%, var(--bg2) 100%) fixed;
  color: var(--ink); line-height: 1.65; letter-spacing: .01em; -webkit-text-size-adjust: 100%;
}
main { max-width: 780px; margin: 0 auto; padding: 16px 15px 96px; }
h1, h2, h3, .chip-name, .verdict-text, .preset-name, .wseg-label, .sg-name, .quiz-card h3, .suggest-head b { font-family: var(--font-head); font-weight: 700; }
h2 { font-size: 1.2rem; margin: 0 0 15px; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
/* inline icons (lucide-style line icons, currentColor) */
.ic { width: 1em; height: 1em; flex: none; vertical-align: -.12em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.step .ic { width: 16px; height: 16px; }
h2 > .ic, h3 > .ic { width: 1.15em; height: 1.15em; color: var(--teal); }
.omakase .ic, .act .ic, .mini-omakase .ic { width: 1.2em; height: 1.2em; }
.suggest-head b { display: inline-flex; align-items: center; gap: 6px; }
.suggest-head b .ic { width: 1.15em; height: 1.15em; color: var(--teal); }
.tab .ic { width: 1.4em; height: 1.4em; }
.cat-note .ic, .sel-detail .ic { width: 1.15em; height: 1.15em; }
.switch .ic, .tank-empty .ic { width: 1.25em; height: 1.25em; }
.wseg-label .ic, .saved-load .ic, .quiz-btn .ic { width: 1.05em; height: 1.05em; }
.saved-load, .quiz-btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.act, .mini-omakase { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.muted { color: var(--sub); }
.small { font-size: .78rem; }
.center { text-align: center; }
a { color: var(--teal-d); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center; color: #fff;
  padding: 40px 18px 46px;
  background: linear-gradient(165deg, #1391b8 0%, #0c5a82 48%, #0a3a58 100%);
}
.hero::before { /* 光のゆらぎ */
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 120%; z-index: 1; opacity: .5;
  background: radial-gradient(closest-side, rgba(255,255,255,.5), transparent 70%), radial-gradient(closest-side, rgba(150,230,255,.4), transparent 70%);
  background-size: 44% 60%, 38% 55%; background-position: 18% 8%, 78% 22%; background-repeat: no-repeat;
  animation: caustic 9s ease-in-out infinite alternate; filter: blur(6px);
}
@keyframes caustic { to { background-position: 26% 20%, 68% 6%; } }
.hero::after { /* 波型の底 */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 46px; z-index: 3;
  background: var(--bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='46' viewBox='0 0 1200 46' preserveAspectRatio='none'%3E%3Cpath d='M0 46 L0 20 Q150 0 300 18 T600 18 T900 18 T1200 16 L1200 46 Z' fill='black'/%3E%3C/svg%3E") bottom/100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='46' viewBox='0 0 1200 46' preserveAspectRatio='none'%3E%3Cpath d='M0 46 L0 20 Q150 0 300 18 T600 18 T900 18 T1200 16 L1200 46 Z' fill='black'/%3E%3C/svg%3E") bottom/100% 100% no-repeat;
}
.hero h1 { margin: 0; font-size: 2.2rem; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: .3em; letter-spacing: .02em; position: relative; z-index: 2; text-shadow: 0 3px 16px rgba(0,20,40,.28); }
.hero .tag { margin: .55em 0 0; font-size: 1.05rem; position: relative; z-index: 2; color: #dff2fb; }
.hero .tag b { color: var(--gold); font-weight: 800; }
.hero h1 .ic { width: 1.05em; height: 1.05em; stroke-width: 2.2; filter: drop-shadow(0 2px 6px rgba(0,20,40,.3)); }
.hero h1 .brand-logo { width: 1.2em; height: 1.2em; object-fit: contain; flex: none; filter: drop-shadow(0 2px 6px rgba(0,20,40,.3)); }
/* 信頼バッジ */
.hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 16px auto 0; position: relative; z-index: 2; max-width: 520px; }
.hero-badges span { font-size: .78rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.38); backdrop-filter: blur(2px); line-height: 1.5; }
.hero-badges b { color: var(--gold); font-weight: 800; }
.bubbles { position: absolute; inset: 0; z-index: 1; }
.bubbles span { position: absolute; bottom: -20px; background: rgba(255,255,255,.18); border-radius: 50%; animation: rise linear infinite; }
.bubbles span:nth-child(1){left:8%;width:9px;height:9px;animation-duration:7s}
.bubbles span:nth-child(2){left:22%;width:5px;height:5px;animation-duration:5s;animation-delay:1s}
.bubbles span:nth-child(3){left:40%;width:13px;height:13px;animation-duration:9s;animation-delay:.5s}
.bubbles span:nth-child(4){left:58%;width:7px;height:7px;animation-duration:6s;animation-delay:2s}
.bubbles span:nth-child(5){left:73%;width:11px;height:11px;animation-duration:8s;animation-delay:1.5s}
.bubbles span:nth-child(6){left:88%;width:6px;height:6px;animation-duration:5.5s;animation-delay:.8s}
@keyframes rise { to { transform: translateY(-280px) translateX(16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce){ .bubbles, .hero::before { animation: none; } }

/* ---------- card ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--teal), var(--teal-d)); color: #fff; font-size: .86rem; font-weight: 800; box-shadow: 0 2px 8px rgba(15,163,189,.35); }

/* ---------- water segmented (photos) ---------- */
.water-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.wseg { display: flex; flex-direction: column; gap: 7px; padding: 8px; border: 2px solid var(--line); border-radius: 15px; background: var(--card); cursor: pointer; transition: .15s; text-align: left; }
.wseg:hover { border-color: var(--teal); }
.wseg.on { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal), var(--shadow); }
.wseg[data-water="salt"].on { border-color: #1478c4; box-shadow: 0 0 0 2px #1478c4, var(--shadow); }
.wseg-imgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.wseg-img { aspect-ratio: 1; border-radius: 8px; font-size: 1.1rem; overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg,#d3ecf6,#a9d6e8); }
.wseg-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wseg-txt { padding: 0 4px 3px; }
.wseg-label { display: block; font-size: 1.05rem; font-weight: 800; }
.wseg-sub { display: block; font-size: .76rem; color: var(--sub); line-height: 1.3; }

/* picker controls (sort) */
.picker-controls { display: flex; justify-content: flex-end; margin: 10px 0 2px; }
.sortlbl { font-size: .78rem; color: var(--sub); display: inline-flex; align-items: center; gap: 6px; }
.sortlbl select { padding: 6px 10px; font-size: .82rem; }

/* env grid */
.env-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.envf { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--sub); font-weight: 700; }
.envf select, .envf input { font-weight: 400; color: var(--ink); }
.env-toggles { display: flex; gap: 16px; align-items: center; grid-column: 1 / -1; flex-wrap: wrap; }

/* ---------- quickstart ---------- */
.quickstart { display: flex; flex-direction: column; gap: 14px; }
.omakase { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 16px;
  border: none; border-radius: var(--r-s); cursor: pointer; font: inherit; font-size: 1.08rem; font-weight: 800; color: #fff;
  background: linear-gradient(120deg, var(--coral), var(--coral-d)); box-shadow: 0 6px 18px rgba(255,111,94,.36); transition: .16s; }
.omakase:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255,111,94,.46); }
.omakase:active { transform: translateY(0); }
.omakase .dice { font-size: 1.35rem; display: inline-flex; animation: wobble 3s ease-in-out infinite; }
@keyframes wobble { 0%,92%,100%{transform:rotate(0)} 95%{transform:rotate(-18deg)} 98%{transform:rotate(14deg)} }
/* preset slider */
.presets { display: flex; gap: 11px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.preset-card { flex: none; display: flex; flex-direction: column; width: 210px; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 15px; background: var(--card); cursor: pointer; overflow: hidden; text-align: left; padding: 0; transition: .15s; box-shadow: var(--shadow-s); }
.preset-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.preset-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.preset-imgs.n3 { grid-template-rows: 1fr 1fr; }
.preset-imgs.n3 .preset-img:first-child { grid-row: 1 / 3; aspect-ratio: auto; height: 100%; }
.preset-imgs.n1 { grid-template-columns: 1fr; }
/* 写真2枚だけ帯の高さが半分(64px)になっていた。n1/n3/n4 と同じ約130pxに合わせる
   （img は object-fit:cover なので歪まず、切り取りが広がるだけ） */
.preset-imgs.n2 { grid-template-rows: 131px; }
.preset-imgs.n2 .preset-img { aspect-ratio: auto; }
.preset-img { aspect-ratio: 16/10; font-size: 1.5rem; overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg,#d3ecf6,#a9d6e8); }
.preset-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preset-info { padding: 9px 11px 11px; }
.preset-name { font-weight: 800; font-size: .9rem; display: block; }
.preset-sub { font-size: .76rem; line-height: 1.35; display: block; margin-top: 2px; }

/* ---------- inputs ---------- */
input, select { font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-s); background: #fbfdfe; color: var(--ink); transition: .14s; }
input:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,163,189,.15); }
.search-wrap { position: relative; display: block; }
.search-wrap > .ic { position: absolute; left: 14px; top: 50%; margin-top: -.53em; color: var(--sub); pointer-events: none; }
#search { width: 100%; padding-left: 40px; }
.hidden { display: none !important; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 5px; scrollbar-width: thin; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fbfdfe; font: inherit; font-size: .82rem; cursor: pointer; white-space: nowrap; color: var(--sub); transition: .14s; }
.tab:hover { border-color: var(--teal); }
.tab.on { background: linear-gradient(135deg, var(--teal), var(--teal-d)); border-color: var(--teal-d); color: #fff; box-shadow: 0 2px 8px rgba(15,163,189,.3); }
.species-cat-icon { width: 1.7em; height: 1.7em; flex: none; background: currentColor; -webkit-mask: var(--cat-icon) center / contain no-repeat; mask: var(--cat-icon) center / contain no-repeat; }
.tab-clean { border-color: #7bc47f; color: #3f8a45; background: #f3fbf4; }
.tab-clean:hover { border-color: #4a9b52; }
.tab-clean.on { background: linear-gradient(135deg, #6fc276, #3f8a45); border-color: #3f8a45; color: #fff; box-shadow: 0 2px 8px rgba(63,138,69,.3); }
.cat-note { margin: 4px 0 2px; padding: 9px 12px; border-radius: 10px; background: #f3fbf4; border: 1px solid #d6eed9; color: #3c6b41; font-size: .78rem; line-height: 1.6; }

/* ---------- picker cards ---------- */
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 11px; max-height: 460px; overflow-y: auto; padding: 4px; scrollbar-width: thin; }
.chip { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 15px; background: var(--card); cursor: pointer; text-align: left; overflow: hidden; transition: .15s; padding: 0; box-shadow: var(--shadow-s); }
.chip:hover { border-color: var(--teal); transform: translateY(-3px); box-shadow: var(--shadow); }
.chip:hover .thumb img { transform: scale(1.07); }
.chip.on { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal), var(--shadow); }
.thumb { width: 100%; aspect-ratio: 4/3; background: linear-gradient(160deg, #d3ecf6, #a9d6e8); display: grid; place-items: center; font-size: 2.1rem; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.chip-body { padding: 7px 9px 9px; }
.chip-name { font-weight: 800; font-size: .82rem; line-height: 1.25; display: block; letter-spacing: -.01em; }
.chip-desc { font-size: .74rem; color: var(--sub); line-height: 1.3; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.tg { font-size: .75rem; padding: 1.5px 5px; border-radius: 5px; background: var(--line2); color: var(--sub); white-space: nowrap; }
.tg.care-easy { background: #e2f6ec; color: var(--ok); }
.tg.care-hard { background: #fdeae8; color: var(--ng); }
.price-badge { position: absolute; top: 7px; left: 7px; background: rgba(12,58,87,.82); color: #fff; font-size: .74rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; z-index: 2; backdrop-filter: blur(2px); }
.chip-badge { position: absolute; top: 7px; right: 7px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--coral); color: #fff; font-size: .74rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); z-index: 2; }

/* ---------- tank visual (サイズ感) ---------- */
.tank-visual { border-radius: 16px; overflow: hidden; position: relative; margin-bottom: 14px; border: 4px solid rgba(255,255,255,.7); box-shadow: var(--shadow); }
.tank-water { position: relative; background: linear-gradient(180deg, #bfe8f7 0%, #86c8e6 55%, #63b0d6 100%); }
.tank-water::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 14px; z-index: 4; background: linear-gradient(180deg, rgba(255,255,255,.55), transparent); }
.tank-water::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.14) 42%, transparent 46%, transparent 62%, rgba(255,255,255,.1) 72%, transparent 76%); }
.tank-gravel { height: 20px; background: repeating-linear-gradient(95deg, #b79b73, #a3865f 6px, #b79b73 12px); box-shadow: inset 0 3px 6px rgba(0,0,0,.15); }
.tank-scale { text-align: center; font-size: .76rem; color: var(--sub); padding: 4px; letter-spacing: .1em; }
.tank-layer { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; padding: 10px 24px; min-height: 54px; position: relative; z-index: 2; }
.tank-layer + .tank-layer { border-top: 1px dashed rgba(255,255,255,.4); }
.tank-layer-label { position: absolute; right: 9px; top: 5px; font-size: .75rem; color: rgba(255,255,255,.8); font-weight: 800; letter-spacing: .05em; }
/* サイズ感つきの魚 */
.fishviz { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 26px; max-width: 32%; }
.fishviz-body { width: 100%; aspect-ratio: 1; border-radius: 26%; overflow: hidden; background: rgba(255,255,255,.85); box-shadow: 0 4px 10px rgba(0,30,60,.22); display: grid; place-items: center; border: 2px solid #fff; filter: drop-shadow(0 2px 3px rgba(0,30,60,.15)); animation: floaty 4.2s ease-in-out infinite; }
.fishviz:nth-child(even) .fishviz-body { animation-delay: -1.4s; animation-duration: 4.8s; }
.fishviz:nth-child(3n) .fishviz-body { animation-delay: -2.6s; animation-duration: 5.4s; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-1.5deg); } }
@media (prefers-reduced-motion: reduce) { .fishviz-body { animation: none; } }
.fishviz-body img { width: 100%; height: 100%; object-fit: cover; }
.fishviz-body .fe { font-size: 1.1em; }
.fishviz-lbl { font-size: .72rem; color: #063; background: rgba(255,255,255,.8); border-radius: 5px; padding: 0 4px; white-space: normal; text-align: center; line-height: 1.25; max-width: calc(100% + 44px); font-weight: 700; }
.tank-flora { display: flex; gap: 5px; align-items: flex-end; padding: 0 11px 6px; position: relative; z-index: 3; }
.flora-viz { width: 30px; height: 34px; border-radius: 6px 6px 3px 3px; overflow: hidden; display: grid; place-items: center; background: rgba(200,255,210,.5); box-shadow: 0 -1px 4px rgba(0,60,20,.15); }
.flora-viz img { width: 100%; height: 100%; object-fit: cover; }
.flora-viz .fe { font-size: 1.1rem; }
.tank-empty { color: rgba(255,255,255,.92); font-size: .84rem; padding: 26px; text-align: center; width: 100%; z-index: 2; position: relative; text-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* ---------- suggestions ---------- */
.suggest-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 9px; }
.suggest-head b { font-size: .94rem; }
.mini-omakase { border: 1.5px solid var(--coral); color: var(--coral-d); background: transparent; border-radius: 999px; padding: 5px 13px; font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; transition: .14s; }
.mini-omakase:hover { background: var(--coral); color: #fff; }
.suggests { display: flex; gap: 9px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: thin; }
.sg { flex: none; width: 134px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); cursor: pointer; overflow: hidden; text-align: left; padding: 0; transition: .15s; box-shadow: var(--shadow-s); }
.sg:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.sg .thumb { aspect-ratio: 16/9; font-size: 1.6rem; }
.sg-body { padding: 7px 9px 9px; }
.sg-name { font-weight: 800; font-size: .8rem; display: block; }
.sg-reason { font-size: .76rem; color: var(--teal-d); margin-top: 2px; font-weight: 600; }
.sg-add { display: block; margin-top: 4px; font-size: .76rem; color: var(--coral-d); font-weight: 700; }

/* ---------- selected ---------- */
.selected { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sel-row { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(180deg,#fbfeff,#f5fafd); }
.sel-thumb { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(160deg,#d3ecf6,#a9d6e8); display: grid; place-items: center; font-size: 1.25rem; overflow: hidden; flex: none; }
.sel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sel-name { flex: 1 1 0; min-width: 0; font-weight: 700; font-size: .93rem; }
.sel-sub { font-size: .76rem; color: var(--sub); margin-left: 6px; font-weight: 400; }
.sel-stepper { display: flex; align-items: center; gap: 6px; }
.sel-stepper button { width: 30px; height: 30px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; font-size: 1.15rem; cursor: pointer; line-height: 1; color: var(--ink); transition: .12s; }
.sel-stepper button:hover { border-color: var(--teal); color: var(--teal); }
.sel-stepper b { min-width: 22px; text-align: center; font-size: .95rem; }
.sel-del { border: none; background: none; color: var(--sub); cursor: pointer; font-size: 1rem; padding: 4px; }
.sel-del:hover { color: var(--ng); }
.sel-detail { text-decoration: none; font-size: 1.05rem; padding: 2px 4px; flex: none; }
.empty { text-align: center; padding: 8px; }

/* livestock list */
.live-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.live-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: #f4fafd; border-radius: 10px; }
.live-name { flex: 1; font-size: .86rem; font-weight: 600; }

/* ---------- tank controls ---------- */
.tank-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#tank-custom { width: 112px; }
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: .92rem; cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { width: auto; }
.name-input { flex: 1; font-weight: 800; min-width: 0; }
.head-btns { display: flex; gap: 6px; flex: none; }
.ghost { border: 1.5px solid var(--line); background: #fbfdfe; border-radius: var(--r-xs); padding: 7px 13px; cursor: pointer; color: var(--sub); font: inherit; font-size: .85rem; transition: .12s; }
.ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- plants ---------- */
.plant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 11px; max-height: 460px; overflow-y: auto; padding: 4px; scrollbar-width: thin; }
.plant-note { margin-top: 12px; font-size: .82rem; padding: 11px 13px; border-radius: 11px; background: linear-gradient(180deg,#eefaef,#e4f5e6); color: #226b38; border: 1px solid #cfe9d3; }

/* ---------- result ---------- */
.result { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-l); padding: 20px; }
.result.reveal { animation: reveal .42s cubic-bezier(.2,.7,.3,1); }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.verdict { display: flex; align-items: center; gap: 16px; padding: 17px 18px; border-radius: 16px; margin-bottom: 16px; }
.verdict-mark { font-size: 2.8rem; font-weight: 800; line-height: 1; flex: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.1)); }
.verdict-text { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.verdict-meta { font-size: .76rem; margin-top: 3px; }
.v-best { background: linear-gradient(135deg,#dbf6f1,#c6f0e7); color: var(--best); }
.v-good { background: linear-gradient(135deg,#e0f6e9,#d2f1de); color: var(--ok); }
.v-triangle { background: linear-gradient(135deg,#fdf3e1,#fbe9cd); color: var(--warn); }
.v-x { background: linear-gradient(135deg,#fdeae8,#fbd9d5); color: var(--ng); }

.wq-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 15px; }
.wq { border-radius: 13px; padding: 10px 8px; text-align: center; border: 1.5px solid var(--line); }
.wq.ok { border-color: #c2e8d6; background: #f2fbf6; }
.wq.bad { border-color: #f3c6c2; background: #fdefee; }
.wq-label { display: block; font-size: .76rem; color: var(--sub); }
.wq-val { font-weight: 800; font-size: .95rem; }
.wq.bad .wq-val { color: var(--ng); }
.wq-best { display: block; font-size: .74rem; color: var(--sub); margin-top: 1px; }

.bioload { margin-bottom: 15px; }
.bio-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .9rem; }
.bio-head b { font-size: 1.25rem; font-weight: 800; }
.bio-bar { height: 13px; background: #e6eff4; border-radius: 8px; overflow: hidden; margin: 6px 0; }
.bio-bar span { display: block; height: 100%; background: linear-gradient(90deg,#2bc48c,#12a06a); border-radius: 8px; transition: width .45s; }
.bio-bar span.high { background: linear-gradient(90deg,#f0b429,#e08a12); }
.bio-bar span.over { background: linear-gradient(90deg,#f0654f,#e0483c); }
.bio-sub { font-size: .78rem; }

.issues { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.issue { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; font-size: .88rem; background: #f6fafc; }
.issue .ibadge { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; color: #fff; margin-top: 1px; }
.issue.ng { background: #fdeceb; } .issue.ng .ibadge { background: var(--ng); }
.issue.warn { background: #fdf6ea; } .issue.warn .ibadge { background: var(--warn); }
.issue.info { background: #edf6fb; } .issue.info .ibadge { background: var(--teal); }
.issue.ok { background: #eef9f2; } .issue.ok .ibadge { background: var(--ok); }

.shopping { border-top: 1px dashed var(--line); padding-top: 16px; }
.shopping h3 { font-size: 1rem; margin: 0 0 5px; }
.est { display: inline-block; margin: 4px 0 6px; font-size: .82rem; background: #fff3ef; color: var(--coral-d); font-weight: 800; padding: 4px 11px; border-radius: 999px; border: 1px solid #ffd8d0; }
.shop-cat { font-size: .78rem; font-weight: 800; color: var(--teal-d); margin: 13px 0 6px; letter-spacing: .05em; }
.shop-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .86rem; padding: 9px 12px; background: #f4fafd; border-radius: 10px; margin-bottom: 5px; }
.shop-item.ess { background: #edf6fb; }
.shop-label { display: flex; align-items: center; gap: 7px; min-width: 0; }
.shop-shops { display: flex; flex-wrap: wrap; gap: 6px; flex: none; }
.shop-shops a { display: inline-block; color: var(--teal-d); text-decoration: none; font-weight: 700; font-size: .78rem; line-height: 1.4; white-space: nowrap; padding: 3px 10px; border: 1.5px solid #cfe3ec; border-radius: 999px; background: #fff; transition: .12s; }
.shop-shops a:hover { border-color: var(--teal); background: #eef8fb; text-decoration: none; }
@media (max-width: 480px) {
  .shop-item { flex-direction: column; align-items: flex-start; gap: 7px; }
  .live-row { flex-wrap: wrap; row-gap: 7px; }
  .live-name { flex: 1 1 150px; }
  .live-row .shop-shops { flex: 1 1 100%; padding-left: 48px; }
  /* 折り返すと「育て方」リンクだけが1行目の右端に取り残され、ステッパーが2行目に落ちて
     間に空白ができていた。1行目=サムネ+名前 / 2行目=育て方・ステッパー・✕ にまとめて右へ寄せる。 */
  .sel-row { flex-wrap: wrap; row-gap: 4px; }
  .sel-name { flex: 1 1 calc(100% - 49px); }  /* サムネ38px + gap11px */
  .sel-sub { display: block; margin-left: 0; }
  .sel-detail { margin-left: auto; }
  .sel-stepper { margin-left: 0; }
}

.fun { margin-top: 4px; }
.fun summary { cursor: pointer; font-weight: 800; font-size: 1rem; padding: 4px 0; }
.fun summary::marker { color: var(--coral); }

.result-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.act { flex: 1; min-width: 132px; padding: 12px; border: 1.5px solid var(--line); border-radius: 11px; background: #fbfdfe; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--ink); transition: .12s; }
.act:hover { border-color: var(--teal); }
.act.primary { background: linear-gradient(135deg, var(--coral), var(--coral-d)); border-color: var(--coral-d); color: #fff; font-weight: 800; box-shadow: 0 4px 12px rgba(255,111,94,.32); }

/* ---------- saved ---------- */
.saved { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-chip { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: #fbfdfe; }
.saved-load { border: none; background: none; padding: 8px 14px; font: inherit; cursor: pointer; color: var(--ink); font-weight: 600; }
.saved-load:hover { color: var(--teal); }
.saved-del { border: none; background: none; padding: 8px 11px 8px 4px; color: var(--sub); cursor: pointer; }
.saved-del:hover { color: var(--ng); }

.disclaimer { font-size: .76rem; color: var(--sub); margin-top: 22px; padding: 13px 15px; background: #e7f0f5; border-radius: 12px; }
.disclaimer a { color: var(--teal-d); }
footer { text-align: center; padding: 22px; }

/* quiz overlay */
.quiz-ov { position: fixed; inset: 0; z-index: 70; background: rgba(8,30,44,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: reveal .2s ease; }
.quiz-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-l); padding: 24px 22px; max-width: 380px; width: 100%; text-align: center; }
.quiz-step { font-size: .78rem; color: var(--coral-d); font-weight: 800; letter-spacing: .05em; }
.quiz-card h3 { font-size: 1.2rem; margin: 8px 0 18px; }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; }
.quiz-btn { padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fbfdfe; font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; transition: .12s; color: var(--ink); }
.quiz-btn:hover { border-color: var(--teal); background: #eef8fb; transform: translateY(-1px); }
.quiz-cancel { margin-top: 16px; border: none; background: none; color: var(--sub); font: inherit; font-size: .85rem; cursor: pointer; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); background: rgba(12,35,48,.96); color: #fff; padding: 12px 22px; border-radius: 999px; font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: .26s; z-index: 60; box-shadow: var(--shadow-l); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* sticky mobile bar */
.stickybar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(12,58,87,.12); padding: 10px 15px; display: flex; align-items: center; gap: 13px; z-index: 40; transform: translateY(120%); transition: .28s; }
.stickybar.show { transform: none; }
.sb-verdict { font-size: 1.7rem; font-weight: 800; flex: none; }
.sb-info { flex: 1; font-size: .82rem; line-height: 1.28; }
.sb-info b { font-size: .93rem; }
.sb-btn { border: none; background: linear-gradient(135deg, var(--coral), var(--coral-d)); color: #fff; padding: 11px 18px; border-radius: 11px; font: inherit; font-weight: 800; cursor: pointer; flex: none; box-shadow: 0 3px 10px rgba(255,111,94,.3); }
@media (min-width: 720px) { .stickybar { display: none; } main { padding-bottom: 52px; } }

/* dark */
@media (prefers-color-scheme: dark) {
  :root { --bg: #0a1820; --bg2: #08121a; --card: #12222c; --ink: #e7eff4; --sub: #90a9b8; --line: #223846; --line2: #182934; --teal: #22b6d0; --teal-d: #1a9ab3; --coral: #ff7a68; --coral-d: #f0604d; }
  body { background: radial-gradient(1200px 500px at 50% -120px, #123043 0%, var(--bg) 45%, var(--bg2) 100%) fixed; }
  input, select, .chip, .preset, .sel-row, .sel-stepper button, .ghost, .tab, .sg, .saved-chip { background: #0f1e28; }
  .preset { background: linear-gradient(180deg,#12222c,#0e1c25); }
  .sel-row { background: linear-gradient(180deg,#12222c,#0f1e28); }
  .issue { background: #0f1e28; }
  .issue.ng { background: #2c1a1a; } .issue.warn { background: #2b2416; } .issue.info { background: #10252f; } .issue.ok { background: #14261e; }
  .shop-item, .wq, .plant-note, .disclaimer { background: #0f1e28; }
  .shop-shops a { background: #12222c; border-color: #2a4557; }
  .shop-item.ess, .live-row, .act, .quiz-btn { background: #10252f; }
  .wq.ok { background: #14261e; border-color: #24402b; } .wq.bad { background: #2c1a1a; border-color: #4a2b25; }
  .shop-shops a:hover { background: #17303d; }
  .plant-note { background: #12251a; color: #a6dcae; border-color: #24402b; }
  .est { background: #2a1a17; border-color: #4a2b25; }
  .stickybar { background: rgba(18,34,44,.9); }
  .bio-bar { background: #0e1c25; }
  .price-badge { background: rgba(0,0,0,.6); }
}
