:root {
  color-scheme: light;
  font: 15px/1.55 Inter, system-ui, "PingFang SC", sans-serif;
  color: #192837;
  background: #f4f7fb;
  --ink: #192837;
  --muted: #51647a;
  --blue: #1551bf;
  --border: #dce4ee;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, select, input, textarea {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
button, select { min-height: 38px; padding: 6px 12px; }
button { cursor: pointer; font-weight: 620; text-align: center; }
button:not(:disabled):hover { border-color: #8da6cc; }
button:disabled { opacity: .52; cursor: default; }
:focus-visible { outline: 3px solid #2771e0; outline-offset: 2px; }
a { color: var(--blue); text-decoration: none; }
p, h1, h2 { margin: 0; }
h1 { font-size: clamp(26px, 5vw, 37px); line-height: 1.19; letter-spacing: -.025em; }
h2 { font-size: 16px; line-height: 1.35; }
small, .ed-heading p, .ed-list-controls span { color: var(--muted); }
.ed-shell { max-width: 1220px; margin: auto; padding-inline: clamp(14px, 3.5vw, 34px); }
.ed-header { border-bottom: 1px solid var(--border); background: #fff; }
.ed-header-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; }
.ed-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.ed-brand span { flex: none; border-radius: 8px; padding: 4px 7px; color: #fff; font-weight: 750; background: #2159be; }
#editor-language { max-width: min(40vw, 176px); }
.ed-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-block: 24px 18px; }
.ed-heading p { margin-top: 6px; }
.ed-actions, .ed-import, .ed-preview-tools, .ed-edit-tools, .ed-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ed-primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.ed-primary:not(:disabled):hover { background: #1046ac; }
.ed-open { background: #eaf2ff; border-color: #bbd3fa; color: #15468d; }
.ed-import { margin-bottom: 14px; }
.ed-import small { margin-inline-start: 6px; }
.ed-encoding { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "preview list" "preview edit";
  align-items: start;
  gap: 14px;
  padding-bottom: 24px;
}
.ed-panel { min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: clip; }
.ed-preview { grid-area: preview; }
.ed-list { grid-area: list; }
.ed-edit { grid-area: edit; }
.ed-card-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ed-card-heading small, .ed-list-controls span { overflow: hidden; max-width: 58%; text-overflow: ellipsis; white-space: nowrap; }
.ed-card-heading bdi, .ed-pagination bdi { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ed-screen { position: relative; display: grid; place-items: center; min-height: 150px; aspect-ratio: 16/9; background: #172338; color: #edf3ff; }
.ed-screen p { max-width: 32ch; padding: 14px; text-align: center; }
.ed-screen video { position: absolute; inline-size: 100%; block-size: 100%; object-fit: contain; }
.ed-ass { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ed-overlay { position: absolute; inset-inline: 7%; bottom: 19%; text-align: center; pointer-events: none; overflow-wrap: anywhere; }
.ed-overlay span { background: #071122e6; border-radius: 4px; color: #fff; padding: 2px 5px; font-size: clamp(13px, 2vw, 19px); white-space: pre-line; }
.ed-preview-tools, .ed-edit-tools { padding: 10px 14px; }
.ed-preview-tools label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.ed-video-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 14px 10px; color: var(--muted); font-size: 13px; }
.ed-video-progress progress { flex: 1; min-width: 5em; }
.ed-edit-tools { border-top: 1px solid var(--border); }
.ed-edit-tools button, .ed-preview-tools button, .ed-pagination button { font-size: 13px; }
.ed-list-controls { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.ed-list-controls input { inline-size: 100%; padding: 7px 9px; }
.ed-list-controls span { font-size: 12px; max-width: 40%; }
.ed-empty { margin: 10px 14px 16px; color: var(--muted); }
#editor-cues { max-height: 350px; overflow: auto; list-style: none; margin: 0; padding: 0 8px; }
#editor-cues button {
  display: grid;
  align-items: baseline;
  grid-template-columns: 3.15ch 12ch minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  padding: 8px;
  min-height: 40px;
  text-align: start;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  border-bottom-color: var(--border);
  border-radius: 7px;
}
#editor-cues button[aria-current="true"] { background: #eaf2ff; border-color: #a8c5f7; }
#editor-cues button[data-error="true"] { box-shadow: inset 2px 0 #b24136; }
#editor-cues button .ed-cue-time, #editor-cues button .ed-cue-index { color: var(--muted); font-variant-numeric: tabular-nums; }
#editor-cues button .ed-cue-copy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-pagination { justify-content: space-between; padding: 10px 14px; }
.ed-edit-fields { padding: 12px 14px; display: grid; gap: 8px; }
.ed-edit-fields label { min-width: 0; display: grid; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 620; }
.ed-edit-fields input, .ed-edit-fields textarea { width: 100%; padding: 7px 9px; color: var(--ink); }
.ed-edit-fields textarea { resize: vertical; min-height: 4em; }
.ed-edit-fields [aria-invalid="true"] { border-color: #b24136; }
.ed-times { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.ed-times label { margin-bottom: 4px; }
.ed-time-field { display: flex; align-items: stretch; gap: 4px; }
.ed-time-field input { font-variant-numeric: tabular-nums; }
.ed-time-field button { min-width: 30px; padding: 3px 5px; }
.ed-message { padding: 8px 12px; border-radius: 8px; border: 1px solid #dfcaa3; background: #fff7e7; color: #73481e; margin-bottom: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width: 720px) {
  .ed-grid { grid-template-columns: minmax(0,1fr); grid-template-areas: "preview" "list" "edit"; }
  #editor-cues { max-height: 260px; }
  .ed-heading { padding-block-start: 17px; }
}
@media (max-width: 370px) {
  #editor-cues button { grid-template-columns: 2.7ch 11ch minmax(0, 1fr); gap: 5px; }
  .ed-time-field input { padding-inline: 4px; font-size: 12px; }
}
