:root {
  --bg-page: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;

  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-soft: #e0f2fe;

  /* 快適度ランクカラー */
  --rank-s: #059669;
  --rank-s-bg: #ecfdf5;
  --rank-s-border: #a7f3d0;

  --rank-a: #0284c7;
  --rank-a-bg: #f0f9ff;
  --rank-a-border: #bae6fd;

  --rank-b: #d97706;
  --rank-b-bg: #fffbeb;
  --rank-b-border: #fde68a;

  --rank-c: #ea580c;
  --rank-c-bg: #fff7ed;
  --rank-c-border: #fed7aa;

  --rank-d: #dc2626;
  --rank-d-bg: #fef2f2;
  --rank-d-border: #fecaca;

  --sat-color: #2563eb;
  --sun-color: #dc2626;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

button, input, select {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ヘッダー */
.app-header {
  background: linear-gradient(135deg, #0c4a6e 0%, #0284c7 60%, #0d9488 100%);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 2px 12px rgba(12, 74, 110, 0.22);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.brand-sub {
  margin: 1px 0 0;
  font-size: 0.72rem;
  opacity: 0.88;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

.icon-btn:active {
  transform: scale(0.97);
}

.icon-btn.spinning .btn-icon {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

.here-btn {
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(167, 243, 208, 0.55);
}

.here-btn:hover {
  background: rgba(16, 185, 129, 0.42);
}

.here-btn.active {
  background: #10b981;
  border-color: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

/* いまここ（現在地）帰り道サマリーカード */
.here-now-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
  border: 2px solid #34d399;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.here-now-card.tone-warn {
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
  border-color: #f59e0b;
}

.here-now-card.tone-danger {
  background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
  border-color: #ef4444;
}

.here-now-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.here-now-title {
  font-size: 0.96rem;
  font-weight: 900;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.here-now-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.here-now-verdict {
  font-size: 0.92rem;
  font-weight: 800;
  color: #065f46;
}

.here-now-card.tone-warn .here-now-verdict { color: #b45309; }
.here-now-card.tone-danger .here-now-verdict { color: #b91c1c; }

.here-now-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
}

.spot-pill.temp-pill {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(167, 243, 208, 0.7);
}

.spot-pill.temp-pill.active {
  background: #ecfdf5;
  color: #065f46;
  border-color: #ffffff;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* スポット切替バー */
.spot-bar-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2px 16px 12px;
}

.spot-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.spot-bar::-webkit-scrollbar {
  display: none;
}

.spot-pill {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.spot-pill:hover {
  background: rgba(255, 255, 255, 0.28);
}

.spot-pill.active {
  background: #ffffff;
  color: #0c4a6e;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.spot-pill .pill-tag {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
}

.spot-pill.active .pill-tag {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* メイン */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 36px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.status-banner {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.spot-chip, .date-chip {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.segmented-control {
  display: inline-flex;
  background: #e2e8f0;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.text-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.text-btn:hover {
  background: var(--primary-soft);
}

/* ① 週末フォーカス比較カード */
.day-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.day-cards-grid.week-mode {
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
}

.day-card {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.day-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.day-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.16), var(--shadow-md);
}

.day-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.day-date-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.day-date {
  font-size: 1rem;
  font-weight: 800;
}

.day-date.sat { color: var(--sat-color); }
.day-date.sun { color: var(--sun-color); }

.day-rel-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-sub);
}

.day-card-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.day-wx-score {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-wx-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.score-num-lg {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.score-unit {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.75;
  margin-left: 1px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 0.8rem;
  border: 1px solid transparent;
}

.rank-s { color: var(--rank-s); background: var(--rank-s-bg); border-color: var(--rank-s-border); }
.rank-a { color: var(--rank-a); background: var(--rank-a-bg); border-color: var(--rank-a-border); }
.rank-b { color: var(--rank-b); background: var(--rank-b-bg); border-color: var(--rank-b-border); }
.rank-c { color: var(--rank-c); background: var(--rank-c-bg); border-color: var(--rank-c-border); }
.rank-d { color: var(--rank-d); background: var(--rank-d-bg); border-color: var(--rank-d-border); }

.text-rank-s { color: var(--rank-s); }
.text-rank-a { color: var(--rank-a); }
.text-rank-b { color: var(--rank-b); }
.text-rank-c { color: var(--rank-c); }
.text-rank-d { color: var(--rank-d); }

.bg-rank-s { background: var(--rank-s); }
.bg-rank-a { background: var(--rank-a); }
.bg-rank-b { background: var(--rank-b); }
.bg-rank-c { background: var(--rank-c); }
.bg-rank-d { background: var(--rank-d); }

.day-card-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-sub);
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  gap: 6px;
  flex-wrap: wrap;
}

.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.temp-max { color: #e11d48; font-weight: 800; }
.temp-min { color: #0284c7; font-weight: 800; }

.day-card-best {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.mini-flag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
}

/* ② メイン：サイクリング時間帯タイムライン */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.timeline-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.tl-title-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tl-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tl-main-date {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
}

.tl-verdict {
  font-size: 0.92rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

.tl-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.83rem;
  color: var(--text-sub);
  font-weight: 600;
}

.tl-score-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.tl-score-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
}

.tl-score-big {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.tl-score-caption {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 2px;
}

.tl-best-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid var(--border);
  padding-left: 12px;
}

.tl-best-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tl-best-time {
  font-size: 1rem;
  font-weight: 800;
  color: var(--rank-s);
}

/* アラート＆風向き判定バー */
.alerts-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.alert-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.alert-pill.danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-pill.warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.alert-pill.info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.alert-pill.good { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.alert-pill.neutral { background: #f8fafc; color: #475569; border-color: #e2e8f0; }

.dir-selector-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-sub);
}

.dir-selector-inline select {
  border: none;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  outline: none;
}

/* タイムライン凡例 */
.timeline-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.legend-ranks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.legend-title {
  color: var(--text-sub);
  font-weight: 800;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-sub);
  font-weight: 700;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.legend-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-star {
  color: #059669;
  font-weight: 700;
}

/* 時間帯タイムライン本体 */
.timeline-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
}

.hourly-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(68px, 1fr);
  gap: 6px;
  min-width: 100%;
}

.hour-col {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
  position: relative;
}

.hour-col:hover {
  border-color: #94a3b8;
  background: #ffffff;
}

.hour-col.best-hour {
  background: #f0fdf4;
  border-color: #86efac;
}

.hour-col.active-hour {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.hour-time {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 2px;
}

.best-star {
  color: #059669;
  font-size: 0.74rem;
}

/* 快適度バー */
.hour-bar-wrap {
  width: 24px;
  height: 54px;
  background: #e2e8f0;
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 2px;
}

.hour-bar-fill {
  width: 100%;
  border-radius: 4px;
  transition: height 0.3s ease;
}

.hour-score-text {
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

/* 天気・降水 */
.hour-wx-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.hour-rain {
  font-size: 0.68rem;
  font-weight: 700;
  color: #0284c7;
  min-height: 14px;
  line-height: 1.1;
}

.hour-rain.has-rain {
  color: #1d4ed8;
  background: #dbeafe;
  padding: 1px 4px;
  border-radius: 4px;
}

/* 気温 */
.hour-temp {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.hour-temp.cold { color: #0369a1; }
.hour-temp.warm { color: #b45309; }
.hour-temp.hot { color: #dc2626; }

/* 風ブロック */
.hour-wind-box {
  width: 100%;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.wind-arrow-svg {
  width: 20px;
  height: 20px;
  display: block;
  transition: transform 0.25s ease;
}

.wind-speed-val {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
}

.wind-calm { color: #059669; }
.wind-mod { color: #d97706; }
.wind-strong { color: #ea580c; }
.wind-severe { color: #dc2626; }

.wind-dir-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* 選択中時間の詳細ストリップ */
.hour-detail-panel {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hd-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 700;
}

.hd-time-pill {
  background: var(--primary);
  color: #ffffff;
  padding: 3px 9px;
  border-radius: 7px;
  font-weight: 800;
}

.hd-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-sub);
  font-weight: 600;
}

.hd-reasons {
  font-size: 0.78rem;
  color: #b45309;
  font-weight: 700;
}

/* おすすめウェアセットパネル */
.wear-set-panel {
  background: linear-gradient(180deg, #f8fafc 0%, #f0f9ff 100%);
  border: 1.5px solid #bae6fd;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wear-set-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.wear-set-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wear-set-title {
  font-size: 0.94rem;
  font-weight: 900;
  color: #0c4a6e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wear-set-note {
  font-size: 0.8rem;
  color: var(--text-sub);
  font-weight: 600;
}

.wear-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 10px;
}

.wear-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.wear-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.wear-img-box {
  position: relative;
  width: 100%;
  height: 128px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
  border-bottom: 1px solid #f1f5f9;
}

.wear-img-box img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.wear-role-pill {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.wear-card-body {
  padding: 8px 9px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.wear-name {
  font-size: 0.77rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.wear-badge {
  align-self: flex-start;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  margin-top: auto;
}

.wear-badge.fixed-badge {
  background: #f1f5f9;
  color: #475569;
}

.wear-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: auto;
  flex-wrap: wrap;
}

.wear-swap-btn {
  border: 1px solid #bae6fd;
  background: #ffffff;
  color: var(--primary-dark);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.66rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.12s ease;
}

.wear-swap-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.wear-group-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.wear-group-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}

.preset-set-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #0c4a6e;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
}

.wear-card.dynamic-card {
  border-color: #7dd3fc;
}

/* マイウェア・定番セット管理モーダル */
.wardrobe-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.wardrobe-subview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sets-intro-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-sets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preset-set-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.psc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.psc-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}

.psc-name-input {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  background: #ffffff;
  flex: 1;
  min-width: 120px;
}

.psc-temp-group {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-sub);
}

.psc-items-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.psc-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  color: var(--text-sub);
  border-radius: 9px;
  padding: 4px 8px 4px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.psc-item-chip img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 5px;
  background: #f8fafc;
}

.psc-item-chip.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.psc-item-chip:hover {
  border-color: var(--primary);
}

/* マイウェア管理モーダル */
.modal-lg {
  max-width: 820px;
}

.wardrobe-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.wardrobe-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wardrobe-tab {
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-sub);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.wardrobe-tab.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.wardrobe-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.wm-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wm-card.disabled-item {
  opacity: 0.55;
  background: #f8fafc;
}

.wm-top {
  display: flex;
  gap: 10px;
  padding: 10px;
  align-items: center;
}

.wm-thumb {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  object-fit: contain;
  flex-shrink: 0;
  padding: 3px;
}

.wm-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wm-cat {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.wm-title-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  padding: 2px 4px;
  border-radius: 6px;
}

.wm-title-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  outline: none;
}

.wm-temp-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  color: var(--text-sub);
  font-weight: 700;
}

.wm-temp-input {
  width: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 2px 4px;
  font-size: 0.74rem;
  text-align: center;
  font-weight: 700;
}

.wm-footer {
  padding: 7px 10px;
  border-top: 1px dashed var(--border);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.73rem;
}

.wm-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-main);
}

@media (max-width: 640px) {
  .wear-set-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .wardrobe-manager-grid {
    grid-template-columns: 1fr;
  }
}

/* ③ 複数スポット比較ボード */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.compare-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  position: relative;
}

.compare-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.compare-card.active-spot {
  border-color: var(--primary);
  background: #fafdff;
}

.compare-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.compare-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.compare-name {
  font-size: 0.98rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.crown-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 2px 7px;
  border-radius: 999px;
}

.compare-area {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.compare-score-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.compare-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg-subtle);
  border-radius: 10px;
  padding: 8px;
  font-size: 0.78rem;
}

.cm-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cm-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.cm-val {
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.compare-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-sub);
  font-weight: 600;
}

/* モーダル */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.modal-sm {
  max-width: 420px;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
}

.modal-close {
  border: none;
  background: #f1f5f9;
  color: var(--text-sub);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.modal-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-main);
}

.form-help {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.search-row {
  display: flex;
  gap: 6px;
}

.text-input, .select-input {
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.88rem;
  background: #ffffff;
  color: var(--text-main);
  outline: none;
}

.text-input {
  flex: 1;
  min-width: 0;
}

.text-input:focus, .select-input:focus {
  border-color: var(--primary);
}

.full-width {
  width: 100%;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.primary-btn:hover { background: var(--primary-dark); }

.secondary-btn {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.secondary-btn:hover { background: #e2e8f0; }

.search-results {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.search-result-item {
  border: none;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--primary-soft); }

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-main);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.preset-chip:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

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

.reg-spot-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.reg-spot-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reg-spot-name {
  font-weight: 800;
  font-size: 0.88rem;
}

.reg-spot-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.reg-spot-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.danger-btn {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.danger-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* スケルトンローディング */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 10px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* フッター */
.app-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.76rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.app-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.last-updated {
  margin-left: 8px;
}

/* スマホ向け最適化 */
@media (max-width: 640px) {
  .header-inner {
    padding: 10px 12px 6px;
  }
  .btn-label {
    display: none;
  }
  .icon-btn {
    padding: 8px 10px;
    font-size: 0.95rem;
  }
  .main-content {
    padding: 14px 12px 28px;
    gap: 18px;
  }
  .timeline-card {
    padding: 14px 12px;
  }
  .day-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .day-card {
    padding: 10px 10px;
  }
  .score-num-lg {
    font-size: 1.4rem;
  }
  .tl-score-box {
    width: 100%;
    justify-content: space-between;
  }
  .hourly-grid {
    grid-auto-columns: 64px;
  }
  .compare-grid {
    grid-template-columns: 1fr;
  }
}
