:root {
  color-scheme: light;
  --midnight: #2a2a5e;
  --purple: #543f9e;
  --violet: #9d2fd1;
  --cyan: #89e1ef;
  --canvas: #ebf0f4;
  --paper: #fff;
  --ink: #25254b;
  --muted: #545870;
  --line: #d6dbe6;
  --control: #8b92aa;
  --lavender: #efebfa;
  --success: #215a59;
  --success-bg: #e2f5f7;
  --warning: #795226;
  --warning-bg: #fbefd9;
  --danger: #8b294b;
  --danger-bg: #fae9ee;
  --radius: 18px;
  --space: clamp(18px, 3vw, 32px);
  --body-font: "Volte", system-ui, -apple-system, "Segoe UI", sans-serif;
  --heading-font: "Vastine", var(--body-font);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.55 var(--body-font);
}
main { flex: 1; min-width: 0; }
main:focus { outline: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--purple); }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
img { display: block; max-width: 100%; }
h1, h2, h3 {
  margin: 0;
  color: var(--midnight);
  font-family: var(--heading-font);
  line-height: 1.16;
  letter-spacing: -.028em;
  overflow-wrap: anywhere;
}
h1 { font-size: clamp(30px, 4.3vw, 46px); font-weight: 690; }
h2 { font-size: 22px; font-weight: 680; }
h3 { font-size: 17px; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.container { width: min(calc(100% - 2 * var(--space)), 1160px); margin-inline: auto; }
.skip-link {
  position: fixed;
  z-index: 5;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  background: var(--paper);
  border-radius: 8px;
}
.skip-link:focus { transform: none; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 630;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.button.primary { color: var(--paper); background: var(--purple); border-color: var(--purple); }
.button.primary:hover:not(:disabled) { background: var(--midnight); border-color: var(--midnight); }
.button.secondary { color: var(--purple); background: var(--paper); border-color: var(--control); }
.button.secondary:hover:not(:disabled) { background: var(--lavender); border-color: var(--purple); }
.button.text-button { color: var(--purple); background: transparent; padding-inline: 0; text-decoration: underline; text-underline-offset: 4px; }
.button.text-button:hover { color: var(--midnight); }
.button:disabled {
  color: var(--muted);
  background: var(--canvas);
  border-color: var(--line);
}
.button.full { width: 100%; }
.button-group { display: flex; flex-wrap: wrap; gap: 8px; }
.surface {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 2px 5px rgb(42 42 94 / 4%);
}
.field, .form-stack { display: grid; min-width: 0; }
.field { gap: 6px; color: var(--midnight); font-size: 14px; font-weight: 620; }
.form-stack { gap: 16px; }
.field input, .field select {
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--control);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 450;
  width: 100%;
  min-width: 0;
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input:disabled, .field select:disabled {
  color: var(--muted);
  opacity: 1;
  background: var(--canvas);
  border-color: var(--line);
}
.field-pair { display: grid; grid-template-columns: minmax(80px, .65fr) minmax(0, 1fr); gap: 12px; }
.check {
  display: flex;
  align-items: center;
  min-height: 32px;
  gap: 10px;
  color: var(--midnight);
  font-weight: 600;
}
.check input { width: 18px; height: 18px; flex: none; accent-color: var(--purple); }

.access-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  min-height: 100svh;
}
.access-brand {
  position: relative;
  display: flex;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(32px, 5.6vw, 88px);
  min-width: 0;
  background: linear-gradient(152deg, var(--midnight), var(--purple) 86%);
  color: var(--paper);
}
.access-brand-content {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: clamp(60px, 12svh, 124px);
}
.access-logo { width: clamp(200px, 20vw, 286px); height: auto; }
.access-intro { width: 100%; max-width: 620px; padding-top: 50px; }
.access-intro h1 { font-size: clamp(36px, 5.08vw, 76px); color: var(--paper); letter-spacing: -.057em; }
.access-intro p { max-width: 37ch; margin-top: 18px; font-size: clamp(15px, 1.4vw, 19px); color: var(--paper); line-height: 1.6; }
.traces { position: absolute; inset: 0; z-index: -1; opacity: .54; pointer-events: none; }
.traces span {
  position: absolute;
  right: -1px;
  top: var(--top);
  width: var(--width);
  height: var(--height);
  border: 1px solid var(--cyan);
  border-right: 0;
  border-bottom: 0;
  border-radius: 30px 0 0;
}
.traces span::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: -3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
}
.traces span:nth-child(1) { --top: 35%; --width: 57%; --height: 13%; }
.traces span:nth-child(2) { --top: 41%; --width: 45%; --height: 14%; }
.traces span:nth-child(3) { --top: 47%; --width: 32%; --height: 12%; }
.traces span:nth-child(4) { --top: 53%; --width: 19%; --height: 10%; }
.access-content {
  display: grid;
  align-items: center;
  justify-items: center;
  padding: clamp(24px, 5vw, 72px) var(--space);
}
.access-inner { width: min(100%, 420px); }
.access-card { padding: clamp(20px, 4vw, 36px); box-shadow: 0 12px 46px rgb(42 42 94 / 8%); }
.access-card h2 { font-size: clamp(23px, 3vw, 30px); }
.access-card .muted { margin-top: 8px; }
.access-card .form-stack { margin-top: 24px; }
.access-card .text-button { margin-top: 9px; }
.access-footer { margin: 19px 0 0; color: var(--muted); font-size: 13px; text-align: center; overflow-wrap: anywhere; }
.switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--canvas);
  border-radius: 11px;
}
.switcher button {
  min-height: 42px;
  padding: 5px;
  background: transparent;
  color: var(--midnight);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 625;
}
.switcher button:hover { background: var(--lavender); }
.switcher button.active {
  background: var(--paper);
  color: var(--purple);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgb(42 42 94 / 8%);
}
#notice {
  margin-bottom: 16px;
  padding: 12px 15px;
  border: 1px solid #a8d4dd;
  border-left: 3px solid var(--success);
  border-radius: 10px;
  background: var(--success-bg);
  color: var(--success);
  overflow-wrap: anywhere;
}
#notice.error { border-color: #e1adbe; border-left-color: var(--danger); background: var(--danger-bg); color: var(--danger); }

.app-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-content {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; color: var(--midnight); gap: 8px; text-decoration: none; }
.brand img { width: clamp(132px, 16vw, 169px); height: auto; flex: none; }
.brand span { padding-left: 12px; border-left: 1px solid var(--line); font-weight: 650; }
.identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
#email { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.workspace { padding-bottom: 45px; }
.workspace-nav { display: flex; flex-wrap: wrap; gap: 24px; padding-top: 7px; border-bottom: 1px solid #c9cfe0; }
.workspace-nav button {
  position: relative;
  padding: 12px 1px;
  min-height: 49px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-weight: 635;
}
.workspace-nav button:hover, .workspace-nav button.active { color: var(--purple); }
.workspace-nav button.active::after { content: ""; position: absolute; inset: auto 0 -1px; height: 3px; border-radius: 4px 4px 0 0; background: var(--purple); }
#dashboard-notice:not(:empty) #notice { margin-top: 16px; margin-bottom: 0; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-block: 28px 22px; }
.page-intro p { margin-top: 8px; }
.format-tag {
  flex: none;
  align-self: flex-start;
  padding: 5px 10px;
  border: 1px solid #b8dce4;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--midnight);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.upload-card, .admin-card { padding: var(--space); }
.section-heading p { margin-top: 6px; }
.upload-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 195px) auto;
  align-items: end;
  gap: 16px;
  margin-top: 18px;
}
.file-picker {
  display: flex;
  position: relative;
  min-width: 0;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--control);
  border-radius: 11px;
  background: #f7f5fc;
  color: var(--purple);
  cursor: pointer;
}
.file-picker:hover { border-color: var(--purple); background: var(--lavender); }
.file-picker:focus-within { outline: 2px solid var(--purple); outline-offset: 3px; }
.file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.file-picker-text { display: grid; gap: 2px; overflow-wrap: anywhere; }
.upload-icon, .empty-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 9px;
  background: var(--lavender);
  color: var(--purple);
  font-size: 23px;
  font-weight: 650;
  line-height: 1;
}
#send-files { min-height: 46px; }
.upload-progress { margin-top: 18px; }
.upload-progress progress, .job-status progress {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--lavender);
  accent-color: var(--purple);
}
.upload-progress progress::-webkit-progress-bar, .job-status progress::-webkit-progress-bar { background: var(--lavender); }
.upload-progress progress::-webkit-progress-value, .job-status progress::-webkit-progress-value { background: var(--purple); }
.upload-progress progress::-moz-progress-bar, .job-status progress::-moz-progress-bar { background: var(--purple); }
.job-status[data-stage-style="done"] progress::-webkit-progress-value { background: var(--success); }
.job-status[data-stage-style="done"] progress::-moz-progress-bar { background: var(--success); }
.job-status[data-stage-style="warning"] progress::-webkit-progress-value { background: var(--warning); }
.job-status[data-stage-style="warning"] progress::-moz-progress-bar { background: var(--warning); }
.job-status[data-stage-style="failed"] progress::-webkit-progress-value { background: var(--danger); }
.job-status[data-stage-style="failed"] progress::-moz-progress-bar { background: var(--danger); }
#progress-label { margin-top: 8px; }

.table-card { margin-top: 18px; }
.table-title, .pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px var(--space); }
.records { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; }
.records th, .records td { padding: 12px 16px; border-block-start: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.records th:first-child, .records td:first-child { padding-left: var(--space); width: 32%; }
.records th:last-child, .records td:last-child { padding-right: var(--space); }
.records th { background: #f2f4f8; color: var(--muted); font-size: 13px; font-weight: 670; }
.records td { font-size: 14px; }
.records tbody tr:nth-child(even) { background: #fafbfc; }
.records.admin-records th:first-child, .records.admin-records td:first-child { width: 34%; }
.filename { display: block; color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.sub { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.badge {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border-radius: 7px;
  padding: 4px 8px;
  background: var(--canvas);
  color: var(--midnight);
  font-size: 12px;
  font-weight: 625;
  line-height: 1.35;
}
.badge::before { content: ""; flex: 0 0 5px; height: 5px; border-radius: 50%; background: currentColor; align-self: center; }
.badge.done { color: var(--success); background: var(--success-bg); }
.badge.warning { color: var(--warning); background: var(--warning-bg); }
.badge.failed { color: var(--danger); background: var(--danger-bg); }
.badge.processing { color: var(--purple); background: var(--lavender); }
.button.download { color: var(--purple); background: var(--lavender); font-size: 13px; }
.button.download:hover { border-color: var(--purple); }
.records .button { padding-inline: 10px; }
.job-stage-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 10px; margin-bottom: 7px; }
.job-stage-label { flex: 1 1 125px; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.job-percent { font-variant-numeric: tabular-nums; white-space: nowrap; }
.job-status[data-stage-style="done"] .job-stage-heading { color: var(--success); }
.job-status[data-stage-style="warning"] .job-stage-heading { color: var(--warning); }
.job-status[data-stage-style="failed"] .job-stage-heading { color: var(--danger); }
.job-actions { display: grid; gap: 6px; }
.records td:last-child .button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
@media (min-width: 701px) {
  .records:not(.admin-records) th:first-child { width: 24%; }
  .records:not(.admin-records) th:nth-child(3), .records.admin-records th:nth-child(2) { width: 30%; }
  .records:not(.admin-records) th:last-child { width: 18%; }
}
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 30px var(--space); border-top: 1px solid var(--line); }
.pagination, .table-note { border-top: 1px solid var(--line); }
.pagination .button { min-height: 40px; font-size: 13px; }
.table-note { padding: 14px var(--space); }

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.admin-card .form-stack { margin-top: 16px; }
#transcript-email-form { border-top: 1px solid var(--line); padding-top: 16px; }
#transcript-email-status { align-self: center; }
.connection-status {
  margin-top: 16px;
  padding: 10px 13px;
  border-left: 3px solid var(--purple);
  border-radius: 7px;
  background: var(--lavender);
  color: var(--midnight);
  font-size: 14px;
}
.connection-status.connected { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.connection-status.attention { border-color: var(--warning); background: var(--warning-bg); color: var(--warning); }
.managed-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.share-dialog, .share-landing {
  width: min(calc(100% - 24px), 560px);
  padding: var(--space);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}
.share-dialog::backdrop { background: rgb(25 25 61 / 65%); }
.share-heading { align-items: center; justify-content: space-between; }
.share-dialog .field, .share-dialog p, .share-dialog .button-group:last-child,
.share-landing p, .share-landing form { margin-top: 12px; }
.share-landing { margin: clamp(24px, 10vh, 100px) auto; }
.browser-dialog {
  width: min(calc(100% - 24px), 1120px);
  max-height: calc(100svh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
}
.browser-dialog::backdrop { background: rgb(25 25 61 / 65%); }
.browser-instructions { padding-inline: var(--space); margin-bottom: 10px; }
.browser-clipboard {
  display: grid;
  gap: 8px;
  padding: 0 var(--space) 12px;
}
#browser-clipboard-status:empty { display: none; }
.browser-paste-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.browser-paste-form .field { flex: 1 1 180px; }
#browser-copy-text {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--control);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
}
#browser-view { height: min(64svh, 660px); overflow: hidden; background: var(--midnight); }
.app-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-block: 16px; }

@media (max-width: 850px) {
  .access-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .access-brand { padding: 16px var(--space) 24px; }
  .access-brand-content { padding-bottom: 0; }
  .access-logo { width: 178px; }
  .access-intro { padding-top: 4px; }
  .access-intro h1 { font-size: clamp(32px, 7vw, 48px); }
  .access-intro p { margin-top: 6px; max-width: 40ch; }
  .traces { opacity: .35; }
  .access-content { align-items: start; }
  .upload-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .file-picker { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .header-content { min-height: 68px; gap: 9px; }
  .brand { gap: 4px; }
  .brand img { width: 116px; }
  .brand span { padding-left: 8px; font-size: 13px; }
  .identity { gap: 6px; }
  #email { font-size: 12px; }
  .identity .button { padding-inline: 9px; }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .records, .records tbody { display: block; }
  .records thead {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
  }
  .records tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 14px var(--space);
    border-block-start: 1px solid var(--line);
  }
  .records tbody td, .records tbody td:first-child, .records tbody td:last-child,
  .records.admin-records tbody td:first-child { display: block; padding: 0; width: auto; min-width: 0; border: 0; }
  .records tbody td:first-child { grid-column: 1 / -1; }
  .records tbody td.job-status { grid-column: 1 / -1; }
  .records tbody td:nth-child(n+2)::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 620; }
}

@media (max-width: 440px) {
  .header-content { align-items: center; }
  .identity { flex-flow: column-reverse; align-items: flex-end; padding-block: 6px; }
  #email { text-align: right; }
  .brand { flex-direction: column; align-items: flex-start; }
  .brand span { padding-left: 8px; border: 0; margin-top: -8px; }
  .workspace-nav { gap: 18px; }
  .page-intro { flex-wrap: wrap; margin-top: 20px; }
  .upload-controls { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pagination { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
