:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #1f2937;
  background: #f5f6fa;
  font-synthesis: none;
  --ink: #182236;
  --muted: #667085;
  --accent: #4945dd;
  --line: #e3e6ee;
  --purple: #efefff;
  --green: #147a5d;
  --red: #b42318;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 9px 13px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.12s;
}
button:hover {
  background: #f1f2f7;
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.primary:hover {
  background: #3935c3;
}
button.quiet {
  border-color: transparent;
  background: transparent;
}
button.danger {
  color: var(--red);
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid #cfd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #a9a7f5;
  border-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.7;
}
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 550;
}
label input,
label select,
label textarea {
  margin-top: 7px;
}
input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 1.9rem;
  letter-spacing: -0.05em;
  font-weight: 650;
  margin-bottom: 8px;
}
h2 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1rem;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 0.8rem;
}
.flex {
  display: flex;
  align-items: center;
  gap: 10px;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 18px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.hidden {
  display: none !important;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 0.75rem;
  font-weight: 550;
  background: #eef1f6;
  color: #536078;
  white-space: nowrap;
}
.pill.ready {
  background: #e7f6ed;
  color: var(--green);
}
.pill.working {
  background: var(--purple);
  color: var(--accent);
}
.pill.failed {
  background: #fff0ec;
  color: var(--red);
}
.eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 650;
  color: var(--muted);
}
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  gap: 10px;
}
.brand img {
  width: 31px;
  height: 31px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 29px 18px;
  z-index: 5;
}
.sidebar .brand {
  padding: 0 8px;
  margin-bottom: 34px;
}
.workspace-label {
  font-size: 0.8rem;
  margin: 0 10px 16px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav button {
  justify-content: flex-start;
  width: 100%;
  border: none;
  color: #586174;
  padding: 11px 12px;
}
.nav button.selected {
  background: var(--purple);
  color: var(--accent);
}
.nav .eyebrow {
  margin: 29px 12px 10px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 20px 8px 0;
  border-top: 1px solid var(--line);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--purple);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
  font-size: 0.85rem;
}
.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.workspace {
  margin-left: 224px;
  min-height: 100vh;
}
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  gap: 14px;
}
.crumb {
  font-size: 0.875rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 38px 42px;
}
.page-head {
  margin-bottom: 30px;
  align-items: flex-start;
}
.page-head p {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 8px 0 0;
}
.toolbar {
  padding: 15px 0;
  display: flex;
  gap: 12px;
  align-items: center;
}
.search {
  position: relative;
  max-width: 440px;
  flex: 1;
}
.search .icon {
  position: absolute;
  top: 12px;
  left: 12px;
  color: var(--muted);
}
.search input {
  padding-left: 40px;
  background: #fff;
}
.filter {
  max-width: 210px;
}
.table-wrap {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 550;
  padding: 15px 19px;
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
}
td {
  font-size: 0.85rem;
  padding: 20px 19px;
  border-bottom: 1px solid #edf0f5;
}
tr:last-child td {
  border-bottom: 0;
}
.record-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  text-align: left;
  border: none;
  background: none;
  padding: 0;
  justify-content: flex-start;
  line-height: 1.5;
}
.record-title:hover {
  color: var(--accent);
  background: none;
}
.file-icon {
  width: 39px;
  height: 45px;
  border: 1px solid #e0e2fd;
  background: #f6f5ff;
  border-radius: 8px;
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.table-wrap td:first-child {
  min-width: 290px;
}
.subline {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 5px;
}
.empty {
  padding: 65px 25px;
  text-align: center;
  background: #fff;
  border: 1px dashed #cdd3e2;
  border-radius: 12px;
}
.empty .big-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--purple);
  color: var(--accent);
  margin: 0 auto 23px;
}
.empty .big-icon .icon {
  width: 29px;
  height: 29px;
}
.empty p {
  max-width: 410px;
  margin: 12px auto 25px;
  color: var(--muted);
  line-height: 1.7;
}
.pagination {
  margin-top: 18px;
  justify-content: flex-end;
}
.editor-head {
  padding: 28px 32px 20px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.editor-head h1 {
  font-size: 1.6rem;
  max-width: 900px;
  line-height: 1.3;
}
.editor-head .metadata {
  margin-top: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  min-height: calc(100vh - 290px);
  padding-bottom: 145px;
}
.transcript {
  padding: 25px 30px 50px;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}
.transcript-toolbar {
  padding: 12px 0 22px;
  position: sticky;
  top: 0;
  background: #f5f6faf5;
  z-index: 2;
}
.transcript-toolbar input {
  max-width: 320px;
}
.segment {
  display: grid;
  grid-template-columns: 69px 1fr;
  gap: 16px;
  padding: 18px 15px;
  border-radius: 9px;
  border-left: 3px solid transparent;
  margin-bottom: 8px;
  transition: background 0.12s;
}
.segment.active {
  background: white;
  border-left-color: var(--accent);
  box-shadow: 0 3px 16px #26366707;
}
.segment.reviewed .speaker-name:after {
  content: " ✓";
  color: var(--green);
}
.timecode {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding: 4px 0;
  background: none;
  border: none;
  align-self: start;
  justify-content: flex-start;
}
.speaker-name {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--accent);
}
.speaker-color-1 {
  color: #0b836b;
}
.speaker-color-2 {
  color: #bd722b;
}
.speaker-color-3 {
  color: #ad438d;
}
.segment-header {
  min-height: 28px;
  margin-bottom: 5px;
}
.segment-tools {
  display: flex;
  gap: 4px;
  opacity: 0.3;
}
.segment:hover .segment-tools,
.segment:focus-within .segment-tools {
  opacity: 1;
}
.segment-tools button {
  padding: 3px 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.segment-text {
  font-size: 1.02rem;
  line-height: 1.95;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #313c4d;
}
.word {
  border: 0;
  padding: 0 1px;
  border-radius: 3px;
  background: none;
  display: inline;
  font: inherit;
  color: inherit;
}
.word:hover {
  background: #e6e5ff;
}
.word.playing {
  background: #dedcff;
  color: #302bb7;
}
.edit-box {
  margin-top: 9px;
}
.edit-box textarea {
  min-height: 110px;
  font-size: 1rem;
}
.edit-options {
  display: grid;
  grid-template-columns: 1fr 95px 95px;
  gap: 8px;
  margin: 10px 0;
}
.edit-options label {
  font-size: 0.75rem;
  font-weight: 400;
}
.edit-options input,
.edit-options select {
  font-size: 0.8rem;
  padding: 7px;
}
.edit-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.edit-actions button {
  font-size: 0.75rem;
  padding: 5px 8px;
}
.speakers-panel {
  border-left: 1px solid var(--line);
  background: #fbfcff;
  padding: 25px 22px;
}
.speakers-panel h2 {
  font-size: 0.9rem;
}
.speaker-card {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.speaker-card input {
  font-size: 0.875rem;
  border-color: transparent;
  background: transparent;
  padding: 4px 0;
  border-radius: 0;
  font-weight: 600;
}
.speaker-card input:hover {
  border-bottom-color: #c5c8db;
}
.speaker-card button {
  font-size: 0.75rem;
  padding: 5px 7px;
}
.speaker-card .subline {
  line-height: 1.6;
}
.speaker-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.speaker-dot.color-1 {
  background: #0b836b;
}
.speaker-dot.color-2 {
  background: #bd722b;
}
.speaker-dot.color-3 {
  background: #ad438d;
}
.note {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 20px;
}
.notice {
  background: #fff8e6;
  border: 1px solid #f1dfa9;
  color: #846122;
  padding: 13px 16px;
  border-radius: 9px;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 15px;
}
.notice.info {
  background: #efefff;
  border-color: #dddafb;
  color: #4d489a;
}
.notice.error {
  background: #fff2ef;
  color: var(--red);
  border-color: #f9cdc6;
}
.player {
  position: fixed;
  bottom: 0;
  left: 224px;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 18px 32px;
  z-index: 6;
  box-shadow: 0 -5px 20px #1a254006;
}
.player-main {
  display: flex;
  align-items: center;
  gap: 17px;
}
.play-button {
  border-radius: 50%;
  width: 43px;
  height: 43px;
  padding: 0;
  background: var(--accent);
  color: white;
  border: 0;
}
.play-button:hover {
  background: #3733bf;
}
.player input[type="range"] {
  accent-color: var(--accent);
  padding: 0;
  border: 0;
  cursor: pointer;
  flex: 1;
  min-width: 50px;
}
.player select {
  width: 85px;
  font-size: 0.8rem;
  padding: 6px;
}
.player-time {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.player-caption {
  margin: 10px 0 0 58px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
}
.player .quiet {
  padding: 5px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(130deg, #f1f2fa, #fff);
}
.login-card {
  background: white;
  border: 1px solid var(--line);
  padding: 40px;
  border-radius: 16px;
  width: min(430px, calc(100% - 32px));
  box-shadow: 0 20px 80px #1c235a08;
}
.login-card .brand {
  margin-bottom: 35px;
}
.login-card h1 {
  font-size: 1.6rem;
}
.login-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}
.loading {
  padding: 70px;
  text-align: center;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 25px 90px #101a3c30;
  padding: 0;
  width: min(590px, calc(100vw - 30px));
  max-height: 90vh;
  color: var(--ink);
}
dialog::backdrop {
  background: #16213977;
  backdrop-filter: blur(3px);
}
.modal-head {
  padding: 22px 25px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
}
.modal-body {
  padding: 25px;
  overflow: auto;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 22px;
}
.dropzone {
  display: block;
  padding: 28px 20px;
  border: 1.5px dashed #bebce8;
  border-radius: 10px;
  background: #f8f8ff;
  text-align: center;
  cursor: pointer;
}
.dropzone.dragging {
  background: #e8e6ff;
}
.dropzone .icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
  margin-bottom: 12px;
}
.dropzone input {
  font-size: 0.8rem;
  margin-top: 15px;
  border: 0;
  background: none;
  padding: 0;
}
.dropzone p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.checkbox {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.5;
  font-weight: 400;
}
.checkbox input {
  margin-top: 3px;
}
.form-hint {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 7px;
}
.settings-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
}
.settings-card h2 {
  margin-bottom: 7px;
}
.settings-card > p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.status-row:last-child {
  border: 0;
}
.voice-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.voice-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.voice-tile audio {
  width: 100%;
  height: 35px;
  margin-top: 20px;
}
.version {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.version p {
  margin: 5px 0;
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
}
.version.selected {
  color: var(--accent);
}
#toast {
  position: fixed;
  bottom: 135px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 20px;
  background: #1e293b;
  color: white;
  border-radius: 9px;
  box-shadow: 0 8px 30px #0002;
  max-width: 90vw;
  font-size: 0.875rem;
  z-index: 30;
  display: none;
}
#toast.visible {
  display: block;
}
progress {
  width: 100%;
  accent-color: var(--accent);
}
code {
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f3f5fa;
  padding: 15px;
  border-radius: 8px;
  font-size: 0.8rem;
}
.mobile-menu {
  display: none;
}
@media (min-width: 1500px) {
  .transcript {
    padding-left: 65px;
    padding-right: 65px;
  }
  .editor-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}
@media (max-width: 1000px) {
  .sidebar {
    width: 190px;
    padding: 25px 12px;
  }
  .workspace {
    margin-left: 190px;
  }
  .player {
    left: 190px;
  }
  .page {
    padding: 30px 25px;
  }
  .editor-grid {
    grid-template-columns: minmax(0, 1fr) 225px;
  }
  .transcript {
    padding: 20px 12px;
  }
  .segment {
    gap: 8px;
    grid-template-columns: 58px 1fr;
    padding: 15px 8px;
  }
  .speakers-panel {
    padding: 25px 15px;
  }
  .topbar {
    padding: 0 23px;
  }
  .editor-head {
    padding: 25px 23px;
  }
  .topbar .flex {
    gap: 4px;
  }
  .topbar button {
    padding: 8px;
  }
  .optional {
    display: none;
  }
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
  }
  .sidebar.open {
    display: flex;
    width: 224px;
    box-shadow: 20px 0 60px #15213930;
  }
  .workspace {
    margin-left: 0;
  }
  .player {
    left: 0;
    padding: 13px 16px;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .topbar {
    height: auto;
    min-height: 62px;
    padding: 12px 15px;
    flex-wrap: wrap;
  }
  .topbar > .flex:last-child {
    margin-left: auto;
  }
  .crumb {
    max-width: 145px;
  }
  .page {
    padding: 25px 18px;
  }
  .page-head {
    gap: 15px;
  }
  .page-head h1 {
    font-size: 1.7rem;
  }
  .editor-head {
    padding: 22px 18px;
  }
  .editor-grid {
    display: flex;
    flex-direction: column;
  }
  .speakers-panel {
    order: -1;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px;
    max-height: 280px;
    overflow: auto;
  }
  .speakers-panel .speaker-card {
    display: inline-block;
    vertical-align: top;
    width: 48%;
    padding: 10px 10px 10px 0;
  }
  .speakers-panel .note {
    margin: 12px 0 0;
  }
  .speaker-card input {
    max-width: 165px;
  }
  .transcript {
    padding: 15px 8px 40px;
  }
  .transcript-toolbar {
    padding: 10px 8px 18px;
  }
  .segment {
    grid-template-columns: 49px 1fr;
    gap: 6px;
  }
  .segment-text {
    font-size: 1rem;
    line-height: 1.9;
  }
  .segment-tools {
    opacity: 1;
  }
  .player-main {
    gap: 9px;
  }
  .player-caption {
    margin-left: 0;
    font-size: 0.72rem;
  }
  .player-caption span:last-child {
    display: none;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .search {
    min-width: 200px;
    max-width: none;
  }
  .filter {
    max-width: 100%;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  h1 {
    overflow-wrap: anywhere;
  }
  .editor-head > .flex {
    flex-wrap: wrap;
  }
  .table-wrap th:nth-child(3),
  .table-wrap td:nth-child(3) {
    display: none;
  }
  .page-head .primary {
    white-space: nowrap;
  }
  .edit-options {
    grid-template-columns: 1fr 80px 80px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.without-timecodes .timecode { display: none; }
.transcript-toolbar { flex-wrap: wrap; }

.without-timecodes .segment { grid-template-columns: 1fr; }

.without-timecodes .segment { margin-bottom: 0; padding-bottom: 4px; }
.without-timecodes .continued-turn { padding-top: 4px; }
.without-timecodes .continued-turn .speaker-name { display: none; }
.without-timecodes .continued-turn .segment-header { min-height: 0; margin-bottom: 0; position: relative; }
.without-timecodes .continued-turn .segment-tools { position: absolute; right: 0; top: 0; }
.without-timecodes .continued-turn .segment-text { padding-right: 70px; }
