:root {
  color-scheme: light;
  --ink: #201a32;
  --muted: #615973;
  --accent: #5934a8;
  --accent-dark: #442583;
  --soft: #eee7fa;
  --border: #ded8e9;
  --surface: #fff;
  --base: #f6f4fb;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 75% 3%, #e9ddf9 0%, transparent 39rem), var(--base);
  line-height: 1.55;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, textarea { color: inherit; font: inherit; }
button, label[for="file"] { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #875cea; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.width { width: min(100% - 2.75rem, 68.5rem); margin-inline: auto; }
.site-header { border-bottom: 1px solid #ded8e9aa; }
.header-inner {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: .68rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -.025em;
}
.logo, .file-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 750;
  letter-spacing: -.05em;
}
.logo {
  width: 2.13rem;
  height: 1.8rem;
  color: white;
  background: var(--accent);
  border-radius: .45rem;
}
.nav-link {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
  text-decoration: none;
}
.nav-link:hover { color: var(--accent-dark); text-decoration: underline; }
.hero { padding: clamp(2.4rem, 7vw, 4.8rem) 0 clamp(1.5rem, 4vw, 2.65rem); }
h1 {
  font-size: clamp(2.5rem, 6.45vw, 5rem);
  font-weight: 770;
  line-height: 1.03;
  letter-spacing: -.065em;
}
h1 span { color: var(--accent); }
.hero p {
  margin-top: 1rem;
  max-width: 41rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.12rem);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  gap: 1rem;
}
.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  padding: clamp(1rem, 3vw, 1.55rem);
  box-shadow: 0 12px 28px #3f216909;
}
.panel-head, .field-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .65rem;
}
.panel-head { margin-bottom: 1rem; }
.panel h2, .guide h2 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -.028em; }
.link-button {
  border: 0;
  padding: .15rem 0;
  background: none;
  color: var(--accent);
  font-size: .88rem;
  font-weight: 690;
  text-underline-offset: .18em;
}
.link-button:hover:not(:disabled) { text-decoration: underline; }
.link-button:disabled { color: #746d83; }
.file-zone {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  padding: .75rem;
  border: 1px dashed #b6a6cc;
  border-radius: .7rem;
  background: #faf8fe;
}
.file-zone:focus-within, .file-zone.dragover { outline: 2px solid #875cea; outline-offset: 2px; }
.file-icon {
  width: 2.2rem;
  height: 2rem;
  border: 1px solid #c4afe0;
  border-radius: .38rem;
  background: var(--soft);
  color: var(--accent-dark);
}
.file-message { flex: 1 1 9rem; min-width: 0; line-height: 1.4; }
.file-message strong { display: block; overflow-wrap: anywhere; font-size: .93rem; }
.file-message span, .small, .preview-count { color: var(--muted); font-size: .87rem; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.9rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  padding: .45rem .78rem;
  font-weight: 710;
  line-height: 1.25;
}
.secondary {
  border-color: var(--border);
  background: white;
  color: var(--accent-dark);
}
.secondary:hover { background: #f2ebfb; border-color: #c9b5e4; }
.file-label { min-height: 2.55rem; font-size: .88rem; }
.field-heading { margin: .85rem 0 .3rem; }
.field-heading label, .field-label { font-weight: 680; font-size: .95rem; }
textarea {
  display: block;
  width: 100%;
  min-height: 9.3rem;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: #fcfbfe;
  padding: .72rem .82rem;
  font: .88rem/1.55 var(--mono);
  tab-size: 2;
}
textarea::placeholder { color: #7d758d; opacity: 1; }
.small { margin-top: .5rem; }
.offset-line {
  display: flex;
  gap: .42rem;
  align-items: stretch;
  margin-top: .4rem;
}
.offset-field {
  min-width: 0;
  flex: 1 1 8rem;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: #fcfbfe;
}
.offset-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: .55rem;
  padding: .52rem .65rem;
  background: transparent;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.offset-field span { padding-right: .55rem; color: var(--muted); font-size: .87rem; }
.pulse { padding-inline: .55rem; font-family: var(--mono); font-size: .9rem; }
.shift-help { max-width: 27rem; line-height: 1.43; }
.format-field { border: 0; margin: .95rem 0 1rem; padding: 0; }
.format-field legend { padding: 0; margin-bottom: .4rem; }
.format-choices { display: flex; gap: .45rem; }
.format-choices label {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  padding: .52rem .6rem;
  border: 1px solid var(--border);
  border-radius: .55rem;
  line-height: 1.2;
}
.format-choices label:has(input:checked) { background: #f5effe; border-color: #a687d4; }
.format-choices label:focus-within { outline: 2px solid #875cea; outline-offset: 2px; }
.format-choices input { margin: 0; accent-color: var(--accent); }
.format-choices b { color: var(--accent-dark); font-size: .92rem; }
.format-choices label > span > span { display: block; color: var(--muted); font-size: .85rem; margin-top: .22rem; }
.primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
}
.primary:hover:not(:disabled) { background: var(--accent-dark); }
.primary:disabled { background: #ebe6f2; color: #615973; }
.action-status {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .15rem .75rem;
  align-items: baseline;
  margin-top: .4rem;
  color: var(--muted);
  font-size: .87rem;
}
.file-problem {
  margin-top: .4rem;
  color: #922c38;
  font-size: .88rem;
}
.preview { margin-top: 1rem; }
.preview .panel-head { margin-bottom: .8rem; }
.preview-count { text-align: right; }
.empty-preview { padding-block: .55rem; color: var(--muted); }
.feedback-box {
  margin-bottom: .7rem;
  border: 1px solid #dcd1eb;
  border-radius: .6rem;
  padding: .55rem .75rem;
  background: #f8f4fe;
  color: #523672;
  font-size: .9rem;
}
.feedback-box.error { border-color: #eebdc4; background: #fff4f5; color: #842c38; }
.feedback-box ul { margin: .2rem 0 .1rem; padding-left: 1.25rem; }
.timeline {
  border: 1px solid #e3d8f0;
  border-radius: .7rem;
  background: #f9f5fe;
  padding: .75rem;
  margin-bottom: .65rem;
}
.timeline-track {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-auto-rows: .38rem;
  gap: .16rem;
  padding: .22rem 0;
  background: repeating-linear-gradient(to right, #e6dcf2 0 1px, transparent 1px 10%);
}
.timeline-cue { border-radius: .38rem; background: #8765c1; height: 100%; }
.timeline-labels {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font: .8rem/1.4 var(--mono);
  margin-top: .3rem;
  color: var(--muted);
}
.cue-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .54rem .62rem; border-bottom: 1px solid #ede8f1; vertical-align: top; }
th { color: var(--muted); font-size: .86rem; font-weight: 690; }
td { font-size: .93rem; }
td.time { font: .85rem/1.6 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
td.changed { color: var(--accent-dark); font-weight: 750; }
td.text { min-width: 12rem; white-space: pre-wrap; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
.guide { margin: 2.25rem 0; scroll-margin-top: 1rem; }
.guide-cards {
  margin-top: .8rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.guide article { padding-top: .7rem; border-top: 2px solid #d5c2ee; }
.guide article h3 { font-size: 1rem; margin-bottom: .42rem; }
.guide article p { color: var(--muted); }
.guide article a { display: inline-block; margin-top: .5rem; font-size: .9rem; font-weight: 660; }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  border-top: 1px solid var(--border);
  padding: .8rem 0 1.4rem;
  color: var(--muted);
  font-size: .85rem;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 49rem) {
  .workspace { grid-template-columns: 1fr; }
  .guide-cards { grid-template-columns: 1fr; }
}
@media (max-width: 24rem) {
  .width { width: calc(100% - 1.5rem); }
  .file-label { width: 100%; }
  .pulse { min-width: 2.55rem; padding-inline: .25rem; }
  .offset-field input { padding-inline: .38rem; }
  .offset-field span { font-size: .8rem; }
}
