:root {
  color-scheme: light;
  --bg: #eef8fc;
  --surface: #ffffff;
  --surface-soft: #f5fbfe;
  --surface-strong: #eaf7fc;
  --text: #113447;
  --muted: #658291;
  --line: #d7e9f1;
  --brand: #28b8ef;
  --brand-strong: #079bd3;
  --brand-deep: #087fa9;
  --blue-ink: #123e53;
  --accent: #23b4d1;
  --danger: #b42318;
  --shadow: 0 20px 50px rgba(18, 89, 119, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 4%, rgba(40, 184, 239, 0.12), transparent 30%),
    linear-gradient(180deg, #f8fcfe 0%, #edf7fb 52%, #f7fbfd 100%);
  color: var(--text);
}

button,
input,
pre {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
}

.auth-screen {
  min-height: 100vh;
  padding: 28px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(520px, 1.14fr);
  gap: 20px;
  width: min(1180px, 100%);
  margin: 0 auto;
  align-items: stretch;
}

.auth-brand,
.auth-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(19, 36, 26, 0.04), var(--shadow);
}

.auth-brand {
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 520px;
  padding: 28px;
  border-top: 4px solid var(--brand-strong);
}

.auth-brand .brand-logo {
  width: min(280px, 100%);
}

.auth-brand p:last-child {
  max-width: 460px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.auth-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 520px;
  padding: 20px;
  border-top: 4px solid var(--accent);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 760;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-strong);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.form-message.danger {
  color: var(--danger);
}

.form-message.ok {
  color: var(--brand-deep);
}

.workspace {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(19, 36, 26, 0.04), var(--shadow);
}

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

.brand-logo {
  width: clamp(170px, 22vw, 250px);
  height: auto;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.session-actions,
.badge-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.session-label {
  max-width: 220px;
  min-height: 30px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow,
.section-kicker {
  margin: 0 0 5px;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.2;
}

.grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.84fr) minmax(470px, 1.16fr);
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(19, 36, 26, 0.04), var(--shadow);
}

.upload-panel {
  border-top: 4px solid var(--brand-strong);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #b9dfc5;
  border-radius: 999px;
  background: #effaf2;
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.badge.muted {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.badge.danger {
  border-color: #f4b7b0;
  background: #fff1ef;
  color: var(--danger);
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6faf7;
  color: var(--blue-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.text-button:hover {
  border-color: #c6d3cc;
  background: #eef7f1;
}

.text-button.danger {
  border-color: #f4b7b0;
  background: #fff6f5;
  color: var(--danger);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6faf7;
  color: var(--blue-ink);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.icon-button:hover {
  border-color: #c6d3cc;
  background: #eef7f1;
}

.upload-box {
  display: grid;
  gap: 12px;
}

.mode-controls {
  display: grid;
  gap: 10px;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented-control label {
  min-width: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.segmented-control input:checked + span {
  background: var(--brand-strong);
  color: #fff;
}

.percent-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.percent-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 850;
}

#fileInput {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 24px;
  border: 1px dashed #91bba0;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfefd 0%, #f1f8f4 100%);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.dropzone:hover {
  border-color: var(--brand);
  background: #f0faf3;
  transform: translateY(-1px);
}

.file-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border: 1px solid #b4dec0;
  border-radius: 50%;
  background: #effaf2;
  color: var(--brand-strong);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

#fileLabel {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 780;
}

.primary-action {
  min-height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-strong), #126d54);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(47, 127, 56, 0.18);
}

.primary-action.secondary {
  background: linear-gradient(135deg, var(--accent), #1f4055);
  box-shadow: 0 10px 20px rgba(40, 111, 134, 0.16);
}

.primary-action:hover {
  background: linear-gradient(135deg, var(--brand-deep), #0d5947);
}

#submitBtn:disabled,
.icon-button:disabled,
.text-button:disabled {
  cursor: progress;
  opacity: 0.66;
}

.status-card {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fcf9 0%, var(--surface-strong) 100%);
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status-row strong {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.progress-track {
  height: 9px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #d4e0d8;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 240ms ease;
}

.progress-bar.failed {
  background: var(--danger);
}

.steps {
  display: grid;
  gap: 0;
  max-height: 320px;
  margin: 16px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border-top: 1px solid var(--line);
}

.steps li {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.steps span {
  color: var(--muted);
  font-size: 12px;
}

.steps strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 750;
}

.result-panel {
  min-height: 640px;
  border-top: 4px solid var(--accent);
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  min-height: 500px;
  color: var(--muted);
  text-align: center;
}

.empty-logo {
  width: min(280px, 80%);
  height: auto;
  opacity: 0.82;
}

.empty-state p {
  max-width: 430px;
  margin-bottom: 0;
}

.result-content {
  display: grid;
  gap: 14px;
}

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

.summary-item {
  display: grid;
  gap: 8px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-soft) 100%);
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.summary-item strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.percentages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.percentages span {
  display: inline-grid;
  place-items: center;
  min-width: 132px;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 8px;
  background: var(--blue-ink);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px;
  border: 1px solid #b8dfc0;
  border-radius: 8px;
  background: linear-gradient(180deg, #f4fcf5 0%, #eaf8ee 100%);
}

.primary-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-strong), #126d54);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(47, 127, 56, 0.18);
}

.primary-download:hover {
  background: linear-gradient(135deg, var(--brand-deep), #0d5947);
}

pre {
  min-height: 430px;
  max-height: 650px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid #223a46;
  border-radius: 8px;
  background: #16272f;
  color: #f3faf5;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(520px, 1.28fr);
  gap: 20px;
  align-items: start;
}

.admin-create {
  display: grid;
  gap: 13px;
  border-top: 4px solid var(--brand-strong);
}

.admin-users {
  border-top: 4px solid var(--accent);
}

.users-list {
  display: grid;
  gap: 12px;
}

.admin-empty,
.user-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-empty {
  padding: 18px;
  color: var(--muted);
  font-weight: 760;
}

.user-row {
  display: grid;
  gap: 13px;
  padding: 14px;
}

.user-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.user-row-top strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.user-row-top span:not(.badge) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-user-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(120px, 0.75fr) auto;
  gap: 10px;
  align-items: end;
}

.token-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.token-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.token-line code {
  min-width: 0;
  color: var(--blue-ink);
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hidden {
  display: none !important;
}

body.version-v1 #closeBrowserBtn,
body.version-v1 .report-details {
  display: none !important;
}

body.version-v1 .result-content {
  gap: 16px;
}

body.version-v1 .summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

body.version-v1 .empty-state {
  min-height: 520px;
}

button:focus-visible,
input:focus-visible,
.dropzone:focus-within,
.primary-download:focus-visible {
  outline: 3px solid rgba(40, 111, 134, 0.2);
  outline-offset: 2px;
}

@media (max-width: 960px) {
  .auth-screen,
  .app-shell {
    padding: 14px;
  }

  .auth-layout,
  .auth-grid,
  .admin-grid,
  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .auth-brand,
  .auth-card {
    min-height: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand-copy {
    padding-left: 0;
    border-left: 0;
  }

  .brand-logo {
    width: min(245px, 86vw);
  }

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

  .panel {
    padding: 14px;
  }

  .session-actions,
  .badge-row {
    justify-content: flex-start;
    width: 100%;
  }

  .session-label {
    max-width: 100%;
  }

  .token-line {
    grid-template-columns: 1fr;
  }

  .download-card {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-download {
    width: 100%;
  }

  .steps li {
    grid-template-columns: 64px 1fr;
  }
}

/* Modern Turnitin-inspired interface */
.auth-screen {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 40px 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(45, 195, 241, 0.22), transparent 27%),
    radial-gradient(circle at 88% 82%, rgba(16, 133, 177, 0.16), transparent 30%),
    linear-gradient(145deg, #f7fdff 0%, #eaf7fc 50%, #f8fcfe 100%);
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.auth-orb-one {
  top: -170px;
  right: -120px;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(40, 184, 239, 0.25);
  box-shadow: inset 0 0 90px rgba(40, 184, 239, 0.08);
}

.auth-orb-two {
  bottom: -230px;
  left: -170px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(7, 155, 211, 0.18);
  box-shadow: inset 0 0 100px rgba(7, 155, 211, 0.07);
}

.auth-layout {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(360px, 1.08fr) minmax(360px, 0.92fr);
  gap: 0;
  width: min(1040px, 100%);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(163, 211, 229, 0.75);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 35px 90px rgba(16, 92, 122, 0.18);
  backdrop-filter: blur(18px);
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 620px;
  padding: 46px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 90% 8%, rgba(75, 214, 250, 0.28), transparent 32%),
    linear-gradient(155deg, #0c607f 0%, #087ea9 54%, #0aa4ce 100%);
  box-shadow: none;
  color: #fff;
}

.auth-brand::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -130px;
  width: 370px;
  height: 370px;
  border: 60px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.auth-brand-top,
.auth-brand-copy,
.auth-features {
  position: relative;
  z-index: 1;
}

.auth-brand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
}

.auth-brand .brand-logo {
  width: min(225px, 72%);
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(4, 62, 83, 0.16);
}

.version-pill {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.auth-brand-copy {
  margin: auto 0;
}

.auth-brand .eyebrow {
  margin-bottom: 12px;
  color: #bceeff;
  letter-spacing: 0.12em;
}

.auth-brand h1 {
  max-width: 460px;
  margin-bottom: 16px;
  color: #fff;
  font-size: clamp(36px, 5vw, 54px);
  letter-spacing: -0.04em;
}

.auth-brand p:last-child,
.auth-brand-copy > p:last-child {
  max-width: 450px;
  margin: 0;
  color: rgba(238, 250, 255, 0.84);
  font-size: 16px;
  line-height: 1.7;
}

.auth-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.auth-feature strong,
.auth-feature small {
  display: block;
}

.auth-feature strong {
  color: #fff;
  font-size: 12px;
}

.auth-feature small {
  margin-top: 3px;
  color: rgba(232, 248, 254, 0.72);
  font-size: 10px;
  line-height: 1.3;
}

.auth-panel {
  display: grid;
  align-content: center;
  padding: 48px;
  background: rgba(255, 255, 255, 0.94);
}

.auth-card {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-card-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.login-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 15px;
  background: linear-gradient(135deg, #dff6ff, #ebfbff);
  color: var(--brand-strong);
  font-size: 24px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px #cceef9;
}

.auth-card h2 {
  color: var(--blue-ink);
  font-size: 28px;
  letter-spacing: -0.025em;
}

.field {
  gap: 9px;
  color: #456879;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.field input,
.percent-field input {
  min-height: 50px;
  padding: 0 15px;
  border-color: #cee4ed;
  border-radius: 13px;
  background: #f9fdff;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input::placeholder {
  color: #9bb0ba;
  font-weight: 600;
}

.field input:focus,
.percent-field input:focus {
  border-color: #42bde9;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(40, 184, 239, 0.13);
}

.login-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin-top: 5px;
  padding: 0 19px;
}

.auth-security-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 13px 14px;
  border: 1px solid #d8edf5;
  border-radius: 13px;
  background: #f4fbfe;
  color: var(--muted);
}

.auth-security-note > span {
  color: #25afcf;
  font-size: 11px;
  line-height: 1.6;
}

.auth-security-note p {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
}

.auth-footer {
  align-self: end;
  margin: 28px 0 0;
  color: #8ba4af;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.app-shell {
  padding: 32px;
}

.workspace {
  width: min(1360px, 100%);
}

.topbar,
.panel {
  border-color: rgba(201, 226, 236, 0.9);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(21, 91, 119, 0.08);
}

.topbar {
  margin-bottom: 22px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(15px);
}

.topbar .brand-logo {
  width: clamp(165px, 19vw, 225px);
}

.brand-copy h1 {
  color: var(--blue-ink);
  font-size: clamp(22px, 2.5vw, 32px);
  letter-spacing: -0.03em;
}

.eyebrow,
.section-kicker {
  color: var(--brand-strong);
  letter-spacing: 0.08em;
}

.panel {
  padding: 24px;
  overflow: hidden;
}

.upload-panel,
.result-panel,
.admin-create,
.admin-users {
  position: relative;
  border-top: 1px solid rgba(201, 226, 236, 0.9);
}

.upload-panel::before,
.result-panel::before,
.admin-create::before,
.admin-users::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.primary-action,
.primary-download {
  border-radius: 13px;
  background: linear-gradient(135deg, #08a6df, #1abbd2);
  box-shadow: 0 12px 24px rgba(8, 166, 223, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.primary-action:hover,
.primary-download:hover {
  background: linear-gradient(135deg, #078fca, #10a9c4);
  box-shadow: 0 15px 30px rgba(8, 150, 205, 0.26);
  transform: translateY(-1px);
}

.text-button,
.icon-button {
  border-color: #d2e7ef;
  border-radius: 11px;
  background: #f5fbfe;
}

.text-button:hover,
.icon-button:hover {
  border-color: #a8d9ea;
  background: #eaf8fd;
}

.session-label,
.badge {
  border-color: #bde4f2;
  background: #ecf9fe;
  color: #087da5;
}

.badge.muted,
.session-label {
  border-color: #d6e8ef;
  background: #f5fafc;
  color: #587887;
}

.dropzone {
  min-height: 230px;
  border: 1.5px dashed #82cee8;
  border-radius: 17px;
  background: linear-gradient(180deg, #fbfeff 0%, #eef9fd 100%);
}

.dropzone:hover {
  border-color: #18aee2;
  background: #eaf8fd;
  box-shadow: inset 0 0 0 4px rgba(40, 184, 239, 0.05);
}

.file-icon {
  width: 52px;
  height: 52px;
  border-color: #b8e5f4;
  background: #e7f8fe;
  color: #0aa5dc;
}

.status-card,
.summary-item,
.download-card,
.admin-empty,
.user-row,
.token-line,
.segmented-control {
  border-radius: 14px;
}

.status-card {
  border-color: #d3eaf2;
  background: linear-gradient(180deg, #f9fdff 0%, #edf9fd 100%);
}

.progress-track {
  background: #d6eaf2;
}

.progress-bar {
  background: linear-gradient(90deg, #10a8e0, #28c4da);
}

.segmented-control input:checked + span {
  background: linear-gradient(135deg, #0aa3db, #20b8d0);
  box-shadow: 0 6px 14px rgba(8, 159, 211, 0.18);
}

.result-panel {
  min-height: 660px;
}

.empty-state {
  border: 1px dashed #d0e8f1;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(250, 254, 255, 0.8), rgba(239, 249, 253, 0.65));
}

.empty-logo {
  filter: saturate(0.9);
}

.summary-item {
  border-color: #d5e9f1;
  background: linear-gradient(180deg, #fff 0%, #f3fbfe 100%);
}

.summary-item strong {
  color: #087ea8;
}

.percentages span {
  border-radius: 12px;
  background: linear-gradient(135deg, #123e53, #0c6f90);
}

.download-card {
  border-color: #bce5f2;
  background: linear-gradient(180deg, #f3fcff 0%, #e7f8fd 100%);
}

.user-row {
  border-color: #d5e8ef;
  background: #f8fcfe;
}

.token-line {
  border-color: #cfe8f1;
  background: #fff;
}

pre {
  border-color: #174d63;
  border-radius: 14px;
  background: #0e3141;
}

@media (max-width: 960px) {
  .auth-screen {
    padding: 18px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 24px;
  }

  .auth-brand {
    min-height: 360px;
    padding: 30px;
  }

  .auth-features {
    display: none;
  }

  .auth-panel {
    padding: 34px 28px;
  }

  .app-shell {
    padding: 14px;
  }
}

@media (max-width: 560px) {
  .auth-screen {
    padding: 0;
    background: #fff;
  }

  .auth-layout {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .auth-brand {
    min-height: 285px;
    padding: 24px;
  }

  .auth-brand h1 {
    font-size: 34px;
  }

  .auth-brand .brand-logo {
    width: 185px;
  }

  .auth-panel {
    padding: 30px 24px 36px;
  }

  .auth-card h2 {
    font-size: 24px;
  }
}

/* V1: multi-file workspace */
.upload-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.upload-action svg {
  width: 21px;
  height: 21px;
}

.upload-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(8, 155, 211, 0.22);
  filter: saturate(1.08);
}

.dropzone small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.dropzone.dragging {
  border-color: #08a8df;
  background: #e5f8ff;
  box-shadow: inset 0 0 0 4px rgba(8, 168, 223, 0.09), 0 12px 30px rgba(13, 139, 183, 0.12);
  transform: translateY(-2px) scale(1.005);
}

.dropzone.disabled {
  pointer-events: none;
  opacity: .58;
  filter: grayscale(.18);
}

.upload-limit-notice {
  min-height: 16px;
  margin: -3px 2px 0;
  color: #40788d;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
}

.upload-limit-notice.blocked {
  color: #a13e36;
}

.file-icon svg {
  width: 27px;
  height: 27px;
}

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

.selected-file {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #d5eaf2;
  border-radius: 13px;
  background: #f8fcfe;
  animation: fileCardIn 220ms ease both;
}

.selected-file > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.selected-file strong,
.selected-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file strong {
  font-size: 12px;
}

.selected-file span {
  color: var(--muted);
  font-size: 11px;
}

.selected-file button {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.selected-file button:hover {
  background: #e8f6fb;
  color: var(--danger);
}

.document-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(145deg, #e6f7fd, #f5fcff);
  color: #099ed4;
  box-shadow: inset 0 0 0 1px #c9eaf6;
}

.document-icon.pdf {
  background: linear-gradient(145deg, #fff0ef, #fff9f8);
  color: #d84a41;
  box-shadow: inset 0 0 0 1px #f4d0cc;
}

.document-icon svg {
  width: 24px;
  height: 24px;
  transform: translateY(-3px);
}

.document-icon small {
  position: absolute;
  bottom: 4px;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .08em;
}

body.version-v1 .workspace {
  width: 100%;
  max-width: none;
}

body.version-v1 .app-shell {
  height: 100vh;
  min-height: 0;
  padding: 10px;
  font-size: 13px;
}

body.version-v1.workspace-active {
  height: 100vh;
  overflow: hidden;
}

body.version-v1 .workspace {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

body.version-v1 #healthBadge {
  display: none !important;
}

body.version-v1 #quotaBadge,
body.version-v1 #uploadLimitNotice {
  display: none !important;
}

body.version-v1 #appShell .brand-copy .eyebrow {
  display: none;
}

body.version-v1 .topbar {
  flex: 0 0 auto;
  min-height: 78px;
  margin-bottom: 10px;
  padding: 10px 16px;
  border-radius: 15px;
}

body.version-v1 .topbar .brand-logo {
  width: clamp(145px, 13vw, 190px);
}

body.version-v1 .topbar .brand-copy {
  padding-left: 14px;
}

body.version-v1 .topbar .brand-copy h1 {
  font-size: clamp(21px, 1.8vw, 27px);
}

body.version-v1 .grid {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

body.version-v1 .upload-panel {
  display: grid;
  grid-template-columns: minmax(310px, .35fr) minmax(520px, .65fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 16px;
  height: 100%;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
}

body.version-v1 .result-panel {
  display: none;
}

body.version-v1 .dropzone {
  min-height: 180px;
  padding: 16px;
}

body.version-v1 .upload-panel > .panel-header {
  grid-column: 1 / -1;
  margin-bottom: 12px;
}

body.version-v1 .upload-panel > .upload-box {
  grid-column: 1;
  grid-row: 2;
  align-content: start;
  min-width: 0;
  min-height: 0;
  padding-right: 16px;
  border-right: 1px solid #dcecf2;
}

body.version-v1 .upload-panel .file-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 7px;
}

body.version-v1 .upload-panel .primary-action {
  min-height: 43px;
}

.file-library {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #dcecf2;
}

body.version-v1 .file-library {
  display: flex;
  grid-column: 2;
  grid-row: 2;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  flex-direction: column;
}

body.version-v1 .library-heading {
  flex: 0 0 auto;
  margin-bottom: 9px;
}

body.version-v1 .library-heading h3 {
  font-size: 17px;
}

.library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.library-heading h3 {
  margin-top: 3px;
  font-size: 19px;
}

.library-count {
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf8fc;
  color: #187c9e;
  font-size: 11px;
  font-weight: 850;
}

.jobs-list {
  display: grid;
  gap: 10px;
  max-height: 570px;
  padding: 2px 4px 4px 2px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #b9dce9 transparent;
}

body.version-v1 .jobs-list {
  flex: 1 1 auto;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  max-height: none;
  min-height: 0;
  overflow: hidden;
}

body.version-v1 .library-empty {
  grid-column: 1 / -1;
}

.library-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.library-nav {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid #d5e9f1;
  border-radius: 9px;
  background: #f6fbfd;
  color: #167b9d;
  cursor: pointer;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}

.library-nav:hover:not(:disabled) {
  border-color: #8bcde3;
  background: #eaf8fd;
}

.library-nav:disabled {
  cursor: default;
  opacity: .38;
}

.library-page {
  min-width: 31px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.library-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 130px;
  padding: 20px;
  border: 1px dashed #c9e5ef;
  border-radius: 16px;
  background: #f8fcfe;
  color: var(--muted);
}

.library-empty > span > .document-icon {
  opacity: .7;
}

.library-empty strong,
.library-empty p {
  display: block;
  margin: 0;
}

.library-empty strong {
  color: var(--text);
}

.library-empty p {
  margin-top: 3px;
  font-size: 12px;
}

.job-card {
  position: relative;
  overflow: hidden;
  padding: 12px;
  border: 1px solid #d6eaf2;
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  cursor: default;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body.version-v1 .job-card {
  padding: 10px;
  border-radius: 13px;
}

body.version-v1 .document-icon {
  width: 36px;
  height: 40px;
  border-radius: 10px;
}

body.version-v1 .document-icon svg {
  width: 21px;
  height: 21px;
}

body.version-v1 .job-main {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 8px;
}

body.version-v1 .job-copy strong {
  font-size: 12px;
}

body.version-v1 .job-copy span,
body.version-v1 .job-state,
body.version-v1 .queue-action {
  font-size: 9.5px;
}

.job-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.job-metrics span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #d9ebf2;
  border-radius: 11px;
  background: linear-gradient(180deg, #f9fdff, #edf8fc);
}

body.version-v1 .job-metrics {
  gap: 5px;
  margin-top: 7px;
}

body.version-v1 .job-metrics span {
  padding: 7px 8px;
  border-radius: 9px;
}

body.version-v1 .job-metrics strong {
  font-size: 15px;
}

body.version-v1 .job-actions {
  margin-top: 6px;
}

body.version-v1 .queue-action {
  min-height: 27px;
  padding: 0 8px;
}

.job-metrics small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-metrics strong {
  color: #087fa9;
  font-size: 18px;
  line-height: 1.1;
}

.job-card:hover,
.job-card.active {
  border-color: #83cfe8;
  box-shadow: 0 12px 28px rgba(22, 118, 153, .10);
  transform: translateY(-1px);
}

.job-card.active {
  box-shadow: inset 3px 0 0 #12a9df, 0 12px 28px rgba(22, 118, 153, .10);
}

.job-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.job-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.job-copy strong,
.job-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-copy strong {
  color: var(--text);
  font-size: 13px;
}

.job-copy span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}

.job-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #eef8fc;
  color: #287f9c;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.job-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-running .job-state i,
.status-queued .job-state i,
.status-uploading .job-state i,
.status-waiting .job-state i {
  animation: statusPulse 1.15s ease-in-out infinite;
}

.status-completed .job-state {
  background: #eafaf2;
  color: #138356;
}

.status-failed .job-state {
  background: #fff0ee;
  color: var(--danger);
}

.job-progress {
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4f0f4;
}

.job-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #08a7df, #30cadc);
  transition: width 280ms ease;
}

.status-running .job-progress span,
.status-queued .job-progress span {
  background-size: 220% 100%;
  animation: progressFlow 1.5s linear infinite;
}

.status-completed .job-progress span {
  background: linear-gradient(90deg, #18a56f, #53c999);
}

.status-failed .job-progress span {
  background: var(--danger);
}

.job-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 9px;
}

.queue-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #d3e8f0;
  border-radius: 9px;
  background: #f6fbfd;
  color: #176e8c;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 850;
  text-decoration: none;
}

.queue-action svg {
  width: 15px;
  height: 15px;
}

.queue-action:hover {
  border-color: #8bcde3;
  background: #eaf8fd;
}

.queue-action.delete {
  color: #a53b33;
}

.queue-action.delete:hover {
  border-color: #efbdb8;
  background: #fff3f2;
}

.job-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

@keyframes fileCardIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes statusPulse {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes progressFlow {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 980px) {
  body.version-v1.workspace-active {
    height: auto;
    overflow: auto;
  }

  body.version-v1 .app-shell,
  body.version-v1 .workspace {
    height: auto;
  }

  body.version-v1 .grid {
    grid-template-columns: 1fr;
  }

  body.version-v1 .upload-panel {
    display: block;
    height: auto;
    min-height: 620px;
  }

  body.version-v1 .upload-panel > .upload-box {
    padding-right: 0;
    border-right: 0;
  }

  body.version-v1 .file-library {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #dcecf2;
  }
}

@media (max-width: 1200px) {
  body.version-v1 .jobs-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .selection-preview {
    grid-template-columns: 1fr;
  }

  .job-main {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .job-state {
    grid-column: 2;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .job-card,
  .selected-file,
  .job-state i,
  .job-progress span {
    animation: none !important;
    transition: none !important;
  }
}
