/* ============================================================
   マイポータル スタイル
   カラースキーム：ディープネイビー×ゴールド（高級・高コントラスト）
     - 背景：ネイビー寄りのクールライト
     - カード：純白＋ネイビーグレーの枠線
     - アクセント：ゴールド
     - 文字：ディープネイビーインク
   スマホ→タブレット→PC でカードの列数が自動で変わります。
   ============================================================ */

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

:root {
  /* --- ディープネイビー×ゴールド カラースキーム（ここを変えると全体の色が変わります） --- */
  --bg: #eef1f6;          /* 背景：ネイビー寄りのクールライト */
  --surface: #ffffff;     /* カード背景：純白 */
  --border: #d2dae6;      /* 枠線：ネイビーグレー */
  --text: #0e1f3d;        /* 文字（濃い）：ディープネイビーインク */
  --text-sub: #44506a;    /* 文字（中）：ネイビースレート */
  --text-muted: #8a95a9;  /* 文字（薄い）：日付など */
  --accent: #a87c0a;      /* アクセント：ゴールド */
  --accent-strong: #13294b; /* ディープネイビー（ブランドのグラデ／リンク文字） */
  --accent-soft: #f3e7c4; /* 薄いゴールド（タグ背景など） */
  /* セマンティックカラーも鮮明・高コントラストに */
  --good: #16a34a;        /* 取得・勝ち（鮮明なグリーン） */
  --good-soft: #dcfce7;
  --warn: #d97706;        /* 譲渡（鮮明なアンバー） */
  --warn-soft: #fef3c7;
  --cool: #0ea5e9;        /* 最低気温（クールなスカイブルー） */
  --up: #16a34a;          /* 株価：上昇（グリーン） */
  --down: #dc2626;        /* 株価：下落（レッド） */
  --strip-h: 84px;        /* 株価バー等の共通の高さ */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 44px;
}

/* ---- 最上部バー（ロゴ + 日付/時刻 + AIリンク） ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
/* ロゴ：かっこよくグラデーション + 字間 */
.brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
/* 日付 + 現在時刻（コンパクト） */
.clock {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.clock-date {
  font-size: 0.78rem;
  color: var(--text-sub);
}
.clock-time {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* AIリンクボタン */
.quick-links {
  display: flex;
  gap: 6px;
}
/* AIサービスのロゴリンク（アイコンボタン） */
.ai-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.ai-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.ai-link img,
.ai-link svg {
  width: 30px;
  height: 30px;
  display: block;
}

/* ---- 大手デベロッパー リリースリンク（ロゴ付きチップ・独立行） ---- */
.company-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;        /* 折り返さず1行 */
  gap: 5px;
  margin-bottom: 12px;
  overflow-x: auto;         /* はみ出したら横スクロール */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;    /* Firefox: 細いスクロールバー */
}
.company-links::-webkit-scrollbar {
  height: 6px;
}
.company-links::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.company-links-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-sub);
  padding-right: 2px;
  flex: none;               /* 縮めない */
}
.company-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex: none;               /* 縮めない（1行維持） */
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.company-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.company-link img {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: block;
  flex: none;
}

/* ---- 株価バー（最上部・横スクロール対応） ---- */
.ticker {
  display: flex;
  gap: 4px;
  align-items: center;
  height: var(--strip-h);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  -webkit-overflow-scrolling: touch;
}
.ticker-item {
  flex: 0 0 auto;
  min-width: 116px;
  padding: 4px 14px;
  border-right: 1px solid var(--border);
}
.ticker-item:last-child {
  border-right: none;
}
.ticker-name {
  font-size: 0.72rem;
  color: var(--text-sub);
  white-space: nowrap;
}
.ticker-price {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.ticker-change {
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}
.ticker-change.up {
  color: var(--up);
}
.ticker-change.down {
  color: var(--down);
}
.ticker-change.flat {
  color: var(--text-muted);
}

/* ---- 天気(左半分) と MLB(右半分) の横並び ---- */
.top-row {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  align-items: stretch; /* 高さを揃える */
}
.top-row > .weather-strip {
  flex: 1 1 0; /* 全幅 */
  min-width: 0;
  margin-top: 0;
}
@media (max-width: 760px) {
  .top-row {
    flex-direction: column;
  }
}

/* ---- 天気予報（簡易表示 + 都道府県ダイヤル） ---- */
.weather-strip {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
/* 左側：天気の中身 */
.wx-now {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.wx-current {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wx-cur-emoji {
  font-size: 2.1rem;
  line-height: 1;
}
.wx-cur-temp {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.wx-cur-cond {
  font-size: 0.76rem;
  color: var(--text-sub);
}
/* 1週間（7日分）のミニ予報 */
.wx-mini {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  justify-content: space-between;
}
.wx-mini-day {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 2px;
  border-radius: 8px;
}
.wx-mini-day.is-today {
  background: var(--accent-soft);
}
.wx-mini-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-sub);
}
.wx-mini-date {
  font-size: 0.6rem;
  color: var(--text-muted);
}
.wx-mini-emoji {
  font-size: 1.15rem;
}
.wx-mini-temp {
  font-size: 0.72rem;
  color: var(--cool);
  white-space: nowrap;
}
.wx-mini-temp b {
  color: var(--accent-strong);
}
.wx-mini-pop {
  font-size: 0.6rem;
  color: var(--cool);
  white-space: nowrap;
}
/* 右側：都道府県セレクト（ダイヤル） */
.wx-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wx-pref-label {
  font-size: 0.72rem;
  color: var(--text-sub);
}
.wx-pref {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
}
.wx-pref:focus {
  outline: none;
  border-color: var(--accent);
}
.strip-updated {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 読み込み中・エラー時の文言 */
.strip-loading {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 6px 8px;
}

@media (max-width: 560px) {
  .weather-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .wx-control {
    justify-content: flex-end;
  }
  /* 7日分は狭い画面では横スクロールで1行維持 */
  .wx-mini {
    overflow-x: auto;
    gap: 10px;
  }
  .wx-mini-day {
    flex: 0 0 auto;
  }
}

/* ---- カードを並べるグリッド（自動で 1→2→3 列） ---- */
.grid {
  margin-top: 24px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ---- カード共通 ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.card-header .icon {
  font-size: 1.1rem;
}
.card-body {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-sub);
  flex: 1;
}

/* ---- 記事タイトルの1行リスト（NFM / NewsPicks） ---- */
.thumb-section {
  margin-top: 24px;
}
.thumb-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.thumb-head h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.thumb-head a {
  font-size: 0.72rem;
  color: var(--accent-strong);
  text-decoration: none;
}
/* 見出し下の補足（対象企業名など） */
.thumb-sub {
  margin: -2px 0 8px;
  font-size: 0.72rem;
  color: var(--text-sub);
  line-height: 1.5;
}
/* 見出し右側のまとまり（補足ラベル + 更新ボタン） */
.thumb-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* 「更新」ボタン（手動でAIに調べ直させる） */
.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.refresh-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-strong);
}
.refresh-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.refresh-icon {
  display: inline-block;
  font-size: 0.85rem;
  line-height: 1;
}
/* 調査中はアイコンを回転 */
.refresh-btn.is-loading .refresh-icon {
  animation: refresh-spin 0.8s linear infinite;
}
@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}
.feed-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
/* 1行＝1記事（表題のみ） */
.feed-row {
  display: block;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s;
}
.feed-row:first-child {
  border-top: none;
}
.feed-row:hover {
  background: var(--accent-soft);
}

/* セル見出しの補足ラベル（例：毎朝8時更新） */
.thumb-note {
  font-size: 0.72rem;
  color: var(--text-sub);
}

/* 業界リリース情報（AI調べ）：見出し + 要点の1行 */
.release-row {
  display: block;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}
.release-row:first-child {
  border-top: none;
}
.release-row:hover {
  background: var(--accent-soft);
}
.release-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 公開日バッジ（見出し先頭に表示） */
.release-date {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
/* 会社名バッジ（PR TIMES競合リリース用） */
.prt-company {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}
/* 競合リリース・REIT開示は最新6件だけ表示し、残りはスクロールで閲覧 */
#prtimes-grid {
  max-height: 264px; /* 約6行分 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
#prtimes-grid::-webkit-scrollbar {
  width: 6px;
}
#prtimes-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
/* TDnet(REIT物件取引)も最新6件だけ表示し、残りはスクロール */
#disclosure-card {
  max-height: 234px; /* 約6行分 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
#disclosure-card::-webkit-scrollbar {
  width: 6px;
}
#disclosure-card::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.release-summary {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  color: var(--text-sub);
  line-height: 1.4;
}

/* REIT開示の1行（日付 + 題名） */
.reit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}
.reit-row:first-child {
  border-top: none;
}
.reit-row:hover {
  background: var(--accent-soft);
}
.reit-date {
  flex: 0 0 auto;
  width: 40px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.reit-title {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 共通：日付付きリスト（REIT） ---- */
.list-divided {
  list-style: none;
}
.list-divided li {
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.list-divided li:first-child {
  border-top: none;
  padding-top: 0;
}
.row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.tag {
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.date {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.title-line {
  margin-top: 4px;
  color: var(--text);
}

/* ---- 5. 開示（REIT） ---- */
.disclosure-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tag-acquire {
  background: var(--good-soft);
  color: var(--good);
  font-weight: 600;
}
.tag-transfer {
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 600;
}
.sub-line {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-sub);
}

/* ---- MLBドジャース（株価バーと同じ高さのスリム表示） ---- */
.mlb {
  margin-top: 24px;
}
.mlb-track {
  display: flex;
  gap: 6px;
  height: var(--strip-h);
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  -webkit-overflow-scrolling: touch;
}
/* 先頭の概要セル */
.mlb-sum {
  background: var(--accent-soft) !important;
  justify-content: center !important;
  min-width: 92px;
}
.mlb-sum-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-strong);
}
.mlb-sum-rec {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}
.mlb-sum-today {
  font-size: 0.68rem;
  color: var(--text-sub);
}
/* 試合コマ（3行で高さに収める） */
.mlb-cell {
  flex: 0 0 auto;
  width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: outline 0.12s;
}
.mlb-cell:hover {
  outline: 1px solid var(--accent);
}
.mlb-cell.today {
  background: var(--accent-soft);
  outline: 1px solid var(--accent);
}
.mlb-cell-date {
  font-size: 0.68rem;
  color: var(--text-sub);
}
.mlb-cell-opp {
  font-size: 0.7rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.mlb-cell-sl {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mlb-badge {
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mlb-cell-score {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text);
}
.result-win {
  background: var(--good);
}
.result-lose {
  background: var(--text-muted);
}
.result-live {
  background: var(--down);
}
.result-upcoming {
  background: var(--cool);
}

/* ---- フッター ---- */
.page-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- スマホ向けの微調整 ---- */
@media (max-width: 480px) {
  .container {
    padding: 18px 12px 32px;
  }
  .page-header h1 {
    font-size: 1.35rem;
  }
}
