/* ===== 表示設定（テーマ・文字サイズ） ===== */

/* --- ヘッダーの歯車ボタンとパネル --- */
.tt-ui-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: 12px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid #2a3040;
  background: rgba(255, 255, 255, 0.03);
  color: #aeb6c4;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s, border-color 0.2s, color 0.2s, background 0.2s;
}
.tt-ui-btn svg { display: block; }
.tt-ui-btn:hover { opacity: 1; color: #fff; border-color: #3b82f6; }
.tt-ui-btn[aria-expanded="true"] { color: #fff; border-color: #3b82f6; }

.tt-ui-btn.is-fixed { position: fixed; top: 14px; right: 14px; z-index: 1200; }

.tt-ui-panel {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 1250;
  width: 232px;
  max-width: calc(100vw - 20px);
  padding: 12px;
  display: none;
  background: #12151c;
  border: 1px solid #2a3040;
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  color: #e6e9ee;
  font-size: 13px;
  line-height: 1.4;
}
.tt-ui-panel.open { display: block; }

.tt-ui-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tt-ui-title { font-weight: 700; font-size: 13px; }
.tt-ui-close {
  border: 0; background: transparent; color: #9aa0aa; font-size: 18px;
  line-height: 1; cursor: pointer; padding: 0 2px;
}
.tt-ui-close:hover { color: #fff; }

.tt-ui-group { margin-top: 10px; }
.tt-ui-label { color: #9aa0aa; font-size: 11px; margin-bottom: 5px; letter-spacing: 0.03em; }
.tt-ui-row { display: flex; gap: 6px; }
.tt-ui-opt {
  flex: 1;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid #2a3040;
  background: transparent;
  color: #c9d0dc;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tt-ui-opt:hover { border-color: #3b82f6; color: #fff; }
.tt-ui-opt.is-active { background: #0052ff; border-color: #0052ff; color: #fff; font-weight: 700; }
.tt-ui-note { color: #7c8494; font-size: 11px; margin-top: 10px; }

/* --- ドロワー（ハンバーガーメニュー）内の設定ブロック --- */
.tt-ui-dsec {
  padding: 18px 22px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.tt-ui-dtitle {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--gray, #9aa0aa);
  margin-bottom: 12px;
}
.tt-ui-dsec .tt-ui-group { margin-top: 12px; }

/* --- 文字サイズ --- */
html[data-ui-fs="s"] body { zoom: 0.94; }
html[data-ui-fs="l"] body { zoom: 1.1; }

/* hidden 属性が display 指定に負けないように */
.next-live[hidden] { display: none !important; }

/* --- ライトテーマ --- */
html[data-ui-theme="light"] {
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #e3e6ea;
  --text: #151a21;
  --gray: #5b6472;
  --blue-light: #1d4ed8;

  --cf-black: #f6f7f9;
  --cf-dark: #ffffff;
  --cf-gray: #5b6472;
  --cf-blue-light: #1d4ed8;

  color-scheme: light;
}

html[data-ui-theme="light"] body {
  background: #f6f7f9 !important;
  background-image: none !important;
  color: #151a21 !important;
}

html[data-ui-theme="light"] header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom-color: #e3e6ea !important;
  box-shadow: none !important;
}
html[data-ui-theme="light"] footer { background: transparent !important; border-top-color: #e3e6ea !important; }

html[data-ui-theme="light"] h1,
html[data-ui-theme="light"] h2,
html[data-ui-theme="light"] h3,
html[data-ui-theme="light"] h4,
html[data-ui-theme="light"] h5 { color: #10151b !important; }

html[data-ui-theme="light"] .hero {
  background: radial-gradient(60% 50% at 15% 0%, rgba(59, 130, 246, 0.10), transparent 60%),
              radial-gradient(50% 50% at 90% 10%, rgba(14, 165, 233, 0.08), transparent 60%),
              linear-gradient(180deg, #ffffff, #f6f7f9 70%) !important;
}
html[data-ui-theme="light"] .hero::before,
html[data-ui-theme="light"] .hero::after { background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 65%) !important; }
html[data-ui-theme="light"] .hero h1 .grad,
html[data-ui-theme="light"] .stat .num {
  background: linear-gradient(90deg, #1d4ed8, #0284c7 55%, #2563eb) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}
html[data-ui-theme="light"] .cta { background: radial-gradient(circle at center, rgba(59, 130, 246, 0.10), transparent 70%) !important; }
html[data-ui-theme="light"] .stats { background: #ffffff !important; border-color: #e3e6ea !important; }
html[data-ui-theme="light"] .hero-inner {
  background: #ffffff !important;
  border-color: #e3e6ea !important;
  box-shadow: 0 10px 30px rgba(20, 30, 50, 0.06) !important;
}
html[data-ui-theme="light"] .badge {
  color: #1d4ed8 !important;
  background: linear-gradient(#ffffff, #ffffff) padding-box,
              linear-gradient(90deg, var(--cf-blue), var(--cf-orange)) border-box !important;
}
html[data-ui-theme="light"] .next-live {
  background: #ffffff !important;
  border-color: #d8dde5 !important;
  color: #5b6472 !important;
}
html[data-ui-theme="light"] .next-live .cd { color: #1d4ed8 !important; }

/* ラベル類（記事のカテゴリ・バージョン） */
html[data-ui-theme="light"] .cat { color: #b45309 !important; background: rgba(245, 158, 11, 0.14) !important; }
html[data-ui-theme="light"] .ver { color: #1d4ed8 !important; background: rgba(59, 130, 246, 0.12) !important; }

/* カード・パネル類 */
html[data-ui-theme="light"] .card,
html[data-ui-theme="light"] .post,
html[data-ui-theme="light"] .log,
html[data-ui-theme="light"] .news-card,
html[data-ui-theme="light"] .sch-card,
html[data-ui-theme="light"] .rm-card,
html[data-ui-theme="light"] .service,
html[data-ui-theme="light"] .item,
html[data-ui-theme="light"] .panel,
html[data-ui-theme="light"] .mcard,
html[data-ui-theme="light"] .cal-card,
html[data-ui-theme="light"] .cal-wrap,
html[data-ui-theme="light"] .welcome,
html[data-ui-theme="light"] .status-item,
html[data-ui-theme="light"] .inc-item,
html[data-ui-theme="light"] .modal,
html[data-ui-theme="light"] .searchbar,
html[data-ui-theme="light"] .tab-btn,
html[data-ui-theme="light"] .chip,
html[data-ui-theme="light"] .rel-card,
html[data-ui-theme="light"] .toc {
  background: #ffffff !important;
  border-color: #e3e6ea !important;
  color: #151a21 !important;
}

/* フォーム */
html[data-ui-theme="light"] input,
html[data-ui-theme="light"] textarea,
html[data-ui-theme="light"] select,
html[data-ui-theme="light"] .field input,
html[data-ui-theme="light"] .field textarea,
html[data-ui-theme="light"] .field select,
html[data-ui-theme="light"] .lang-btn,
html[data-ui-theme="light"] .mini-btn,
html[data-ui-theme="light"] .tab {
  background: #ffffff !important;
  border-color: #d8dde5 !important;
  color: #151a21 !important;
}
html[data-ui-theme="light"] .lang-btn.active { background: #0052ff !important; color: #fff !important; border-color: #0052ff !important; }

/* リンク・補助テキスト */
html[data-ui-theme="light"] a { color: inherit; }
html[data-ui-theme="light"] .nav-links a,
html[data-ui-theme="light"] nav a,
html[data-ui-theme="light"] .post .date,
html[data-ui-theme="light"] .post .ex,
html[data-ui-theme="light"] .meta-row,
html[data-ui-theme="light"] .log ul,
html[data-ui-theme="light"] .sub,
html[data-ui-theme="light"] .empty { color: #5b6472 !important; }
html[data-ui-theme="light"] .nav-links a:hover,
html[data-ui-theme="light"] nav a:hover,
html[data-ui-theme="light"] .post:hover h2 { color: #10151b !important; }

/* カレンダー（配信予定） */
html[data-ui-theme="light"] .cal-day {
  background: #ffffff !important;
  border-color: #e3e6ea !important;
  color: #151a21 !important;
}
html[data-ui-theme="light"] .cal-day.blank { background: transparent !important; border-color: transparent !important; }
html[data-ui-theme="light"] .cal-day:hover { background: #f1f4f9 !important; border-color: #cbd5e1 !important; }
html[data-ui-theme="light"] .cal-day.has-event .num { color: #10151b !important; }
html[data-ui-theme="light"] .cal-day.selected { background: rgba(0, 82, 255, 0.10) !important; }
html[data-ui-theme="light"] .cal-nav button {
  background: #ffffff !important;
  border-color: #d8dde5 !important;
  color: #151a21 !important;
}
html[data-ui-theme="light"] .cal-nav button:hover { background: #f1f4f9 !important; }

/* 影は控えめに */
html[data-ui-theme="light"] .post:hover,
html[data-ui-theme="light"] .card:hover,
html[data-ui-theme="light"] .news-card:hover,
html[data-ui-theme="light"] .sch-card:hover { box-shadow: 0 6px 18px rgba(20, 30, 50, 0.08) !important; }

/* パネル自身（ライト） */
html[data-ui-theme="light"] .tt-ui-btn {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: #d8dde5 !important;
  color: #4b5563 !important;
}
html[data-ui-theme="light"] .tt-ui-btn:hover { color: #111827 !important; border-color: #3b82f6 !important; }
html[data-ui-theme="light"] .tt-ui-panel {
  background: #ffffff !important;
  border-color: #e3e6ea !important;
  color: #151a21 !important;
  box-shadow: 0 12px 30px rgba(20, 30, 50, 0.14) !important;
}
html[data-ui-theme="light"] .tt-ui-dsec { border-top-color: #e3e6ea !important; }
html[data-ui-theme="light"] .tt-ui-close,
html[data-ui-theme="light"] .tt-ui-label,
html[data-ui-theme="light"] .tt-ui-note { color: #6b7280 !important; }
html[data-ui-theme="light"] .tt-ui-opt { border-color: #d8dde5 !important; color: #374151 !important; }
html[data-ui-theme="light"] .tt-ui-opt.is-active { background: #0052ff !important; border-color: #0052ff !important; color: #fff !important; }
