/* =========================================================
   ScriptCue — スタイル
   ダークなスタジオ風UI。録音中の行が一目で分かることを最優先。
   ========================================================= */

:root {
  --bg-0: #0b0e14;
  --bg-1: #111726;
  --bg-2: #171f33;
  --bg-3: #1e2942;
  --line: #26314d;
  --line-soft: #1c2438;

  --text-0: #eef2fb;
  --text-1: #b9c4dc;
  --text-2: #7d8aa8;

  --accent: #4f8cff;
  --accent-strong: #2f6ce8;
  --accent-soft: rgba(79, 140, 255, 0.15);

  --record: #ff4d5e;
  --record-soft: rgba(255, 77, 94, 0.16);
  --ok: #35d39a;
  --ok-soft: rgba(53, 211, 154, 0.14);
  --warn: #ffb02e;
  --warn-soft: rgba(255, 176, 46, 0.14);
  --pending: #8b95ad;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);

  --font-ui: 'Inter', 'Noto Sans JP', 'Noto Sans SC', system-ui, -apple-system, 'Hiragino Sans', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }

/* hidden 属性を必ず効かせる。
   下で display:flex 等を指定した要素でも hidden が上書きされて
   表示され続けてしまうのを防ぐ（重要な安全策）。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

body {
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(79, 140, 255, 0.14), transparent 62%),
    radial-gradient(760px 480px at 96% 4%, rgba(255, 77, 94, 0.10), transparent 60%);
  background-repeat: no-repeat;
  min-height: 100vh;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: 0.01em; }
p { margin: 0; }
b { font-weight: 700; color: var(--text-0); }

button, input, select, textarea { font: inherit; color: inherit; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-3);
  padding: 0.1em 0.4em;
  border-radius: 5px;
  color: #cfe0ff;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

/* ---------------- ヘッダー ---------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(14px, 3vw, 32px);
  background: rgba(11, 14, 20, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(140deg, var(--accent), #8b5cf6);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 6px 18px rgba(79, 140, 255, 0.35);
}
.brand-text h1 { font-size: 1.2rem; line-height: 1.25; }
.brand-text p { font-size: 0.78rem; color: var(--text-2); }

.header-status { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: #a9c6ff;
  border: 1px solid rgba(79, 140, 255, 0.3);
  white-space: nowrap;
}
.pill-muted {
  background: var(--bg-2);
  color: var(--text-2);
  border-color: var(--line);
}
.pill-rec {
  background: var(--record-soft);
  color: #ff9aa4;
  border-color: rgba(255, 77, 94, 0.4);
}
.pill-rec i { animation: blink 1.1s steps(2, end) infinite; font-size: 0.6rem; }
@keyframes blink { 50% { opacity: 0.15; } }

/* ---------------- レイアウト ---------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
  gap: 18px;
  align-items: start;
  padding: 18px clamp(14px, 3vw, 32px) 8px;
  max-width: 1500px;
  margin: 0 auto;
}
.panel-script { grid-row: span 2; }

@media (max-width: 1040px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .panel-script { grid-row: auto; }
}

/* ---------------- パネル ---------------- */
.panel {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-head h2 {
  font-size: 0.98rem;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-0);
}
.panel-head h2 i { color: var(--accent); }
.panel-head-actions { display: flex; gap: 8px; }

/* ---------------- ボタン ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--bg-3);
  color: var(--text-0);
  font-weight: 600;
  font-size: 0.87rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 6px 18px rgba(79, 140, 255, 0.28);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 24px rgba(79, 140, 255, 0.36); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line);
  color: var(--text-1);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); color: var(--text-0); }

.btn-sm { padding: 7px 12px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.file-btn { position: relative; }

.btn-record {
  flex: 1 1 200px;
  background: linear-gradient(140deg, #ff5566, #e02b47);
  color: #fff;
  padding: 14px 22px;
  font-size: 0.98rem;
  box-shadow: 0 8px 22px rgba(255, 77, 94, 0.32);
}
.btn-record.is-active {
  background: linear-gradient(140deg, #2a3350, #1c2338);
  border-color: rgba(255, 77, 94, 0.5);
  box-shadow: none;
}

/* ---------------- フォーム ---------------- */
.field-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}
.field-row-wrap { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-block { width: 100%; }
.field-label { font-size: 0.75rem; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  color: var(--text-0);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea {
  resize: vertical;
  min-height: 190px;
  line-height: 1.75;
  font-family: var(--font-ui);
}
.select { cursor: pointer; }
.select option { background: var(--bg-2); color: var(--text-0); }

/* ---------------- スイッチ ---------------- */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.83rem;
  color: var(--text-1);
  user-select: none;
  min-width: 0;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  flex: 0 0 auto;
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.18s ease, background 0.18s ease;
}
.switch input:checked + .switch-track { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(17px); background: var(--accent); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch-text { line-height: 1.35; }

.hint-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.78rem;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hint-list b { color: var(--text-1); }

/* ---------------- 進捗 ---------------- */
.script-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line-soft);
}
.progress-wrap { display: flex; align-items: center; gap: 12px; flex: 1 1 240px; min-width: 0; }
.progress {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
  min-width: 90px;
}
.progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  transition: width 0.3s ease;
}
.progress-label { font-size: 0.78rem; font-weight: 600; color: var(--text-1); white-space: nowrap; }
.toolbar-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- テイク一覧 ---------------- */
.empty-note {
  font-size: 0.83rem;
  color: var(--text-2);
  text-align: center;
  padding: 22px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.take-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 78vh;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 4px;
}
.take-list::-webkit-scrollbar { width: 8px; }
.take-list::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }

.take {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: start;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--line);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.take:hover { background: rgba(255, 255, 255, 0.055); }
.take.is-current {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(79, 140, 255, 0.35);
}
.take.is-recorded { border-left-color: var(--ok); }
.take.is-recorded.is-current { border-left-color: var(--accent); }
.take.is-playing { outline: 2px solid var(--ok); outline-offset: -2px; }
.take.is-hold { opacity: 0.55; }

.take-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--bg-3);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-2);
  margin-top: 1px;
}
.take.is-recorded .take-index { background: var(--ok-soft); color: var(--ok); }
.take.is-current .take-index { background: var(--accent); color: #fff; }

.take-body { min-width: 0; }
.take-speaker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: none;
  margin-bottom: 2px;
}
.take-text {
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text-0);
  word-break: break-word;
  white-space: pre-wrap;
}
.take.is-hold .take-text { color: var(--text-2); font-style: italic; }

.take-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-top: 2px;
}
.take-time {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  white-space: nowrap;
}
.take-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-2);
  white-space: nowrap;
}
.take.is-recorded .take-badge { background: var(--ok-soft); color: var(--ok); }
.take-actions { display: flex; gap: 6px; flex: 0 0 auto; grid-column: 2 / -1; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  cursor: pointer;
  font-size: 0.78rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { background: var(--accent-soft); color: #a9c6ff; border-color: var(--accent); }
.icon-btn.is-danger:hover { background: var(--record-soft); color: #ff9aa4; border-color: var(--record); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------- マイク選択 ---------------- */
.mic-select-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.field-grow { flex: 1 1 auto; min-width: 0; }
.mic-in-use {
  font-size: 0.74rem;
  color: var(--ok);
  margin-top: -6px;
  word-break: break-word;
}
.export-note {
  font-size: 0.77rem;
  line-height: 1.6;
  color: var(--text-2);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: rgba(79, 140, 255, 0.08);
  border-left: 3px solid var(--accent);
}
.export-note i { color: var(--accent); margin-right: 4px; }

/* ---------------- 現在読む行 ---------------- */
.current-cue {
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(79, 140, 255, 0.14), rgba(139, 92, 246, 0.10));
  border: 1px solid rgba(79, 140, 255, 0.28);
}
.cue-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #a9c6ff;
  text-transform: uppercase;
}
.cue-speaker {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}
.cue-text {
  margin-top: 4px;
  font-size: clamp(1.05rem, 1.7vw, 1.32rem);
  line-height: 1.6;
  font-weight: 600;
  word-break: break-word;
  white-space: pre-wrap;
}
.cue-next {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 読み上げ進捗バー（現在行の中） */
.cue-progress {
  margin-top: 10px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.cue-progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #9ae66e, var(--ok));
  transition: width 0.18s ease;
}
.cue-hint {
  margin-top: 7px;
  font-size: 0.74rem;
  color: #a9c6ff;
  font-variant-numeric: tabular-nums;
}

/* 認識エンジンが「読んでいる」と判定した行 */
.take.is-detected:not(.is-current) {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

/* ---------------- レベルメーター ---------------- */
.meter-block { display: flex; flex-direction: column; gap: 6px; }
.meter {
  height: 14px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
  border: 1px solid var(--line-soft);
}
.meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ok), #9ae66e 45%, var(--warn) 76%, var(--record));
  transition: width 0.07s linear;
}
.meter-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

/* ---------------- トランスポート ---------------- */
.transport { display: flex; gap: 10px; flex-wrap: wrap; }

/* 手動での行移動（前へ / 次の行へ） */
.transport-nav {
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line-soft);
}
.transport-nav .btn { flex: 0 1 auto; }
.btn-nav-next {
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 140, 255, 0.24);
}
.btn-nav-next:hover:not(:disabled) { box-shadow: 0 10px 22px rgba(79, 140, 255, 0.34); }
.nav-hint {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  white-space: nowrap;
}

/* 字幕（SRT）のオプション */
.srt-options { margin-top: -2px; }
.autocue-row {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line-soft);
}

/* ---------------- 認識結果 ---------------- */
.heard-box {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  padding: 10px 12px;
}
.heard-box summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.heard-box summary i { color: var(--accent); }
.heard-text {
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--text-1);
  max-height: 130px;
  overflow-y: auto;
  word-break: break-word;
}
.heard-text .hit { color: var(--ok); font-weight: 700; }

/* ---------------- 注意書き ---------------- */
.notice {
  font-size: 0.78rem;
  color: var(--text-2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border-left: 3px solid var(--line);
}
.notice-warn { border-left-color: var(--warn); background: var(--warn-soft); color: #ffd89a; }

/* ---------------- 書き出し ---------------- */
.panel-export { gap: 12px; }
.export-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.export-status { font-size: 0.79rem; color: var(--text-2); }
.export-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line-soft);
}
.export-result audio { width: 100%; height: 40px; }
.export-meta { font-size: 0.78rem; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------------- フッター ---------------- */
.app-footer {
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 32px) 34px;
  font-size: 0.76rem;
  color: var(--text-2);
  text-align: center;
}

/* ---------------- トースト ---------------- */
.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  max-width: min(92vw, 360px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.83rem;
  color: var(--text-0);
  animation: toast-in 0.22s ease;
}
.toast i { margin-top: 2px; }
.toast.is-ok { border-left: 3px solid var(--ok); }
.toast.is-warn { border-left: 3px solid var(--warn); }
.toast.is-error { border-left: 3px solid var(--record); }
.toast.is-ok i { color: var(--ok); }
.toast.is-warn i { color: var(--warn); }
.toast.is-error i { color: var(--record); }
.toast.is-out { animation: toast-out 0.28s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* マイクが使えないときの案内 */
.mic-notice {
  padding: 13px 14px;
  border-radius: var(--radius);
  background: rgba(255, 77, 94, 0.10);
  border: 1px solid rgba(255, 77, 94, 0.38);
  border-left: 3px solid var(--record);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.mic-notice-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.87rem;
  font-weight: 700;
  color: #ff9aa4;
}
.mic-notice-text {
  font-size: 0.82rem;
  line-height: 1.6;
  color: #ffd2d7;
}
.mic-notice-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mic-notice-steps {
  margin: 0;
  padding-left: 20px;
  font-size: 0.79rem;
  line-height: 1.7;
  color: var(--text-1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mic-notice-steps b { color: #fff; }

/* トーストが長文でも読めるように左揃えのまま折り返す */
.toast span { word-break: break-word; }

/* ---------------- モバイル ---------------- */
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .app-header { padding: 11px 13px; gap: 9px; }
  .brand-text p { display: none; }
  .layout { padding: 12px 11px 4px; gap: 12px; }
  .panel { padding: 13px; border-radius: var(--radius); gap: 12px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .take-list { max-height: none; }
  .transport { flex-direction: column; }
  .transport .btn { width: 100%; }
  .btn-record { flex: 1 1 auto; }
  .script-toolbar { flex-direction: column; align-items: stretch; }
  .progress-wrap { flex: 1 1 auto; }
  .toolbar-buttons .btn { flex: 1 1 auto; }
  .export-actions .btn, .export-actions .file-btn { width: 100%; }
  .toast-stack { left: 11px; right: 11px; max-width: none; align-items: stretch; }
  .current-cue { padding: 13px; }
  .take-actions { grid-column: 2 / -1; }
  .transport-nav .btn { width: auto; flex: 1 1 auto; }
  .nav-hint { order: 3; flex: 1 1 100%; margin-left: 0; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ヘッダーから開く設定画面 */
.settings-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 24px;
  overflow-y: auto;
  background: var(--bg-1);
  color: var(--text-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.settings-dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.settings-dialog h3 { margin: 24px 0 16px; }
.settings-dialog > .switch { margin: 12px 0; }
.settings-dialog .field-row-wrap .field { min-width: min(220px, 100%); }
@media (max-width: 600px) {
  .settings-dialog { padding: 16px; }
  .settings-dialog .field-row { flex-wrap: wrap; }
}

.language-picker { align-items: center; }
.language-picker select {
  font: inherit;
  color: var(--text-0);
  background: var(--bg-1);
  border: 0;
  cursor: pointer;
  max-width: 130px;
}
.language-picker select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.brand-home { color: inherit; text-decoration: none; }
.brand-home:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.social-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; font-size: 12px; }
.social-links a { color: inherit; text-decoration: none; }
.social-links a:hover { text-decoration: underline; }
.social-links a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.social-icon{width:20px;height:20px;flex-shrink:0;vertical-align:middle}.social-links a,.creator-links a{display:inline-flex;align-items:center;gap:8px}
