:root {
  --bg: #0f1117;
  --bg2: #161b27;
  --bg3: #1d2333;
  --bd: rgba(255, 255, 255, .07);
  --bd2: rgba(255, 255, 255, .14);
  --tx: #e2e8f0;
  --mu: #7a8899;
  --mu2: #4a5568;
  --grn: #10b981;
  --amb: #f59e0b;
  --red: #f87171;
  --blu: #60a5fa;
  --r: 8px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.login-body {
  background: #0b0f15;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 24px;
  background: rgba(15, 17, 23, .95);
  border-bottom: 1px solid var(--bd2);
  backdrop-filter: blur(12px);
}

.top-left,
.top-actions,
.nav-links,
.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.brand > span:last-child {
  display: grid;
}

.brand-logo-wrap,
.avatar {
  border: 1px solid rgba(96, 165, 250, .32);
  border-radius: 6px;
  background: rgba(96, 165, 250, .1);
  color: var(--blu);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 600;
}

.brand-logo-wrap {
  width: 92px;
  height: 30px;
  padding: 4px 7px;
}

.brand-logo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.avatar {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.brand-title {
  font-size: 15px;
  font-weight: 500;
}

.brand-sub {
  color: var(--mu);
  font-family: var(--mono);
  font-size: 11px;
  display: block;
  max-width: min(34vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grn);
  box-shadow: 0 0 7px rgba(16, 185, 129, .65);
}

.nav-link,
.ghost-btn,
.primary-btn,
.danger-btn,
.link-button {
  min-height: 30px;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.nav-link,
.ghost-btn,
.primary-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link {
  color: var(--mu);
  border: 1px solid var(--bd2);
  font-family: var(--mono);
  font-weight: 400;
}

.nav-link.active,
.nav-link:hover {
  color: var(--tx);
  border-color: rgba(96, 165, 250, .45);
  background: rgba(96, 165, 250, .08);
}

.ghost-btn {
  color: var(--tx);
  border: 1px solid var(--bd2);
  background: transparent;
}

.primary-btn {
  color: #0f1117;
  border: 1px solid var(--blu);
  background: var(--blu);
}

.danger-btn {
  color: #18090b;
  border: 1px solid var(--red);
  background: var(--red);
}

.primary-btn:disabled,
.primary-btn[disabled],
.danger-btn:disabled,
.danger-btn[disabled] {
  cursor: not-allowed;
  opacity: .55;
}

.primary-btn.is-loading {
  cursor: wait;
  opacity: .72;
}

.link-button {
  color: var(--blu);
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  min-height: 0;
  font-family: var(--mono);
  font-size: 11px;
}

.nav-link:focus-visible,
.ghost-btn:focus-visible,
.primary-btn:focus-visible,
.danger-btn:focus-visible,
.link-button:focus-visible,
.back-link:focus-visible,
.danger-icon-btn:focus-visible {
  outline: 2px solid var(--blu);
  outline-offset: 3px;
}

.wrap {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 46px;
}

.section {
  margin-bottom: 24px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--bd);
}

.section-title {
  color: var(--mu);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.section-note,
.muted {
  color: var(--mu);
}

.section-note {
  overflow-wrap: anywhere;
  text-align: right;
}

.mono {
  font-family: var(--mono);
}

.small {
  font-size: 11px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.metric,
.panel,
.upload-panel {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--r);
}

.metric {
  padding: 14px 16px;
}

.metric-label {
  margin-bottom: 5px;
  color: var(--mu);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.metric-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 300;
  line-height: 1.1;
}

.blue {
  color: var(--blu);
}

.green {
  color: var(--grn);
}

.amber {
  color: var(--amb);
}

.red {
  color: var(--red);
}

.muted-value {
  color: var(--mu);
}

.dashboard-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  color: var(--tx);
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 6px;
  background: rgba(96, 165, 250, .08);
  font-size: 13px;
}

.dashboard-notice.error {
  border-color: rgba(248, 113, 113, .36);
  background: rgba(248, 113, 113, .08);
}

.dashboard-notice.warning {
  border-color: rgba(245, 158, 11, .36);
  background: rgba(245, 158, 11, .08);
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 360px;
  gap: 18px;
  padding: 18px;
}

.drop-zone {
  min-height: 210px;
  border: 1px dashed rgba(96, 165, 250, .42);
  border-radius: var(--r);
  background: rgba(96, 165, 250, .05);
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  cursor: pointer;
}

.drop-zone > span {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.drop-zone.dragover {
  border-color: var(--blu);
  background: rgba(96, 165, 250, .09);
}

.drop-zone:focus-within {
  border-color: var(--blu);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .14);
}

.drop-icon {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(96, 165, 250, .35);
  border-radius: 7px;
  color: var(--blu);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 600;
}

.drop-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.drop-title {
  font-size: 16px;
  font-weight: 500;
}

.fake-button {
  display: inline-grid;
  place-items: center;
}

.selected-files {
  color: var(--mu);
  font-family: var(--mono);
  font-size: 11px;
  display: block;
  max-width: min(100%, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-files.is-error {
  color: var(--red);
}

.file-selection-message {
  display: block;
  max-width: min(100%, 560px);
  color: var(--mu);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.file-selection-message:empty {
  display: none;
}

.file-selection-message.is-error {
  color: var(--red);
}

.settings-grid {
  display: grid;
  gap: 12px;
}

.field label {
  display: block;
  margin-bottom: 5px;
  color: var(--mu);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.field select,
.field input,
.caption-search {
  width: 100%;
  min-height: 34px;
  color: var(--tx);
  background: var(--bg3);
  border: 1px solid var(--bd2);
  border-radius: 5px;
  padding: 6px 9px;
  outline: none;
}

.field select:focus,
.field input:focus,
.caption-search:focus {
  border-color: var(--blu);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .12);
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mu);
  font-size: 12px;
}

.check-line input {
  accent-color: var(--blu);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--bd);
  border-radius: var(--r);
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.job-col-file {
  width: 40%;
}

.job-col-status {
  width: 13%;
}

.job-col-progress {
  width: 17%;
}

.job-col-created,
.job-col-finished {
  width: 10%;
}

.job-col-actions {
  width: 100px;
}

thead tr {
  background: var(--bg3);
}

th {
  padding: 8px 12px;
  color: var(--mu);
  border-bottom: 1px solid var(--bd2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.actions-heading {
  text-align: center;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bd);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, .018);
}

.temporary-upload-row td {
  background: rgba(96, 165, 250, .035);
}

.filename {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--tx);
  font-family: var(--mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-reference {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.badge.finished,
.step.finished {
  color: var(--grn);
  background: rgba(16, 185, 129, .12);
}

.badge.finished::before {
  background: var(--grn);
}

.badge.running,
.step.running {
  color: var(--amb);
  background: rgba(245, 158, 11, .12);
}

.badge.running::before {
  background: var(--amb);
}

.badge.queued,
.step.queued {
  color: #9ca3af;
  background: rgba(107, 114, 128, .15);
}

.badge.queued::before {
  background: #6b7280;
}

.badge.failed,
.step.failed {
  color: var(--red);
  background: rgba(248, 113, 113, .12);
}

.badge.failed::before {
  background: var(--red);
}

.badge.canceled,
.step.canceled {
  color: #aab2c0;
  background: rgba(148, 163, 184, .12);
}

.badge.canceled::before {
  background: #94a3b8;
}

.progress-cell {
  display: grid;
  grid-template-columns: 96px 44px;
  align-items: center;
  gap: 8px;
  color: var(--mu);
  font-family: var(--mono);
  font-size: 11px;
}

.progress {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, .06);
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blu);
}

.progress > span.finished {
  background: var(--grn);
}

.progress > span.running {
  background: var(--amb);
}

.progress > span.failed {
  background: var(--red);
}

.progress > span.canceled {
  background: #94a3b8;
}

.upload-pulse {
  animation: upload-pulse 1.1s ease-in-out infinite alternate;
}

.upload-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 14px;
  color: var(--tx);
  background: #151a25;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 6px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .28);
  font-size: 13px;
}

.upload-toast.success {
  border-color: rgba(16, 185, 129, .35);
}

.upload-toast.error {
  border-color: rgba(248, 113, 113, .36);
}

.upload-toast.dismissed {
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 14, .72);
  backdrop-filter: blur(8px);
}

.confirm-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  width: min(100%, 440px);
  padding: 18px;
  color: var(--tx);
  background: #151a25;
  border: 1px solid rgba(248, 113, 113, .28);
  border-radius: var(--r);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .44);
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, .34);
  border-radius: 7px;
  background: rgba(248, 113, 113, .08);
}

.confirm-copy h2 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
}

.confirm-copy p {
  margin: 0;
  color: var(--mu);
  font-size: 13px;
  line-height: 1.45;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

@keyframes upload-pulse {
  from {
    opacity: .55;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .upload-pulse {
    animation: none;
  }

  .upload-toast.dismissed {
    transition: none;
  }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  width: fit-content;
  color: var(--tx);
  border: 1px solid rgba(96, 165, 250, .3);
  border-radius: 6px;
  background: rgba(96, 165, 250, .06);
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 11px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.back-link:hover,
.back-link:focus-visible {
  border-color: rgba(96, 165, 250, .55);
  background: rgba(96, 165, 250, .12);
}

.back-link .icon {
  width: 15px;
  height: 15px;
}

.icon-link,
.danger-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.icon-link {
  color: var(--blu);
  border: 1px solid rgba(96, 165, 250, .3);
  border-radius: 6px;
  background: rgba(96, 165, 250, .06);
}

.danger-icon-btn {
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, .34);
  border-radius: 6px;
  background: rgba(248, 113, 113, .06);
}

.icon-link:hover,
.icon-link:focus-visible {
  color: var(--tx);
  border-color: rgba(96, 165, 250, .55);
  background: rgba(96, 165, 250, .12);
}

.danger-icon-btn:hover,
.danger-icon-btn:focus-visible {
  color: #fecaca;
  border-color: rgba(248, 113, 113, .6);
  background: rgba(248, 113, 113, .12);
}

.icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.actions-cell {
  width: 1%;
  text-align: center;
  white-space: nowrap;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}

.row-actions form {
  margin: 0;
}

.inline-form {
  display: inline;
  margin: 0;
}

.error-text {
  max-width: 300px;
  margin-top: 4px;
  color: var(--red);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.status-help {
  max-width: 320px;
  margin-top: 5px;
  color: var(--mu);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
  min-height: 100vh;
}

.error-shell {
  display: grid;
  min-height: 100vh;
  padding: 28px;
  place-items: center;
}

.error-panel {
  width: min(100%, 480px);
  padding: 44px;
  background: #101722;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--r);
}

.error-logo {
  display: block;
  width: 146px;
  height: auto;
  margin-bottom: 42px;
}

.error-code {
  margin-bottom: 14px;
  color: var(--blu);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
}

.error-panel h1 {
  margin: 0 0 12px;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.12;
}

.error-panel p {
  max-width: 340px;
  margin: 0 0 28px;
  color: var(--mu);
  font-size: 15px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-intro,
.login-panel {
  min-height: 100vh;
  padding: clamp(48px, 6vw, 74px);
}

.login-intro {
  display: grid;
  align-content: start;
  gap: 50px;
  background: #101722;
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.login-panel {
  display: grid;
  align-content: center;
  width: min(100%, 440px);
  justify-self: center;
}

.login-brand {
  display: flex;
  align-items: center;
}

.login-logo {
  display: block;
  width: 156px;
  height: 46px;
}

.login-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.login-kicker {
  margin-bottom: 42px;
  color: var(--blu);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.login-intro h1 {
  max-width: 520px;
  margin: 0 0 18px;
  color: var(--tx);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.16;
}

.login-panel h2 {
  margin: 0 0 10px;
  color: var(--tx);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
}

.login-copy {
  color: var(--mu);
  max-width: 430px;
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}

.login-panel > .login-copy {
  margin-bottom: 42px;
  font-size: 14px;
}

.login-points {
  display: grid;
  gap: 22px;
  max-width: 660px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--mu);
  font-size: 15px;
}

.login-points li {
  position: relative;
  padding-left: 24px;
}

.login-points li::before {
  position: absolute;
  top: .58em;
  left: 0;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--blu);
  border-radius: 50%;
}

.login-footer {
  align-self: end;
  color: var(--mu2);
  font-size: 12px;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form .field label {
  margin-bottom: 8px;
  color: var(--mu);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-form .field input {
  min-height: 46px;
  background: #0f171f;
  border-color: rgba(96, 165, 250, .18);
  border-radius: 6px;
  padding: 9px 12px;
}

.login-form .field input:focus {
  border-color: rgba(96, 165, 250, .85);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .12);
}

.login-error {
  padding: 10px 12px;
  color: var(--red);
  background: rgba(248, 113, 113, .09);
  border: 1px solid rgba(248, 113, 113, .24);
  border-radius: 5px;
  font-size: 12px;
}

.login-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 10px;
  color: #071017;
  background: var(--blu);
  border-color: var(--blu);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.login-submit:hover {
  background: #93c5fd;
  border-color: #93c5fd;
}

.empty {
  padding: 22px;
  color: var(--mu2);
  text-align: center;
}

.detail-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.detail-main-column,
.detail-side-column {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.panel {
  padding: 16px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bd);
}

.detail-header > div {
  min-width: 0;
}

.detail-header h1 {
  margin: 6px 0 2px;
  overflow-wrap: anywhere;
  font-size: 22px;
  font-weight: 500;
}

.detail-alert {
  margin-bottom: 20px;
  padding: 13px 15px;
  border: 1px solid rgba(248, 113, 113, .28);
  border-radius: var(--r);
  background: rgba(248, 113, 113, .08);
}

.detail-alert-title {
  margin-bottom: 5px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.detail-alert p {
  margin: 0;
  color: var(--tx);
  overflow-wrap: anywhere;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.step {
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--bd);
  border-radius: 6px;
}

.step-kicker {
  color: var(--mu);
  font-family: var(--mono);
  font-size: 10px;
}

.step-title {
  margin-top: 6px;
  color: var(--tx);
  font-size: 12px;
  font-weight: 600;
}

.step-error {
  margin-top: 6px;
  color: var(--red);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.summary-list {
  display: grid;
  gap: 9px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bd);
}

.summary-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.summary-row span:first-child {
  color: var(--mu);
}

.summary-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.caption-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.caption-viewer {
  display: grid;
  gap: 12px;
}

.caption-search {
  flex: 1 1 240px;
  width: min(360px, 100%);
}

.caption-count {
  color: var(--mu);
  overflow-wrap: anywhere;
}

.caption-scroll {
  max-height: min(58vh, 720px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-color: rgba(96, 165, 250, .42) rgba(255, 255, 255, .045);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.caption-scroll:focus-visible {
  outline: 2px solid rgba(96, 165, 250, .85);
  outline-offset: 3px;
}

.caption-scroll::-webkit-scrollbar {
  width: 10px;
}

.caption-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .045);
  border-radius: 999px;
}

.caption-scroll::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, .42);
  border: 2px solid #161b27;
  border-radius: 999px;
}

.caption-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 165, 250, .68);
}

.caption-list {
  display: grid;
  gap: 10px;
}

.caption-block {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--bd);
  border-radius: 6px;
  background: rgba(255, 255, 255, .015);
}

.caption-index {
  color: var(--blu);
  font-family: var(--mono);
  font-size: 14px;
}

.caption-time {
  margin-bottom: 4px;
  color: var(--mu);
  font-family: var(--mono);
  font-size: 11px;
}

.caption-text {
  color: var(--tx);
  font-size: 15px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.load-more-form {
  display: flex;
  justify-content: center;
}

.download-list {
  display: grid;
  gap: 10px;
}

.download-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--bd);
  border-radius: 6px;
  background: rgba(255, 255, 255, .018);
}

.download-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.download-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.download-language {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--tx);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.language-code-pill {
  flex: 0 0 auto;
  padding: 1px 6px;
  color: var(--blu);
  border: 1px solid rgba(96, 165, 250, .25);
  border-radius: 999px;
  background: rgba(96, 165, 250, .07);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

.download-code {
  color: var(--mu);
  font-size: 11px;
  line-height: 1.35;
}

.download-format {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding-inline: 12px;
  color: var(--tx);
  border-color: var(--bd2);
  background: transparent;
}

.download-format-wide {
  min-width: 72px;
}

.download-format:hover,
.download-format:focus-visible {
  color: var(--tx);
  border-color: rgba(96, 165, 250, .45);
  background: rgba(96, 165, 250, .08);
}

.filter-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--r);
}

.filter-row .field {
  min-width: 180px;
  flex: 1;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline;
}

@media (max-width: 820px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-intro,
  .login-panel {
    min-height: auto;
    padding: 38px 28px;
  }

  .login-intro {
    gap: 30px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
  }

  .login-panel {
    width: min(100%, 520px);
    order: -1;
    justify-self: start;
  }

  .login-kicker {
    margin-bottom: 24px;
  }
}

@media (max-width: 1000px) {
  .login-intro,
  .login-panel {
    padding: 42px 34px;
  }

  .login-intro {
    gap: 36px;
  }

  .login-intro h1 {
    font-size: 30px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-panel,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-main-column,
  .detail-side-column {
    display: contents;
  }

  .timeline-panel {
    order: 1;
  }

  .summary-panel {
    order: 2;
  }

  .caption-panel {
    order: 3;
  }

  .downloads-panel {
    order: 4;
  }
}

@media (max-width: 960px) {
  .table-wrap td.empty {
    min-width: calc(100vw - 48px);
    text-align: left;
    white-space: normal;
  }

  .table-wrap {
    overflow: hidden;
  }

  .table-wrap table {
    min-width: 0;
  }

  .table-wrap thead,
  .table-wrap colgroup {
    display: none;
  }

  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
  }

  .table-wrap tr {
    padding: 14px;
    border-bottom: 1px solid var(--bd);
  }

  .table-wrap tbody tr:last-child {
    border-bottom: 0;
  }

  .table-wrap tbody tr:hover td {
    background: transparent;
  }

  .table-wrap td {
    padding: 0;
    border-bottom: 0;
  }

  .table-wrap td + td {
    margin-top: 10px;
  }

  .table-wrap td[data-label] {
    display: grid;
    grid-template-columns: minmax(86px, 26%) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .table-wrap td[data-label]::before {
    color: var(--mu);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .table-wrap td[data-label="File"] {
    display: block;
  }

  .table-wrap td[data-label="File"]::before {
    display: block;
    margin-bottom: 6px;
  }

  .table-wrap td.empty {
    min-width: 0;
    padding: 18px;
  }

  .table-wrap td.empty::before {
    display: none;
  }

  .actions-cell {
    width: auto;
    text-align: left;
    white-space: normal;
  }

  .row-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-left,
  .nav-links,
  .top-actions,
  .caption-toolbar {
    flex-wrap: wrap;
  }

  .brand-sub {
    max-width: calc(100vw - 92px);
  }

  .section-head {
    align-items: flex-start;
  }

  .section-note {
    text-align: left;
  }

  .wrap {
    width: min(100% - 24px, 1400px);
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .confirm-panel {
    grid-template-columns: 1fr;
  }

  .confirm-actions {
    justify-content: stretch;
  }

  .confirm-actions > * {
    flex: 1;
  }

  .login-intro,
  .login-panel {
    padding: 28px 20px;
  }

  .login-logo {
    width: 132px;
    height: 40px;
  }

  .login-intro h1 {
    font-size: 28px;
  }
}
