/* プロンプター — iPhone / iPad 前提のスタイル。
   ・本番画面はホーム画面追加(standalone)でアドレスバーごと消える前提で全画面に組む
   ・ノッチ／ホームインジケータは env(safe-area-inset-*) で避ける */

:root {
  --bg: #0b0b0d;
  --fg: #f2f2f4;
  --sub: #8b8b95;
  --line: #26262c;
  --card: #17171b;
  --accent: #2dd4bf;
  --danger: #f2686a;
  --gothic: "Hiragino Sans", "ヒラギノ角ゴシック", "Helvetica Neue", Arial, sans-serif;
  --mincho: "Hiragino Mincho ProN", "ヒラギノ明朝 ProN", "YuMincho", serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--fg);
  font-family: var(--gothic);
  overscroll-behavior: none;
}

body { overflow: hidden; }

.hidden { display: none !important; }

.view { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* ---------- 共通バー ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.bar h1 { font-size: 18px; margin: 0; letter-spacing: .04em; }
.bar-actions { display: flex; gap: 8px; align-items: center; }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--fg);
  border-radius: 10px; padding: 9px 14px; font-size: 15px; font-family: inherit;
  cursor: pointer; white-space: nowrap;
}
.btn:active { opacity: .6; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #04201d; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: transparent; }
.btn.small { font-size: 13px; padding: 7px 11px; }

.scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 14px calc(env(safe-area-inset-bottom) + 24px);
}

.hint { color: var(--sub); font-size: 14px; line-height: 1.7; padding: 24px 4px; }

/* ---------- 台本一覧 ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; cursor: pointer;
}
.card:active { border-color: var(--accent); }
.card h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.card .excerpt {
  margin: 0 0 10px; color: var(--sub); font-size: 13px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { display: flex; gap: 14px; color: var(--sub); font-size: 12px; }
.card .meta b { color: var(--accent); font-weight: 600; }

.lib-footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

/* ---------- 編集 ---------- */
.edit-wrap { display: flex; flex-direction: column; }
.title-input {
  appearance: none; width: 100%; background: transparent; border: none; color: var(--fg);
  font-family: inherit; font-size: 22px; font-weight: 600; padding: 6px 2px; outline: none;
}
.stats { color: var(--sub); font-size: 13px; padding: 2px 2px 10px; border-bottom: 1px solid var(--line); }
.stats b { color: var(--accent); }
.body-input {
  flex: 1; min-height: 45vh; width: 100%; margin-top: 12px;
  appearance: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  color: var(--fg); font-family: inherit; font-size: 17px; line-height: 1.85;
  padding: 14px; outline: none; resize: none;
}
.body-input:focus { border-color: var(--accent); }
.help { margin: 16px 2px 0; color: var(--sub); font-size: 13px; }
.help summary { cursor: pointer; }
.help ul { padding-left: 18px; line-height: 1.9; }
.help code { background: var(--card); padding: 1px 5px; border-radius: 4px; }

/* ---------- 本番 ---------- */
.view.run { background: #000; }

.stage { position: absolute; inset: 0; overflow: hidden; }

/* 反転はこの層にかける。中の走行(translate)は反転の影響を受けても見た目上正しい */
.mirror { position: absolute; inset: 0; transform-origin: 50% 50%; }

.inner { position: absolute; left: 0; top: 0; width: 100%; will-change: transform; }

.text {
  /* 文字サイズは画面の「幅」基準。こうすると縦横どちらでも1行の文字数がほぼ一定になり、
     読む位置を見失いにくい（高さ基準だと縦持ちで1行5〜6文字になってしまう） */
  font-size: var(--fs, 6vw);
  line-height: var(--lh, 1.6);
  padding: 0 var(--sidepad, 6%);
  font-weight: var(--fw, 500);
  letter-spacing: .01em;
  word-break: normal;
  overflow-wrap: anywhere;
  line-break: strict;
}
.text .p { margin: 0 0 .55em; }
.text .h { margin: .3em 0 .5em; color: var(--accent); font-weight: 700; }
.text .note {
  font-size: .52em; line-height: 1.5; opacity: .45; margin: 0 0 .6em; font-weight: 400;
}
.text .sep { height: 1.1em; }

/* 配色 */
.run[data-theme="dark"]  .text { color: #fff; }
.run[data-theme="dark"]  .stage { background: #000; }
.run[data-theme="light"] .text { color: #000; }
.run[data-theme="light"] .stage { background: #fff; }
.run[data-theme="light"] .text .h { color: #0a7a70; }
.run[data-theme="amber"] .text { color: #ffc24a; }
.run[data-theme="amber"] .stage { background: #000; }
.run[data-theme="amber"] .text .h { color: #fff; }

/* 書体 */
.run[data-font="mincho"] .text { font-family: var(--mincho); }

/* 読む位置のライン */
.focus-line {
  position: absolute; left: 0; right: 0; top: var(--focus, 38%);
  border-top: 2px solid rgba(45, 212, 191, .55);
  pointer-events: none; display: none;
}
.run[data-focusline="1"] .focus-line { display: block; }
.fl-arrow {
  position: absolute; top: -9px; width: 0; height: 0;
  border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}
.fl-arrow.left  { left: 0;  border-left: 13px solid var(--accent); }
.fl-arrow.right { right: 0; border-right: 13px solid var(--accent); }

/* 先読み部分を暗く */
.run[data-dim="1"] .stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(0,0,0,.72) 0%, rgba(0,0,0,.18) calc(var(--focus, 38%) - 8%),
    rgba(0,0,0,0) var(--focus, 38%), rgba(0,0,0,0) 100%);
}
.run[data-dim="1"][data-theme="light"] .stage::after {
  background: linear-gradient(to bottom,
    rgba(255,255,255,.75) 0%, rgba(255,255,255,.2) calc(var(--focus, 38%) - 8%),
    rgba(255,255,255,0) var(--focus, 38%), rgba(255,255,255,0) 100%);
}

/* HUD */
.hud {
  position: absolute; left: 0; right: 0; top: 0;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: rgba(255,255,255,.55); font-variant-numeric: tabular-nums;
  background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,0));
  transition: opacity .3s; pointer-events: none;
}
.run[data-theme="light"] .hud { color: rgba(0,0,0,.5); background: linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,0)); }
.run[data-chrome="0"] .hud { opacity: 0; }
.progress { flex: 1; height: 3px; background: rgba(255,255,255,.18); border-radius: 2px; overflow: hidden; pointer-events: auto; }
.run[data-theme="light"] .progress { background: rgba(0,0,0,.15); }
#progressFill { height: 100%; width: 0; background: var(--accent); }

/* ツールバー */
.toolbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 10px calc(env(safe-area-inset-bottom) + 10px);
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: nowrap;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.82));
  transition: opacity .3s, transform .3s;
}
.run[data-chrome="0"] .toolbar { opacity: 0; transform: translateY(14px); pointer-events: none; }
.tb {
  appearance: none; border: none; background: rgba(255,255,255,.12); color: #fff;
  min-width: 48px; height: 48px; border-radius: 12px; font-size: 17px; font-family: inherit;
  cursor: pointer; padding: 0 10px;
}
.tb:active { background: rgba(255,255,255,.28); }
.tb.play { background: var(--accent); color: #04201d; min-width: 66px; font-size: 20px; }
.tb-label {
  color: rgba(255,255,255,.7); font-size: 13px; min-width: 42px; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* カウントダウン */
.countdown {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.75); z-index: 5;
}
#countdownNum { font-size: 26vh; font-weight: 700; color: var(--accent); }

/* ---------- パネル ---------- */
.panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  max-height: 82%; display: flex; flex-direction: column;
  background: #131318; border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.panel-body { overflow-y: auto; padding: 8px 16px 20px; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 15px;
}
.row > span { flex: 0 0 auto; min-width: 116px; }
.row em { color: var(--accent); font-style: normal; font-size: 13px; margin-left: 8px; }
.row input[type="range"] { flex: 1; accent-color: var(--accent); }
.row.switch input { width: 46px; height: 28px; accent-color: var(--accent); }
.segbtns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.seg-btn {
  appearance: none; border: 1px solid var(--line); background: transparent; color: var(--sub);
  border-radius: 9px; padding: 7px 11px; font-size: 13px; font-family: inherit; cursor: pointer;
}
.seg-btn.on { background: var(--accent); border-color: var(--accent); color: #04201d; font-weight: 700; }
.note { color: var(--sub); font-size: 12px; line-height: 1.8; margin: 14px 0 0; }

.jump-list { list-style: none; margin: 0; padding: 0; }
.jump-list li {
  padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 16px; cursor: pointer;
}
.jump-list li small { color: var(--sub); margin-left: 10px; font-size: 12px; }

/* ---------- トースト ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px);
  transform: translateX(-50%); z-index: 50;
  background: rgba(28,28,34,.96); color: var(--fg); border: 1px solid var(--line);
  padding: 11px 18px; border-radius: 12px; font-size: 14px; max-width: 84vw; text-align: center;
}

/* iPad など広い画面では読み物系の幅を制限 */
@media (min-width: 760px) {
  .scroll { padding-left: max(14px, calc((100vw - 720px) / 2)); padding-right: max(14px, calc((100vw - 720px) / 2)); }
  .panel { left: 50%; transform: translateX(-50%); width: min(680px, 100%); border-radius: 18px 18px 0 0; }
}

/* ============================================================
   タブバー
   ============================================================ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: none; gap: 2px;
  padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px);
  background: rgba(13,13,16,.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
body[data-tabs="1"] .tabbar { display: flex; }
body[data-tabs="1"] .scroll { padding-bottom: calc(env(safe-area-inset-bottom) + 96px); }
.tab {
  flex: 1; appearance: none; border: none; background: transparent; color: var(--sub);
  font-family: inherit; font-size: 11px; padding: 7px 0 5px; border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tab span { font-size: 20px; line-height: 1; }
.tab.on { color: var(--accent); background: rgba(45,212,191,.10); }

.sec { font-size: 13px; color: var(--sub); margin: 22px 2px 8px; font-weight: 600; letter-spacing: .06em; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tin {
  flex: 1; appearance: none; background: #0d0d11; border: 1px solid var(--line); border-radius: 9px;
  color: var(--fg); font-family: inherit; font-size: 15px; padding: 9px 11px; outline: none; min-width: 0;
}
.tin:focus { border-color: var(--accent); }

/* ============================================================
   カチンコ
   ============================================================ */
.slate-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 10px 12px; gap: 8px; }
/* タブバーは画面に固定で乗るので、その分だけ下を空けておく */
body[data-tabs="1"] .slate-wrap { padding-bottom: calc(env(safe-area-inset-bottom) + 74px); }

.slate-board {
  flex: 1; min-height: 0; position: relative; cursor: pointer;
  background: #0e0e12; border: 2px solid #2b2b33; border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
}
.slate-board:active { border-color: var(--accent); }

/* 上の白黒バー（カチンと閉じる板）。
   板は上下に離して置き、カチンのときに上の板が下りて当たる。
   回転させると横幅の広い画面で端がボードからはみ出すので、上下の動きで見せる。 */
.sticks { position: relative; height: 76px; flex: 0 0 auto; overflow: hidden; }
.stick-top, .stick-base {
  position: absolute; left: 0; right: 0; height: 30px;
  background: repeating-linear-gradient(115deg, #f4f4f6 0 22px, #101014 22px 44px);
}
.stick-base { bottom: 0; }
.stick-top { top: 16px; border-bottom: 2px solid #101014; }
.stick-top.clapping { animation: clapdown .34s cubic-bezier(.25,1.3,.5,1) 1; }
@keyframes clapdown {
  0%   { transform: translateY(0); }
  26%  { transform: translateY(30px); }   /* 下の板に当たる */
  44%  { transform: translateY(23px); }   /* 少し跳ねる */
  62%  { transform: translateY(30px); }
  100% { transform: translateY(0); }
}

.slate-rows { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.srow { display: flex; border-top: 1px solid #24242c; min-height: 0; }
.srow:first-child { border-top: none; }
.srow.big { flex: 1; }
.cell {
  flex: 1 1 0; min-width: 0; border-left: 1px solid #24242c;
  white-space: nowrap;
  padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.cell.grow { flex: 2 1 0; }
.cell:first-child { border-left: none; }
.cell label {
  font-size: 10px; letter-spacing: .14em; color: var(--accent); text-transform: uppercase;
}
.cell label em { font-style: normal; color: var(--sub); letter-spacing: 0; }
.cell span {
  font-size: clamp(15px, 3.4vw, 30px); color: #fff; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srow.big .cell span { font-size: clamp(44px, 13vw, 150px); line-height: 1; font-weight: 700; }
.cell span.tc { font-variant-numeric: tabular-nums; font-size: clamp(14px, 2.6vw, 24px); }

.slate-hint {
  margin: 0; text-align: center;
  font-size: 11px; color: rgba(255,255,255,.32);
}

.slate-controls { flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; }
.steppers { display: flex; gap: 8px; }
.stepper {
  flex: 1; display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.stepper span { font-size: 12px; color: var(--sub); letter-spacing: .1em; }
.stepper button {
  appearance: none; border: none; background: transparent; color: var(--fg);
  font-size: 22px; font-family: inherit; width: 46px; height: 46px; cursor: pointer;
}
.stepper button:active { background: rgba(255,255,255,.12); }

.clap {
  appearance: none; border: none; border-radius: 14px; cursor: pointer;
  background: var(--accent); color: #04201d; font-family: inherit;
  font-size: 22px; font-weight: 800; letter-spacing: .18em; padding: 18px 0;
}
.clap:active { filter: brightness(.85); }

.lastline { display: flex; align-items: center; gap: 8px; }
.last-label {
  flex: 1; min-width: 0; font-size: 13px; color: var(--sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mute-warn { margin: 0; font-size: 11px; }

/* 大きく表示：タブと操作列を隠してボードを画面いっぱいに */
body.slate-big .tabbar { display: none; }
body.slate-big .slate-controls { display: none; }
body.slate-big .slate-wrap { padding: 6px; }

.flash {
  position: fixed; inset: 0; z-index: 999; background: #fff; pointer-events: none;
  opacity: 0; transition: opacity .16s linear;
}
.flash.on { opacity: 1; transition: none; }

.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li { padding: 11px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.log-head { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.log-list small { color: var(--sub); font-size: 12px; }
.log-mark {
  margin-left: auto; width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); color: var(--sub); font-size: 16px;
}
.log-mark.ok { background: rgba(45,212,191,.2); color: var(--accent); }
.log-mark.ng { background: rgba(242,104,106,.18); color: var(--danger); }

/* ============================================================
   ロケハン
   ============================================================ */
.sun-now { margin-bottom: 14px; }
.sun-now-body {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  font-size: 14px; line-height: 1.9; color: var(--sub);
}
.sun-now-body b { color: var(--fg); display: block; margin-bottom: 4px; }
.sun-now-body .left { color: var(--accent); font-weight: 600; margin-top: 4px; }

.photo-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.photo { position: relative; flex: 0 0 auto; }
.photo img {
  width: 116px; height: 116px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); cursor: pointer; display: block;
}
.photo-del {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 8px;
  appearance: none; border: none; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; cursor: pointer;
}
.geo { font-size: 14px; color: var(--sub); line-height: 1.8; padding: 4px 2px; }

.suntable { margin-top: 6px; }
.sunrow {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px;
}
.sunrow .sl { flex: 0 0 108px; color: var(--sub); }
.sunrow .sv { color: var(--fg); font-variant-numeric: tabular-nums; }
.sunrow .sn { color: #5f5f6b; font-size: 12px; margin-left: auto; text-align: right; }

.sun-dial-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.sun-dial { width: 190px; height: 190px; flex: 0 0 auto; }
.sun-readout { font-size: 15px; line-height: 1.9; color: var(--sub); }
.sun-readout b { color: var(--fg); }
.sun-readout small { color: #5f5f6b; }

.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chk {
  appearance: none; border: 1px solid var(--line); background: transparent; color: var(--sub);
  border-radius: 999px; padding: 9px 14px; font-size: 13px; font-family: inherit; cursor: pointer;
}
.chk.on { background: rgba(45,212,191,.16); border-color: var(--accent); color: var(--accent); }

/* ============================================================
   道具
   ============================================================ */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tool-tile {
  appearance: none; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; color: var(--fg); font-family: inherit;
  display: flex; flex-direction: column; gap: 5px;
}
.tool-tile:active { border-color: var(--accent); }
.tool-tile b { font-size: 16px; }
.tool-tile small { color: var(--sub); font-size: 12px; line-height: 1.5; }

.tool-box { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 4px; }
.fov-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.fov-table th {
  text-align: left; color: var(--sub); font-weight: 500; font-size: 12px;
  padding: 6px 4px; border-bottom: 1px solid var(--line);
}
.fov-table td { padding: 9px 4px; border-bottom: 1px solid rgba(255,255,255,.06); color: var(--sub); }
.fov-table td b { color: var(--accent); font-size: 15px; }

.level-wrap {
  position: relative; width: 190px; height: 190px; margin: 14px auto;
  border: 1px solid var(--line); border-radius: 50%; background: #0d0d11;
}
.level-cross {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, transparent calc(50% - 1px), var(--line) calc(50% - 1px), var(--line) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(to bottom, transparent calc(50% - 1px), var(--line) calc(50% - 1px), var(--line) calc(50% + 1px), transparent calc(50% + 1px));
  border-radius: 50%;
}
.level-dot {
  position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%; background: var(--sub); transition: transform .08s linear, background .2s;
}
.level-dot.flat { background: var(--accent); }
.level-read { text-align: center; color: var(--sub); font-size: 15px; font-variant-numeric: tabular-nums; }

/* 色板（WB・露出・映り込みの確認用） */
.full-color { position: fixed; inset: 0; z-index: 900; display: flex; align-items: flex-end; justify-content: center; }
.full-color[data-kind="white"] { background: #fff; }
.full-color[data-kind="gray"]  { background: #7b7b7b; }   /* sRGB上の18%グレー相当 */
.full-color[data-kind="black"] { background: #000; }
.full-color span {
  margin-bottom: calc(env(safe-area-inset-bottom) + 20px);
  font-size: 12px; color: rgba(128,128,128,.75);
}

/* ============================================================
   下から出るパネル（iPhoneでの重なり対策）
   ============================================================ */
/* パネルはタブバーより手前。開いている間はタブバーを隠して、
   下端が隠れたり2枚重なって読めなくなるのを防ぐ。 */
.panel { z-index: 40; padding-bottom: calc(env(safe-area-inset-bottom) + 8px); }
.panel-body { overscroll-behavior: contain; }
body.panel-open .tabbar { display: none; }

/* ============================================================
   狭い画面（iPhone）：ラベルと操作を上下に分ける
   横並びのままだと、選択ボタンが潰れて読めなくなる
   ============================================================ */
@media (max-width: 480px) {
  .row { flex-wrap: wrap; gap: 8px; }
  .row > span { min-width: 0; flex: 1 1 100%; }
  .row .segbtns { width: 100%; justify-content: flex-start; }
  .row input[type="range"] { flex: 1 1 100%; }
  .row .tin { flex: 1 1 100%; }
  /* オン・オフだけの行は左右のままのほうが見やすい */
  .row.switch { flex-wrap: nowrap; }
  .row.switch > span { flex: 1 1 auto; }
  .sunrow { flex-wrap: wrap; }
  .sunrow .sl { flex: 0 0 96px; }
  .sunrow .sn { flex: 1 1 100%; text-align: left; margin-left: 96px; }
  .sun-dial { width: 160px; height: 160px; }
}

/* ============================================================
   カラーチャート
   ============================================================ */
.full-color[data-kind="chart"] { background: #101010; align-items: stretch; justify-content: stretch; }
.chart-grid {
  position: absolute; inset: 0;
  display: grid; gap: 1.5%;
  padding: 3% 3% calc(env(safe-area-inset-bottom) + 34px);
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
}
/* 縦持ちのときは90度回した並び（元の1行が1列になる）にして、パッチを正方形に近づける */
@media (orientation: portrait) {
  .chart-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr);
    grid-auto-flow: column;
  }
}
.chart-grid i { display: block; border-radius: 3px; }
.full-color .fc-hint {
  position: absolute; left: 0; right: 0; bottom: 0;
  margin-bottom: calc(env(safe-area-inset-bottom) + 14px);
  text-align: center; font-size: 12px; color: rgba(128,128,128,.75);
}
.full-color[data-kind="chart"] .fc-hint {
  color: rgba(190,190,190,.75); margin-bottom: calc(env(safe-area-inset-bottom) + 8px);
}
