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

:root {
  --bg: #111113;
  --surface: #1c1c1f;
  --border: #2e2e33;
  --text: #e4e4e7;
  --text-muted: #9494a0;
  --accent: #4f7df5;
  --accent-hover: #6690f7;
  --accent-disabled: #2e4a8a;
  --success: #22c55e;
  --error: #ef4444;
  --input-bg: #16161a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── Lock Screen ──────────────────────────────────────────────────────────── */

.lock-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.lock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.lock-card h1 { font-size: 18px; font-weight: 600; }

.lock-card input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  text-align: center;
}

.lock-card input:focus { outline: none; border-color: var(--accent); }

.lock-error {
  color: var(--error);
  font-size: 13px;
  margin: 0;
}

/* ─── App Layout ───────────────────────────────────────────────────────────── */

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

h1 {
  font-size: 20px;
  font-weight: 600;
}

.show-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.show-logo {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.show-name {
  font-size: 18px;
  font-weight: 600;
}

.show-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
}

.tab {
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.tab:hover { background: var(--border); color: var(--text); }
.tab.active { background: var(--accent); color: #fff; }

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

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

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.hint {
  font-weight: 400;
  font-size: 11px;
  opacity: .7;
}

input[type="text"],
input[type="date"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color .15s;
  resize: vertical;
}

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

input[readonly], textarea[readonly] {
  background: var(--bg);
  color: var(--text-muted);
}

select {
  color: var(--text);
  background: var(--input-bg);
}

select option {
  background: var(--surface);
  color: var(--text);
}

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

.episode-row select { flex: 1; }

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

.file-row input { flex: 1; }

.upload-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width .2s;
}

#progress-text {
  font-size: 12px;
  color: var(--text-muted);
}

.ad-spots { display: flex; flex-direction: column; gap: 8px; }

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

.ad-label {
  width: 36px;
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ad-time { width: 110px !important; font-variant-numeric: tabular-nums; }

.btn-primary, .btn-secondary {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}

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

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: var(--accent-disabled); cursor: default; }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover { background: rgba(79,125,245,.1); }
.btn-secondary.signed-in { color: var(--success); border-color: var(--success); }

.full-width { width: 100%; padding: 10px; font-size: 14px; }

.output-box {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  user-select: text;
}

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

.copy-row input { flex: 1; }

.copy-confirm {
  font-size: 13px;
  color: var(--success);
  font-weight: 500;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  transition: opacity .2s;
  pointer-events: none;
}

.hidden { display: none !important; }
