/* =========================================================
     Suidobashi Station Crowd Forecast
     - WordPress 固定ページに iframe 埋め込み前提の単体ページ
     - レスポンシブ: スマホ縦カード / PC 横並び
     ========================================================= */

  :root {
    /* === Royal Azure基調 + 大学ピンクアクセント + 虹色傘リスク色 === */
    /* ベース: Royal Azure (#196BE9) を中心にトーン展開 */
    --brand-900: #0a2a5c;   /* 最濃: 見出し・ヘッダー罫線 */
    --brand-800: #0f3e8a;
    --brand-700: #196BE9;   /* Royal Azure 本色 */
    --brand-600: #4287ed;
    --brand-500: #7EA9F8;   /* Bali: 中立・情報系に */
    --brand-300: #b1c8f7;
    --brand-100: #dde8fb;
    --brand-50:  #eef3fd;
    --paper:    #fbfcfe;

    /* インク (本文用): やや濃紺寄り */
    --ink-900: #0f1f3a;
    --ink-700: #2a3a5a;
    --ink-500: #586a8a;
    --ink-300: #9aa6bd;
    --ink-100: #e6ebf3;
    --ink-50:  #f3f6fb;

    /* 大学カラー (ピンク): アクセントとして限定使用 */
    --accent:      #f25089;
    --accent-soft: #fde0ec;
    --accent-deep: #c93a6e;

    /* リスクレベル: 虹色傘パレット (信号機順) */
    --risk-1: #0ADF97;   /* 低: Medium Spring Green */
    --risk-2: #E4E171;   /* やや注意: Dusty Lemon */
    --risk-3: #F4BF57;   /* 中: Saffron */
    --risk-4: #FF401E;   /* 高: Scarlet Flame */
    --risk-5: #A82610;   /* 非常に高: Scarlet Flame の深色 */

    --warn-bg: #fcf7d6;
    --warn-border: #d4a017;
    --warn-ink: #5b430a;

    --danger-bg: #ffe4dc;
    --danger-border: #FF401E;
    --danger-ink: #6e1a08;

    --shadow-sm: 0 1px 2px rgba(15,31,58,.06), 0 1px 3px rgba(15,31,58,.04);
    --shadow-md: 0 4px 14px rgba(15,31,58,.08), 0 2px 6px rgba(15,31,58,.05);

    --radius: 10px;
    --radius-sm: 6px;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
    color: var(--ink-900);
    background: var(--paper);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
  }

  .wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 18px 80px;
  }

  /* ========== ヘッダー ========== */
  .site-header {
    border-bottom: 3px solid var(--brand-700);
    padding-bottom: 14px;
    margin-bottom: 22px;
    position: relative;
  }
  .site-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -7px;
    height: 3px;
    background: var(--accent);
  }

  /* ロゴ + タイトル横並び */
  .logo-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
  }
  .logo {
    width: clamp(120px, 21vw, 173px);
    height: auto;
    display: block;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-drag: none;
  }
  .logo-wrap .ja-title {
    font-family: "Zen Kaku Gothic Antique", sans-serif;
    font-size: clamp(17px, 3.2vw, 24px);
    color: var(--brand-900);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
  }
  .logo-wrap .title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .logo-wrap .ja-subtitle {
    font-family: "Zen Kaku Gothic Antique", sans-serif;
    font-size: clamp(13px, 2.4vw, 18px);
    color: var(--accent);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.02em;
  }

  /* スクリーンリーダー用 視覚的非表示 */
  .visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
  .header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--ink-500);
    font-family: "JetBrains Mono", monospace;
  }
  .header-meta .dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    vertical-align: 1px;
  }
  .update-btn {
    margin-left: auto;
    background: var(--brand-700);
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-family: "Noto Sans JP", sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background .15s;
  }
  .update-btn:hover { background: var(--brand-800); }

  /* ========== セクション共通 ========== */
  .section {
    margin-bottom: 28px;
  }
  .section-label {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--brand-100);
    padding-bottom: 6px;
  }
  .section-label h2 {
    font-family: "Zen Kaku Gothic Antique", sans-serif;
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: var(--brand-900);
    letter-spacing: 0.01em;
  }
  .section-label .sub {
    font-size: 11px;
    color: var(--ink-500);
    margin-left: auto;
    font-family: "JetBrains Mono", monospace;
  }

  /* ========== ① 当日 現況 4カード ========== */
  .now-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .now-card {
    background: #fff;
    border: 1px solid var(--brand-100);
    border-top: 4px solid var(--brand-700);
    border-radius: var(--radius);
    padding: 14px 14px 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    min-height: 130px;
    display: flex;
    flex-direction: column;
  }
  .now-card.risk-1 { border-top-color: var(--risk-1); }
  .now-card.risk-2 { border-top-color: var(--risk-2); }
  .now-card.risk-3 { border-top-color: var(--risk-3); }
  .now-card.risk-4 { border-top-color: var(--risk-4); }
  .now-card.risk-5 { border-top-color: var(--risk-5); }
  .now-card.is-info { border-top-color: var(--brand-500); } /* 中立情報 (列車平常など) */

  .now-card .label {
    font-size: 11px;
    color: var(--ink-500);
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    text-transform: none;
  }
  .now-card .value {
    font-family: "Zen Kaku Gothic Antique", sans-serif;
    font-size: 26px;
    font-weight: 900;
    line-height: 1.1;
    margin: 4px 0 8px;
    letter-spacing: -0.01em;
  }
  .now-card .note {
    font-size: 11.5px;
    color: var(--ink-700);
    margin-top: auto;
    line-height: 1.45;
  }
  .now-card .note .time {
    font-family: "JetBrains Mono", monospace;
    font-weight: 500;
  }
  .now-card .note .weekday-note {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--ink-100);
    font-size: 11px;
    color: var(--brand-800);
    line-height: 1.4;
  }
  .now-card .note .delay-source-note {
    margin-top: 3px;
    font-size: 10.5px;
    color: var(--ink-500);
    line-height: 1.3;
  }
  .now-card .note .source-lines {
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--ink-600);
    line-height: 1.55;
  }
  .now-card .note .source-row {
    margin-bottom: 2px;
  }
  .now-card .note .source-label-link {
    color: var(--brand-700);
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .now-card .note .source-label-link:hover {
    color: var(--brand-900);
  }

  /* 大きな数値表示用: 読みやすさのため濃いめに */
  .v-risk-1 { color: #088c5e; }   /* 緑 (濃) */
  .v-risk-2 { color: #8a8a18; }   /* 黄 (濃) */
  .v-risk-3 { color: #b07e0f; }   /* サフラン (濃) */
  .v-risk-4 { color: var(--risk-4); }
  .v-risk-5 { color: var(--risk-5); }

  /* ========== ② 現況の主因 ========== */
  .reasons-box {
    background: #fff;
    border: 1px solid var(--brand-100);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 14px 16px;
  }
  .reasons-box .heading {
    font-size: 12px;
    color: var(--ink-500);
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.04em;
  }
  .reasons-list {
    list-style: none;
    padding: 0; margin: 0;
  }
  .reasons-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--brand-100);
    font-size: 13.5px;
  }
  .reasons-list li:last-child { border-bottom: none; }
  .reasons-list .marker {
    flex-shrink: 0;
    width: 4px;
    align-self: stretch;
    background: var(--brand-700);
    border-radius: 2px;
    margin-top: 4px;
    margin-bottom: 4px;
  }
  .reasons-list .marker.r4 { background: var(--risk-4); }
  .reasons-list .marker.r3 { background: var(--risk-3); }
  .reasons-list .marker.r2 { background: var(--risk-2); }
  .reasons-list .venue {
    font-weight: 700;
    color: var(--brand-900);
  }
  .reasons-list .detail {
    color: var(--ink-700);
  }

  /* ========== ⚠ 簡易免責(現況直下) ========== */
  .disclaimer-short {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--warn-ink);
    line-height: 1.55;
    display: flex;
    gap: 10px;
    align-items: flex-start;
  }
  .disclaimer-short .icon {
    flex-shrink: 0;
    font-weight: 900;
    font-size: 14px;
    line-height: 1.2;
  }

  /* ========== ④ このあと2-3時間 ========== */
  .timeline {
    background: #fff;
    border: 1px solid var(--brand-100);
    border-radius: var(--radius);
    padding: 14px 16px;
  }
  .timeline-row {
    display: grid;
    grid-template-columns: 130px 90px 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--brand-100);
    font-size: 13.5px;
  }
  .timeline-row:last-child { border-bottom: none; }
  .timeline-row .t {
    font-family: "JetBrains Mono", monospace;
    font-weight: 500;
    color: var(--brand-900);
    font-size: 13px;
  }
  .timeline-row .desc {
    color: var(--ink-700);
    font-size: 12.5px;
  }

  /* リスクバッジ共通 */
  .badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    text-align: center;
    min-width: 56px;
  }
  .badge.r1 { background: var(--risk-1); color: #003d28; }      /* 緑: 濃緑文字 */
  .badge.r2 { background: var(--risk-2); color: #4a4708; }      /* 黄: 濃文字 */
  .badge.r3 { background: var(--risk-3); color: #4a3508; }      /* サフラン: 濃文字 */
  .badge.r4 { background: var(--risk-4); color: #fff; }         /* スカーレット: 白 */
  .badge.r5 { background: var(--risk-5); color: #fff; }         /* 深紅: 白 */

  /* ========== ⑤ 授業に間に合いそう? 時限別到着リスク ========== */
  .class-table-wrap {
    background: #fff;
    border: 1px solid var(--brand-100);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .class-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .class-table thead th {
    background: var(--brand-50);
    color: var(--brand-800);
    font-weight: 500;
    text-align: left;
    padding: 10px 14px;
    font-size: 11.5px;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--brand-100);
  }
  .class-table thead th:nth-child(2),
  .class-table thead th:nth-child(3),
  .class-table thead th:nth-child(4) {
    text-align: center;
  }
  .class-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--brand-100);
    vertical-align: middle;
  }
  .class-table tbody tr:last-child td { border-bottom: none; }
  .class-table tbody tr:hover { background: var(--brand-50); }
  .class-table .period {
    font-family: "Zen Kaku Gothic Antique", sans-serif;
    font-weight: 700;
    color: var(--brand-900);
    font-size: 14px;
    width: 70px;
    white-space: nowrap;
  }
  .class-table .time {
    font-family: "JetBrains Mono", monospace;
    color: var(--ink-700);
    font-size: 12.5px;
    text-align: center;
    white-space: nowrap;
  }
  .class-table .arrival-window {
    font-family: "JetBrains Mono", monospace;
    color: var(--ink-500);
    font-size: 11.5px;
    text-align: center;
    white-space: nowrap;
  }
  .class-table .risk-cell {
    text-align: center;
  }
  .class-table .note {
    color: var(--ink-700);
    font-size: 12px;
  }
  /* 既に終了した時限はグレーアウト */
  .class-table tbody tr.past-period {
    opacity: 0.45;
  }
  .class-table tbody tr.past-period td {
    color: var(--ink-500);
  }
  .class-table tbody tr.past-period:hover {
    background: transparent;
  }
  .class-note {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--ink-500);
    line-height: 1.5;
  }
  .class-note strong {
    color: var(--brand-700);
    font-weight: 700;
  }

  /* ========== ⑥ 本日のイベント表 (PC) ========== */
  .event-table-wrap {
    background: #fff;
    border: 1px solid var(--brand-100);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .event-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .event-table thead th {
    background: var(--brand-50);
    color: var(--brand-800);
    font-weight: 500;
    text-align: left;
    padding: 10px 12px;
    font-size: 11.5px;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--brand-100);
    white-space: nowrap;
  }
  .event-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--brand-100);
    vertical-align: middle;
  }
  .event-table tbody tr:last-child td { border-bottom: none; }
  .event-table tbody tr:hover { background: var(--brand-50); }
  .event-table .venue {
    font-weight: 700;
    color: var(--brand-900);
    white-space: nowrap;
  }
  .event-table .ev-name {
    color: var(--ink-700);
  }
  .event-table .num {
    font-family: "JetBrains Mono", monospace;
    color: var(--ink-700);
    font-size: 12.5px;
    text-align: right;
    white-space: nowrap;
  }
  .event-table .time {
    font-family: "JetBrains Mono", monospace;
    color: var(--ink-700);
    font-size: 12.5px;
    white-space: nowrap;
  }
  .event-table .est-flag {
    font-size: 9px;
    color: var(--ink-500);
    margin-left: 4px;
    vertical-align: 2px;
  }
  .event-table .peak {
    font-family: "JetBrains Mono", monospace;
    font-size: 11.5px;
    color: var(--ink-700);
  }

  /* スマホ用カード(初期は非表示) */
  .event-cards { display: none; }

  /* ========== ⑥ 1週間 折りたたみ ========== */
  .week-list { display: flex; flex-direction: column; gap: 8px; }
  .day {
    background: #fff;
    border: 1px solid var(--brand-100);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .day summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 70px 1fr auto auto;
    align-items: center;
    gap: 14px;
    background: #fff;
    transition: background .15s;
  }
  .day summary::-webkit-details-marker { display: none; }
  .day summary:hover { background: var(--brand-50); }
  .day[open] summary {
    border-bottom: 1px solid var(--brand-100);
    background: var(--brand-50);
  }
  .day .date {
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
    color: var(--brand-900);
    font-size: 14px;
  }
  .day .date .dow {
    font-size: 11px;
    color: var(--accent);
    margin-left: 4px;
    font-weight: 700;
  }
  .day .summary-text {
    font-size: 12.5px;
    color: var(--ink-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .day .count {
    font-size: 11px;
    color: var(--ink-500);
    font-family: "JetBrains Mono", monospace;
  }
  .day .arrow {
    font-size: 11px;
    color: var(--brand-500);
    transition: transform .15s;
  }
  .day[open] .arrow { transform: rotate(90deg); }

  .day-body {
    padding: 4px 16px 14px;
    font-size: 13px;
    color: var(--ink-700);
  }
  .day-event {
    padding: 10px 0;
    border-bottom: 1px dashed var(--brand-100);
    display: grid;
    grid-template-columns: 110px 1fr auto auto;
    gap: 12px;
    align-items: center;
  }
  .day-event:last-child { border-bottom: none; }
  .day-event .v {
    font-weight: 700;
    color: var(--brand-900);
    font-size: 12.5px;
  }
  .day-event .n {
    color: var(--ink-700);
    font-size: 12.5px;
  }
  .day-event .t {
    font-family: "JetBrains Mono", monospace;
    font-size: 11.5px;
    color: var(--ink-500);
    white-space: nowrap;
  }

  /* ========== 凡例 ========== */
  .legend {
    background: var(--brand-50);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: center;
    font-size: 11.5px;
    color: var(--ink-700);
  }
  .legend .lab { font-weight: 500; color: var(--brand-800); }
  .legend .item { display: flex; align-items: center; gap: 6px; }

  /* カードラベルのサブ説明 */
  .now-card .label-sub {
    display: block;
    margin-top: 2px;
    font-size: 10.5px;
    color: var(--ink-500);
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.35;
  }

  /* 混雑レベルの目安テーブル */
  .legend-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    color: var(--ink-900);
    background: var(--brand-50);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .legend-table thead th {
    background: var(--brand-100);
    color: var(--brand-800);
    font-weight: 600;
    font-size: 11.5px;
    text-align: left;
    padding: 8px 12px;
    letter-spacing: 0.02em;
  }
  .legend-table tbody td {
    padding: 10px 12px;
    border-top: 1px solid var(--brand-100);
    vertical-align: top;
    line-height: 1.5;
  }
  .legend-table tbody tr:first-child td { border-top: none; }
  .legend-table tbody td:first-child {
    white-space: nowrap;
    width: 1%;
  }
  .legend-note {
    margin-top: 10px;
    font-size: 11px;
    color: var(--ink-500);
    line-height: 1.5;
  }

  /* 曜日別遅延傾向 */
  .delay-history-intro {
    font-size: 12.5px;
    color: var(--ink-700);
    line-height: 1.6;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--brand-50);
    border-left: 3px solid var(--brand-500);
    border-radius: 4px;
  }
  .delay-history-table-wrap {
    overflow-x: auto;
  }
  .delay-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--ink-900);
  }
  .delay-history-table thead th {
    background: var(--brand-100);
    color: var(--brand-800);
    font-weight: 600;
    font-size: 11.5px;
    text-align: left;
    padding: 9px 12px;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
  .delay-history-table thead th:nth-child(2),
  .delay-history-table thead th:nth-child(3),
  .delay-history-table thead th:nth-child(4) {
    text-align: right;
  }
  .delay-history-table tbody td {
    padding: 10px 12px;
    border-top: 1px solid var(--ink-100);
    vertical-align: middle;
  }
  .delay-history-table tbody td.slot {
    font-weight: 500;
    white-space: nowrap;
  }
  .delay-history-table tbody td.rate,
  .delay-history-table tbody td.delay,
  .delay-history-table tbody td.sample {
    text-align: right;
    font-family: "JetBrains Mono", monospace;
    white-space: nowrap;
  }
  .rate-value {
    font-weight: 700;
    font-size: 14px;
  }
  .rate-value.rate-high { color: #cf2b2b; }   /* 60%以上: 赤 */
  .rate-value.rate-mid  { color: #d97706; }   /* 30〜59%: オレンジ */
  .rate-value.rate-low  { color: #088c5e; }   /* 30%未満: 緑 */
  .rate-value.rate-none { color: var(--ink-300); }
  .rate-count {
    font-size: 11px;
    color: var(--ink-500);
    margin-left: 4px;
  }
  .delay-history-note {
    margin-top: 10px;
    font-size: 11px;
    color: var(--ink-500);
    line-height: 1.5;
  }

  /* ========== ⑦ 詳細免責 ========== */
  .disclaimer-full {
    margin-top: 36px;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    padding: 16px 18px;
    color: var(--danger-ink);
  }
  .disclaimer-full summary {
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .disclaimer-full summary::-webkit-details-marker { display: none; }
  .disclaimer-full summary .icon { font-size: 16px; }
  .disclaimer-full summary .arrow {
    margin-left: auto;
    font-size: 11px;
    transition: transform .15s;
  }
  .disclaimer-full[open] summary .arrow { transform: rotate(90deg); }
  .disclaimer-full .body {
    margin-top: 12px;
    font-size: 12.5px;
    line-height: 1.75;
    border-top: 1px solid rgba(200,50,28,.3);
    padding-top: 12px;
  }
  .disclaimer-full .body strong {
    color: var(--danger-ink);
  }
  .disclaimer-full ul {
    margin: 6px 0 10px;
    padding-left: 20px;
  }

  /* ========== フッター ========== */
  .site-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 3px solid var(--brand-700);
    position: relative;
    font-size: 11px;
    color: var(--ink-500);
    font-family: "JetBrains Mono", monospace;
    text-align: center;
    letter-spacing: 0.04em;
  }
  .site-footer::before {
    content: "";
    position: absolute;
    left: 50%; top: -3px;
    width: 60px; height: 3px;
    transform: translateX(-50%);
    background: var(--accent);
  }
  .site-footer .meta { margin-top: 4px; color: var(--ink-300); }

  /* ========== レスポンシブ: タブレット ========== */
  @media (max-width: 900px) {
    .now-grid { grid-template-columns: repeat(2, 1fr); }
    .timeline-row { grid-template-columns: 110px 80px 1fr; }
  }

  /* ========== レスポンシブ: スマホ ========== */
  @media (max-width: 640px) {
    .wrap { padding: 16px 14px 60px; }

    .header-meta { font-size: 11px; gap: 6px 12px; }
    .update-btn { margin-left: 0; }

    /* スマホ: ロゴ+サブタイトルは横並びのまま、文字を少し小さく */
    .logo-wrap { gap: 12px; }
    .logo-wrap .ja-title { font-size: 16px; line-height: 1.3; }
    .logo-wrap .ja-subtitle { font-size: 12px; line-height: 1.25; }

    .now-grid { grid-template-columns: 1fr; }
    .now-card { min-height: auto; }
    .now-card .value { font-size: 24px; }

    .timeline-row {
      grid-template-columns: 1fr auto;
      grid-template-rows: auto auto;
      gap: 4px 10px;
    }
    .timeline-row .t { grid-column: 1; grid-row: 1; }
    .timeline-row .badge { grid-column: 2; grid-row: 1; }
    .timeline-row .desc { grid-column: 1 / -1; grid-row: 2; }

    /* 振鈴表: スマホでは判定窓セルを非表示にして簡潔に */
    .class-table thead th:nth-child(3),
    .class-table tbody td:nth-child(3) {
      display: none;
    }
    .class-table .period { width: 50px; font-size: 13px; }
    .class-table thead th { padding: 8px 10px; font-size: 11px; }
    .class-table tbody td { padding: 10px 8px; }
    .class-table .time { font-size: 11.5px; }

    /* イベント: 表 -> カード切替 */
    .event-table-wrap { display: none; }
    .event-cards {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .ev-card {
      background: #fff;
      border: 1px solid var(--brand-100);
      border-left: 4px solid var(--brand-700);
      border-radius: var(--radius);
      padding: 12px 14px;
    }
    .ev-card.r5 { border-left-color: var(--risk-5); }
    .ev-card.r4 { border-left-color: var(--risk-4); }
    .ev-card.r3 { border-left-color: var(--risk-3); }
    .ev-card.r2 { border-left-color: var(--risk-2); }
    .ev-card.r1 { border-left-color: var(--risk-1); }
    .ev-card .v {
      font-size: 11px;
      color: var(--accent);
      letter-spacing: 0.04em;
      margin-bottom: 2px;
      font-weight: 700;
    }
    .ev-card .n {
      font-family: "Zen Kaku Gothic Antique", sans-serif;
      font-weight: 700;
      font-size: 14.5px;
      color: var(--brand-900);
      margin-bottom: 8px;
      line-height: 1.4;
    }
    .ev-card .meta {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 4px 10px;
      font-size: 12px;
      color: var(--ink-700);
      margin-bottom: 8px;
    }
    .ev-card .meta dt {
      color: var(--ink-500);
      font-weight: 500;
      margin: 0;
    }
    .ev-card .meta dd {
      margin: 0;
      font-family: "JetBrains Mono", monospace;
      font-size: 12px;
    }
    .ev-card .badges {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px dashed var(--brand-100);
    }
    .ev-card .badges .blk {
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .ev-card .badges .lbl {
      font-size: 10.5px;
      color: var(--ink-500);
    }

    .day summary {
      grid-template-columns: 60px 1fr auto;
      gap: 8px;
      padding: 10px 14px;
    }
    .day .summary-text { display: none; }
    .day-event {
      grid-template-columns: 1fr;
      gap: 4px;
      padding: 10px 0;
    }
    .day-event .ev-badges {
      display: flex; gap: 6px; margin-top: 4px;
    }

    .legend { font-size: 11px; }
    .section-label h2 { font-size: 15px; }
  }

  /* 印刷 */
  @media print {
    .update-btn, details summary .arrow { display: none; }
    .day, .disclaimer-full { break-inside: avoid; }
    body { background: #fff; }
  }