/* COACHING-L ポモドーロタイマー
   スマホ優先。外部フォントは使わず、端末のフォントで表示します。 */

/* 色は COACHING-L のホームページ（coaching-l.net）のブランドカラーに合わせています。
   紺 #042143 / 濃い紺 #02172f / 金 #c09e5c / 濃い金 #98783d / 背景 #f7f8fa / 文字 #293746 */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-muted: #edf0f3;
  --text: #293746;
  --text-muted: #5f6d7c;
  --heading: #042143;
  --accent: #042143; /* 主なボタン・選んだ項目 */
  --accent-strong: #02172f;
  --accent-soft: #eaeef3;
  --accent-contrast: #ffffff;
  --gold: #c09e5c; /* 飾りの線 */
  --gold-text: #98783d; /* 大きな文字（24px 以上）に使う金 */
  --gold-label: #7a5f2c; /* 小さな文字に使う金（背景に対して 4.5:1 以上） */
  --gold-soft: #faf6ec;
  --border: #d3dae2; /* ボタンの枠 */
  --input-border: #808c99; /* 入力欄の枠（背景に対して 3:1 以上） */
  --line: #e0e5ea; /* 区切り線・カードの枠 */
  --focus-halo: rgba(192, 158, 92, 0.22); /* 入力欄を選んだときの金の淡い光（ホームページと同じ） */
  /* グラフ：集中度 1〜5 を紺の濃淡で。灰色は未記入（良し悪しを赤や緑で表さない） */
  --chart-1: #c9d4e0;
  --chart-2: #9db0c6;
  --chart-3: #6a84a3;
  --chart-4: #34527a;
  --chart-5: #042143;
  --chart-none: #eceef1;
  --chart-none-stroke: #aab3bd;
  --chart-track: #f0f2f5;
  --badge-done-bg: #e6ecf3;
  --badge-done-text: #042143;
  --badge-rest-bg: #faf6ec;
  --badge-rest-text: #7a5f2c;
  --focus-ring: #98783d;
  --warn-text: #7a5f2c;

  --radius: 10px; /* カード（ホームページと同じ） */
  --radius-small: 8px; /* ボタン・入力欄（ホームページと同じ） */
  --radius-pill: 999px;
  --shadow: 0 8px 24px rgba(2, 23, 47, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Noto Sans JP", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, sans-serif;

  color-scheme: light dark;
}

/* ダークモードは、紺を背景にして金を差し色にする。
   「自動」で端末がダークのときと、「ダーク」を選んだときの2か所に、同じ値を書いている（変えるときは両方そろえる） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #02172f;
    --surface: #0a2945;
    --surface-muted: #0b2440;
    --text: #e9edf1;
    --text-muted: #a8b4c2;
    --heading: #f3f5f8;
    --accent: #c09e5c;
    --accent-strong: #d1b47a;
    --accent-soft: #0f3152;
    --accent-contrast: #02172f;
    --gold: #c09e5c;
    --gold-text: #d6bd8a;
    --gold-label: #d6bd8a;
    --gold-soft: #2a2a24;
    --border: #24476b;
    --input-border: #557699;
    --line: #1a3a5c;
    --focus-halo: var(--accent-soft);
    /* グラフ：集中度 1〜5 を金の濃淡で */
    --chart-1: #4a4436;
    --chart-2: #6e6143;
    --chart-3: #94804f;
    --chart-4: #b7995b;
    --chart-5: #e0c48a;
    --chart-none: #1a3553;
    --chart-none-stroke: #4f6f92;
    --chart-track: #0f3152;
    --badge-done-bg: #133a5e;
    --badge-done-text: #dbe5f0;
    --badge-rest-bg: #3a3221;
    --badge-rest-text: #e8d3a6;
    --focus-ring: #c09e5c;
    --warn-text: #e3c48f;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  --bg: #02172f;
  --surface: #0a2945;
  --surface-muted: #0b2440;
  --text: #e9edf1;
  --text-muted: #a8b4c2;
  --heading: #f3f5f8;
  --accent: #c09e5c;
  --accent-strong: #d1b47a;
  --accent-soft: #0f3152;
  --accent-contrast: #02172f;
  --gold: #c09e5c;
  --gold-text: #d6bd8a;
  --gold-label: #d6bd8a;
  --gold-soft: #2a2a24;
  --border: #24476b;
  --input-border: #557699;
  --line: #1a3a5c;
  --focus-halo: var(--accent-soft);
  /* グラフ：集中度 1〜5 を金の濃淡で */
  --chart-1: #4a4436;
  --chart-2: #6e6143;
  --chart-3: #94804f;
  --chart-4: #b7995b;
  --chart-5: #e0c48a;
  --chart-none: #1a3553;
  --chart-none-stroke: #4f6f92;
  --chart-track: #0f3152;
  --badge-done-bg: #133a5e;
  --badge-done-text: #dbe5f0;
  --badge-rest-bg: #3a3221;
  --badge-rest-text: #e8d3a6;
  --focus-ring: #c09e5c;
  --warn-text: #e3c48f;
  --shadow: none;
}

/* アプリで選んだ表示に、入力欄やチェックボックスなどブラウザの部品の色も合わせる */
:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

/* ---------- 基本 ---------- */

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

p,
h1,
h2,
h3,
h4,
ol,
dl,
dd,
fieldset {
  margin: 0;
  padding: 0;
}

fieldset {
  border: 0;
  min-width: 0;
}

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

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

[tabindex="-1"]:focus {
  outline: none;
}

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

/* ---------- レイアウト ---------- */

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

main {
  flex: 1;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 32px;
}

.view-center {
  min-height: 62vh;
  min-height: 62dvh;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- 文字 ---------- */

/* スタート画面の上部：ロゴ＋COACHING-L（ホームページのヘッダーと同じ組み方） */
.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  flex: none;
  width: 52px;
  height: 52px;
}

.brand-name {
  color: var(--heading);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.14em;
}

.app-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* 見出し：左に金の線（ホームページの見出しと同じ） */
.lead {
  padding-left: 14px;
  border-left: 4px solid var(--gold);
  color: var(--heading);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.45;
}

.question {
  color: var(--heading);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.5;
}

.field-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
}

legend.field-label {
  margin-bottom: 10px;
}

.hint {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hint-center {
  text-align: center;
}

.hint-warn {
  color: var(--warn-text);
  font-weight: 600;
}

.notice {
  padding: 14px 16px;
  border-radius: var(--radius-small);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.9375rem;
}

/* 画面上部に重ねて出す案内（表示・非表示でボタンの位置が動かないように） */
.touch-hint {
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  z-index: 10;
  max-width: 448px;
  margin: 0 auto;
  box-shadow: var(--shadow);
  text-align: center;
  text-wrap: balance;
  word-break: auto-phrase;
}

.notice-muted {
  background: var(--surface-muted);
}

.break-summary {
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- 入力 ---------- */

.text-input,
.number-input {
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-small);
  background: var(--surface);
  font-size: 1.0625rem;
  appearance: none;
  -webkit-appearance: none;
}

.text-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.text-input:hover,
.number-input:hover {
  border-color: var(--heading);
}

/* 選んだ入力欄は、ホームページと同じく金の枠と淡い光 */
.text-input:focus,
.number-input:focus {
  border-color: var(--focus-ring);
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-halo);
}

.custom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.custom-row .number-input {
  width: 6.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.custom-row .unit {
  font-weight: 600;
}

.custom-row .hint {
  flex-basis: 100%;
}

/* ---------- ボタン ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 24px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-small);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--heading);
}

.btn-secondary:hover {
  border-color: var(--heading);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.btn-large {
  min-height: 64px;
  font-size: 1.1875rem;
}

.btn-small {
  min-height: 48px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* 選択式のボタン（作業時間・集中度・気分） */
.chips {
  display: grid;
  gap: 10px;
}

.chips-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chips-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chips-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.chip {
  min-height: 56px;
  padding: 8px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: var(--heading);
}

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.chip-tall {
  min-height: 64px;
  font-size: 1.375rem;
  font-variant-numeric: tabular-nums;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ---------- スタート ---------- */

.start-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.settings summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
}

.settings summary::-webkit-details-marker {
  display: none;
}

.settings summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}

.settings[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.settings-body {
  padding: 4px 18px 20px;
  gap: 22px;
}

.settings .btn {
  align-self: flex-start;
}

/* オン・オフの切り替え（チェックボックス） */
.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  font-weight: 500;
  cursor: pointer;
}

.toggle input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- 集中・休憩 ---------- */

.time {
  color: var(--heading);
  font-size: clamp(4.5rem, 25vw, 7.5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s ease;
}

.time-break {
  font-size: clamp(3.75rem, 20vw, 6rem);
  color: var(--gold-text);
}

[data-view="focus"][data-paused="true"] .time {
  opacity: 0.45;
}

.intention {
  max-width: 100%;
  color: var(--heading);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.paused-note {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.view-center .actions {
  max-width: 320px;
  margin-top: 12px;
}

.phase-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-label);
  letter-spacing: 0.2em;
}

.prompt {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold); /* 1px の枠より後に書く（ホームページのカードと同じ組み方） */
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 1.125rem;
  line-height: 1.7;
  text-wrap: balance;
  word-break: auto-phrase;
}

.message {
  color: var(--heading);
  text-wrap: balance;
  word-break: auto-phrase;
  line-break: strict;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.8;
  white-space: pre-line;
}

.sub {
  color: var(--text-muted);
}

/* ---------- 振り返り ---------- */

.recap {
  margin-top: -16px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* ---------- 今日の記録 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.stat-value {
  color: var(--heading);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
}

.log-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.log-time {
  color: var(--heading);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.badge {
  padding: 2px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
}

.badge-completed {
  background: var(--badge-done-bg);
  color: var(--badge-done-text);
}

.badge-interrupted {
  background: var(--badge-rest-bg);
  color: var(--badge-rest-text);
}

.log-intention {
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}

.log-intention.is-empty {
  color: var(--text-muted);
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.875rem;
}

.log-meta div {
  display: flex;
  gap: 6px;
}

.log-meta dt {
  color: var(--text-muted);
}

/* ---------- フッター ---------- */

.app-footer {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--text-muted);
}

.footer-brand {
  color: var(--heading);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.footer-privacy {
  margin-top: 2px;
  font-size: 0.75rem;
  text-wrap: balance;
  word-break: auto-phrase;
}

/* ---------- 大きめの画面 ---------- */

@media (min-width: 600px) {
  .app {
    padding-top: 56px;
  }

  .question {
    font-size: 1.5rem;
  }
}

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

/* ---------- 記録（日ごと・週ごと） ---------- */

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-muted);
}

.tab {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.tab[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.period-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.period-title {
  color: var(--heading);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-wrap: balance;
  word-break: auto-phrase;
}

.nav-btn {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--heading);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.nav-btn[aria-disabled="true"] {
  opacity: 0.35;
  cursor: default;
}

.link-btn {
  align-self: center;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--heading);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.period-summary {
  color: var(--heading);
  font-size: 1.0625rem;
  font-weight: 600;
  text-wrap: pretty;
  word-break: auto-phrase;
}

.resumed {
  color: var(--text);
  font-size: 0.9375rem;
}

.note-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 18px 18px;
}

.note-input {
  min-height: 72px;
  resize: vertical;
  font-size: 1rem;
  line-height: 1.6;
}

.copy-fallback {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copy-fallback textarea {
  font-size: 0.875rem;
}

.week-summary,
.chart-box,
.download-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* バックアップの読み込み */
.disclosure .copy-fallback {
  padding-bottom: 4px;
}

.disclosure textarea {
  font-size: 1rem; /* iPhone で貼り付けるときに画面が拡大されないように 16px 以上 */
}

.import-preview {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.import-preview-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  word-break: auto-phrase;
}

.import-will-add {
  font-weight: 600;
}

.import-kept-item {
  padding-left: 10px;
  border-left: 2px solid var(--line);
  font-size: 0.875rem;
  white-space: pre-line; /* ふりかえりの改行をそのまま */
  user-select: text;
}

.summary-line {
  font-size: 0.9375rem;
  word-break: auto-phrase;
}

.flow-meta {
  display: block;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.flow-text {
  display: block;
  color: var(--heading);
}

.flow-text.is-empty {
  color: var(--text-muted);
}

.summary-total {
  color: var(--text-muted);
}

.chart-title,
.section-title {
  padding-left: 10px;
  border-left: 3px solid var(--gold);
  color: var(--heading);
  font-size: 1rem;
  font-weight: 700;
}

.chart-note {
  font-size: 0.9375rem;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.seg-f1 { fill: var(--chart-1); }
.seg-f2 { fill: var(--chart-2); }
.seg-f3 { fill: var(--chart-3); }
.seg-f4 { fill: var(--chart-4); }
.seg-f5 { fill: var(--chart-5); }

.seg-none {
  fill: var(--chart-none);
  stroke: var(--chart-none-stroke);
  stroke-width: 1;
}

.chart-track {
  fill: var(--chart-track);
}

.chart-axis-line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-empty {
  stroke: var(--input-border);
  stroke-width: 2;
  stroke-linecap: round;
}

.chart-label {
  fill: var(--text-muted);
  font-size: 12px;
}

.chart-label.is-today {
  fill: var(--heading);
  font-weight: 700;
}

.chart-label.is-future {
  opacity: 0.5;
}

.chart-value {
  fill: var(--heading);
  font-size: 12px;
  font-weight: 700;
}

/* 記録の少ない時間帯は、棒だけを薄く（文字は読める濃さのまま） */
.band-row.is-few .seg,
.band-row.is-few .chart-track {
  opacity: 0.45;
}

.chart-few {
  font-size: 11px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.swatch.seg-f1 { background: var(--chart-1); }
.swatch.seg-f2 { background: var(--chart-2); }
.swatch.seg-f3 { background: var(--chart-3); }
.swatch.seg-f4 { background: var(--chart-4); }
.swatch.seg-f5 { background: var(--chart-5); }

.swatch.seg-none {
  margin-left: 6px;
  margin-right: 4px;
  border: 1px solid var(--chart-none-stroke);
  background: var(--chart-none);
}

.chart-table summary,
.disclosure summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--heading);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.chart-table summary::-webkit-details-marker,
.disclosure summary::-webkit-details-marker {
  display: none;
}

/* 開け閉めできることが分かるように、小さな矢印を付ける（▸ 閉 → ▾ 開） */
.chart-table summary::before,
.disclosure summary::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 10px 0 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.chart-table[open] summary::before,
.disclosure[open] summary::before {
  transform: rotate(45deg);
}

.table-wrap {
  overflow-x: auto;
}

.chart-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.chart-table th,
.chart-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.chart-table th[scope="row"],
.chart-table tr:first-child th:first-child {
  text-align: left;
}

.day-rows {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  list-style: none;
}

.day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.day-row::after {
  content: "›";
  color: var(--text-muted);
  font-size: 1.25rem;
}

.day-rows li:last-child .day-row {
  border-bottom: 0;
}

.week-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plain-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
}

.plain-list li,
.week-note {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  overflow-wrap: anywhere;
}

.week-note + .week-note {
  margin-top: 8px;
}

.week-note-date {
  margin-bottom: 4px;
  color: var(--heading);
  font-size: 0.875rem;
}

.week-note-line {
  font-size: 0.9375rem;
  white-space: pre-line; /* 本人が書いた改行をそのまま */
}
