/* ============================================
   釣果価値チェッカー / style.css (v4)
   サイズ別匹数入力・スマホファースト
   ============================================ */

:root {
  --bg:       #f5f7fa;
  --card:     #fff;
  --border:   #d0d8e0;
  --border-2: #e4e9ef;
  --nav:      #f0f3f7;

  --text:     #1a2332;
  --sub:      #5a6a7a;
  --muted:    #8a96a4;
  --faint:    #b8c2cc;

  --accent:   #0d2b4a;
  --accent-2: #1a4070;
  --cta:      #e85d04;
  --cta-2:    #d04e00;

  --pos:      #1a9d56;
  --neg:      #d43333;
  --warn:     #d4a017;
  --prem:     #7c3aed;

  --hdr:      #0d2b4a;

  --r:        12px;
  --r-sm:     8px;
  --mx:       760px;

  --shadow-bn: rgba(0,0,0,.06);

  --bar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

[hidden] { display: none !important; }

body {
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + 24px);
}

/* ============================================
   Header
   ============================================ */

header {
  background: var(--hdr);
  color: #fff;
  padding: 10px 16px;
  border-bottom: 3px solid var(--cta);
  position: sticky;
  top: 0;
  z-index: 20;
}
.hd-inner {
  max-width: var(--mx);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hd-logo {
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  opacity: .85;
}
.hd-logo:hover { opacity: 1; text-decoration: underline; }
.hd-title {
  font-weight: 700;
  font-size: 15px;
  border-left: 1px solid rgba(255,255,255,.3);
  padding-left: 10px;
}

/* ============================================
   Wrap / Card
   ============================================ */

.wrap {
  max-width: var(--mx);
  margin: 12px auto 0;
  padding: 0 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px var(--shadow-bn);
}
.card h2.st {
  font-size: 13px;
  font-weight: 700;
  color: var(--sub);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-2);
  letter-spacing: .04em;
}

/* ============================================
   Form basics
   ============================================ */

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.form-row > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: .03em;
}

.form-row select {
  padding: 13px 36px 13px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6a7a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  min-height: 48px;
}
.form-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 43, 74, .12);
}
.form-row select option:disabled {
  color: var(--accent);
  font-weight: 700;
  background: var(--nav);
}

/* ============================================
   Entries (複数魚種)
   ============================================ */

.entries {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 12px;
}

.entry {
  position: relative;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: #fff;
  overflow: hidden;
}
.entry.has-fish {
  border-color: rgba(13, 43, 74, .25);
}

.entry-head {
  display: grid;
  grid-template-columns: 28px 1fr 36px;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 0;
  background: var(--nav);
  border-bottom: 1px solid var(--border-2);
}
.entry.has-fish .entry-head {
  background: rgba(13, 43, 74, .04);
}

.entry-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* 魚種選択ボタン（select 置き換え） */
.entry-fish-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--sub);
  font-family: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .12s, box-shadow .12s;
}
.entry-fish-btn:hover { border-color: var(--accent-2); }
.entry-fish-btn:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 43, 74, .12);
}
.entry.has-fish .entry-fish-btn { color: var(--text); }

.efb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
}
.efb-icon img { display: block; border-radius: 4px; }

.efb-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.efb-caret {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform .15s;
}

.entry-remove {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .12s, color .12s, opacity .12s;
}
.entry-remove:hover {
  background: rgba(212, 51, 51, .12);
  color: var(--neg);
}
.entry-remove:disabled {
  opacity: .25;
  cursor: not-allowed;
}

.entry .band-list-row {
  margin: 0;
  border-radius: 0;
  background: #fff;
  padding: 12px 12px 14px;
}

/* 「魚種を追加」ボタン */
.add-entry-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  background: #fff;
  color: var(--accent);
  border: 1.5px dashed var(--border);
  border-radius: var(--r);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.add-entry-btn:hover {
  border-color: var(--accent);
  background: rgba(13, 43, 74, .04);
}
.add-entry-btn svg { display: inline-block; }

/* ============================================
   サイズ別 匹数リスト
   ============================================ */

.band-list-row {
  border-radius: var(--r-sm);
  padding: 0;
}
.band-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.band-list-head label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: .03em;
}
.band-total {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 12px;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  transition: background-color .15s, border-color .15s;
}
.band-list-row.has-value .band-total {
  background: var(--cta);
  border-color: var(--cta);
}
.band-total-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  line-height: 1;
  transition: color .15s;
}
.band-list-row.has-value .band-total-val { color: #fff; }
.band-total-unit {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  transition: color .15s;
}
.band-list-row.has-value .band-total-unit { color: rgba(255,255,255,.85); }

.band-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 入力モード切替セグメント（簡単入力 / 詳細入力） */
.input-mode-seg {
  display: inline-flex;
  background: var(--border-2);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.ims-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  background: transparent;
  color: var(--sub);
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
  letter-spacing: .02em;
  -webkit-tap-highlight-color: transparent;
}
.ims-btn.active {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 1px 4px rgba(232,93,4,.28);
}

/* 単位切替セグメント（詳細モード内: kg / cm） */
.unit-seg {
  display: inline-flex;
  align-self: flex-start;
  background: var(--border-2);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 10px;
}
.us-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 4px 18px;
  cursor: pointer;
  background: transparent;
  color: var(--sub);
  transition: background .15s, color .15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.us-btn.active {
  background: var(--accent);
  color: #fff;
}

/* 詳細リスト */
.detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.di-num {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  min-width: 3.5em;
}
/* 詳細入力ステッパー（di-stepper / ds-btn / ds-val） */
.di-stepper {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: 38px auto 38px;
  align-items: stretch;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
  user-select: none;
  transition: border-color .12s;
}
.di-stepper.has-value {
  border-color: var(--cta);
}
.ds-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .08s, transform .05s;
  touch-action: manipulation;
}
.ds-btn:hover { background: rgba(13, 43, 74, .06); }
.ds-btn:active,
.ds-btn.pressing {
  background: rgba(13, 43, 74, .14);
  transform: scale(.94);
}
.ds-val {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border-2);
  border-right: 1px solid var(--border-2);
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  background: #fcfcfd;
  padding: 0 10px;
  white-space: nowrap;
  min-width: 68px;
  position: relative;
  cursor: text;
}
.di-stepper.has-value .ds-val {
  background: rgba(232, 93, 4, .07);
  color: var(--cta);
}
.ds-edit-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, .97);
  text-align: center;
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  color: var(--cta);
  padding: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.ds-edit-input::-webkit-inner-spin-button,
.ds-edit-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.di-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
}
.di-remove:hover { background: #f0f0f0; color: var(--text); }
.detail-add-btn {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  color: var(--cta);
  background: none;
  border: 1.5px dashed var(--cta);
  border-radius: var(--r-sm);
  padding: 7px 16px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background .12s;
}
.detail-add-btn:hover { background: rgba(230,119,27,.06); }

.band-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  transition: border-color .12s, background-color .12s;
}
.band-row.has-value {
  border-color: rgba(13, 43, 74, .25);
  box-shadow: 0 1px 3px rgba(13, 43, 74, .06);
}

.band-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.band-label {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  letter-spacing: .02em;
}
.band-label[data-class="small"]    { background: var(--sub); }
.band-label[data-class="standard"] { background: var(--accent); }
.band-label[data-class="large"]    { background: var(--cta); }
.band-label[data-class="premium"]  { background: var(--prem); }

.band-range {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

/* ステッパー */
.band-stepper {
  display: grid;
  grid-template-columns: 40px 60px 40px;
  align-items: stretch;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
  user-select: none;
  transition: border-color .12s;
}
.band-row.has-value .band-stepper {
  border-color: var(--accent);
}
.bs-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .08s, transform .05s;
  touch-action: manipulation;
}
.bs-btn:hover { background: rgba(13, 43, 74, .06); }
.bs-btn:active,
.bs-btn.pressing {
  background: rgba(13, 43, 74, .14);
  transform: scale(.94);
}
.bs-input {
  border: none;
  outline: none;
  border-left: 1px solid var(--border-2);
  border-right: 1px solid var(--border-2);
  background: #fcfcfd;
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 0;
  width: 100%;
  -moz-appearance: textfield;
  appearance: textfield;
}
.bs-input::-webkit-outer-spin-button,
.bs-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.band-row.has-value .bs-input {
  background: rgba(232, 93, 4, .07);
  color: var(--cta);
}

.band-hint {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  letter-spacing: .02em;
}

/* ============================================
   Error
   ============================================ */

.err {
  color: var(--neg);
  font-size: 13px;
  margin: 4px 0 0;
  padding: 10px 12px;
  background: #fef2f2;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--neg);
}

/* ============================================
   Result summary
   ============================================ */

.result-summary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 14px 16px;
  border-radius: var(--r);
  margin-bottom: 14px;
}
.result-totals {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 10px;
}
.rt-item { text-align: center; }
.rt-val {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  line-height: 1.1;
  color: #fff;
}
.rt-lbl {
  font-size: 11px;
  color: rgba(255, 255, 255, .75);
  font-weight: 600;
  letter-spacing: .04em;
  margin-top: 2px;
}
.rt-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, .25);
}

.result-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.rp-icon { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
.rp-name { letter-spacing: .02em; }
.rp-count {
  font-size: 11px;
  color: rgba(255, 255, 255, .85);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   Result price
   ============================================ */

.result-price {
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
}
.result-price:last-of-type { border-bottom: none; }

.price-label {
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 8px;
  font-weight: 600;
}
.price-label .paren {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* 主表示: 推定値 (中央値) */
.price-main {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.price-amt {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1;
}
.price-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--sub);
}
.result-price.retail .price-amt { color: var(--cta); }
.result-price.wholesale .price-amt { color: var(--text); }
.result-price.wholesale .price-amt {
  font-size: 24px;
}

/* 補助: レンジ */
.price-range {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* 価格基準（鮮度・出典） */
.price-basis {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.price-basis:empty { display: none; }

/* 詳細入力への導線ヒント（簡単入力時のみ） */
.simple-hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 8px 2px 0;
}
.simple-hint-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--cta);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* basis */
.basis-details {
  margin-top: 14px;
  background: var(--nav);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--sub);
}
.basis-details[open] { padding-bottom: 12px; }
.basis-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  padding-right: 18px;
  position: relative;
}
.basis-details summary::-webkit-details-marker { display: none; }
.basis-details summary::after {
  content: "▼";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 10px;
  transition: transform .15s;
}
.basis-details[open] summary::after { transform: rotate(180deg); }
.basis-list {
  margin: 10px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}
.basis-list li { margin-bottom: 2px; }
.basis-head {
  list-style: none;
  margin-left: -18px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 8px;
}
.basis-head:first-child { margin-top: 0; }

/* ============================================
   Caution
   ============================================ */

.caution {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin: 4px 12px 16px;
  padding: 0;
}

/* ============================================
   Bottom action bar (mobile sticky)
   ============================================ */

.bottom-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 10px;
  align-items: center;
}
.bottom-bar .btn-primary {
  flex: 1 1 auto;
  background: var(--cta);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0 22px;
  height: 52px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: .04em;
  transition: background-color .12s, transform .08s, box-shadow .12s;
  box-shadow: 0 4px 14px rgba(232, 93, 4, .3);
}
.bottom-bar .btn-primary:hover { background: var(--cta-2); }
.bottom-bar .btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 4px rgba(232,93,4,.3); }
.bottom-bar .btn-ghost {
  background: transparent;
  color: var(--sub);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 48px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex: 0 0 auto;
}
.bottom-bar .btn-ghost:hover { background: var(--nav); color: var(--text); }

/* ============================================
   Footer
   ============================================ */

.ft {
  max-width: var(--mx);
  margin: 16px auto 0;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.ft-back {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.ft-back:hover { text-decoration: underline; }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 360px) {
  .hd-title { font-size: 14px; padding-left: 8px; }
  .wrap { padding: 0 10px; }
  .card { padding: 14px; }
  .price-amt { font-size: 28px; }
  .result-price.wholesale .price-amt { font-size: 22px; }
  .band-row { padding: 8px 10px; }
  .band-stepper { grid-template-columns: 36px 52px 36px; height: 40px; }
  .bs-input { font-size: 16px; }
}

@media (min-width: 768px) {
  .wrap { margin-top: 16px; padding: 0 16px; }
  .card { padding: 22px; }
}

/* ============================================
   魚ピッカーモーダル
   ============================================ */

body.picker-open { overflow: hidden; }

.fish-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: flex-end;
}

.picker-sheet {
  width: 100%;
  max-height: 80vh;
  background: var(--card);
  border-radius: var(--r) var(--r) 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
  animation: sheet-up .22s cubic-bezier(.22,.61,.36,1);
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-2);
  flex: 0 0 auto;
}

.picker-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .03em;
}

.picker-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--nav);
  color: var(--sub);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .12s;
}
.picker-close:hover { background: var(--border); color: var(--text); }

.picker-content {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px 24px;
}

/* 50音グループラベル */
.picker-group-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .08em;
  background: var(--nav);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  margin: 12px 0 8px;
  display: inline-block;
}
.picker-group-label:first-child { margin-top: 4px; }

/* 魚チップグリッド */
.picker-content {
  /* flex column から grid に変更するために wrap を使う */
}

/* チップ群をフレックスラップで並べる */
.picker-content > .fish-chip,
.picker-content > .picker-group-label {
  display: inline-flex; /* グループラベルはブロック扱い */
}

/* グリッドレイアウトのためのコンテナをラベル後に作りたいが、
   DOM 上はフラット。CSS で対処: ラベルは width:100% でラップ強制 */
.picker-group-label {
  width: 100%;
  box-sizing: border-box;
}

/* チップ群はフレックス */
.picker-content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.fish-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px 6px;
  background: #fff;
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .12s, background-color .12s, transform .08s;
  min-width: 64px;
  max-width: 80px;
  text-align: center;
}
.fish-chip:hover {
  border-color: var(--accent);
  background: rgba(13, 43, 74, .04);
}
.fish-chip:active { transform: scale(.94); }
.fish-chip.selected {
  border-color: var(--cta);
  background: rgba(232, 93, 4, .07);
}

.fish-chip-icon {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.fish-chip-icon.fish-chip-icon-placeholder {
  width: 36px;
  height: 36px;
  font-size: 28px;
  line-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fish-chip-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.fish-chip.selected .fish-chip-name { color: var(--cta); }

/* ============================================
   Xシェアセクション
   ============================================ */

.share-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border-2);
}
.share-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  letter-spacing: .02em;
}
.share-tabs {
  display: flex;
  gap: 2px;
  background: var(--border-2);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 10px;
}
.share-tab {
  flex: 1 1 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 7px 0;
  cursor: pointer;
  background: transparent;
  color: var(--sub);
  transition: background .15s, color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: .02em;
}
.share-tab.active {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 1px 4px rgba(232,93,4,.28);
}
.share-preview {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  white-space: pre-wrap;
  line-height: 1.65;
  margin-bottom: 12px;
  max-height: 260px;
  overflow-y: auto;
  word-break: break-word;
}
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 0;
  background: #000;
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: opacity .15s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.share-btn:hover { opacity: .88; }
.share-btn:active { transform: scale(.98); }
.share-btn svg { flex-shrink: 0; }

/* ============================================
   入力完了ボタン & ロック状態
   ============================================ */

.lock-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 11px 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .15s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.lock-btn:hover { background: var(--accent-2); }
.lock-btn:active { transform: scale(.98); }

.entry.is-locked { border-color: var(--accent); }
.entry.is-locked .entry-head {
  background: rgba(13, 43, 74, .05);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}

/* ロック済みサマリー行 */
.entry-locked-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 14px;
}
.els-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.els-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.els-body { flex: 1 1 0; min-width: 0; }
.els-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.els-count {
  font-size: 13px;
  color: var(--sub);
  margin-top: 2px;
}
.els-edit-btn {
  flex-shrink: 0;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--sub);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.els-edit-btn:hover { border-color: var(--accent); color: var(--accent); }

/* 削除確認パネル */
.entry-del-confirm {
  margin: 0 14px 14px;
  padding: 12px 14px;
  background: rgba(212, 51, 51, .06);
  border: 1.5px solid rgba(212, 51, 51, .25);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.edc-msg {
  flex: 1 1 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--neg);
}
.edc-btns { display: flex; gap: 8px; flex-shrink: 0; }
.edc-cancel {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--sub);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.edc-cancel:hover { border-color: var(--sub); }
.edc-delete {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  background: var(--neg);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.edc-delete:hover { background: #b92b2b; }

@media (min-width: 480px) {
  .picker-sheet {
    max-width: var(--mx);
    margin: 0 auto;
    border-radius: var(--r) var(--r) 0 0;
  }
  .fish-chip { min-width: 72px; max-width: 90px; }
}
