/* ==========================================================================
   components.css — カード、ボタン、チップ、グラフ、検索、トースト、スケルトン
   ========================================================================== */

/* --------------------------------------------------------------------------
   カード
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  animation: card-in 360ms var(--ease) both;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .card {
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
  }
}
.card.is-highlight { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.card-head .title { display: flex; align-items: center; gap: 6px; }
.card-head .title .wi { width: 18px; height: 18px; color: var(--text-sub); }
.card-sub { color: var(--text-sub); font-size: var(--fs-sub); white-space: nowrap; }

.section-label {
  font-size: var(--fs-sub);
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 0.04em;
  margin-top: var(--space-2);
}
.section-sub { font-weight: 400; margin-left: 4px; }
.hint { color: var(--text-sub); font-size: var(--fs-sub); line-height: 1.6; }

/* --------------------------------------------------------------------------
   ボタン
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: var(--fs-body);
  line-height: 1.2;
  transition: transform 120ms var(--ease), background-color 120ms var(--ease), opacity 120ms;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn .wi { width: 20px; height: 20px; }
.btn-block { width: 100%; padding-left: 12px; padding-right: 12px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(47, 128, 237, 0.3); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); font-weight: 500; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: var(--fs-sub); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  color: inherit;
  transition: background-color 120ms var(--ease);
}
.icon-btn .wi { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(127, 127, 127, 0.15); }
.icon-btn:active { background: rgba(127, 127, 127, 0.25); }
.icon-btn.is-spinning .wi { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   チップ
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms, color 120ms, border-color 120ms;
}
.chip .wi { width: 16px; height: 16px; }
.chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip-add { color: var(--text-sub); border-style: dashed; }

/* 地点チップ（背景の上） */
.place-chips .chip {
  color: var(--on-bg);
  background: rgba(127, 127, 127, 0.16);
  border-color: rgba(127, 127, 127, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.place-chips .chip.is-active { background: var(--card-strong); color: var(--text); border-color: transparent; box-shadow: var(--shadow); }

/* チェック式チップ・セグメント */
.chip-check { position: relative; padding: 0; }
.chip-check input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip-check span { padding: 6px 14px; border-radius: inherit; }
.chip-check:has(input:checked) { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip-check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

.segment {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  gap: 2px;
}
.segment-item { position: relative; flex: 1; }
.segment-item input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.segment-item span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  transition: background-color 120ms, color 120ms;
}
.segment-item:has(input:checked) span { background: var(--card-solid); color: var(--text); box-shadow: var(--shadow); }
.segment-item:has(input:focus-visible) span { outline: 2px solid var(--accent); }

/* バッジ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  background: rgba(127, 127, 127, 0.2);
}
.badge-warn { background: var(--warn); color: #1A1D24; }
.badge-offline { background: rgba(0, 0, 0, 0.35); color: #fff; }

/* --------------------------------------------------------------------------
   ヒーロー
   -------------------------------------------------------------------------- */
.hero { display: flex; gap: 10px; align-items: flex-start; padding: var(--space-4) var(--space-4); }
.hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.hero-icon .wi { width: 26px; height: 26px; stroke-width: 1.6; }
.hero-icon.level-good { background: var(--good-soft); color: var(--good); }
.hero-icon.level-warn { background: var(--warn-soft); color: var(--warn); }
.hero-icon.level-danger { background: var(--danger-soft); color: var(--danger); }
.hero-body { min-width: 0; flex: 1; }
.hero-q { font-size: var(--fs-sub); color: var(--text-sub); font-weight: 600; margin-bottom: 2px; }
.hero-a {
  /* 375px（本文幅 ≒ 290px）で全角13字×2行。長文（27字以上）は .is-long で一段小さく 3 行まで */
  font-size: clamp(17px, 5.3vw, var(--fs-hero));
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.hero-a.is-long { font-size: clamp(16px, 4.8vw, 18px); }
@media (min-width: 900px) { .hero-a { font-size: var(--fs-hero); } .hero-a.is-long { font-size: 18px; } }
.hero-d { margin-top: 4px; font-size: 14px; color: var(--text-sub); }
.hero.level-danger { border-color: rgba(214, 69, 69, 0.4); }

/* 注意情報バナー */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  background: var(--warn);
  color: #1A1D24;
  box-shadow: var(--shadow);
}
.alert .wi { width: 20px; height: 20px; }
.alert.level-danger { background: var(--danger); color: #fff; }

/* --------------------------------------------------------------------------
   現在の天気
   -------------------------------------------------------------------------- */
.current { padding: var(--space-3) var(--space-4) var(--space-4); }
.cur-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.cur-temp {
  display: flex;
  align-items: flex-start;
  font-size: var(--fs-temp);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.cur-temp .deg { font-size: 0.5em; margin-top: 0.12em; font-weight: 300; }
.cur-side { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 0 0 auto; min-width: 88px; }
.cur-icon .wi { width: 56px; height: 56px; stroke-width: 1.4; color: var(--text); }
.cur-desc { font-size: 15px; font-weight: 600; }
.cur-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 6px;
  color: var(--text-sub);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.cur-sub .hi { color: var(--hot); font-weight: 600; }
.cur-sub .lo { color: var(--cold); font-weight: 600; }
.cur-sub .hilo { display: inline-flex; gap: 8px; }
.cur-extra {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.cur-extra div { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); font-variant-numeric: tabular-nums; min-width: 0; }
.cur-extra .wi { width: 16px; height: 16px; }
.cur-extra b { color: var(--text); font-weight: 600; white-space: nowrap; }

/* --------------------------------------------------------------------------
   雨タイムライン
   -------------------------------------------------------------------------- */
.rain { padding-bottom: var(--space-3); }
.rain-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--border-strong);
}
.rain-bar {
  flex: 1;
  min-width: 0;
  height: 4%;
  border-radius: 3px 3px 1px 1px;
  background: var(--rain);
  opacity: 0.3;
  transform-origin: bottom;
  transition: height 400ms var(--ease);
}
.rain-bar.p30 { opacity: 0.55; }
.rain-bar.p50 { opacity: 0.8; }
.rain-bar.p70 { opacity: 1; }
.rain-bar.is-now { outline: 2px solid var(--accent); outline-offset: 1px; }
.rain-axis {
  display: flex;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}
.rain-axis span { flex: 1; min-width: 0; white-space: nowrap; overflow: visible; }
.rain-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-2);
  font-weight: 600;
  font-size: 14px;
}
.rain-summary .wi { width: 18px; height: 18px; color: var(--rain); }
/* 24 時間すべて 0% のとき: 棒グラフを出さず 1 行だけ */
.rain-none {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
}
.rain-none .wi { width: 18px; height: 18px; color: var(--good); }

/* --------------------------------------------------------------------------
   今日のアドバイス
   -------------------------------------------------------------------------- */
.tip-list { display: flex; flex-direction: column; gap: 10px; }
.tip { display: flex; align-items: flex-start; gap: 12px; }
.tip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.tip-icon .wi { width: 20px; height: 20px; }
.tip-icon.level-good { background: var(--good-soft); color: var(--good); }
.tip-icon.level-warn { background: var(--warn-soft); color: var(--warn); }
.tip-icon.level-danger { background: var(--danger-soft); color: var(--danger); }
.tip-text { padding-top: 7px; font-size: 15px; line-height: 1.45; }

/* --------------------------------------------------------------------------
   週末カード
   -------------------------------------------------------------------------- */
.wk-days { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wk-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  text-align: center;
}
.wk-day.is-sun { background: var(--danger-soft); }
.wk-day.is-best { outline: 2px solid var(--good); }
.wk-day-name { font-weight: 700; font-size: 14px; }
.wk-day .wi { width: 36px; height: 36px; stroke-width: 1.5; margin: 4px 0; }
.wk-day-temp { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wk-day-pop { font-size: 13px; color: var(--text-sub); display: inline-flex; align-items: center; gap: 3px; }
.wk-day-pop .wi { width: 14px; height: 14px; margin: 0; color: var(--rain); }
.wk-text { margin-top: 10px; font-weight: 600; font-size: 15px; }

/* --------------------------------------------------------------------------
   空カード（夕焼け・星空）
   -------------------------------------------------------------------------- */
.sky-text { font-weight: 600; font-size: 15px; }
.sky-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.sky-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.sky-item .wi { width: 18px; height: 18px; color: var(--warn); }
.sky-meter { position: relative; width: 56px; height: 6px; border-radius: 3px; background: var(--border-strong); overflow: hidden; }
.sky-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--warn); }
.sky-item.is-star .wi, .sky-item.is-star .sky-meter i { color: var(--accent); background: var(--accent); }

/* --------------------------------------------------------------------------
   1時間ごとグラフ
   -------------------------------------------------------------------------- */
.hourly { padding-right: 0; padding-left: 0; }
.hourly .card-head { padding: 0 var(--space-4); }
.chart-legend {
  display: flex;
  gap: 12px;
  padding: 0 var(--space-4);
  margin: -6px 0 6px;
  font-size: 12px;
  color: var(--text-sub);
}
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 3px; }
.chart-legend .lg-temp { background: var(--accent); height: 3px; border-radius: 2px; vertical-align: 3px; }
.chart-legend .lg-rain { background: var(--rain); opacity: 0.6; }
.chart-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  padding: 0 var(--space-4);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--space-4), #000 calc(100% - var(--space-4)), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--space-4), #000 calc(100% - var(--space-4)), transparent 100%);
}
.chart-inner { position: relative; }
.chart-inner svg { display: block; overflow: visible; font-family: var(--font); }

.ch-grid { stroke: var(--chart-grid); stroke-width: 1; }
.ch-daysep { stroke: var(--text-sub); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.7; }
.ch-daylabel { fill: var(--text-sub); font-size: 12px; font-weight: 700; }
.ch-bar { fill: var(--rain); opacity: 0.55; }
.ch-bar-label { fill: var(--rain); font-size: 12px; font-weight: 600; text-anchor: middle; }
.ch-area { fill: var(--accent); opacity: 0.12; }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ch-dot { fill: var(--card-solid); stroke: var(--accent); stroke-width: 2; }
.ch-temp { fill: var(--text); font-size: 12px; font-weight: 600; text-anchor: middle; }
.ch-pop { fill: var(--text-sub); font-size: 12px; text-anchor: middle; font-variant-numeric: tabular-nums; }
.ch-pop.is-dry { opacity: 0.45; }
.ch-pop.is-wet { fill: var(--rain); font-weight: 700; }
.ch-time { fill: var(--text-sub); font-size: 12px; text-anchor: middle; }
.ch-time.is-now { fill: var(--accent); font-weight: 700; }
.ch-icon { color: var(--text); }
.ch-icon.is-rain { color: var(--rain); }
.ch-icon.is-thunder { color: var(--warn); }
.ch-now { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.ch-nowlabel { fill: var(--accent); font-size: 12px; font-weight: 700; text-anchor: middle; }
.ch-hit { fill: transparent; cursor: pointer; }
.ch-hit:hover, .ch-hit:focus { fill: var(--accent-soft); outline: none; }
.ch-hl { fill: var(--accent-soft); pointer-events: none; }
.ch-past { opacity: 0.45; }

.chart-tip {
  position: absolute;
  top: 44px;
  z-index: 2;
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
  color: var(--text);
}
.chart-tip b { font-size: 13px; display: block; margin-bottom: 2px; }
.chart-tip .tip-row { display: flex; justify-content: space-between; gap: 10px; color: var(--text-sub); }
.chart-tip .tip-row span:last-child { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   週間予報
   -------------------------------------------------------------------------- */
.wk-list { display: flex; flex-direction: column; }
.wk-row {
  display: grid;
  grid-template-columns: 70px 30px 38px 32px minmax(40px, 1fr) 32px;
  align-items: center;
  gap: 5px;
  min-height: 48px;
  padding: 0 4px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.wk-row + .wk-row { border-top: 1px solid var(--border); }
.wk-row.is-today { background: var(--accent-soft); }
.wk-row.is-sat .wk-dow { color: var(--accent); }
.wk-row.is-sun .wk-dow { color: var(--danger); }
.wk-dow { display: flex; align-items: baseline; gap: 4px; font-weight: 600; font-size: 15px; line-height: 1.1; white-space: nowrap; }
.wk-date { font-size: 12px; color: var(--text-sub); font-weight: 400; }
.wk-row .wk-icon .wi { width: 28px; height: 28px; stroke-width: 1.5; }
.wk-pop { font-size: 12px; color: var(--text-sub); display: inline-flex; align-items: center; gap: 2px; }
.wk-pop .wi { width: 12px; height: 12px; color: var(--rain); }
.wk-pop.is-wet { color: var(--rain); font-weight: 700; }
.wk-min { text-align: right; color: var(--cold); font-size: 14px; }
.wk-max { text-align: left; color: var(--hot); font-size: 14px; font-weight: 600; }
.wk-range { position: relative; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.wk-range i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }

/* --------------------------------------------------------------------------
   詳細指標
   -------------------------------------------------------------------------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(127, 127, 127, 0.07);
  min-width: 0;
}
.detail-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-sub); }
.detail-label .wi { width: 15px; height: 15px; }
.detail-value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.detail-value small { font-size: 12px; font-weight: 400; color: var(--text-sub); margin-left: 2px; }
.detail-sub { font-size: 12px; color: var(--text-sub); }
.detail-sub.is-warn { color: var(--warn); font-weight: 600; }
.detail-sub.is-danger { color: var(--danger); font-weight: 600; }
.detail-sub.is-good { color: var(--good); font-weight: 600; }
.detail-wide { grid-column: 1 / -1; flex-direction: row; justify-content: space-around; text-align: center; }
.detail-wide > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
@media (min-width: 420px) { .detail-grid { grid-template-columns: repeat(3, 1fr); } .detail-wide { grid-column: 1 / -1; } }

/* --------------------------------------------------------------------------
   今日の発見
   -------------------------------------------------------------------------- */
.discover { display: flex; align-items: center; gap: 12px; }
.discover-icon {
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px;
  background: var(--warn-soft); color: var(--warn);
}
.discover-icon .wi { width: 22px; height: 22px; }
.discover-body { min-width: 0; }
.discover-text { font-weight: 600; font-size: 15px; }
.discover-sekki { margin-top: 2px; font-size: 13px; color: var(--text-sub); }
.discover-sekki b { color: var(--text); margin-right: 4px; }

/* --------------------------------------------------------------------------
   エラーカード
   -------------------------------------------------------------------------- */
.error-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; border-color: rgba(214, 69, 69, 0.35); }
.error-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--danger); }
.error-title .wi { width: 20px; height: 20px; }
.error-msg { color: var(--text); font-size: 14px; }
.error-actions { display: flex; gap: 8px; }

/* --------------------------------------------------------------------------
   スケルトン
   -------------------------------------------------------------------------- */
.skeleton { position: relative; }
.sk {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 50%, var(--skeleton-a) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.sk-line { height: 14px; margin: 6px 0; }
.sk-line.w40 { width: 40%; } .sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; }
.sk-title { height: 22px; width: 70%; margin: 4px 0 8px; }
.sk-temp { height: 72px; width: 140px; border-radius: 12px; }
.sk-block { height: 64px; width: 100%; margin-top: 8px; }
.sk-tall { height: 200px; width: 100%; }
.sk-row { display: flex; align-items: center; gap: 12px; }
.sk-circle { width: 52px; height: 52px; border-radius: 14px; flex: 0 0 auto; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --------------------------------------------------------------------------
   検索
   -------------------------------------------------------------------------- */
.search { position: relative; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-sub); pointer-events: none; }
.search-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px 10px 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(127, 127, 127, 0.08);
  color: var(--text);
  font-size: 16px; /* iOSのズーム防止 */
  -webkit-appearance: none;
  appearance: none;
}
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-input:focus { border-color: var(--accent); background: var(--card-solid); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.search-input::placeholder { color: var(--text-faint); }
.search-list {
  margin-top: -4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-solid);
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow-y: auto;
}
.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 8px 14px;
  cursor: pointer;
}
.search-item + .search-item { border-top: 1px solid var(--border); }
.search-item:hover, .search-item.is-active { background: var(--accent-soft); }
.search-item-name { font-weight: 600; }
.search-item-sub { font-size: 12px; color: var(--text-sub); }
.search-item-tag { font-size: 12px; color: var(--text-sub); flex: 0 0 auto; }
.search-empty, .search-loading { padding: 14px; color: var(--text-sub); font-size: 14px; text-align: center; }

/* お気に入り一覧 */
.fav-list { display: flex; flex-direction: column; }
.fav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 4px 0;
}
.fav-item + .fav-item { border-top: 1px solid var(--border); }
.fav-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  text-align: left;
  padding: 4px 6px;
  margin-left: -6px;
  border-radius: 8px;
}
.fav-main:hover { background: var(--accent-soft); }
.fav-main .wi { width: 20px; height: 20px; color: var(--text-sub); flex: 0 0 auto; }
.fav-item.is-current .fav-main { background: var(--accent-soft); }
.fav-item.is-current .fav-main .wi { color: var(--accent); }
.fav-item.is-current .fav-name { color: var(--accent); }
.fav-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-admin { font-size: 12px; color: var(--text-sub); }
.fav-check { color: var(--accent); font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.fav-actions { display: flex; gap: 0; flex: 0 0 auto; }
.fav-actions .icon-btn { width: 36px; height: 36px; color: var(--text-sub); }
.fav-actions .icon-btn .wi { width: 18px; height: 18px; }
.fav-actions .icon-btn:disabled { opacity: 0.25; }
.fav-empty { color: var(--text-sub); font-size: 14px; padding: 12px 0; }

/* --------------------------------------------------------------------------
   設定フォーム
   -------------------------------------------------------------------------- */
.settings { display: flex; flex-direction: column; gap: 6px; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--tap);
}
.row-col { flex-direction: column; align-items: stretch; gap: 8px; padding: 6px 0; }
.row-label { font-size: 15px; }
.row-switch { cursor: pointer; }
.select {
  min-height: 40px;
  padding: 6px 32px 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(127, 127, 127, 0.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  color: var(--text);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none;
  appearance: none;
}
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 50px; height: 30px;
  flex: 0 0 auto;
  border-radius: 15px;
  background: var(--border-strong);
  transition: background-color 160ms var(--ease);
  cursor: pointer;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 160ms var(--ease);
}
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }

.install-ios {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 14px;
}
.install-ios-title { font-weight: 700; margin-bottom: 6px; }
.install-steps { padding-left: 20px; list-style: decimal; line-height: 1.7; }
.about { margin-top: 8px; font-size: 12px; color: var(--text-sub); line-height: 1.6; }

/* オンボーディング */
.onboard-hero {
  padding: 32px 24px 8px;
  text-align: center;
}
.onboard-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 22px;
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 24px rgba(47, 128, 237, 0.35);
  margin-bottom: 14px;
}
.onboard-icon .wi { width: 40px; height: 40px; stroke-width: 1.6; }
.onboard-title { font-size: 26px; font-weight: 800; letter-spacing: 0.04em; }
.onboard-copy { margin-top: 8px; color: var(--text-sub); font-size: 14px; line-height: 1.7; }
.onboard-times { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); }

/* --------------------------------------------------------------------------
   トースト
   -------------------------------------------------------------------------- */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 420px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: #22262E;
  color: #F2F4F7;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 240ms var(--ease) both;
}
.toast.is-leaving { animation: toast-out 200ms ease-in both; }
.toast-error { background: #B33A3A; color: #fff; }
.toast-msg { flex: 1; min-width: 0; }
.toast-action {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  font-weight: 700;
  font-size: 13px;
}
.toast-close { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; color: inherit; opacity: 0.8; display: inline-flex; align-items: center; justify-content: center; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(8px); } }
