:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #111114;
  --surface-2: #18181c;
  --surface-hover: #1c1c22;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #8b8b95;
  --accent: #e4e4e7;
  --link-hover: #93c5fd;
  --up: #f87171;
  --up-bg: rgba(248, 113, 113, 0.12);
  --down: #34d399;
  --down-bg: rgba(52, 211, 153, 0.12);
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  font: 14px/1.65 "Inter", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, -apple-system, sans-serif;
  font-feature-settings: "palt" 1;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

:focus-visible {
  outline: 1.5px solid #e4e4e7;
  outline-offset: 2px;
}

#news, #weather, #fx, #services {
  scroll-margin-top: 120px;
}

#news-panel:focus {
  outline: none;
}

/* スキップリンク（キーボード操作時のみ表示） */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: #fafafa;
  color: #09090b;
  font-size: 13px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.noscript {
  margin: 0;
  padding: 12px 16px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}

/* =========================
   ヘッダー（2層エディトリアル・マストヘッド）
   ========================= */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.header-main {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

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

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: #fafafa;
  color: #09090b;
  display: grid;
  place-items: center;
}

.brand-mark svg {
  width: 16px;
  height: 16px;
}

.brand-wordmark {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fafafa;
  line-height: 1;
}

.header-divider {
  width: 1px;
  height: 16px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.date-label {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: stretch;
  height: 60px;
  gap: 4px;
}

.header-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.15s ease;
}

.header-nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: #fafafa;
  transform: scaleX(0);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-nav a:hover {
  color: #fafafa;
}

.header-nav a.active {
  color: #fafafa;
  font-weight: 600;
}

.header-nav a.active::after {
  transform: scaleX(1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-quick-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 164px;
  justify-content: space-between;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.header-quick-meta:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.header-fx-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header-fx-pair {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.header-fx-name {
  margin-top: 2px;
  font-size: 9.5px;
  color: var(--text-3);
  font-weight: 500;
}

.header-fx-rate {
  font-size: 13px;
  color: #fafafa;
  font-weight: 700;
  letter-spacing: 0.01em;
}

@keyframes headerTickerIn {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-quick-meta.is-switching .header-fx-info,
.header-quick-meta.is-switching .header-fx-rate {
  animation: headerTickerIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ヘッダー下段：カテゴリタブバー */
.header-sub {
  border-top: 1px solid var(--border-subtle);
  background: rgba(14, 14, 18, 0.72);
}

.category-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 42px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.category-bar button {
  position: relative;
  flex-shrink: 0;
  height: 42px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.category-bar button:first-child {
  padding-left: 0;
}

.category-bar button::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 1.5px;
  background: #fafafa;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.category-bar button:first-child::after {
  left: 0;
}

.category-bar button:hover {
  color: var(--text);
}

.category-bar button[aria-pressed="true"] {
  color: #fafafa;
  font-weight: 600;
}

.category-bar button[aria-pressed="true"]::after {
  opacity: 1;
}

/* =========================
   メイン2カラムグリッド
   ========================= */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  align-items: start;
  gap: 32px;
  padding-block: 28px 72px;
}

.main-column, .sidebar {
  min-width: 0;
}

/* ニュースセクションヘッダー */
.news-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.news-heading-group {
  min-width: 0;
}

.news-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}

.news-kicker .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
}

.news-toolbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #fafafa;
}

.news-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.feed-count {
  color: var(--text-3);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ニュース検索 */
.news-search {
  width: 240px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.search-input-wrap svg.search-icon {
  position: absolute;
  left: 10px;
  width: 13px;
  height: 13px;
  color: var(--text-3);
  pointer-events: none;
}

.news-search input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 26px 0 30px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 12px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.news-search input:focus {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.news-search input::placeholder {
  color: var(--text-3);
}

.news-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  position: absolute;
  right: 6px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 12px;
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.search-clear[hidden] {
  display: none;
}

.news-search button[type="submit"] {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.news-search button[type="submit"]:hover {
  background: #27272a;
  border-color: var(--border-strong);
}

/* 記事リスト（フラット＆ヘアラインのエディトリアル表現） */
.news-section {
  transition: box-shadow 0.25s ease;
}

.news-section.section-highlight {
  outline: 1px solid rgba(255, 255, 255, 0.35);
  outline-offset: 8px;
  border-radius: var(--radius-md);
}

.story-list {
  min-height: 320px;
}

.story {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 8px;
  margin-inline: -8px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
}

.story:last-child {
  border-bottom: 0;
}

.story:hover {
  background: rgba(255, 255, 255, 0.028);
}

/* 先頭記事のフィーチャー表示 */
.story.is-lead {
  padding: 22px 10px 24px;
  margin-inline: -10px;
  gap: 24px;
}

.story.is-lead .story-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.48;
  letter-spacing: -0.015em;
}

.story.is-lead .story-thumb {
  width: 216px;
  height: 128px;
}

.story-body {
  flex: 1;
  min-width: 0;
}

.story-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -0.005em;
}

.story-title::after {
  content: "";
  position: absolute;
  inset: 0;
}

.story-title-ext {
  flex-shrink: 0;
  margin-top: 4px;
  width: 13px;
  height: 13px;
  color: var(--text-3);
  opacity: 0;
  transform: translate(-2px, 2px);
  transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.story:hover .story-title {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.28);
  text-underline-offset: 4px;
}

.story:hover .story-title-ext {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--text);
}

.story-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.source-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
}

.category-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.6;
}

.story-time {
  color: var(--text-3);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.story-meta .sep {
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: var(--text-3);
  opacity: 0.6;
}

.story-thumb {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 76px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.story-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.story:hover .story-thumb img {
  transform: scale(1.03);
}

.story-thumb-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  color: var(--text-3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%),
    var(--surface);
}

.story-thumb-fallback svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  opacity: 0.8;
}

.story-thumb-fallback span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-transform: uppercase;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-actions {
  display: flex;
  justify-content: center;
  padding-top: 24px;
}

.more-button {
  min-width: 200px;
  padding: 10px 24px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 12.5px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.more-button:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.3);
}

.more-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.message {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 32px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}

.message button {
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  font-size: 12px;
}

.message button:hover {
  background: #27272a;
}

/* =========================
   サイドバー・パネル共通
   ========================= */
.sidebar {
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.panel.section-highlight {
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.widget-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.widget-heading h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Wikipedia 検索カード */
.wiki-card {
  position: relative;
  z-index: 20;
  overflow: visible;
  padding: 14px 16px;
}

.wiki-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.wiki-head h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wiki-head h2 svg {
  width: 13px;
  height: 13px;
  color: var(--text-2);
}

.wiki-form {
  position: relative;
}

.wiki-input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.wiki-input-group:focus-within {
  border-color: rgba(255, 255, 255, 0.4);
}

.wiki-input-group input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px 0 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
}

.wiki-input-group input::placeholder {
  color: var(--text-3);
}

.wiki-input-group input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.wiki-lang {
  flex-shrink: 0;
  height: 36px;
  padding: 0 8px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.wiki-lang option {
  background: #18181b;
  color: var(--text);
}

.wiki-submit {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 0;
  transition: background-color 0.15s ease;
}

.wiki-submit:hover {
  background: #27272a;
}

.wiki-submit svg {
  width: 14px;
  height: 14px;
}

.wiki-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 45;
  background: #141418;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}

.wiki-dropdown[hidden] {
  display: none;
}

.wiki-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow-y: auto;
}

.wiki-item {
  border-bottom: 1px solid var(--border);
}

.wiki-item:last-child {
  border-bottom: 0;
}

.wiki-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  transition: background-color 0.12s ease;
}

.wiki-item a:hover,
.wiki-item a.is-selected {
  background: var(--surface-hover);
}

.wiki-thumb {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-3);
}

.wiki-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wiki-thumb svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.wiki-item-body {
  flex: 1;
  min-width: 0;
}

.wiki-item-title {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-item a:hover .wiki-item-title,
.wiki-item a.is-selected .wiki-item-title {
  color: #ffffff;
}

.wiki-item-title mark {
  background: transparent;
  color: #fafafa;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wiki-item-desc {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-empty {
  padding: 14px 12px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
}

/* 天気カード */
.weather-card {
  padding: 18px 20px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  background: transparent;
  transition: all 0.15s ease;
}

.icon-button svg {
  width: 14px;
  height: 14px;
}

.icon-button:hover {
  background: var(--surface-2);
  color: #fff;
  border-color: var(--border-strong);
}

.location-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 4px 8px;
  margin-left: -8px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: #fafafa;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  transition: background-color 0.15s ease;
}

.location-button:hover {
  background: var(--surface-2);
}

.location-button svg.pin-icon {
  width: 14px;
  height: 14px;
  color: var(--text-2);
  flex-shrink: 0;
}

.location-button svg.chevron-icon {
  width: 13px;
  height: 13px;
  color: var(--text-3);
  flex-shrink: 0;
}

.location-button span {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 12px;
}

.weather-primary-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.weather-glyph {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 38px;
  line-height: 1;
}

.weather-glyph svg {
  width: 46px;
  height: 46px;
}

.weather-primary-text strong {
  display: block;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  color: #fafafa;
}

.weather-primary-text span {
  display: inline-block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 11.5px;
}

.weather-summary {
  margin: 2px 0 14px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.65;
}

.temperature-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.temp-box {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.temp-box span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
}

.temp-box strong {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.temperature-row .high {
  color: #fca5a5;
}

.temperature-row .low {
  color: #93c5fd;
}

.rain {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: 11.5px;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.day-cell {
  min-width: 0;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
}

.day-cell b {
  display: block;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
}

.day-cell .glyph {
  display: grid;
  place-items: center;
  height: 28px;
  margin: 5px auto;
  font-size: 20px;
}

.day-cell .glyph svg {
  width: 24px;
  height: 24px;
}

.day-cell small {
  display: block;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.weather-updated {
  margin: 12px 0 0;
  color: var(--text-3);
  font-size: 10.5px;
  text-align: right;
}

.weather-error {
  color: var(--up);
}

/* 為替レートカード */
.fx-card {
  padding: 18px 20px;
}

.fx-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.fx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 8px;
  margin-inline: -8px;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.25s ease;
}

.fx-item:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.fx-extra-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.36s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.26s ease;
}

.fx-extra-wrap.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.fx-extra-inner {
  overflow: hidden;
}

.fx-list-extra {
  margin-top: 0;
  border-top: 1px solid var(--border-subtle);
}

@keyframes fxFlashUp {
  0% { background-color: rgba(248, 113, 113, 0.2); }
  100% { background-color: transparent; }
}

@keyframes fxFlashDown {
  0% { background-color: rgba(52, 211, 153, 0.2); }
  100% { background-color: transparent; }
}

.fx-item.flash-up {
  animation: fxFlashUp 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.fx-item.flash-down {
  animation: fxFlashDown 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.fx-item.flash-up .fx-rate {
  color: var(--up);
}

.fx-item.flash-down .fx-rate {
  color: var(--down);
}

.fx-pair {
  display: flex;
  flex-direction: column;
}

.fx-pair strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.fx-pair small {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 2px;
}

.fx-values {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.fx-rate {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: #fafafa;
  line-height: 1.25;
  transition: color 0.35s ease;
}

.fx-unit {
  margin-left: 4px;
  letter-spacing: 0.02em;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
}

.fx-diff {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}

.fx-diff.up {
  color: var(--up);
}

.fx-diff.down {
  color: var(--down);
}

.fx-more-button {
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fx-more-button:hover {
  background: var(--surface-2);
  color: #fafafa;
  border-color: var(--border-strong);
}

.fx-more-button[hidden] {
  display: none;
}

.fx-more-button svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}

.fx-more-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* 暮らしの情報カード */
.links-card {
  padding: 18px 20px;
}

.links-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.links-list li + li {
  border-top: 1px solid var(--border-subtle);
}

.links-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.links-list a:hover {
  color: #fafafa;
}

.links-list a svg {
  width: 13px;
  height: 13px;
  color: var(--text-3);
  transition: color 0.15s ease, transform 0.15s ease;
}

.links-list a:hover svg {
  color: #fafafa;
  transform: translate(2px, -2px);
}

/* =========================
   フッター
   ========================= */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0;
}

.footer-inner strong {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fafafa;
}

.footer-inner small {
  display: block;
  margin-top: 3px;
  color: var(--text-3);
  font-size: 11px;
}

.footer-inner nav {
  display: flex;
  gap: 20px;
  color: var(--text-3);
  font-size: 12px;
}

.footer-inner nav a:hover {
  color: #fafafa;
}

/* =========================
   地域設定ダイアログ
   ========================= */
.dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  color: var(--text);
  background: #141418;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
}

.dialog:not([open]) {
  display: none;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dialog-head {
  position: relative;
  padding: 20px 56px 16px 22px;
  border-bottom: 1px solid var(--border);
}

.dialog-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.dialog-head p {
  color: var(--text-2);
  font-size: 12px;
  margin: 4px 0 0;
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  background: transparent;
}

.dialog-close svg {
  width: 15px;
  height: 15px;
}

.dialog-close:hover {
  background: var(--surface-2);
  color: #fff;
}

.dialog-body {
  padding: 18px 22px 22px;
}

.geo-button {
  width: 100%;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: #fafafa;
  font-size: 12.5px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.geo-button svg {
  width: 15px;
  height: 15px;
}

.geo-button:hover:not(:disabled) {
  background: #27272a;
}

.geo-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-3);
  font-size: 11px;
}

.divider::before, .divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}

.field select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  font-size: 13px;
}

.field select:focus {
  border-color: rgba(255, 255, 255, 0.45);
}

.field select:disabled {
  opacity: 0.45;
}

.dialog-status {
  min-height: 18px;
  margin: 6px 0 12px;
  color: var(--text-2);
  font-size: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-actions button {
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-weight: 600;
  font-size: 12px;
}

.cancel {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.cancel:hover {
  background: var(--surface-2);
  color: #fafafa;
}

.confirm {
  background: #fafafa;
  color: #09090b;
  border: 1px solid #fafafa;
}

.confirm:hover:not(:disabled) {
  background: #e4e4e7;
}

.confirm:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.geo-credit {
  margin: 14px 0 0;
  color: var(--text-3);
  font-size: 10.5px;
  text-align: right;
}

.geo-credit a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 読み込み中スケルトン */
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.story-skeleton {
  pointer-events: none;
}

.story-skeleton .sk-line,
.story-skeleton .sk-block {
  background: var(--surface-2);
  border-radius: 4px;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}

.story-skeleton .sk-line {
  height: 14px;
  margin: 4px 0 12px;
}

.story-skeleton .sk-line.sk-short {
  width: 38%;
  height: 11px;
  margin-bottom: 4px;
}

.story-skeleton .sk-block {
  border-color: transparent;
}

/* カテゴリバー：端のフェードで横スクロールを示す */
.header-sub .category-bar {
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
}

/* タップしやすさ（タッチ端末） */
@media (pointer: coarse) {
  .category-bar button,
  .header-nav a {
    min-height: 44px;
  }
  .icon-button,
  .dialog-close {
    width: 38px;
    height: 38px;
  }
}

/* =========================
   レスポンシブ対応
   ========================= */
@media (max-width: 1024px) {
  .header-quick-meta {
    display: none;
  }
  .main-grid {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 24px;
  }
}

@media (max-width: 820px) {
  .main-grid {
    display: flex;
    flex-direction: column;
    padding-top: 22px;
    gap: 28px;
  }
  .main-column, .sidebar {
    width: 100%;
  }
  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wiki-card,
  .weather-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 380px) {
  .brand-wordmark {
    font-size: 15px;
  }
  .header-nav a {
    padding: 0 7px;
  }
  .header-nav a::after {
    left: 7px;
    right: 7px;
  }
  .header-main {
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .shell {
    width: calc(100% - 28px);
  }
  .header-divider,
  .date-label {
    display: none;
  }
  .header-main {
    height: 54px;
  }
  .header-nav {
    height: 54px;
    gap: 0;
  }
  .header-nav a {
    padding: 0 10px;
    font-size: 12px;
  }
  .header-nav a::after {
    left: 10px;
    right: 10px;
  }
  .news-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .news-toolbar-right {
    justify-content: space-between;
  }
  .news-search {
    width: 100%;
  }
  .story.is-lead {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 12px;
  }
  .story.is-lead .story-thumb {
    width: 100%;
    height: 180px;
  }
  .story.is-lead .story-title {
    font-size: 17px;
  }
  .story {
    padding: 15px 4px;
    margin-inline: -4px;
    gap: 12px;
  }
  .story-thumb {
    width: 96px;
    height: 64px;
  }
  .story-title {
    font-size: 14px;
  }
  .sidebar {
    display: flex;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}