/* Web フォントの読み込みは theme-companion.css の1本（Zen Kaku Gothic New）に集約した。
   ここで Bebas Neue / Noto Sans JP を追加読み込みすると書体が混ざるため import しない。 */

:root {
  --bg:           #070707;
  --card-bg:      #ffffff;
  --accent:       #c6002b;
  --accent-light: #ffe6eb;
  --accent-dim:   #ffccd7;
  --green:        #c6002b;
  --green-light:  #ffe6eb;
  --red:          #ff1a45;
  --red-light:    #2a0e14;
  --link:         #111111;
  --link-light:   #ffffff;
  --text:         #111111;
  --text-sub:     #5e5e5e;
  --border:       #111111;
  --section-bg:   #f3f3f3;
  --section-bg2:  #e3e3e3;
  --radius-lg:    0px;
  --radius-md:    0px;
  --radius-sm:    0px;
}

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

body {
  font-family: 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  background:
    radial-gradient(circle at 10% 15%, rgba(198, 0, 43, 0.26) 0 2px, transparent 2px 100%),
    radial-gradient(circle at 72% 38%, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 100%),
    linear-gradient(164deg, #080808 0%, #101010 42%, #000 100%);
  background-size: 14px 14px, 11px 11px, 100% 100%;
  color: #f7f7f7;
  min-height: 100vh;
  padding: 24px 20px;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(130deg, transparent 33%, rgba(198, 0, 43, 0.14) 33.5%, rgba(198, 0, 43, 0.14) 34.2%, transparent 35%);
  opacity: 0.75;
  z-index: -1;
}

/* ========== Header ========== */
header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

header h1 {
  font-size: 2.35rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.1em;
  text-shadow: 3px 3px 0 #c6002b;
}

#today {
  font-size: 0.82rem;
  color: #d9d9d9;
  flex: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-btn {
  width: 36px;
  height: 36px;
  border: 2px solid #ffffff;
  border-radius: 0;
  background: #111111;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 4px 0 #c6002b;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.settings-btn:hover { background: #c6002b; border-color: #fff; }

.analytics-band {
  max-width: 1400px;
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.analytics-card {
  background: #fff;
 
  padding: 12px 14px;
  color: #111;
  position: relative;
  overflow: hidden;
  box-shadow: 8px 8px 0 #c6002b;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 4% 100%, 0 76%);
}

.analytics-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(198, 0, 43, 0.15) 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: 0.45;
  pointer-events: none;
}

.analytics-label {
  letter-spacing: 0.14em;
  font-size: 1rem;
  margin-bottom: 8px;
}

.analytics-footnote {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-left: 10px;
}

.mobile-side-overlay {
  display: none;
}

/* ========== Layout ========== */
.layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  max-width: 1400px;
  margin: 8px auto 0;
  align-items: start;
}

/* グリッドアイテムの min-width:auto によるはみ出し防止
   （nowrap なプレビュー行や幅広テーブルがカラム幅を押し広げないように） */
.layout > * {
  min-width: 0;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
}

/* ========== Card ========== */
.card {
  background: var(--card-bg) !important;
  border-radius: 0 !important;
  padding: 20px 22px;
 
  box-shadow: 9px 9px 0 rgba(198, 0, 43, 0.95) !important;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 3% 100%, 0 90%);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: none;
}

.card h2 {
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #c6002b;
  margin-bottom: 14px;
}

#col-main {
  margin-top: 0;
  z-index: 3;
}

.right-col {
  margin-top: 0;
  gap: 18px;
  z-index: 1;
}

/* ========== Right column ========== */
.right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-panel-head {
  display: none;
}

.side-close-btn {
 
  background: #fff;
  color: #111;
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 36px;
  padding: 6px 10px;
  cursor: pointer;
}

.modal-section {
  margin-bottom: 18px;
}

.modal-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #c6002b;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal-note {
  font-size: 0.74rem;
  color: var(--text-sub);
  margin-top: 6px;
}

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

/* 設定画面のキー欄（アクセスキー・Gemini・Perxona）で共通の形。
   「設定済み」表示 → 操作ボタン行（接続テスト・削除・結果）の順に揃える */
.key-set-msg {
  font-size: 12.5px;
  color: var(--green);
  font-weight: 700;
}
.key-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.key-test-status {
  font-size: 12px;
  margin-left: 4px;
}

.token-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  outline: none;
  background: var(--section-bg);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.token-input:focus { border-color: var(--accent); background: var(--card-bg); }

.btn-token {
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: opacity 0.15s;
  white-space: nowrap;
  min-height: 44px;
}

.btn-token:hover { opacity: 0.85; }
.btn-token.danger { background: var(--red); }

.modal-status {
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 6px;
  min-height: 18px;
}

/* ========== スマホ対応 ========== */
@media (max-width: 768px) {
  body {
    padding: 10px 10px 72px; /* ボトムナビ分の下余白 */
  }

  header {
    margin-bottom: 10px;
    gap: 10px;
  }

  header h1 {
    font-size: 1.75rem;
  }

  #today {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
  }

  .analytics-band {
    grid-template-columns: 1fr;
    margin-bottom: 8px;
    gap: 10px;
  }

  .analytics-card {
    box-shadow: 6px 6px 0 #c6002b;
    padding: 10px 12px;
  }

  .card {
    padding: 14px 14px;
    border-radius: 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 3% 100%, 0 92%);
    box-shadow: 6px 6px 0 rgba(198, 0, 43, 0.95) !important;
  }

  .settings-btn {
    width: 44px;
    height: 44px;
  }

  .mobile-side-overlay {
    display: none !important;
  }

  .mobile-side-overlay.open {
    display: none !important;
  }

  .right-col {
    position: static;
    width: auto;
    padding: 0;
    background: transparent;
    z-index: 1;
    overflow: visible;
    transform: none;
    transition: none;
    box-shadow: none;
  }

  .side-panel-head {
    display: none;
  }

  .right-col.mobile-open {
    transform: none;
  }
}
