/* VideoReview 共通スタイル
   動画を見ながら長時間使うツールなのでダーク基調。アクセントはMarketikのember。 */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c232c;
  --surface-3: #222b36;
  --border: #2a323d;
  --border-soft: #212932;
  --ink: #e6edf3;
  --ink-soft: #8b98a5;
  --ink-faint: #626d7a;
  --ember: #ff5a2c;
  --ember-deep: #d6451c;
  --gold: #e0ac3f;
  --ok: #3fb950;
  --danger: #f85149;

  --tag-telop: #e0ac3f;
  --tag-cut: #ff5a2c;
  --tag-sound: #a371f7;
  --tag-color: #39c5cf;
  --tag-asset: #3fb950;
  --tag-other: #8b98a5;

  --radius: 10px;
  --radius-sm: 6px;
  --header-h: 52px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection { background: rgba(255, 90, 44, .35); }

/* ------------------------------------------------------------- スクロールバー */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2f3944; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3c4856; }

/* ------------------------------------------------------------------ ヘッダー */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: rgba(13, 17, 23, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--ember) 0%, var(--ember-deep) 100%);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #fff;
}

.header-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.header-sub {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 400;
  margin-left: 8px;
}

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease;
}

.btn:hover { background: var(--surface-3); border-color: #3a4450; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--ember-deep);
  border-color: var(--ember-deep);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--ember); border-color: var(--ember); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(248, 81, 73, .12); border-color: rgba(248, 81, 73, .4); }

.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn-icon { width: 32px; padding: 0; }

/* --------------------------------------------------------------- フォーム部品 */

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

.field-label {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
}

.input, .textarea, .select {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--ember-deep);
  box-shadow: 0 0 0 3px rgba(214, 69, 28, .18);
}

.textarea { resize: vertical; min-height: 64px; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }

.select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b98a5' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

/* ------------------------------------------------------------------ バッジ類 */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge-open { background: rgba(255, 90, 44, .16); color: var(--ember); }
.badge-done { background: rgba(63, 185, 80, .14); color: var(--ok); }
.badge-muted { background: var(--surface-3); color: var(--ink-soft); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.status-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-review { background: rgba(224, 172, 63, .14); color: var(--gold); }
.status-fixing { background: rgba(255, 90, 44, .14); color: var(--ember); }
.status-done { background: rgba(63, 185, 80, .14); color: var(--ok); }

/* -------------------------------------------------------------- モーダル共通 */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 10, .72);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

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

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.hint { font-size: 12px; color: var(--ink-soft); line-height: 1.55; }
.error-text { font-size: 12px; color: var(--danger); }

[hidden] { display: none !important; }

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

.toast-area {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 9px 16px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  animation: toast-in .18s ease;
}

.toast-error { border-color: rgba(248, 81, 73, .5); color: #ffb4ae; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--ember);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-soft);
}
.empty-title { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
