/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --sage:        #4B7A5E;
  --sage-light:  #EAF3EE;
  --sage-deep:   #1E4D38;
  --petal:       #FAEAE7;
  --petal-ink:   #B85C50;
  --stone:       #F6F4F1;
  --card:        #FFFFFF;
  --ink:         #1C1C1E;
  --ink-2:       #3A3A3C;
  --muted:       #6C6C70;
  --border:      #E5E5EA;
  --warn:        #D97706;
  --danger:      #DC2626;
  --radius:      20px;
  --r-btn:       13px;
  --r-input:     12px;
  --r-card-sm:   14px;
  --shadow:      0 2px 14px rgba(0,0,0,0.07);
  /* セマンティックバッジ */
  --badge-ok-bg:    #D1FAE5;
  --badge-ok-ink:   #065F46;
  --badge-mid-bg:   #FEF3C7;
  --badge-mid-ink:  #92400E;
  --badge-mid-br:   #FDE68A;
  --badge-over-bg:  #FEE2E2;
  --badge-over-ink: #991B1B;
  /* ステータスパネル */
  --status-loading-bg:  #EFF6FF;
  --status-loading-ink: #1E40AF;
  --status-error-bg:    #FFF5F5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --stone:      #0F0F11;
    --card:       #1C1C1E;
    --sage:       #5E9B74;
    --sage-light: #162A20;
    --sage-deep:  #0D2B1E;
    --petal:      #3A1F1C;
    --petal-ink:  #E07060;
    --ink:        #F2F2F7;
    --ink-2:      #AEAEB2;
    --muted:      #636366;
    --border:     #2C2C2E;
    --warn:       #FCA549;
    --danger:     #FC7373;
    --shadow:     0 2px 14px rgba(0,0,0,0.3);
    /* セマンティックバッジ（ダーク） */
    --badge-ok-bg:    #052E16;
    --badge-ok-ink:   #6EE7B7;
    --badge-mid-bg:   #2D1B00;
    --badge-mid-ink:  #FCD34D;
    --badge-mid-br:   #78350F;
    --badge-over-bg:  #2D0808;
    --badge-over-ink: #FCA5A5;
    /* ステータスパネル（ダーク） */
    --status-loading-bg:  #172554;
    --status-loading-ink: #93C5FD;
    --status-error-bg:    #2D0808;
  }
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.modal-open { overflow: hidden; }
body {
  margin: 0;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP",
    "Segoe UI", Meiryo, sans-serif;
  background: var(--stone);
  color: var(--ink);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.topbar h1 {
  font-size: 1.1rem;
  margin: 0;
  color: var(--sage);
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.month-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
  padding: 8px 0 2px;
  border-top: 1px solid var(--border);
}
.month-picker button {
  background: var(--stone);
  border: 1px solid var(--border);
  color: var(--sage);
  width: 40px;
  height: 44px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.month-picker button:hover { background: var(--sage-light); }
.month-picker span {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  min-width: 90px;
  text-align: center;
  letter-spacing: .02em;
}
.topbar-btn {
  background: var(--stone);
  border: 1px solid var(--border);
  color: var(--ink-2);
  padding: 6px 10px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.topbar-btn:hover { background: var(--border); }
.topbar-btn--logout { color: var(--muted); }
.topbar-btn--blog { text-decoration: none; display: inline-flex; align-items: center; }

#shopping-btn, #saved-recipes-btn, #compare-btn {
  background: var(--stone);
  border: 1px solid var(--border);
  color: var(--ink-2);
  padding: 7px 10px;
  border-radius: 100px;
  font-size: 0.96rem;
  cursor: pointer;
  position: relative;
  line-height: 1;
}
#shopping-btn:hover, #saved-recipes-btn:hover, #compare-btn:hover {
  background: var(--sage-light);
  border-color: var(--sage);
  color: var(--sage);
}
.shopping-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--danger);
  color: #fff;
  border-radius: 100px;
  font-size: 0.6rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--card);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 14px 90px; /* bottom: space for bottom nav */
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card h2 { margin: 0 0 12px; font-size: 1rem; font-weight: 700; }
.hint { color: var(--muted); font-size: 0.83rem; line-height: 1.55; margin: 0; }

/* ============================================================
   SUMMARY HERO CARD
   ============================================================ */
.summary {
  padding: 0;
  overflow: hidden;
}
.summary-hero {
  background: var(--sage);
  padding: 20px 20px 18px;
  position: relative;
  overflow: hidden;
}
.summary-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -30px;
  width: 150px; height: 150px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
  pointer-events: none;
}
.summary-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; right: 20px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}
.summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.summary-total { display: flex; flex-direction: column; gap: 2px; margin-bottom: 0; }
.summary-total .label { color: rgba(255,255,255,0.75); font-size: 0.75rem; font-weight: 600; letter-spacing: .05em; }
.summary-total .value { font-size: 2.4rem; font-weight: 800; color: #fff; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary-total .sub { color: rgba(255,255,255,0.65); font-size: 0.76rem; }
.summary-actions { display: flex; gap: 6px; flex-shrink: 0; position: relative; z-index: 1; padding-top: 2px; }
.summary-action-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: var(--r-btn);
  padding: 8px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.summary-action-btn:hover { background: rgba(255,255,255,0.3); }
.summary-body {
  background: var(--card);
  padding: 14px 18px 16px;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ============================================================
   CATEGORY BARS
   ============================================================ */
.category-bars { display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; align-items: center; gap: 10px; font-size: 0.83rem; }
.cat-name { width: 72px; flex-shrink: 0; color: var(--muted); font-weight: 600; }
.cat-bar-wrap { flex: 1; background: var(--stone); border-radius: 100px; overflow: hidden; height: 8px; }
.cat-bar { height: 100%; background: var(--sage); border-radius: 100px; }
.cat-amount { width: 88px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ============================================================
   LOWEST PRICE ALERTS
   ============================================================ */
.lowest-alerts {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--petal);
}
.alert-title { font-size: 0.78rem; font-weight: 700; color: var(--petal-ink); margin-bottom: 6px; }
.alert-section { font-size: 0.72rem; font-weight: 700; color: var(--muted); letter-spacing: .05em; margin: 10px 0 4px; padding-top: 8px; border-top: 1px solid var(--border); }
.alert-section:first-of-type { margin-top: 4px; padding-top: 4px; border-top: none; }
.alert-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 0.83rem; flex-wrap: wrap; margin-top: 4px; }
.alert-name { font-weight: 600; color: var(--ink); }
.alert-detail { color: var(--muted); }
.alert-detail strong { color: var(--sage); font-weight: 700; }

/* ============================================================
   FORM CARD
   ============================================================ */
.form-card.editing { outline: 2px solid var(--sage); outline-offset: 2px; }
.edit-banner {
  margin: -4px 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--sage-light);
  color: var(--sage);
  font-size: 0.83rem;
  font-weight: 600;
}

/* ============================================================
   CAPTURE
   ============================================================ */
.capture h2 { color: var(--sage); }
.capture-buttons { display: flex; gap: 10px; margin-top: 12px; }
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--sage);
  color: #fff;
  padding: 16px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  flex: 1;
  font-size: 1rem;
  border: none;
  letter-spacing: .01em;
}
.file-button:hover { filter: brightness(1.07); }
.file-button:active { filter: brightness(0.95); transform: scale(0.99); }
.file-button.secondary {
  background: var(--sage-light);
  color: var(--sage);
  font-size: 0.88rem;
  padding: 14px 14px;
  flex: 0.8;
}
.status {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-line; /* \n を改行として表示 */
}
.status.loading { background: var(--status-loading-bg); color: var(--status-loading-ink); }
.status.error { background: var(--status-error-bg); color: var(--danger); }
.status.ok { background: var(--sage-light); color: var(--sage); }

/* ============================================================
   FORM
   ============================================================ */
form { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; }
.row > label { flex: 1; }
label { display: flex; flex-direction: column; font-size: 0.78rem; font-weight: 600; color: var(--muted); gap: 5px; letter-spacing: .01em; }
input, select {
  font-size: 0.96rem;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  color: var(--ink);
  background: var(--card);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-light);
}
.items-list { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.item-row { display: flex; flex-direction: column; gap: 4px; }
.item-row-main { display: flex; gap: 8px; align-items: center; }
.item-row-main .item-name { flex: 1; min-width: 0; }
.item-row-main .item-price { width: 84px; flex-shrink: 0; }
.item-row-main .item-category { width: 92px; flex-shrink: 0; }
.item-row-main button { flex-shrink: 0; background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1.1rem; padding: 4px; }
.item-row-qty { display: flex; gap: 6px; align-items: center; padding-left: 2px; }
.item-qty { width: 72px; flex-shrink: 0; font-size: 0.83rem; }
.item-unit { width: 80px; flex-shrink: 0; font-size: 0.83rem; }
.item-qty-label { font-size: 0.7rem; color: var(--sage); line-height: 1.3; }
.items-qty-global-hint {
  font-size: 0.75rem; color: var(--muted); margin: 8px 0 0;
  padding: 7px 10px; background: var(--sage-light); border-radius: 8px;
  border-left: 3px solid var(--sage); line-height: 1.45;
}
.items-toggle-btn {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1.5px dashed var(--sage); background: var(--sage-light);
  color: var(--sage-dark, var(--sage)); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; text-align: left; display: flex; align-items: center; gap: 6px;
}
.items-toggle-btn:hover { background: var(--sage-mid, var(--sage-light)); }
.items-toggle-btn.open { border-style: solid; }
.form-preview img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.form-actions { display: flex; gap: 10px; }
button {
  font-size: 0.96rem;
  padding: 12px 18px;
  border-radius: var(--r-btn);
  border: 1.5px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  font-family: inherit;
  transition: filter .15s, background .15s;
}
button.primary { background: var(--sage); color: #fff; border-color: var(--sage); flex: 1; font-weight: 700; }
button.primary:hover { filter: brightness(1.07); }
button:not(.primary):hover { background: var(--stone); }
button:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }

/* ============================================================
   EXPENSE LIST
   ============================================================ */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.list-head h2 { margin: 0; }
.expense-list { display: flex; flex-direction: column; gap: 14px; }
.store-group { display: flex; flex-direction: column; gap: 6px; }
.store-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding-bottom: 6px; border-bottom: 2px solid var(--border);
}
.store-head .sg-name { font-weight: 800; font-size: 1rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-head .sg-total { font-weight: 700; color: var(--sage); white-space: nowrap; font-variant-numeric: tabular-nums; }
.store-head .sg-count { color: var(--muted); font-weight: 400; font-size: 0.72rem; margin-left: 6px; }
.branch-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-top: 4px; padding: 2px 4px 2px 10px; font-size: 0.83rem; border-left: 3px solid var(--border);
}
.branch-head .bh-name { font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-head .bh-total { font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.expense-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--r-card-sm); background: var(--card);
}
.expense-item.ei-indent { margin-left: 10px; border-left: 3px solid var(--border); border-radius: 0 var(--r-card-sm) var(--r-card-sm) 0; }
.expense-item .ei-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--stone); flex-shrink: 0; }
.expense-item .ei-main { flex: 1; min-width: 0; }
.expense-item .ei-meta { font-size: 0.75rem; color: var(--muted); }
.expense-item .ei-cat {
  display: inline-block; background: var(--sage-light); color: var(--sage);
  padding: 2px 8px; border-radius: 100px; font-size: 0.7rem; font-weight: 700; margin-right: 6px;
}
.expense-item .ei-amount { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.expense-item .ei-actions { display: flex; gap: 4px; }
.expense-item .ei-actions button { padding: 6px 10px; font-size: 0.83rem; }
/* 明細アコーディオン */
.expense-item .ei-details { margin-top: 6px; }
.expense-item .ei-details-summary {
  font-size: 0.75rem; color: var(--sage); font-weight: 600;
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 4px;
  user-select: none;
}
.expense-item .ei-details-summary::before { content: "▶"; font-size: .6rem; transition: transform .15s; }
.expense-item .ei-details[open] > .ei-details-summary::before { transform: rotate(90deg); }
.expense-item .ei-details-summary::-webkit-details-marker { display: none; }
.expense-item .ei-items {
  list-style: none; margin: 6px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.expense-item .ei-items li {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 0.78rem; color: var(--ink-2);
}
.expense-item .ei-items .ei-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expense-item .ei-items .ei-item-qty { color: var(--ink-2); white-space: nowrap; }
.expense-item .ei-items .ei-item-price { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }

/* 支店タグ（支店単一 entry のとき branch-head を出さず行内に表示） */
.ei-branch {
  display: inline-block; font-size: 0.7rem;
  background: var(--sage-light); color: var(--sage-deep);
  padding: 1px 5px; border-radius: 6px; white-space: nowrap; margin-right: 2px;
}

/* インライン編集フォーム（一覧・日付モーダル共通） */
.ei-inline-form { width: 100%; padding: 4px 0; }
.day-inline-form { padding: 0; }
.ei-inline-row {
  display: flex; gap: 6px; margin-bottom: 6px;
}
.ei-inline-row input, .ei-inline-row select {
  flex: 1; min-width: 0;
  font-size: 0.85rem; padding: 7px 9px;
  border: 1.5px solid var(--border); border-radius: var(--r-input);
  background: var(--stone); color: var(--ink); outline: none;
}
.ei-inline-row input:focus, .ei-inline-row select:focus {
  border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-light);
}
.ei-inline-items-note {
  font-size: 0.72rem; color: var(--muted); margin-bottom: 6px; padding-left: 2px;
}
.ei-inline-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ei-inline-actions .primary { font-size: 0.85rem; padding: 7px 16px; }
.ei-inline-actions .ei-cancel-btn {
  font-size: 0.85rem; padding: 7px 12px;
  background: none; border: 1.5px solid var(--border); border-radius: var(--r-btn);
  color: var(--ink-2); cursor: pointer;
}
.ei-inline-actions .ei-full-edit-btn {
  font-size: 0.82rem; padding: 6px 10px;
  background: none; border: 1.5px solid var(--border); border-radius: var(--r-btn);
  color: var(--muted); cursor: pointer; margin-left: auto;
}
.ei-inline-actions .ei-cancel-btn:hover { background: var(--stone); }

/* 明細インライン編集アコーディオン */
.ei-items-edit-details {
  margin: 8px 0 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
}
.ei-items-edit-summary {
  list-style: none;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sage-deep);
  background: var(--sage-light);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ei-items-edit-summary::before { content: "▶"; font-size: .58rem; transition: transform .15s; }
.ei-items-edit-details[open] > .ei-items-edit-summary::before { transform: rotate(90deg); }
.ei-items-edit-summary::-webkit-details-marker { display: none; }
.ei-items-edit-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ei-item-edit-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ei-item-edit-main {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ei-item-edit-qty {
  display: flex;
  gap: 6px;
  padding-left: 2px;
}
.ei-item-edit-qty .ei-item-q,
.ei-item-edit-qty .ei-item-u {
  padding: 5px 8px;
  font-size: 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-btn);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
}
.ei-item-edit-qty .ei-item-q { width: 72px; flex-shrink: 0; }
.ei-item-edit-qty .ei-item-u { width: 88px; flex-shrink: 0; }
.ei-item-edit-qty .ei-item-q:focus,
.ei-item-edit-qty .ei-item-u:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-light);
  outline: none;
}
.ei-item-edit-main .ei-item-n {
  flex: 2;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.82rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-btn);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
}
.ei-item-edit-main .ei-item-p {
  flex: 1;
  min-width: 64px;
  padding: 6px 8px;
  font-size: 0.82rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-btn);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.ei-item-edit-main .ei-item-n:focus,
.ei-item-edit-main .ei-item-p:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-light);
  outline: none;
}
.ei-item-rm {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.ei-item-rm:hover { background: #fee2e2; color: #dc2626; }
.ei-item-rm:active { background: #fecaca; }
.ei-item-add {
  align-self: flex-start;
  margin-top: 2px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sage-deep);
  background: none;
  border: 1.5px dashed var(--sage);
  border-radius: var(--r-btn);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}
.ei-item-add:hover { background: var(--sage-light); }

/* 日付モーダルの前後日ナビ */
.day-nav {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.day-nav button {
  flex: 1; font-size: 0.92rem; font-weight: 600;
  padding: 12px 12px; min-height: 48px;
  background: var(--stone); border: 1.5px solid var(--border);
  border-radius: var(--r-btn); cursor: pointer; color: var(--ink-2);
  transition: background 0.15s;
}
.day-nav button:hover:not(:disabled) { background: var(--sage-light); color: var(--sage-deep); }
.day-nav button:active:not(:disabled) { background: var(--sage-light); }
.day-nav button:disabled { opacity: 0.38; cursor: default; }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 24px 20px;
  font-size: 0.88rem;
  line-height: 1.7;
}

/* ============================================================
   LOGIN
   ============================================================ */
/* ============================================================
   LOGIN SCREEN — 共通（モバイルファースト）
   ターゲット：忙しいお母さん・機械苦手・家計/料理に自信なし
   ============================================================ */
.login-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: #1E5C3A;
  overflow-y: auto;
}

/* ---- ブランドエリア（スマホ：上部・緑背景） ---- */
.login-brand {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 48px 28px 36px;
  min-height: 0;
}
.login-brand-logo {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  font-size: 3rem; font-weight: 800;
  color: #fff; letter-spacing: .04em; line-height: 1;
}
.login-brand-sub {
  font-size: .78rem; color: rgba(255,255,255,.45);
  letter-spacing: .18em; margin-top: 6px; margin-bottom: 18px;
}
.login-brand-tagline {
  font-size: 1.05rem; color: rgba(255,255,255,.82);
  line-height: 1.85; margin-bottom: 28px; font-weight: 500;
}

/* 機能リスト */
.login-features {
  list-style: none;
  display: flex; flex-direction: column; gap: 12px;
  text-align: left; max-width: 300px;
}
.login-features li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: .88rem; color: rgba(255,255,255,.7);
  line-height: 1.5;
}
.lf-icon { font-size: 1.15rem; flex-shrink: 0; margin-top: 1px; }

/* PC専用：ペルソナへの共感メッセージ（スマホでは非表示） */
.login-brand-persona { display: none; }

/* ---- ログインカード（スマホ：下部ボトムシート） ---- */
.login-card {
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 28px 28px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  box-shadow: 0 -8px 40px rgba(0,0,0,.22);
}
.login-card-eyebrow {
  font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  color: var(--primary); text-transform: uppercase;
  margin-bottom: 8px;
}
.login-card-title {
  font-size: 1.15rem; font-weight: 800;
  color: var(--ink); margin-bottom: 22px; line-height: 1.4;
}
/* スマホ専用改行（PCでは非表示） */
.sp-only { display: inline; }

.login-trust {
  margin-top: 14px !important;
  font-size: .73rem !important;
  color: var(--muted) !important;
  line-height: 1.6 !important;
}
.login-blog-link {
  margin-top: 10px;
  font-size: .73rem;
  text-align: center;
  color: var(--muted);
}
.login-blog-link a {
  color: var(--muted);
  text-decoration: none;
}
.login-blog-link a:hover { text-decoration: underline; }
.login-legal-link {
  margin-top: 4px;
  font-size: .68rem;
  text-align: center;
  color: var(--muted);
  opacity: .75;
}
.login-legal-link a { color: var(--muted); text-decoration: none; }
.login-legal-link a:hover { text-decoration: underline; }
.google-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 17px; font-size: 1rem; font-weight: 700;
  border: 1.5px solid var(--border); background: #fff; border-radius: 14px;
  cursor: pointer; color: var(--ink); font-family: inherit; min-height: 54px;
  transition: background .15s, box-shadow .15s;
}
.google-btn:hover { background: var(--stone); box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.google-btn .g-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: #4285F4; color: #fff; font-weight: 800; font-size: 0.88rem;
  flex-shrink: 0;
}
.login-error { color: var(--danger); font-size: 0.83rem; margin-top: 14px; }

/* メール/パスワード認証フォーム */
.email-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font-size: 0.82rem; }
.email-divider::before,.email-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.email-form { display: flex; flex-direction: column; gap: 10px; }
.email-input { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--r-btn); font-size: 0.95rem; background: var(--bg); color: var(--fg); box-sizing: border-box; }
.email-input:focus { outline: none; border-color: var(--primary); }
.email-submit-btn { width: 100%; padding: 13px; background: var(--primary); color: #fff; border: none; border-radius: var(--r-btn); font-size: 1rem; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.email-submit-btn:hover { opacity: .88; }
.email-submit-btn:disabled { opacity: .5; cursor: default; }
.email-sub-actions { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.email-text-btn { background: none; border: none; color: var(--primary); font-size: 0.8rem; cursor: pointer; padding: 0; text-decoration: underline; }
.inapp-warning {
  background: var(--badge-mid-bg); border: 1.5px solid var(--badge-mid-br);
  border-radius: var(--r-card-sm); padding: 16px 14px; margin-bottom: 20px; text-align: left;
}
.inapp-warning p { color: var(--badge-mid-ink); margin: 0 0 8px; font-size: 0.88rem; line-height: 1.6; }
.inapp-warning p:last-of-type { margin-bottom: 12px; }
.inapp-hint strong { color: var(--warn); }
.copy-url-btn {
  width: 100%; padding: 11px; font-size: 0.9rem; font-weight: 700;
  background: var(--warn); color: #fff; border: none; border-radius: 11px;
  cursor: pointer; font-family: inherit;
}
.copy-url-btn:active { opacity: 0.85; }

/* ============================================================
   LOGIN SCREEN — PC スプリットレイアウト（900px以上）
   ============================================================ */
@media (min-width: 900px) {
  .login-screen {
    flex-direction: row;
    overflow: hidden;
  }

  /* 左パネル：緑のブランドエリア */
  .login-brand {
    flex: 1;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    padding: 72px 9% 72px 9%;
    position: relative;
    overflow: hidden;
    /* 上から下へ微妙なグラデーション */
    background: linear-gradient(160deg, #245f3c 0%, #1E5C3A 55%, #163f28 100%);
  }

  /* 背景装飾：薄い「取」の大文字 */
  .login-brand::before {
    content: "取";
    position: absolute;
    right: -80px; bottom: -120px;
    font-size: 34rem; line-height: 1;
    font-family: "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
    font-weight: 800;
    color: rgba(255,255,255,.04);
    pointer-events: none; user-select: none;
  }

  .login-brand-logo { font-size: 4.5rem; }

  .login-brand-sub { text-align: left; }

  .login-brand-tagline {
    font-size: 1.5rem;
    text-align: left;
    margin-bottom: 40px;
    color: rgba(255,255,255,.88);
  }

  .login-features { gap: 16px; max-width: none; }
  .login-features li {
    font-size: .96rem;
    color: rgba(255,255,255,.72);
  }
  .lf-icon { font-size: 1.2rem; }

  /* ペルソナメッセージ（PCのみ表示） */
  .login-brand-persona {
    display: block;
    margin-top: 48px;
    font-size: .88rem;
    color: rgba(255,255,255,.4);
    line-height: 1.8;
    border-left: 2px solid rgba(255,255,255,.15);
    padding-left: 16px;
  }

  /* 右パネル：ログインフォーム */
  .login-card {
    width: 460px;
    flex-shrink: 0;
    display: flex; flex-direction: column;
    align-items: stretch; justify-content: center;
    border-radius: 0;
    box-shadow: -16px 0 56px rgba(0,0,0,.18);
    padding: 72px 56px;
    text-align: left;
  }

  .login-card-eyebrow { margin-bottom: 10px; }

  .login-card-title {
    font-size: 1.6rem;
    margin-bottom: 32px;
    line-height: 1.3;
  }

  /* PCでは改行タグを非表示 */
  .sp-only { display: none; }

  .google-btn {
    padding: 18px 20px;
    font-size: 1.05rem;
    border-radius: 12px;
  }

  .login-trust { text-align: center; }
}

/* ============================================================
   MODAL BASE
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 16px; z-index: 50; overflow-y: auto;
}
.modal-box {
  background: var(--card); border-radius: var(--radius);
  padding: 20px; width: 100%; max-width: 560px; margin-top: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-height: calc(100vh - 80px); overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.modal-head button {
  background: var(--stone); border: none; font-size: 1rem; cursor: pointer; color: var(--muted);
  width: 44px; height: 44px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.modal-head button:hover { background: var(--border); color: var(--ink); }

/* ============================================================
   COMPARE MODAL
   ============================================================ */
#compare-search { margin: 0 0 12px; }
.compare-list { display: flex; flex-direction: column; gap: 10px; }
.cmp-item { border: 1.5px solid var(--border); border-radius: var(--r-card-sm); padding: 12px 14px; }
.cmp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.cmp-name { font-weight: 700; }
.cmp-best { color: var(--sage); font-weight: 700; white-space: nowrap; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.cmp-stores { display: flex; flex-direction: column; gap: 4px; }
.cmp-store { display: flex; justify-content: space-between; font-size: 0.83rem; color: var(--muted); }
.cmp-store.cmp-min { color: var(--ink); font-weight: 700; }
.cmp-date { color: var(--muted); font-weight: 400; font-size: 0.72rem; }
.cmp-branch { color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.cmp-row { display: flex; flex-direction: column; gap: 1px; }
.cmp-low { font-size: 0.72rem; color: var(--muted); padding-left: 10px; }
.cmp-tag { background: var(--badge-mid-bg); color: var(--badge-mid-ink); border-radius: 4px; padding: 0 4px; margin-left: 2px; font-size: 0.68rem; font-weight: 700; }
.cmp-sale { color: #D97706; font-weight: 700; font-size: 0.78rem; white-space: nowrap; }

/* ============================================================
   CALENDAR
   ============================================================ */
.cal-hint { color: var(--muted); font-size: 0.75rem; }
.calendar { width: 100%; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr) 1.2fr; gap: 3px; }
.cal-dow { text-align: center; font-size: 0.68rem; color: var(--muted); padding: 3px 0; font-weight: 700; letter-spacing: .02em; }
.cal-dow.cal-week-h { color: var(--sage); }
.cal-day {
  position: relative; min-height: 52px;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 4px; display: flex; flex-direction: column; gap: 2px;
  cursor: pointer; background: var(--card); overflow: hidden; transition: border-color .15s;
}
.cal-day:hover { border-color: var(--sage); background: var(--stone); }
.cal-day.cal-out { background: var(--stone); color: var(--muted); cursor: default; opacity: 0.45; }
.cal-day.cal-out:hover { border-color: var(--border); }
.cal-day.cal-today { border-color: var(--sage); box-shadow: 0 0 0 1px var(--sage) inset; }
.cal-day.cal-has { background: var(--sage-light); }
.cal-num { font-size: 0.75rem; color: var(--muted); font-weight: 600; line-height: 1; }
.cal-today .cal-num { color: var(--sage); font-weight: 800; }
.cal-amt { font-size: 0.68rem; font-weight: 700; color: var(--sage); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.cal-week {
  display: flex; align-items: center; justify-content: flex-end;
  min-height: 52px; padding: 4px 6px;
  font-size: 0.72rem; font-weight: 700; color: var(--sage);
  background: var(--stone); border-radius: 8px; text-align: right; font-variant-numeric: tabular-nums;
}
.cal-week-click { cursor: pointer; background: var(--sage-light); flex-direction: column; justify-content: center; gap: 1px; }
.cal-week-click::after { content: "内訳▾"; font-size: 0.55rem; font-weight: 600; opacity: 0.75; }
.cal-week-click:active { filter: brightness(0.95); }
.cal-meal { font-size: 0.65rem; line-height: 1; margin-top: auto; }

/* ============================================================
   DAY / WEEK MODALS
   ============================================================ */
.day-total-line { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 14px; }
.day-total-line .label { color: var(--muted); font-size: 0.83rem; }
.day-total-line .value { font-size: 1.6rem; font-weight: 800; color: var(--sage); font-variant-numeric: tabular-nums; }
.day-meal-plan { background: var(--sage-light); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.day-meal-title { font-size: 0.85rem; font-weight: 700; color: var(--sage); margin: 0 0 8px; }
.day-meal-content { display: flex; flex-direction: column; gap: 5px; }
.meal-row { display: flex; gap: 8px; align-items: center; }
.meal-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); width: 2.5rem; flex-shrink: 0; }
.meal-text { font-size: 0.88rem; color: var(--ink); flex: 1; }
.meal-arrow { font-size: 0.7rem; color: var(--sage); flex-shrink: 0; }
.meal-row-tap { cursor: pointer; border-radius: 8px; padding: 4px 6px; margin: -4px -6px; }
.meal-row-tap:hover { background: rgba(0,0,0,0.05); }
.meal-recipe-detail { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 0.85rem; }

/* 献立インライン編集エディタ */
.meal-editor { display: flex; flex-direction: column; gap: 8px; }
.meal-editor-row { display: flex; flex-direction: column; gap: 3px; }
.meal-editor-label { font-size: 0.72rem; font-weight: 700; color: var(--sage); }
.meal-editor-input-wrap { display: flex; align-items: center; gap: 5px; }
.meal-editor-input {
  flex: 1; min-width: 0;
  padding: 7px 10px; font-size: 0.88rem;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--ink);
}
.meal-editor-input:focus { outline: none; border-color: var(--sage); }
.meal-del-btn, .meal-recipe-btn {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  font-size: 1rem; padding: 4px 5px; border-radius: 7px; line-height: 1;
}
.meal-del-btn:hover { background: var(--petal); }
.meal-recipe-btn:hover { background: var(--sage-light); }

/* カレンダー追加スロット選択パネル */
.recipe-meal-slot-picker { padding: 12px 0 4px; border-top: 1px solid var(--border); }
.meal-slot-title { font-size: 0.83rem; color: var(--muted); margin: 0 0 10px; }
.meal-slot-btns { display: flex; gap: 8px; margin-bottom: 10px; }
.meal-slot-btns button {
  flex: 1; padding: 10px 6px; border: 1.5px solid var(--border);
  border-radius: 10px; background: var(--card); color: var(--ink);
  font-size: 0.85rem; cursor: pointer; font-weight: 600;
}
.meal-slot-btns button:hover { background: var(--sage-light); border-color: var(--sage); }

.day-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.day-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--r-card-sm); background: var(--card); }
.day-row-top { display: flex; align-items: center; gap: 8px; }
.day-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.day-row-store { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.day-row-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.day-row button { background: none; border: none; cursor: pointer; font-size: 1rem; min-width: 40px; min-height: 40px; border-radius: 10px; flex-shrink: 0; color: var(--muted); }
.day-row button:active { background: var(--stone); }
/* 日付モーダル内の明細アコーディオン */
.day-row .ei-details { margin-top: 4px; }
.day-row .ei-details-summary {
  font-size: 0.75rem; color: var(--sage); font-weight: 600;
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 4px;
  user-select: none;
}
.day-row .ei-details-summary::before { content: "▶"; font-size: .6rem; transition: transform .15s; }
.day-row .ei-details[open] > .ei-details-summary::before { transform: rotate(90deg); }
.day-row .ei-details-summary::-webkit-details-marker { display: none; }
.day-row .ei-items {
  list-style: none; margin: 6px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.day-row .ei-items li {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 0.78rem; color: var(--ink-2);
}
.day-row .ei-items .ei-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-row .ei-items .ei-item-qty { color: var(--ink-2); white-space: nowrap; }
.day-row .ei-items .ei-item-price { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.day-form { border-top: 1px solid var(--border); padding-top: 14px; }
.day-form h3 { margin: 0 0 12px; font-size: 0.95rem; font-weight: 700; }

/* ============================================================
   RECIPE MODAL
   ============================================================ */
.recipe-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.recipe-label { font-size: 0.78rem; color: var(--muted); white-space: nowrap; min-width: 2.5em; font-weight: 600; }
.recipe-date-range-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.recipe-date-range-row input[type="date"] {
  flex: 1; padding: 5px 8px; font-size: 0.82rem; border: 1.5px solid var(--border);
  border-radius: 8px; background: var(--stone); color: var(--ink); min-width: 0;
}
.recipe-date-sep { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.recipe-plan-start-hint { font-size: 0.75rem; color: var(--muted); }
.recipe-plan-range-error { color: var(--c-err, #c0392b); font-size: 0.8rem; margin: -6px 0 8px; }
#recipe-plan-start { padding: 5px 8px; font-size: 0.82rem; border: 1.5px solid var(--border); border-radius: 8px; background: var(--stone); color: var(--ink); }
.recipe-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.recipe-tab {
  padding: 5px 13px; border-radius: 100px; border: 1.5px solid var(--border);
  background: none; cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--muted);
}
.recipe-tab.active { background: var(--sage); color: #fff; border-color: var(--sage); }
.recipe-useup-row { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--ink); margin-bottom: 8px; cursor: pointer; }
.recipe-useup-row input[type="checkbox"] {
  width: 18px; height: 18px; flex-shrink: 0; padding: 0;
  appearance: auto; -webkit-appearance: checkbox;
  accent-color: var(--sage); cursor: pointer;
}
.recipe-ingredients { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; margin-bottom: 10px; }
.recipe-chip { background: var(--sage-light); color: var(--sage); border-radius: 100px; padding: 4px 11px; font-size: 0.82rem; font-weight: 600; border: none; }
.recipe-chip-budget { display: inline-flex; align-items: center; gap: 1px; padding-right: 7px; }
.chip-remove {
  background: none; border: none; padding: 0 1px 0 3px; font-size: 0.75rem;
  color: var(--sage); cursor: pointer; line-height: 1; font-family: inherit;
  opacity: 0.65; flex-shrink: 0;
}
.chip-remove:hover { opacity: 1; }
.recipe-budget-info {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; background: var(--sage-light); border-radius: var(--r-input);
  padding: 7px 12px; margin-bottom: 8px; flex-wrap: wrap;
}
#recipe-budget-status { font-size: 0.81rem; color: var(--ink-2); }
#recipe-budget-total { font-size: 0.87rem; font-weight: 700; color: var(--sage); white-space: nowrap; }
.recipe-empty-note, .recipe-empty-hint { font-size: 0.83rem; color: var(--muted); }
.recipe-servings-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.recipe-servings-row label { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; flex-direction: row; color: var(--ink); }
.recipe-servings-row input { width: 54px; text-align: center; }

/* 家族構成 */
.family-section { margin-top: 10px; }
.family-toggle {
  width: 100%; text-align: left; background: var(--sage-light); border: none;
  border-radius: var(--r-btn); padding: 10px 14px; font-size: 0.83rem;
  font-weight: 600; color: var(--sage); cursor: pointer; font-family: inherit;
}
.family-toggle.active { background: var(--sage); color: #fff; }
.family-panel { margin-top: 8px; padding: 14px; background: var(--stone); border-radius: 14px; }
.family-hint { font-size: 0.78rem; color: var(--muted); margin: 0 0 10px; line-height: 1.5; }
.family-grid { display: flex; flex-direction: column; gap: 6px; }
.family-row {
  display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--ink);
  flex-direction: row;
}
.family-row span:first-child { flex: 1; }
.family-row input {
  width: 56px; min-height: 44px; text-align: center; padding: 12px 6px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--ink);
  appearance: textfield; -moz-appearance: textfield;
}
.recipe-result { line-height: 1.7; font-size: 0.9rem; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 10px; }
.recipe-result h3 { font-size: 1rem; font-weight: 700; margin: 14px 0 4px; }
.recipe-result h4 { font-size: 0.9rem; font-weight: 700; margin: 10px 0 2px; }
.recipe-result p { margin: 2px 0; }
.recipe-result ul, .recipe-result ol { padding-left: 1.5em; margin: 2px 0 8px; }

.recipe-post-actions { display: flex; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.recipe-post-actions button { flex: 1; font-size: 0.88rem; padding: 11px; }

/* 料理ごと保存パネル */
.recipe-dish-selector { margin-top: 14px; padding: 14px; background: var(--sage-light); border-radius: 14px; }
.dish-selector-title { font-size: 0.88rem; font-weight: 700; color: var(--sage); margin: 0 0 10px; }
.recipe-dish-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.dish-select-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; color: var(--ink); cursor: pointer;
  padding: 10px 12px; background: var(--card); border-radius: 11px;
}
.dish-select-row input[type="checkbox"] {
  width: 18px; height: 18px; flex-shrink: 0; padding: 0;
  appearance: auto; -webkit-appearance: checkbox;
  accent-color: var(--sage); cursor: pointer;
}
.dish-selector-actions { display: flex; gap: 8px; }
.dish-selector-actions button { flex: 1; font-size: 0.88rem; padding: 11px; }

/* 朝・昼・夜 3択カード選択UI */
.recipe-select-picker { margin-top: 16px; }
.meal-select-group { margin-bottom: 18px; }
.meal-select-heading { font-size: 0.92rem; font-weight: 700; color: var(--sage); margin-bottom: 8px; }
.meal-select-cards { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 480px) { .meal-select-cards { flex-direction: row; } }
.meal-select-card {
  flex: 1; padding: 12px 14px; background: var(--bg);
  border: 2px solid var(--border); border-radius: var(--r-btn);
  font-size: 0.88rem; color: var(--fg); cursor: pointer;
  text-align: left; transition: border-color .15s, background .15s;
  min-height: 48px;
}
.meal-select-card:hover { border-color: var(--sage); background: var(--sage-light); }
.meal-select-card.selected {
  border-color: var(--sage); background: var(--sage-light);
  font-weight: 600; color: var(--sage-dark, var(--sage));
}
.meal-select-card-title { display: block; }
.recipe-select-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.recipe-select-actions button { flex: 1; min-width: 140px; font-size: 0.9rem; padding: 12px 10px; border-radius: var(--r-btn); }
.recipe-select-actions button:disabled { opacity: .5; cursor: default; }
/* 汎用ボタンバリアント */
.btn-primary { background: var(--sage); color: #fff; border: none; border-radius: var(--r-btn); cursor: pointer; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--border); border-radius: var(--r-btn); cursor: pointer; }
.btn-ghost:hover { background: var(--stone); color: var(--ink); }

/* 難易度バッジ */
.recipe-difficulty { display: flex; align-items: center; gap: 6px; margin: 2px 0 8px; font-size: 0.8rem; color: var(--muted); }
.diff-badge { font-size: 0.84rem; font-weight: 700; padding: 3px 10px; border-radius: 100px; }
.diff-easy { background: var(--badge-ok-bg);   color: var(--badge-ok-ink); }
.diff-mid  { background: var(--badge-mid-bg);  color: var(--badge-mid-ink); }
.diff-hard { background: var(--badge-over-bg); color: var(--badge-over-ink); }

/* ============================================================
   BUDGET
   ============================================================ */
#budget-form { display: flex; flex-direction: column; gap: 12px; }
.budget-inputs { display: flex; flex-direction: column; gap: 10px; }
.budget-input-row { display: flex; align-items: center; gap: 10px; }
.budget-cat-label { width: 80px; flex-shrink: 0; font-size: 0.86rem; font-weight: 600; }
.budget-input-wrap { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--r-input); overflow: hidden; flex: 1; background: var(--card); }
.budget-yen-prefix { padding: 0 8px; color: var(--muted); font-size: 0.9rem; }
.budget-input-wrap input { border: none; border-radius: 0; padding: 9px 8px 9px 0; }
.budget-input-wrap input:focus { outline: none; box-shadow: none; }
.budget-row { display: flex; flex-direction: column; gap: 5px; padding: 4px 0; }
.budget-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 0.83rem; }
.budget-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.budget-amount.budget-warn { color: var(--warn); }
.budget-amount.budget-over { color: var(--danger); }
.budget-limit { font-size: 0.75rem; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.budget-bar-wrap { height: 8px; background: var(--stone); border-radius: 100px; overflow: hidden; }
.budget-bar { height: 100%; background: var(--sage); border-radius: 100px; transition: width .4s; }
.budget-bar.budget-bar-warn { background: var(--warn); }
.budget-bar.budget-bar-over { background: var(--danger); }

/* ============================================================
   TREND SVG
   ============================================================ */
.trend-svg { width: 100%; max-width: 400px; display: block; margin: 0 auto; }
.trend-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 4px 12px;
  margin: 12px auto 0;
  max-width: 400px;
  padding: 0 4px;
}
.trend-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.78rem;
}
.trend-legend-dot {
  width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0;
}
.trend-legend-cat { color: var(--ink-2); flex: 1; }
.trend-legend-amt { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============================================================
   SAVED RECIPES
   ============================================================ */
.saved-recipes-list { display: flex; flex-direction: column; gap: 10px; }
.saved-recipe-card { border: 1.5px solid var(--border); border-radius: var(--r-card-sm); padding: 14px; }
.saved-recipe-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.saved-recipe-title { font-weight: 700; }
.saved-recipe-meta { font-size: 0.75rem; color: var(--muted); }
.saved-recipe-actions { display: flex; gap: 8px; }
.saved-recipe-actions button { font-size: 0.83rem; padding: 8px 14px; }
.sr-del-btn { color: var(--danger); }
.back-btn { background: none; border: none; color: var(--sage); font-size: 0.88rem; cursor: pointer; padding: 4px 0; margin-bottom: 10px; font-weight: 600; }
.saved-recipe-detail-title { margin: 4px 0 14px; font-size: 1rem; font-weight: 700; }
.saved-recipe-detail-actions { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.saved-recipe-detail-actions button { width: 100%; font-size: 0.9rem; padding: 13px; }

/* ============================================================
   SHOPPING LIST
   ============================================================ */
.shopping-add-form { display: flex; gap: 8px; margin-bottom: 14px; }
.shopping-add-form input { flex: 1; }
.shopping-add-form button { flex-shrink: 0; padding: 11px 18px; }
.shopping-items { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.shopping-store-header {
  font-size: 0.78rem; font-weight: 700; color: var(--sage);
  background: var(--sage-light); border-radius: var(--r-btn);
  padding: 6px 10px; margin-top: 10px; letter-spacing: 0.03em;
}
.shopping-store-header:first-child { margin-top: 0; }
.shopping-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--card); }
.shopping-item.done { opacity: 0.45; }
.shopping-item.done .shopping-check span { text-decoration: line-through; }
.shopping-check { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; flex-direction: row; color: var(--ink); }
.shopping-check input[type="checkbox"] {
  width: 18px; height: 18px; flex-shrink: 0; padding: 0;
  appearance: auto; -webkit-appearance: checkbox;
  accent-color: var(--sage); cursor: pointer;
}
.shopping-check-text { display: flex; flex-direction: column; gap: 1px; }
.shopping-check-name { font-size: 0.92rem; font-weight: 600; }
.shopping-check-store { font-size: 0.75rem; color: var(--muted); }
.shopping-del { background: none; border: none; color: var(--muted); font-size: 0.9rem; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.shopping-del:hover { color: var(--danger); }
.shopping-clear-btn { width: 100%; background: none; border: 1.5px solid var(--border); color: var(--muted); font-size: 0.83rem; padding: 10px; margin-top: 4px; border-radius: var(--r-btn); }

/* ============================================================
   BOTTOM NAV (mobile only)
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 30;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.07);
}
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 0 10px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  min-height: 56px;
  font-family: inherit;
}
.bnav-item:hover { color: var(--sage); }
.bnav-item.active { color: var(--sage); }
.bnav-icon { font-size: 1.3rem; line-height: 1; }
.bnav-label { font-size: 0.68rem; font-weight: 700; letter-spacing: .02em; }

/* FAB */
.fab {
  position: fixed;
  bottom: calc(56px + env(safe-area-inset-bottom, 0) + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: 62px; height: 62px;
  border-radius: 20px;
  background: var(--sage);
  color: #fff;
  border: none;
  box-shadow: 0 6px 24px rgba(75,122,94,0.5), 0 2px 8px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  z-index: 31;
  transition: transform 0.15s, box-shadow 0.15s;
}
.fab:hover { filter: brightness(1.08); }
.fab:active { transform: translateX(-50%) scale(0.94); box-shadow: 0 3px 12px rgba(75,122,94,0.4); }

/* ============================================================
   PC NAV BAR
   ============================================================ */
.pc-nav {
  display: none;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 53px;
  z-index: 9;
}
.pc-nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 44px;
}
.pc-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--r-btn);
  white-space: nowrap;
  position: relative;
  transition: color .13s, background .13s;
}
.pc-nav-item:hover { color: var(--sage); background: var(--sage-light); }
.pc-nav-item.pcnav-accent {
  color: var(--sage);
  background: var(--sage-light);
}
.pc-nav-item.pcnav-accent:hover { filter: brightness(0.95); }
.pcnav-icon { font-size: 1rem; line-height: 1; }
.pcnav-label { font-size: 0.8rem; }
.pcnav-divider { width: 1px; height: 18px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

/* ============================================================
   SMALL MOBILE TWEAKS
   ============================================================ */
@media (max-width: 520px) {
  /* 店名/支店名 行だけ縦並びに（日付/金額は2列維持） */
  .row.row-store { flex-direction: column; }
  .cal-grid { gap: 2px; }
  .cal-day, .cal-week { min-height: 44px; }
  .cal-amt, .cal-week { font-size: 0.6rem; }
  .cal-day { padding: 2px; }
  /* モバイルでは保存レシピ・最安値・CSV・買い物をヘッダーから省略（ボトムナビ・PCナビ優先） */
  #saved-recipes-btn, #compare-btn, #export-btn, #shopping-btn { display: none; }
  /* お得情報をカテゴリバーより先に表示（埋もれ防止） */
  .summary-body { display: flex; flex-direction: column; }
  #lowest-alerts { order: -1; margin-top: 0; margin-bottom: 12px; }
}

/* ============================================================
   PC LAYOUT (≥ 768px)
   ============================================================ */
@media (min-width: 768px) {
  /* hide mobile-only elements */
  .bottom-nav, .fab, .cam-only { display: none; }

  /* PC navバーを表示 */
  .pc-nav { display: block; }

  /* PC navに移動したボタンをヘッダーから隠す */
  #shopping-btn, #saved-recipes-btn, #compare-btn { display: none; }

  main {
    padding-bottom: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "summary  calendar"
      "capture  calendar"
      "form     list    ";
    align-items: start;
    gap: 16px;
  }
  .summary      { grid-area: summary; }
  .calendar-card { grid-area: calendar; }
  .capture      { grid-area: capture; }
  .form-card    { grid-area: form; }
  .list-card    { grid-area: list; }

  .topbar { padding: 12px 24px; }
  .topbar h1 { font-size: 1.1rem; }
  .card { padding: 20px; }
  .summary-body { padding: 16px 20px 18px; }
  .summary-hero { padding: 22px 20px 20px; }
  .summary-total .value { font-size: 2.6rem; }
}

@media (min-width: 1024px) {
  main { max-width: 1040px; padding: 20px 24px 24px; }
  .pc-nav-inner { padding: 0 24px; }
}

/* ============================================================
   LIST FILTER ROW (G-2)
   ============================================================ */
.list-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.list-filter-row input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font-size: 0.88rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  background: var(--stone);
  color: var(--ink);
}
.list-filter-row select {
  width: auto;
  flex-shrink: 0;
  padding: 9px 10px;
  font-size: 0.83rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  background: var(--stone);
  color: var(--ink);
}
.list-filter-count {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
  margin: -4px 0 8px;
}

/* ============================================================
   HOUSEHOLD MODAL (G-5)
   ============================================================ */
.household-status-box {
  padding: 10px 14px;
  border-radius: var(--r-card-sm);
  background: var(--sage-light);
  color: var(--sage);
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.household-section {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.household-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 6px;
}
.household-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}
.household-join-row {
  display: flex;
  gap: 8px;
}
.household-join-row input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
}
.household-join-row button {
  flex-shrink: 0;
  padding: 11px 18px;
}
/* inline code span in JS-generated status HTML */
.household-code-display {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--sage);
  font-variant-numeric: tabular-nums;
  background: var(--stone);
  padding: 2px 10px;
  border-radius: 6px;
}
.household-leave-btn {
  width: 100%;
  color: var(--danger);
  border-color: var(--danger);
  background: none;
  font-size: 0.88rem;
  padding: 10px;
}
.household-leave-btn:hover {
  background: var(--petal);
}

/* ===== Stripe 課金 / アップグレードモーダル ===================================== */

/* PRO バッジ（topbar） */
.premium-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .06em;
  box-shadow: 0 2px 6px rgba(249,115,22,.35);
}

/* 使用量バー */
.usage-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--stone);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--ink-sub);
}
.usage-bar .usage-count { flex: 1; }
.usage-bar .usage-upgrade {
  flex-shrink: 0;
  padding: 5px 12px;
  font-size: 0.78rem;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

/* アップグレードモーダル */
.upgrade-modal-box {
  max-width: 480px;
}
.upgrade-content {
  padding: 0 4px 8px;
}
.upgrade-limit-msg {
  font-size: 0.9rem;
  color: var(--ink-sub);
  margin-bottom: 20px;
  line-height: 1.6;
}
.upgrade-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 480px) {
  .upgrade-plans { grid-template-columns: 1fr; }
}
.upgrade-plan {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px;
  background: var(--card);
}
.upgrade-plan--featured {
  border-color: #f97316;
  background: color-mix(in srgb, var(--card) 90%, #f97316 10%);
}
.plan-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}
.plan-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: var(--ink);
}
.plan-price {
  color: #f97316;
  font-size: 1.1rem;
}
.plan-period {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink-sub);
}
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-sub);
  line-height: 1.9;
}
.plan-features strong { color: var(--ink); }
.upgrade-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(249,115,22,.4);
  transition: opacity .15s, transform .1s;
}
.upgrade-btn:hover { opacity: .9; transform: translateY(-1px); }
.upgrade-btn:active { transform: translateY(0); }
.upgrade-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.upgrade-hint {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--ink-sub);
  text-align: center;
  line-height: 1.6;
}

/* 招待コード入力 */
.beta-code-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.beta-code-label {
  font-size: 0.78rem;
  color: var(--ink-sub);
  text-align: center;
  margin-bottom: 8px;
}
.beta-code-row {
  display: flex;
  gap: 8px;
}
.beta-code-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--ink);
}
.beta-code-row button {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--ink-sub);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.beta-code-row button:disabled { opacity: .6; cursor: not-allowed; }
#beta-code-msg {
  margin-top: 8px;
  font-size: 0.82rem;
  text-align: center;
}

/* ===== アカウント・設定モーダル ===================================== */
.account-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}
.account-user-row {
  padding: 10px 14px;
  background: var(--stone);
  border-radius: 10px;
}
.account-email {
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
}
.account-plan-box {
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
}
.account-plan-free {
  background: var(--stone);
}
.account-plan-premium {
  background: linear-gradient(135deg, #1E4D38 0%, #2D7D52 100%);
  border-color: transparent;
}
.account-plan-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.account-plan-premium .account-plan-label { color: rgba(255,255,255,.6); }
.account-plan-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.account-plan-premium .account-plan-name { color: #fff; }
.account-plan-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.5;
}
.account-plan-premium .account-plan-desc { color: rgba(255,255,255,.75); }
.account-plan-expiry {
  font-size: 0.78rem; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.16); border-radius: 8px;
  padding: 7px 10px; margin: -6px 0 14px;
}
.account-action-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: opacity .15s;
}
.account-action-btn:hover { opacity: .85; }
.account-action-btn--sub {
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  margin-top: 0;
}
.account-portal-hint {
  font-size: 0.75rem;
  color: rgba(255,255,255,.6);
  text-align: center;
  margin: 8px 0 0;
  line-height: 1.5;
}
.account-action-btn--ghost {
  background: var(--stone);
  color: var(--ink-2);
  border: 1px solid var(--border);
}
.account-action-btn--logout {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  margin-top: 4px;
}

/* アカウントボタン（topbar） */
.topbar-btn--account {
  font-size: 1rem;
  padding: 6px 9px;
}

/* トースト通知 */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.9rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  animation: toast-in .25s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}
.toast-success {
  border-color: var(--sage);
  color: var(--sage);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* レシピウィザード */
.recipe-wizard-step { margin-bottom: 14px; }
.recipe-step-label { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.recipe-card-group { display: flex; gap: 8px; flex-wrap: wrap; }
.recipe-card {
  flex: 1; min-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 10px; border-radius: 12px; border: 2px solid var(--border);
  background: var(--stone); cursor: pointer; transition: border-color .15s, background .15s;
  font-family: inherit; text-align: center;
}
.recipe-card:hover { border-color: var(--sage); background: var(--sage-light); }
.recipe-card.active { border-color: var(--sage); background: var(--sage-light); }
.recipe-card-icon { font-size: 1.4rem; line-height: 1; }
.recipe-card-title { font-size: 0.88rem; font-weight: 700; color: var(--ink); }
.recipe-card-desc { font-size: 0.73rem; color: var(--muted); }
.recipe-advanced { margin-top: 6px; border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.recipe-advanced-toggle {
  display: block; padding: 10px 14px; font-size: 0.83rem; font-weight: 600;
  color: var(--muted); cursor: pointer; list-style: none; user-select: none;
  background: var(--stone);
}
.recipe-advanced-toggle::-webkit-details-marker { display: none; }
.recipe-advanced-toggle::before { content: "▶ "; font-size: 0.7rem; }
details[open] .recipe-advanced-toggle::before { content: "▼ "; }
.recipe-advanced-body { padding: 12px 14px; border-top: 1px solid var(--border); }
#recipe-budget-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; margin-top: 8px; }

/* 保存レシピ — カテゴリフィルター */
.saved-recipes-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sr-filter-tag {
  padding: 4px 12px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--stone); font-size: 0.78rem; font-weight: 600; color: var(--ink);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.sr-filter-tag:hover { border-color: var(--sage); }
.sr-filter-tag.active { border-color: var(--sage); background: var(--sage-light); color: var(--sage-dark, var(--sage)); }
.sr-category-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: var(--sage-light); color: var(--sage-dark, var(--sage));
  font-size: 0.72rem; font-weight: 600; margin-right: 4px;
}

/* 保存レシピ — 献立スロットピッカー */
.meal-slot-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.meal-slot-btns button { flex: 1; min-width: 80px; padding: 8px 6px; border-radius: 10px; font-size: 0.85rem; }
.saved-recipe-plan-date-row { margin-bottom: 8px; }
.saved-recipe-plan-date-row label { font-size: 0.83rem; font-weight: 600; }
.saved-recipe-plan-date-row input[type="date"] { margin-left: 6px; font-size: 0.85rem; }
