/* ==========================================================================
   Ototouch ANN — PC / iPad / スマホ対応 ダークモードフラットデザイン
   ========================================================================== */

:root {
  /* カラーパレット */
  --bg-base: #0a0c10;
  --bg-surface: #12161f;
  --bg-elevated: #1a202c;
  --bg-input: #0e1219;
  --border-subtle: #252e3f;
  --border-strong: #374357;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #5d6774;

  --accent-live: #e53935;
  --accent-live-bg: #3b1114;
  --accent-live-border: #f44336;
  --accent-arm: #10b981;
  --accent-arm-bg: #0c2c22;
  --accent-auto: #f59e0b;
  --accent-auto-bg: #2e2009;
  --accent-cd: #06b6d4;
  --accent-cd-bg: #0a2831;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --sat-color: #60a5fa;
  --sun-color: #f87171;

  /* 共通寸法・タイポグラフィ */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --time-pill-w: 176px;
  --sub-slot-w: 154px;
  --play-btn-w: 172px;
  --play-btn-h: 56px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;

  /* セーフエリア */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ==========================================================================
   ベースリセット & 日本語改行ルール
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  line-break: strict;
  overflow-wrap: anywhere;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

input,
select,
textarea {
  -webkit-user-select: text;
  user-select: text;
  font-family: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  white-space: nowrap;
  touch-action: manipulation;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

body.mode-live .app-header {
  border-top-color: var(--accent-live);
}

/* ==========================================================================
   上部バー（左上アイコン・公演名・SAVE/LOAD・現在時刻・数値マスター・ロック）
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-top: 3px solid var(--accent-blue);
  border-bottom: 1px solid var(--border-subtle);
  padding: calc(8px + var(--safe-top)) calc(14px + var(--safe-right)) 8px calc(14px + var(--safe-left));
}

.header-compact-row {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 280px;
  min-width: 0;
}

.header-app-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
}

.prod-title-wrap {
  flex: 1 1 160px;
  min-width: 100px;
  max-width: 340px;
  display: flex;
  align-items: center;
}

.prod-title-input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
}

.prod-title-input:focus {
  outline: none;
  border-color: var(--accent-auto);
}

.prod-title-input::placeholder {
  color: var(--text-muted);
  font-weight: 600;
}

.prod-title-display {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-save-load {
  background: #2e2009;
  border: 1px solid #b45309;
  color: #fbbf24;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.btn-save-load:active {
  background: #452e0b;
  color: #fde68a;
}

.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-gear-svg {
  width: 23px;
  height: 23px;
  display: block;
}

.header-icon-btn:active {
  background: var(--border-strong);
}

.header-help-btn {
  border-radius: 50%;
  font-size: 16px;
  color: #34d399;
  border-color: #166534;
  background: #0b2419;
}

.header-right-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.clock-block {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 11px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  flex-shrink: 0;
}

.clock-meta-line {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.telemetry-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.mini-status-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mini-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.mini-dot.dot-ok {
  background: var(--accent-arm);
}

.mini-dot.dot-warn {
  background: var(--accent-auto);
  animation: pulseWarn 1.6s infinite;
}

.mini-dot.dot-wakelock {
  background: var(--accent-cd);
}

@keyframes pulseWarn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.clock-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* コンパクト数値入力マスターボリューム */
.master-vol-compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 6px;
  flex-shrink: 0;
}

.vol-caption {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 0 3px;
  white-space: nowrap;
}

.vol-step-btn {
  width: 30px;
  height: 32px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vol-step-btn:active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.vol-input-box {
  display: inline-flex;
  align-items: baseline;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 0 5px;
  height: 32px;
}

.vol-num-input {
  width: 36px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 800;
  text-align: right;
  outline: none;
  -moz-appearance: textfield;
}

.vol-num-input::-webkit-inner-spin-button,
.vol-num-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.vol-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-left: 1px;
}

.mode-switcher {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  flex-shrink: 0;
}

.mode-btn {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  transition: background-color 0.15s, color 0.15s;
}

.mode-btn.is-active {
  background: var(--accent-blue);
  color: #ffffff;
}

.mode-btn-live.is-active {
  background: var(--accent-live);
  color: #ffffff;
}

/* ==========================================================================
   共通ボタン
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-sm {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
}

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

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-secondary:active {
  background: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-ghost-danger {
  background: transparent;
  border-color: #5c2224;
  color: #f87171;
}

.btn-ghost-danger:active {
  background: var(--accent-live-bg);
}

.btn-danger {
  background: var(--accent-live);
  color: #ffffff;
}

.btn-pause {
  background: #b45309;
  color: #ffffff;
}

/* ==========================================================================
   メインコンテナ & 公演スケジュールバー
   ========================================================================== */
.app-main {
  padding: 12px calc(14px + var(--safe-right)) calc(36px + var(--safe-bottom)) calc(14px + var(--safe-left));
  max-width: 1360px;
  margin: 0 auto;
}

.show-bar {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.show-bar-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 劇場カレンダー風スケジュールマトリクス（横スクロール対応） */
.calendar-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}

.schedule-matrix {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.schedule-matrix th,
.schedule-matrix td {
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
  vertical-align: middle;
  padding: 0;
}

.schedule-matrix tr:last-child th,
.schedule-matrix tr:last-child td {
  border-bottom: none;
}

.schedule-matrix th:last-child,
.schedule-matrix td:last-child {
  border-right: none;
}

.matrix-corner-cell,
.matrix-time-header {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 62px;
  min-width: 62px;
  background: #0c0f16;
  border-right: 2px solid var(--border-strong) !important;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}

.matrix-corner-cell {
  z-index: 6;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  padding: 6px 4px;
}

.matrix-month-col {
  width: 38px;
  min-width: 38px;
  background: #080a0f;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  border-right: 2px solid var(--border-strong) !important;
}

.matrix-month-sub {
  background: #0b0e14;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  border-right: 2px solid var(--border-strong) !important;
}

.matrix-day-col {
  width: 56px;
  min-width: 56px;
  background: #171c27;
  padding: 6px 2px !important;
}

.matrix-day-num {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.matrix-day-wd {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
  color: var(--text-secondary);
}

.matrix-day-col.is-sat .matrix-day-wd { color: var(--sat-color); }
.matrix-day-col.is-sun .matrix-day-wd { color: var(--sun-color); }

.matrix-day-col.is-past-day {
  background: #0e1117;
  opacity: 0.55;
}

.matrix-day-col.is-today-col {
  background: #0d3328;
  box-shadow: inset 0 3px 0 #10b981, inset 0 0 14px rgba(16, 185, 129, 0.35);
}

.matrix-day-col.is-today-col .matrix-day-num { color: #6ee7b7; }
.matrix-day-col.is-today-col .matrix-day-wd { color: #34d399; }

.matrix-today-pip {
  display: inline-block;
  margin-top: 2px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--accent-arm);
  color: #042f2e;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.matrix-cell {
  width: 56px;
  min-width: 56px;
  height: 48px;
  background: #12161f;
  position: relative;
}

.matrix-cell.is-today-col {
  background: #0c211b;
  box-shadow: inset 1px 0 0 rgba(16, 185, 129, 0.45), inset -1px 0 0 rgba(16, 185, 129, 0.45);
}

.matrix-empty-btn {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 0.7px),
    #252e3f calc(50% - 0.7px),
    #252e3f calc(50% + 0.7px),
    transparent calc(50% + 0.7px)
  );
  color: transparent;
  font-size: 16px;
  font-weight: 800;
  transition: background-color 0.12s, color 0.12s;
}

.matrix-empty-btn:hover,
.matrix-empty-btn:active {
  background: #1b2434;
  color: var(--accent-blue);
}

.matrix-show-btn {
  width: 100%;
  height: 100%;
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: #1a2232;
  transition: background-color 0.12s;
}

.matrix-show-btn:active {
  background: #25324a;
}

.matrix-show-symbol {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.matrix-show-symbol.is-text-sym {
  font-size: 11px;
}

.sym-amber   { color: #fbbf24; }
.sym-gold    { color: #fde047; }
.sym-cyan    { color: #22d3ee; }
.sym-pink    { color: #f472b6; }
.sym-emerald { color: #34d399; }
.sym-violet  { color: #c084fc; }

.matrix-show-memo {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-secondary);
  max-width: 50px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matrix-show-btn.is-past {
  background: #0f1218;
}

.matrix-show-btn.is-past .matrix-show-symbol,
.matrix-show-btn.is-past .matrix-show-memo {
  color: #525b68;
}

.matrix-cell.is-today-col .matrix-show-btn:not(.is-past) {
  background: #12382c;
}

.matrix-show-btn.is-selected {
  background: var(--accent-blue) !important;
  box-shadow: inset 0 0 0 2px #93c5fd;
}

.matrix-show-btn.is-selected .matrix-show-symbol,
.matrix-show-btn.is-selected .matrix-show-memo {
  color: #ffffff !important;
}

/* カレンダー直下のシンプル追加行 */
.calendar-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-footer-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* 選択中公演バー（キュー一覧／空状態の直上・編集モード） */
.active-show-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin-bottom: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.show-meta-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.show-meta-datetime {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.show-meta-symbol {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.show-meta-date {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.show-meta-start {
  font-size: 13px;
  color: var(--text-secondary);
}

.show-meta-start strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  color: #fbbf24;
  margin-left: 3px;
}

.show-meta-note {
  font-size: 13px;
  font-weight: 700;
  color: #fde68a;
  padding: 3px 10px;
  border-radius: 5px;
  background: #2b210c;
  border: 1px solid #78350f;
  word-break: keep-all;
}

.show-meta-note:empty {
  display: none;
}

.show-actions-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 本番ロック時バナー：公演日時のみ大きく表示 */
.live-show-banner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 6px 8px;
  text-align: center;
}

.live-show-datetime-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.live-indicator-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-live);
  flex-shrink: 0;
}

.live-show-datetime {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #ffffff;
  white-space: nowrap;
}

.live-show-memo {
  font-size: 16px;
  font-weight: 700;
  color: #fde68a;
  word-break: keep-all;
}

.live-show-memo:empty {
  display: none;
}

/* ==========================================================================
   音源追加 ＋ ドロップゾーン横並びバー ＆ 下部一括操作フッター
   ========================================================================== */
.edit-toolbar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 10px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.file-upload-btn {
  cursor: pointer;
  flex-shrink: 0;
}

.prep-stats {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0 4px;
  white-space: nowrap;
}

.drop-zone {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
  transition: border-color 0.15s, background-color 0.15s;
}

.drop-zone.is-dragover {
  border-color: var(--accent-blue);
  background: #10203a;
  color: #ffffff;
}

.cue-footer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

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

/* ==========================================================================
   統一キューカード（枠内シークバー・固定サイズ・レイアウトシフト0）
   ========================================================================== */
.cue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cue-card {
  display: flex;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-left: 5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.12s, background-color 0.12s;
}

.cue-card.is-armed {
  border-left-color: var(--accent-arm);
}

.cue-card.is-played:not(.is-playing) {
  background: #10131a;
  border-color: #222938;
}

.cue-card.is-playing {
  background: var(--accent-live-bg);
  border-color: var(--accent-live-border);
  border-left-color: var(--accent-live);
}

.cue-card.sortable-ghost {
  opacity: 0.35;
  border-color: var(--accent-blue);
}

.drag-handle {
  width: 40px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: grab;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
  background: var(--border-strong);
  color: #ffffff;
}

.drag-order-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

.drag-bars {
  font-size: 15px;
  line-height: 1;
}

.cue-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cue-main-area {
  padding: 12px 14px;
}

/* PC / iPad 標準：左(タイトル)・中央(固定幅の発火時間)・右(固定幅の操作エリア) */
.cue-main-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--time-pill-w) calc(var(--sub-slot-w) + var(--play-btn-w) + 8px);
  align-items: center;
  gap: 12px;
}

.cue-time-pill {
  width: var(--time-pill-w);
  min-width: var(--time-pill-w);
  height: var(--play-btn-h);
  padding: 4px 8px;
  border-radius: var(--radius-md);
  background: #1c1509;
  border: 1px solid #92400e;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  transition: border-color 0.2s, background-color 0.2s;
}

.cue-time-pill.is-soon {
  background: #271e09;
  border-color: #eab308;
}

.cue-time-pill.is-imminent {
  background: #2d1115;
  border-color: #ef4444;
}

.cue-time-pill.is-countdown {
  background: var(--accent-cd-bg);
  border-color: #0e7490;
}

.cue-time-pill.is-off,
.cue-time-pill.is-manual {
  background: var(--bg-input);
  border-color: var(--border-strong);
}

.cue-time-manual-label {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #cbd5e1;
  white-space: nowrap;
}

.manual-mode-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.cue-time-pill.is-played-pill {
  background: #141923;
  border-color: var(--border-subtle);
}

/* 時間枠（オレンジ／青）内の直接編集UI（編集モード時） */
.pill-inline-hms-edit,
.pill-inline-cd-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1;
}

.pill-time-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 30px;
  height: 24px;
  background: transparent;
  background-image: none;
  border: none;
  border-bottom: 1px dashed rgba(251, 191, 36, 0.45);
  border-radius: 3px;
  color: #fbbf24;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  text-align: center;
  text-align-last: center;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  cursor: pointer;
  outline: none;
  transition: background-color 0.12s, border-color 0.12s;
}

.pill-time-select:hover,
.pill-time-select:focus {
  background: rgba(251, 191, 36, 0.16);
  border-bottom-color: #fde047;
}

.pill-time-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
}

.pill-inline-colon {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  color: rgba(251, 191, 36, 0.75);
  user-select: none;
}

.cue-time-pill.is-counting .pill-time-select {
  width: 21px;
  height: 17px;
  font-size: 13px;
  color: #f59e0b;
  border-bottom-color: rgba(245, 158, 11, 0.45);
}

.cue-time-pill.is-counting .pill-inline-colon {
  font-size: 12px;
  color: rgba(245, 158, 11, 0.7);
}

.cue-time-pill.is-counting.is-imminent .pill-time-select {
  color: #f87171;
  border-bottom-color: rgba(248, 113, 113, 0.55);
}

.cue-time-pill.is-played-pill .pill-time-select {
  color: var(--text-secondary);
  border-bottom-color: rgba(139, 148, 158, 0.45);
}

/* タイマー指定（青枠）内の分・秒 直接数値入力 */
.pill-cd-input {
  width: 42px;
  background: transparent;
  border: none;
  border-bottom: 1px dashed rgba(34, 211, 238, 0.55);
  border-radius: 3px;
  color: #22d3ee;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  padding: 0 1px;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  transition: background-color 0.12s, border-color 0.12s;
}

.pill-cd-input::-webkit-inner-spin-button,
.pill-cd-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pill-cd-input:hover,
.pill-cd-input:focus {
  background: rgba(34, 211, 238, 0.16);
  border-bottom-color: #67e8f9;
}

.cue-time-pill.is-countdown .pill-inline-colon {
  font-size: 22px;
  color: rgba(34, 211, 238, 0.75);
}

.cue-time-main {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  color: #fbbf24;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* カウントダウン稼働中は上段の発火時刻をコンパクトにして下段カウントダウンを大きく目立たせる */
.cue-time-pill.is-counting .cue-time-main {
  font-size: 13px;
  color: #d97706;
  letter-spacing: 0.04em;
}

.cue-time-pill.is-counting.is-soon .cue-time-main {
  color: #f59e0b;
}

.cue-time-pill.is-counting.is-imminent .cue-time-main {
  color: #f87171;
}

.cue-time-rem {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #94a3b8;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.cue-time-rem.is-counting .cd-prefix {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  opacity: 0.85;
}

.cue-time-rem.is-counting .cd-digits {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
}

.cue-time-rem.is-normal {
  color: #cbd5e1;
}

/* 発火10分前以内：明るい黄色で客入れ〜直前待機を強調 */
.cue-time-rem.is-soon {
  color: #fde047;
}

/* 発火1分前以内：赤系で直前発火を強く注意喚起 */
.cue-time-rem.is-imminent {
  color: #fca5a5;
}

.cue-time-rem.is-cd-running {
  color: #67e8f9;
}

.cue-time-rem.is-off,
.cue-time-rem.is-played,
.cue-time-rem.is-muted {
  color: var(--text-muted);
}

/* タイマー指定のカウントダウン数字も大きく鮮明に表示 */
.cue-time-pill.is-countdown .cue-time-main {
  font-size: 26px;
  font-weight: 900;
  color: #22d3ee;
}

.cue-time-pill.is-off .cue-time-main,
.cue-time-pill.is-played-pill .cue-time-main {
  color: var(--text-secondary);
}

.cue-file-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cue-badges-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-num {
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.badge-dur {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.badge-played {
  background: #273244;
  border: 1px solid #475569;
  color: #e2e8f0;
}

.badge-onair {
  background: var(--accent-live);
  color: #ffffff;
  animation: pulseOnAir 1s infinite;
}

@keyframes pulseOnAir {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.cue-title-display {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-primary);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.cue-card.is-played:not(.is-playing) .cue-title-display {
  color: #9ca3af;
}

.cue-card.is-playing .cue-title-display {
  color: #ffffff;
}

.cue-title-input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
}

.cue-title-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.cue-filename-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 固定サイズアクションエリア（時刻指定・タイマー指定とも同じ幅で時間ピル位置を完全統一） */
.cue-fixed-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.cd-inline-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cd-fixed-btn {
  width: 78px;
  height: var(--play-btn-h);
  min-height: var(--play-btn-h);
  padding: 0;
  font-size: 13px;
  font-weight: 800;
}

.cd-reset-fixed-btn {
  width: 70px;
  height: var(--play-btn-h);
  min-height: var(--play-btn-h);
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.cancel-alarm-fixed-btn {
  width: 92px;
  height: var(--play-btn-h);
  min-height: var(--play-btn-h);
  padding: 0;
  font-size: 13px;
  font-weight: 800;
}

.played-reset-fixed-btn {
  width: 82px;
  height: var(--play-btn-h);
  min-height: var(--play-btn-h);
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

/* 枠内シークバー内蔵のコンパクト固定サイズ直接再生／停止ボタン */
.play-seek-btn {
  position: relative;
  overflow: hidden;
  width: var(--play-btn-w);
  min-width: var(--play-btn-w);
  height: var(--play-btn-h);
  border-radius: var(--radius-md);
  background: #0f3d2e;
  border: 2px solid var(--accent-arm);
  color: #ecfdf5;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.12s, background-color 0.12s;
}

.play-seek-btn:active {
  filter: brightness(1.12);
}

.cue-card.is-played:not(.is-playing) .play-seek-btn {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.play-seek-btn.is-playing {
  background: #450a0a;
  border-color: #ef4444;
  color: #ffffff;
}

.play-seek-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #b91c1c, #ef4444);
  pointer-events: none;
  transition: width 0.08s linear;
}

.play-seek-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  white-space: nowrap;
}

.play-seek-rem {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 800;
  color: #fee2e2;
}

/* ==========================================================================
   編集コントロール行（編集モード時のみ展開）
   ========================================================================== */
.cue-edit-drawer {
  padding: 10px 14px 12px;
  background: #0f131b;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.edit-drawer-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 320px;
  min-width: 0;
}

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

.edit-drawer-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.arm-toggle {
  min-width: 64px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.arm-toggle.is-on {
  background: var(--accent-arm-bg);
  border-color: var(--accent-arm);
  color: #34d399;
}

.arm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.arm-toggle.is-on .arm-dot {
  background: var(--accent-arm);
}

.link-toggle-btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.link-toggle-btn.is-on {
  background: var(--accent-auto-bg);
  border-color: var(--accent-auto);
  color: #fbbf24;
}

.link-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.link-toggle-btn.is-on .link-dot {
  background: var(--accent-auto);
}

.segment-group {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.segment-group.full-width {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.seg-btn {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.seg-btn.is-active {
  background: var(--bg-elevated);
  color: #ffffff;
}

.seg-btn[data-cue-mode="relative"].is-active,
.seg-btn[data-cue-mode="fixed"].is-active,
.seg-btn[data-add-mode="relative"].is-active,
.seg-btn[data-add-mode="fixed"].is-active {
  background: var(--accent-auto-bg);
  color: #fbbf24;
}

.seg-btn[data-cue-mode="countdown"].is-active,
.seg-btn[data-add-mode="countdown"].is-active {
  background: var(--accent-cd-bg);
  color: #22d3ee;
}

.seg-btn[data-cue-mode="manual"].is-active,
.seg-btn[data-add-mode="manual"].is-active {
  background: #273244;
  color: #e2e8f0;
}

.nudge-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nudge-btn {
  min-height: 34px;
  padding: 0 8px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.nudge-btn:active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.nudge-btn.is-zero {
  background: var(--bg-input);
  color: var(--text-secondary);
}

.preset-btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
}

.preset-btn.is-selected {
  background: var(--bg-elevated);
  border-color: var(--accent-auto);
  color: #fbbf24;
}

.time-hm-inputs,
.time-hms-inputs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
}

.time-select {
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
  padding: 4px 2px;
  min-height: 30px;
  outline: none;
}

.time-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.time-colon {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-secondary);
}

.num-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

.num-input {
  width: 52px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.num-unit {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ==========================================================================
   空状態・モーダル・マークピッカー・トースト
   ========================================================================== */
.empty-state {
  padding: 40px 18px;
  text-align: center;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: keep-all;
}

.empty-desc {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-card-lg {
  max-width: 580px;
}

.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.field-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.text-input,
.select-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 14px;
}

.text-input:focus,
.select-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.symbol-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.symbol-opt {
  min-height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 17px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.symbol-opt[data-symbol="貸切"] { font-size: 12px; }
.symbol-opt[data-sym-tone="amber"]   { color: #fbbf24; }
.symbol-opt[data-sym-tone="gold"]    { color: #fde047; }
.symbol-opt[data-sym-tone="cyan"]    { color: #22d3ee; }
.symbol-opt[data-sym-tone="pink"]    { color: #f472b6; }
.symbol-opt[data-sym-tone="emerald"] { color: #34d399; }
.symbol-opt[data-sym-tone="violet"]  { color: #c084fc; }

.symbol-opt.is-selected {
  background: #172844;
  border: 2px solid var(--accent-blue);
}

/* 単日変更（日時・メモ変更モード）の1行日付選択 */
.single-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-nav-btn {
  min-width: 38px;
  padding: 0 10px;
}

.single-date-wd {
  font-size: 13px;
  font-weight: 800;
  min-width: 30px;
  text-align: center;
  color: var(--text-secondary);
  white-space: nowrap;
}

.single-date-wd.is-sat { color: var(--sat-color); }
.single-date-wd.is-sun { color: var(--sun-color); }

/* 複数日追加用：日〜土ミニ月間カレンダー */
.mini-cal-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-cal-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mini-cal-nav-btn {
  min-height: 30px;
  min-width: 32px;
  padding: 0 8px;
}

.mini-cal-month {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 88px;
  text-align: center;
}

.mini-cal-count {
  font-size: 12px;
  font-weight: 800;
  color: #93c5fd;
  background: #172844;
  border: 1px solid #1d4ed8;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.mini-cal-quick-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-cal-quick-btn {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 700;
}

.mini-cal-quick-btn:active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.mini-cal-quick-btn.is-clear {
  margin-left: auto;
  background: transparent;
  color: var(--text-secondary);
}

.mini-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
  padding-top: 2px;
}

.mini-cal-weekdays .is-sun { color: var(--sun-color); }
.mini-cal-weekdays .is-sat { color: var(--sat-color); }

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.mini-cal-day {
  position: relative;
  height: 36px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.1s, border-color 0.1s;
}

.mini-cal-day.is-sun { color: #fca5a5; }
.mini-cal-day.is-sat { color: #93c5fd; }

.mini-cal-day.is-outside {
  opacity: 0.35;
}

/* 公演期間内の日付をひと目で分かるようにハイライト */
.mini-cal-day.is-in-period {
  background: #1a2334;
  border-color: #334663;
}

.mini-cal-day.is-today {
  box-shadow: inset 0 -2px 0 var(--accent-arm);
}

.mini-cal-day.is-selected {
  background: var(--accent-blue) !important;
  border-color: #93c5fd !important;
  color: #ffffff !important;
}

/* 同時刻の既存公演がある日に小さなオレンジドット表示 */
.mini-cal-day.has-existing-show::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-auto);
}

.mini-cal-summary {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  min-height: 16px;
}

.date-input {
  flex: 1;
  color-scheme: dark;
}

.selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #172844;
  border: 1px solid var(--accent-blue);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.selected-date-pill button {
  font-size: 14px;
  color: #93c5fd;
  padding: 0 2px;
}

.time-preset-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.time-hm-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.add-trigger-subbox {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.offset-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.offset-preview-clock {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 800;
  color: #fbbf24;
  white-space: nowrap;
}

.target-shows-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.target-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.target-shows-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.target-show-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.target-show-check.is-past {
  opacity: 0.55;
}

.target-show-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-blue);
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.modal-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 22px;
  line-height: 1;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:active {
  background: var(--bg-elevated);
  color: #ffffff;
}

/* SAVE / LOAD モーダル */
.save-inline-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.saved-projects-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.saved-project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.saved-project-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.saved-project-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-project-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.saved-project-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.saved-projects-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.project-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 公演設定モーダル（期間・バリエーション） */
.period-inputs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.period-sep {
  font-weight: 800;
  color: var(--text-secondary);
}

.variation-input-row {
  flex-wrap: wrap;
  gap: 8px;
}

.variation-time-select {
  padding: 4px 6px;
  min-width: 82px;
}

.variation-or-sep {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.variation-text-input {
  width: 116px;
  height: 38px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

/* 使い方ヘルプモーダル */
.help-body {
  gap: 12px;
}

.help-alert-box {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #2f1215;
  border: 2px solid #ef4444;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-alert-title {
  font-size: 15px;
  font-weight: 800;
  color: #fca5a5;
  line-height: 1.35;
}

.help-alert-text {
  margin: 0;
  font-size: 13px;
  color: #ffffff;
  line-height: 1.6;
}

.help-alert-sub {
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid #7f1d1d;
  font-size: 12px;
  color: #fde68a;
  line-height: 1.55;
}

.help-section {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.help-heading {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 800;
  color: #fbbf24;
}

.help-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.help-text strong {
  color: var(--text-primary);
}

.help-text code {
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: #93c5fd;
  font-size: 12px;
}

/* PRO課金ゲートモーダル */
.paywall-card {
  text-align: center;
  border: 2px solid var(--accent-auto);
}

.paywall-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-auto);
}

.paywall-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.paywall-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.paywall-buy-btn {
  width: 100%;
  min-height: 46px;
  background: #16a34a;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.paywall-note {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.toast-container {
  position: fixed;
  right: calc(14px + var(--safe-right));
  bottom: calc(16px + var(--safe-bottom));
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-blue);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  max-width: 340px;
}

.toast.toast-success { border-left-color: var(--accent-arm); }
.toast.toast-warn    { border-left-color: var(--accent-auto); }
.toast.toast-error   { border-left-color: var(--accent-live); }

/* ==========================================================================
   レスポンシブ設計（iPad縦: <=960px / スマホ: <=680px）
   ========================================================================== */

/* iPad縦（720px〜1023px）：コンパクト固定幅で1行整列と時間ピル縦揃えを維持 */
@media (max-width: 1023px) {
  :root {
    --time-pill-w: 152px;
    --sub-slot-w: 130px;
    --play-btn-w: 146px;
    --play-btn-h: 54px;
  }

  .clock-value {
    font-size: 26px;
  }

  .cue-main-row {
    gap: 10px;
  }

  .cue-time-main,
  .pill-time-select {
    font-size: 17px;
  }

  .pill-time-select {
    width: 25px;
    height: 21px;
  }

  .cue-time-pill.is-counting .cue-time-main,
  .cue-time-pill.is-counting .pill-time-select {
    font-size: 12px;
  }

  .cue-time-pill.is-counting .pill-time-select {
    width: 19px;
    height: 16px;
  }

  .pill-cd-input {
    width: 36px;
    font-size: 22px;
  }

  .cue-time-rem {
    font-size: 10.5px;
  }

  .cue-time-rem.is-counting .cd-digits {
    font-size: 20px;
  }

  .cue-time-pill.is-countdown .cue-time-main {
    font-size: 22px;
  }

  .cue-title-display {
    font-size: 17px;
  }

  .cd-inline-controls {
    gap: 4px;
  }

  .cd-fixed-btn {
    width: 64px;
    font-size: 12px;
  }

  .cd-reset-fixed-btn {
    width: 62px;
    font-size: 11px;
  }

  .cancel-alarm-fixed-btn {
    width: 82px;
    font-size: 12px;
  }

  .played-reset-fixed-btn {
    width: 74px;
    font-size: 11px;
  }

  .play-seek-btn {
    font-size: 14px;
  }
}

/* スマホ（<=719px）：タイトル幅を削らず2段構成で時間ピルを右端縦揃え */
@media (max-width: 719px) {
  :root {
    --time-pill-w: 144px;
    --play-btn-w: 152px;
    --play-btn-h: 50px;
  }

  .app-header {
    padding: calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) 8px calc(10px + var(--safe-left));
  }

  .header-compact-row {
    gap: 8px;
  }

  .header-left-group {
    flex: 1 0 100%;
    gap: 6px;
  }

  .header-app-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
  }

  .prod-title-wrap {
    max-width: none;
    min-width: 72px;
  }

  .prod-title-input {
    height: 34px;
    font-size: 13px;
    padding: 0 8px;
  }

  .btn-save-load {
    padding: 0 8px;
    min-height: 34px;
    font-size: 11px;
  }

  .header-icon-btn {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .header-gear-svg {
    width: 20px;
    height: 20px;
  }

  .header-right-group {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
  }

  .clock-block {
    padding: 3px 5px;
  }

  .telemetry-label {
    font-size: 9px;
  }

  .clock-value {
    font-size: 14px;
    letter-spacing: 0.01em;
  }

  .master-vol-compact {
    padding: 2px 3px;
    gap: 2px;
  }

  .vol-caption {
    display: none;
  }

  .vol-step-btn {
    width: 22px;
    height: 28px;
    font-size: 13px;
  }

  .vol-input-box {
    height: 28px;
    padding: 0 3px;
  }

  .vol-num-input {
    width: 24px;
    font-size: 12px;
  }

  .mode-btn {
    min-height: 32px;
    padding: 0 6px;
    font-size: 10.5px;
  }

  .app-main {
    padding: 10px calc(10px + var(--safe-right)) calc(32px + var(--safe-bottom)) calc(10px + var(--safe-left));
  }

  .show-bar {
    padding: 8px 10px;
  }

  /* スマホではドロップ案内を省いて縦幅を確保 */
  .drop-zone {
    display: none;
  }

  .live-show-datetime {
    font-size: 22px;
  }

  .live-show-memo {
    font-size: 14px;
  }

  /* スマホのキューカード：上段(タイトル+発火時間) / 下段(固定サイズ操作)の2段グリッド */
  .cue-main-area {
    padding: 10px 12px;
  }

  .cue-main-row {
    grid-template-columns: minmax(0, 1fr) var(--time-pill-w);
    grid-template-areas:
      "file time"
      "actions actions";
    gap: 10px;
  }

  .cue-time-pill {
    grid-area: time;
    width: var(--time-pill-w);
    min-width: var(--time-pill-w);
    height: var(--play-btn-h);
    padding: 3px 6px;
    gap: 2px;
  }

  .cue-time-main,
  .pill-time-select {
    font-size: 15px;
  }

  .pill-time-select {
    width: 23px;
    height: 19px;
  }

  .cue-time-pill.is-counting .cue-time-main,
  .cue-time-pill.is-counting .pill-time-select {
    font-size: 11px;
  }

  .cue-time-pill.is-counting .pill-time-select {
    width: 18px;
    height: 15px;
  }

  .pill-cd-input {
    width: 32px;
    font-size: 20px;
  }

  .cue-time-pill.is-countdown .pill-inline-colon {
    font-size: 18px;
  }

  .cue-time-rem {
    font-size: 10px;
  }

  .cue-time-rem.is-counting .cd-prefix {
    font-size: 10px;
  }

  .cue-time-rem.is-counting .cd-digits {
    font-size: 18px;
  }

  .cue-time-pill.is-countdown .cue-time-main {
    font-size: 20px;
  }

  .cue-time-pill .badge-played {
    padding: 1px 5px;
    font-size: 10px;
  }

  .cue-file-block {
    grid-area: file;
  }

  .cue-title-display {
    font-size: 16px;
  }

  .cue-fixed-actions {
    grid-area: actions;
    width: 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    gap: 6px;
  }

  .cd-fixed-btn {
    width: 72px;
    font-size: 12px;
  }

  .cd-reset-fixed-btn {
    width: 64px;
    font-size: 11px;
  }

  .cancel-alarm-fixed-btn {
    width: 84px;
    font-size: 12px;
  }

  .played-reset-fixed-btn {
    width: 76px;
    font-size: 11px;
  }

  .play-seek-btn {
    font-size: 14px;
  }

  .cue-edit-drawer {
    padding: 8px 10px 10px;
  }

  .edit-drawer-left,
  .edit-drawer-right {
    flex-basis: 100%;
  }

  .segment-group.full-width {
    grid-template-columns: repeat(2, 1fr);
  }

  .skin-picker-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .time-preset-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .symbol-picker {
    grid-template-columns: repeat(3, 1fr);
  }

  .target-shows-list {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   外観スキン（テーマ）選択UI
   ========================================================================== */
.skin-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.skin-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  text-align: left;
  transition: border-color 0.15s, background-color 0.15s;
}

.skin-opt.is-selected {
  border: 2px solid var(--accent-blue);
  background: var(--bg-elevated);
}

.skin-swatch {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  border: 1px solid rgba(128, 128, 128, 0.45);
}

.swatch-default {
  background: linear-gradient(135deg, #0a0c10 0%, #1a2232 55%, #3b82f6 100%);
}

.swatch-black {
  background: linear-gradient(135deg, #000000 0%, #090b0f 65%, #f59e0b 100%);
}

.swatch-mac {
  background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 60%, #007aff 100%);
}

.swatch-mac-dark {
  background: linear-gradient(135deg, #1c1c1e 0%, #343438 60%, #0a84ff 100%);
}

.skin-opt-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.skin-opt-text strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.skin-opt-text small {
  font-size: 10.5px;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* ==========================================================================
   スキン 1：ブラック（暗所・OLED特化 ピュアブラック）
   ========================================================================== */
:root[data-theme="black"] {
  --bg-base: #000000;
  --bg-surface: #07080b;
  --bg-elevated: #111318;
  --bg-input: #030406;
  --border-subtle: #181c24;
  --border-strong: #29303d;
}

:root[data-theme="black"] .app-header {
  background: #000000;
}

:root[data-theme="black"] .matrix-corner-cell,
:root[data-theme="black"] .matrix-time-header,
:root[data-theme="black"] .matrix-month-col,
:root[data-theme="black"] .matrix-month-sub {
  background: #000000;
}

:root[data-theme="black"] .matrix-day-col {
  background: #090b0f;
}

:root[data-theme="black"] .matrix-cell {
  background: #040507;
}

:root[data-theme="black"] .matrix-show-btn {
  background: #0c0f15;
}

:root[data-theme="black"] .cue-edit-drawer {
  background: #040507;
}

/* ==========================================================================
   スキン 2：Mac風ダーク（グラファイト・半透明フロスト）
   ========================================================================== */
:root[data-theme="mac-dark"] {
  --bg-base: #1c1c1e;
  --bg-surface: #28282b;
  --bg-elevated: #36363a;
  --bg-input: #202023;
  --border-subtle: #3c3c41;
  --border-strong: #515158;
  --accent-blue: #0a84ff;
  --accent-blue-hover: #0071e3;
  --accent-arm: #30d158;
  --accent-arm-bg: #13311e;
  --accent-auto: #ff9f0a;
  --accent-auto-bg: #36250b;
  --accent-cd: #32ade6;
  --accent-cd-bg: #102b38;
  --accent-live: #ff453a;
  --accent-live-bg: #3d1616;
}

:root[data-theme="mac-dark"] .app-header {
  background: rgba(40, 40, 43, 0.86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

:root[data-theme="mac-dark"] .matrix-corner-cell,
:root[data-theme="mac-dark"] .matrix-time-header,
:root[data-theme="mac-dark"] .matrix-month-col,
:root[data-theme="mac-dark"] .matrix-month-sub {
  background: #222225;
}

:root[data-theme="mac-dark"] .matrix-day-col {
  background: #2c2c30;
}

:root[data-theme="mac-dark"] .matrix-cell {
  background: #242427;
}

:root[data-theme="mac-dark"] .matrix-show-btn {
  background: #303035;
}

:root[data-theme="mac-dark"] .cue-edit-drawer {
  background: #232326;
}

/* ==========================================================================
   スキン 3：Mac風（ライト・フロストグラス調）
   ========================================================================== */
:root[data-theme="mac"] {
  --bg-base: #eceef2;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f3f6;
  --bg-input: #f7f8fa;
  --border-subtle: #dde2ea;
  --border-strong: #c4ccd8;

  --text-primary: #1d1d1f;
  --text-secondary: #525963;
  --text-muted: #7b8491;

  --accent-live: #dc2626;
  --accent-live-bg: #fee2e2;
  --accent-live-border: #ef4444;
  --accent-arm: #16a34a;
  --accent-arm-bg: #dcfce7;
  --accent-auto: #d97706;
  --accent-auto-bg: #fef3c7;
  --accent-cd: #0891b2;
  --accent-cd-bg: #e0f7fa;
  --accent-blue: #007aff;
  --accent-blue-hover: #0066d6;
  --sat-color: #007aff;
  --sun-color: #dc2626;
}

:root[data-theme="mac"] .app-header {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

:root[data-theme="mac"] .show-bar,
:root[data-theme="mac"] .active-show-controls,
:root[data-theme="mac"] .cue-card,
:root[data-theme="mac"] .cue-footer-toolbar,
:root[data-theme="mac"] .modal-card {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

:root[data-theme="mac"] .btn-save-load {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}

:root[data-theme="mac"] .header-help-btn {
  background: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
}

:root[data-theme="mac"] .btn-ghost-danger {
  border-color: #fca5a5;
  color: #dc2626;
}

:root[data-theme="mac"] .date-input {
  color-scheme: light;
}

/* Mac風ライト：劇場カレンダー表 */
:root[data-theme="mac"] .matrix-corner-cell,
:root[data-theme="mac"] .matrix-time-header {
  background: #f1f4f8;
  color: #1d1d1f;
}

:root[data-theme="mac"] .matrix-month-col,
:root[data-theme="mac"] .matrix-month-sub {
  background: #e6ebf2;
  color: #1d1d1f;
}

:root[data-theme="mac"] .matrix-day-col {
  background: #f6f8fb;
}

:root[data-theme="mac"] .matrix-day-col.is-past-day {
  background: #eef1f5;
  opacity: 0.72;
}

:root[data-theme="mac"] .matrix-day-col.is-today-col {
  background: #dcfce7;
  box-shadow: inset 0 3px 0 #16a34a;
}

:root[data-theme="mac"] .matrix-day-col.is-today-col .matrix-day-num {
  color: #14532d;
}

:root[data-theme="mac"] .matrix-day-col.is-today-col .matrix-day-wd {
  color: #15803d;
}

:root[data-theme="mac"] .matrix-today-pip {
  color: #ffffff;
}

:root[data-theme="mac"] .matrix-cell {
  background: #ffffff;
}

:root[data-theme="mac"] .matrix-cell.is-today-col {
  background: #f0fdf4;
  box-shadow: inset 1px 0 0 rgba(22, 163, 74, 0.35), inset -1px 0 0 rgba(22, 163, 74, 0.35);
}

:root[data-theme="mac"] .matrix-empty-btn {
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 0.7px),
    #d5dce6 calc(50% - 0.7px),
    #d5dce6 calc(50% + 0.7px),
    transparent calc(50% + 0.7px)
  );
}

:root[data-theme="mac"] .matrix-empty-btn:hover,
:root[data-theme="mac"] .matrix-empty-btn:active {
  background: #eaf2ff;
  color: #007aff;
}

:root[data-theme="mac"] .matrix-show-btn {
  background: #f4f7fc;
}

:root[data-theme="mac"] .matrix-show-btn.is-past {
  background: #f1f3f6;
}

:root[data-theme="mac"] .matrix-show-btn.is-past .matrix-show-symbol,
:root[data-theme="mac"] .matrix-show-btn.is-past .matrix-show-memo {
  color: #9aa3b2;
}

:root[data-theme="mac"] .matrix-cell.is-today-col .matrix-show-btn:not(.is-past) {
  background: #dcfce7;
}

:root[data-theme="mac"] .sym-amber { color: #d97706; }
:root[data-theme="mac"] .sym-gold  { color: #ca8a04; }
:root[data-theme="mac"] .sym-cyan  { color: #0284c7; }
:root[data-theme="mac"] .sym-pink  { color: #db2777; }
:root[data-theme="mac"] .sym-emerald { color: #16a34a; }
:root[data-theme="mac"] .sym-violet  { color: #7c3aed; }

:root[data-theme="mac"] .show-meta-start strong {
  color: #b45309;
}

:root[data-theme="mac"] .show-meta-note {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

:root[data-theme="mac"] .live-show-datetime {
  color: #1d1d1f;
}

:root[data-theme="mac"] .live-show-memo {
  color: #b45309;
}

/* Mac風ライト：キューカード・時間ピル・再生ボタン・ドロワー */
:root[data-theme="mac"] .cue-card.is-played:not(.is-playing) {
  background: #f6f8fa;
}

:root[data-theme="mac"] .cue-card.is-playing .cue-title-display {
  color: #991b1b;
}

:root[data-theme="mac"] .cue-edit-drawer {
  background: #f7f9fc;
}

:root[data-theme="mac"] .cue-time-pill {
  background: #fffbeb;
  border-color: #f59e0b;
}

:root[data-theme="mac"] .cue-time-pill.is-soon {
  background: #fef3c7;
  border-color: #d97706;
}

:root[data-theme="mac"] .cue-time-pill.is-imminent {
  background: #fef2f2;
  border-color: #dc2626;
}

:root[data-theme="mac"] .cue-time-pill.is-countdown {
  background: #ecfeff;
  border-color: #06b6d4;
}

:root[data-theme="mac"] .cue-time-pill.is-manual,
:root[data-theme="mac"] .cue-time-pill.is-off,
:root[data-theme="mac"] .cue-time-pill.is-played-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

:root[data-theme="mac"] .cue-time-main,
:root[data-theme="mac"] .pill-time-select {
  color: #b45309;
}

:root[data-theme="mac"] .cue-time-pill.is-counting .cue-time-main,
:root[data-theme="mac"] .cue-time-pill.is-counting .pill-time-select {
  color: #92400e;
}

:root[data-theme="mac"] .cue-time-pill.is-counting.is-imminent .cue-time-main,
:root[data-theme="mac"] .cue-time-pill.is-counting.is-imminent .pill-time-select {
  color: #b91c1c;
}

:root[data-theme="mac"] .cue-time-rem.is-normal {
  color: #334155;
}

:root[data-theme="mac"] .cue-time-rem.is-soon {
  color: #b45309;
}

:root[data-theme="mac"] .cue-time-rem.is-imminent {
  color: #dc2626;
}

:root[data-theme="mac"] .cue-time-pill.is-countdown .cue-time-main,
:root[data-theme="mac"] .pill-cd-input {
  color: #0e7490;
}

:root[data-theme="mac"] .cue-time-rem.is-cd-running {
  color: #0284c7;
}

:root[data-theme="mac"] .cue-time-manual-label {
  color: #475569;
}

:root[data-theme="mac"] .play-seek-btn {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}

:root[data-theme="mac"] .cue-card.is-played:not(.is-playing) .play-seek-btn {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #1e293b;
}

:root[data-theme="mac"] .play-seek-btn.is-playing {
  background: #991b1b;
  border-color: #dc2626;
  color: #ffffff;
}

:root[data-theme="mac"] .seg-btn.is-active {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

:root[data-theme="mac"] .seg-btn[data-cue-mode="relative"].is-active,
:root[data-theme="mac"] .seg-btn[data-cue-mode="fixed"].is-active,
:root[data-theme="mac"] .seg-btn[data-add-mode="relative"].is-active,
:root[data-theme="mac"] .seg-btn[data-add-mode="fixed"].is-active {
  background: #fef3c7;
  color: #92400e;
}

:root[data-theme="mac"] .seg-btn[data-cue-mode="countdown"].is-active,
:root[data-theme="mac"] .seg-btn[data-add-mode="countdown"].is-active {
  background: #cffafe;
  color: #0e7490;
}

:root[data-theme="mac"] .seg-btn[data-cue-mode="manual"].is-active,
:root[data-theme="mac"] .seg-btn[data-add-mode="manual"].is-active {
  background: #e2e8f0;
  color: #1e293b;
}

/* Mac風ライト：モーダル・ミニカレンダー・ヘルプ */
:root[data-theme="mac"] .modal-overlay {
  background: rgba(15, 23, 42, 0.42);
}

:root[data-theme="mac"] .selected-date-pill,
:root[data-theme="mac"] .mini-cal-count {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

:root[data-theme="mac"] .selected-date-pill button {
  color: #1d4ed8;
}

:root[data-theme="mac"] .mini-cal-day.is-in-period {
  background: #eff6ff;
  border-color: #bfdbfe;
}

:root[data-theme="mac"] .mini-cal-day.is-sun { color: #dc2626; }
:root[data-theme="mac"] .mini-cal-day.is-sat { color: #007aff; }

:root[data-theme="mac"] .symbol-opt.is-selected {
  background: #dbeafe;
}

:root[data-theme="mac"] .help-alert-box {
  background: #fef2f2;
  border-color: #ef4444;
}

:root[data-theme="mac"] .help-alert-title { color: #b91c1c; }
:root[data-theme="mac"] .help-alert-text  { color: #1f2937; }
:root[data-theme="mac"] .help-alert-sub {
  border-top-color: #fecaca;
  color: #92400e;
}

:root[data-theme="mac"] .help-heading { color: #b45309; }
:root[data-theme="mac"] .help-text code {
  background: #e2e8f0;
  color: #1d4ed8;
}

:root[data-theme="mac"] .drop-zone.is-dragover {
  background: #dbeafe;
  color: #1e40af;
}

:root[data-theme="mac"] .toast {
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
}
