:root {
  color-scheme: dark;
  --bg: #090b0e;
  --panel: #12161b;
  --panel-2: #171c22;
  --line: #282f38;
  --text: #f4f7fa;
  --muted: #929ca8;
  --accent: #b8ff45;
  --danger: #ff796f;
  --success: #8fe86d;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 Inter, ui-sans-serif, system-ui, sans-serif; }
button, input, textarea, select { font: inherit; }
.shell { width: min(1220px, calc(100% - 36px)); margin: 0 auto; padding: 54px 0 80px; }
.shell.narrow { width: min(900px, calc(100% - 36px)); }
.hero, .call-head { display: flex; justify-content: space-between; gap: 28px; align-items: flex-end; margin-bottom: 36px; }
.hero h1, .call-head h1 { margin: 5px 0 9px; font-size: clamp(36px, 5vw, 66px); line-height: 1.02; letter-spacing: -.045em; max-width: 850px; }
.call-head h1 { font-size: clamp(32px, 5vw, 52px); }
h2 { margin: 4px 0 8px; font-size: 25px; letter-spacing: -.025em; }
.eyebrow { margin: 0; color: var(--accent); font: 700 12px/1.2 ui-monospace, monospace; letter-spacing: .14em; }
.muted { color: var(--muted); margin: 0; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.mode-card { position: relative; overflow: hidden; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; }
.mode-number { position: absolute; top: 12px; right: 22px; color: #222932; font: 800 72px/1 ui-monospace, monospace; }
.mode-copy { position: relative; min-height: 116px; padding-right: 46px; }
.manager-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-right: 0; }
.picker-form { display: grid; gap: 20px; margin-top: 20px; }
.field { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.field.compact { max-width: 160px; }
input[type="number"], input[type="date"], input[type="search"], input[type="text"], input[type="password"], textarea, select { width: 100%; padding: 12px 13px; color: var(--text); background: #0d1014; border: 1px solid var(--line); border-radius: 11px; outline: none; }
textarea { min-height: 160px; line-height: 1.5; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184,255,69,.1); }
.script-field small { color: var(--muted); line-height: 1.45; }
.period { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.period legend { width: 100%; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.period input { position: absolute; opacity: 0; pointer-events: none; }
.period span { display: block; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.period input:checked + span { color: #111; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.custom-dates, .duration-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.custom-dates[hidden] { display: none; }
button, .secondary { border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:disabled { opacity: .55; cursor: wait; }
.primary { background: var(--accent); color: #111; }
.secondary { color: var(--text); border: 1px solid var(--line); background: transparent; }
.secondary.small { padding: 8px 12px; font-size: 12px; }
.wide { width: 100%; padding: 14px 18px; }
.manager-box { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.manager-tools { display: flex; align-items: flex-end; gap: 10px; padding: 13px; border-bottom: 1px solid var(--line); }
.search { flex: 1; color: var(--muted); font-size: 12px; }
.search span { display: block; margin-bottom: 5px; }
.text-button { padding: 11px 2px; color: var(--accent); background: none; font-size: 12px; }
.manager-list { max-height: 280px; overflow-y: auto; padding: 7px; }
.manager-option { display: flex; align-items: center; gap: 11px; padding: 9px; border-radius: 9px; cursor: pointer; }
.manager-option:hover { background: var(--panel-2); }
.manager-option input { width: 18px; height: 18px; accent-color: var(--accent); }
.manager-option span, .manager-option strong, .manager-option small { display: block; }
.manager-option small { color: var(--muted); }
.team-list { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.team-option { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.team-option:last-of-type { border-bottom: 0; }
.team-option:hover { background: var(--panel-2); }
.team-option label { display: flex; flex: 1; align-items: center; gap: 11px; cursor: pointer; }
.team-option input { width: 19px; height: 19px; accent-color: var(--accent); }
.team-option span, .team-option strong, .team-option small { display: block; }
.team-option small { color: var(--muted); }
.team-option.is-empty label { opacity: .55; cursor: default; }
.team-edit { flex: 0 0 auto; padding: 6px 9px; color: var(--accent); text-decoration: none; font-size: 12px; font-weight: 700; }
.team-hint { margin: 0; padding: 13px; color: var(--muted); background: #0d1014; font-size: 12px; }
.team-head { margin-bottom: 24px; }
.team-editor { overflow: hidden; }
.team-editor form { padding: 20px 24px 24px; }
.team-search { display: block; margin-bottom: 14px; }
.team-manager-list { max-height: 520px; padding: 8px; background: #0d1014; border: 1px solid var(--line); border-radius: 14px; }
.team-manager-list .manager-option { border-bottom: 1px solid rgba(40,47,56,.65); }
.team-manager-list .manager-option:last-child { border-bottom: 0; }
.team-manager-list .manager-option[hidden], .manager-search-empty[hidden] { display: none !important; }
.team-manager-list .manager-option.is-selected { background: rgba(184,255,69,.08); box-shadow: inset 3px 0 0 var(--accent); }
.manager-search-empty { margin: 8px 0; }
.team-editor-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; }
.panel, .notice, .empty { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.notice { padding: 16px 20px; margin-bottom: 18px; }
.notice.error { color: var(--danger); }
.notice.success { color: var(--success); }
.history { margin-top: 38px; }
.panel-title { padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-title h2 { margin-bottom: 0; font-size: 20px; }
.panel-title > span { color: var(--muted); }
.history-toolbar { display: flex; align-items: flex-end; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.history-sort { width: min(360px, 100%); }
.history-toolbar .secondary { padding: 11px 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 16px 24px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: #252b32; color: var(--muted); font-size: 12px; }
.status-ready { background: rgba(184,255,69,.12); color: var(--accent); }
.status-error { background: rgba(255,121,111,.12); color: var(--danger); }
.status-processing { color: #ffe08c; }
.match-pill { display: inline-flex; min-width: 52px; justify-content: center; padding: 4px 9px; color: #111; background: var(--accent); border-radius: 999px; font-size: 12px; font-weight: 800; }
.match-error { color: var(--danger); font-size: 12px; }
.arrow, .back { color: var(--accent); text-decoration: none; }
.history-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.history-actions form { margin: 0; }
.pagination { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 24px; border-top: 1px solid var(--line); text-align: center; }
.pagination-summary { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.pagination-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; }
.page-link { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; padding: 0; color: var(--text); background: #0d1014; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; }
.page-link:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.page-link.active { color: #111; background: var(--accent); border-color: var(--accent); box-shadow: 0 7px 22px rgba(184,255,69,.2); font-weight: 800; }
.page-link.disabled { color: #56606b; background: transparent; opacity: .55; cursor: default; }
.page-link.disabled:hover { border-color: var(--line); transform: none; }
.page-ellipsis { display: inline-flex; min-width: 24px; height: 40px; align-items: center; justify-content: center; color: var(--muted); }
.delete-button { padding: 0; color: var(--danger); background: none; font-size: 13px; font-weight: 700; }
.danger-button { color: var(--danger); border: 1px solid rgba(255,121,111,.45); background: rgba(255,121,111,.08); }
.empty { padding: 54px 24px; color: var(--muted); text-align: center; }
.compact-empty { padding: 25px 15px; border: 0; }
.back { display: inline-block; margin-bottom: 32px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.transcript-card { overflow: hidden; }
.script-card, .evaluation-card { margin-bottom: 18px; overflow: hidden; }
.script-prose { max-height: 360px; overflow-y: auto; color: #cbd3dc; font-size: 15px; }
.evaluation-card { display: grid; grid-template-columns: 190px 1fr; align-items: stretch; }
.evaluation-score { display: flex; align-items: baseline; justify-content: center; padding: 34px 24px; color: #111; background: var(--accent); }
.evaluation-score strong { font-size: 72px; line-height: 1; letter-spacing: -.06em; }
.evaluation-score span { margin-left: 5px; font-size: 25px; font-weight: 800; }
.evaluation-copy { padding: 28px 30px; }
.evaluation-copy h2 { margin-top: 7px; }
.evaluation-comment { margin: 12px 0 0; color: #dce2e8; font-size: 17px; }
.evaluation-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.prose { padding: 30px; white-space: pre-wrap; font-size: 18px; line-height: 1.7; }
code { font-family: ui-monospace, monospace; }
.account-shell { max-width: 720px; }
.account-head { margin-bottom: 24px; }
.account-section { margin-bottom: 18px; overflow: hidden; }
.profile-panel-title { align-items: flex-start; }
.profile-form { display: grid; gap: 20px; padding: 24px; }
.profile-form .primary { justify-self: start; margin-top: 4px; }
.form-error { padding: 12px 14px; color: var(--danger); background: rgba(255,121,111,.08); border: 1px solid rgba(255,121,111,.25); border-radius: 11px; }
.script-library-item { border-bottom: 1px solid var(--line); }
.script-library-item:last-child { border-bottom: 0; }
.script-edit-form { padding-bottom: 14px; }
.script-delete-form { padding: 0 24px 24px; }
.script-delete-form .delete-button { font-size: 14px; }
.password-panel { padding: 26px; }
.password-form { display: grid; gap: 20px; }
.password-form .field small { color: var(--muted); }
.password-form .primary { justify-self: start; margin-top: 4px; }
.login-page { min-height: 100vh; }
.login-shell { display: grid; width: min(460px, calc(100% - 36px)); min-height: 100vh; margin: 0 auto; padding: 36px 0; place-items: center; }
.login-card { width: 100%; padding: 34px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.login-card h1 { margin: 8px 0 10px; font-size: clamp(31px, 8vw, 43px); line-height: 1.06; letter-spacing: -.04em; }
.login-form { display: grid; gap: 18px; margin-top: 28px; }
.login-error { margin-top: 22px; padding: 12px 14px; color: var(--danger); background: rgba(255,121,111,.08); border: 1px solid rgba(255,121,111,.25); border-radius: 11px; }
.login-help { margin: 20px 0 0; color: var(--muted); }
@media (max-width: 900px) {
  .mode-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shell { padding-top: 32px; }
  .hero, .call-head { align-items: flex-start; flex-direction: column; }
  .mode-card { padding: 22px; }
  .manager-heading, .manager-tools { align-items: stretch; flex-direction: column; }
  .custom-dates, .duration-range { grid-template-columns: 1fr; }
  .evaluation-card { grid-template-columns: 1fr; }
  .evaluation-score { padding: 24px; }
  .team-editor-actions { align-items: stretch; flex-direction: column-reverse; }
  .team-editor-actions .primary { width: 100%; }
  .history-toolbar { align-items: stretch; flex-direction: column; }
  .history-sort { width: 100%; }
  .history-toolbar .secondary { width: 100%; }
  .pagination { padding: 21px 14px; }
  .pagination-links { width: 100%; gap: 6px; }
  .page-link { width: 38px; height: 38px; }
  .page-ellipsis { height: 38px; }
}
