:root {
  --font-heading: "Outfit", "Sora", sans-serif;
  --font-body: "Sora", "Trebuchet MS", sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;
  --brand: #0f5bb8;
  --brand-deep: #093371;
  --brand-accent: #f97316;
  --ink: #0d1b32;
  --ink-muted: #3a4c68;
  --line: #ccdaee;
  --line-strong: #b6c9e4;
  --surface: #eff5ff;
  --surface-2: #e2ecfb;
  --white: #ffffff;
  --ok: #0f7a4f;
  --warn: #a86110;
  --error: #b4232d;
  --shadow-soft: 0 14px 36px -24px rgba(10, 30, 70, 0.32);
  --shadow-card: 0 24px 44px -30px rgba(10, 37, 84, 0.44);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 10px;
  --max-w: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.55;
  background:
    radial-gradient(circle at 92% 8%, rgba(15, 91, 184, 0.18), rgba(15, 91, 184, 0) 34%),
    radial-gradient(circle at 8% 28%, rgba(249, 115, 22, 0.1), rgba(249, 115, 22, 0) 30%),
    linear-gradient(180deg, #ecf3ff 0%, #f7faff 45%, #edf4ff 100%);
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(15, 91, 184, 0.46);
  outline-offset: 2px;
}

.page-shell {
  width: min(100% - 2rem, var(--max-w));
  margin: 0 auto;
  padding: 1.2rem 0 2.9rem;
}

.workspace-page .page-shell,
.portal-page .page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.workspace-page .page-shell > *,
.portal-page .page-shell > * {
  min-width: 0;
}

.app-topbar {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.1rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(182, 201, 228, 0.9);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(7px);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 1.16rem;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--white);
  background: linear-gradient(140deg, var(--brand), #0b4b99);
  box-shadow: 0 14px 28px -16px rgba(15, 91, 184, 0.84);
}

.app-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-menu-shell {
  position: relative;
}

.user-avatar-button {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  border: 1px solid #90afdc;
  background: linear-gradient(145deg, #d5e7ff 0%, #c4dbfb 100%);
  color: #123866;
  font-weight: 800;
  font-size: 0.81rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  border-radius: 12px;
  border: 1px solid #bbd0ee;
  background: #ffffff;
  box-shadow: 0 20px 35px -26px rgba(14, 39, 80, 0.5);
  padding: 0.34rem;
  z-index: 24;
  display: grid;
  gap: 0.22rem;
}

.user-menu-link {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #20497e;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.55rem;
}

.user-menu-link:hover {
  background: #eef5ff;
  border-color: #d4e2f7;
}

.user-menu-logout {
  color: #9c1f1f;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.86rem;
  border-radius: 999px;
  border: 1px solid #c7d8ef;
  background: rgba(255, 255, 255, 0.88);
  color: #2a456b;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.topbar-link:hover {
  color: var(--ink);
  background: #ffffff;
  border-color: #b7ccea;
}

.topbar-link.topbar-link-active {
  background: #e7f0ff;
  border-color: #a8c3ea;
  color: #1b4f97;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  padding: 1.55rem 1.35rem 1.45rem;
  margin-bottom: 0.06rem;
  box-shadow: var(--shadow-card);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 91, 184, 0.26), rgba(15, 91, 184, 0) 38%),
    radial-gradient(circle at 0% 100%, rgba(249, 115, 22, 0.1), rgba(249, 115, 22, 0) 34%),
    linear-gradient(118deg, #f9fbff 0%, #edf4ff 100%);
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -130px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(15, 91, 184, 0.16);
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
  color: #1f5faf;
}

h1 {
  margin: 0.4rem 0 0.5rem;
  font-family: var(--font-heading);
  font-size: clamp(1.72rem, 2.8vw, 2.34rem);
  letter-spacing: -0.01em;
  line-height: 1.08;
}

.subtitle {
  margin: 0;
  color: var(--ink-muted);
  max-width: 64ch;
}

.hero-meta {
  margin-top: 0.92rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.44rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.64rem;
  border-radius: 999px;
  border: 1px solid #bad0ef;
  background: rgba(255, 255, 255, 0.75);
  color: #214d86;
  font-size: 0.77rem;
  font-weight: 700;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #ffffff;
  padding: 1.05rem;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}

.guest-callout {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.9rem;
  border-color: #c3d6f3;
  background:
    radial-gradient(circle at 98% 98%, rgba(249, 115, 22, 0.1), rgba(249, 115, 22, 0) 36%),
    linear-gradient(120deg, #f9fbff 0%, #f0f6ff 100%);
}

.guest-callout h2 {
  margin-bottom: 0.35rem;
}

.guest-callout .hint {
  margin-top: 0;
}

.guest-callout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.is-authenticated .guest-callout {
  display: none;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stack {
  display: grid;
  gap: 0.48rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.manual-balloon-row {
  margin-top: 0.72rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.manual-balloon-row input {
  width: 8rem;
}

.is-hidden {
  display: none !important;
}

.trial-meter {
  margin-top: 0.6rem;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  border: 1px solid #c3d5ef;
  background: #eff4ff;
  overflow: hidden;
}

.trial-meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2080eb 0%, #0f5bb8 100%);
  transition: width 0.2s ease-in-out;
}

.trial-meter-fill.warn {
  background: linear-gradient(90deg, #f5b239 0%, #d98211 100%);
}

.trial-meter-fill.limit {
  background: linear-gradient(90deg, #f28534 0%, #c74b17 100%);
}

.export-checklist,
.csv-tolerance-controls {
  margin-top: 0.75rem;
  padding: 0.74rem;
  border: 1px solid #d4e2f6;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.export-checklist label.export-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.42rem;
  margin-top: 0.45rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: #294b77;
}

.export-checklist-input {
  margin-top: 0.14rem;
  transform: scale(1.05);
}

#export-checklist-status.ok {
  color: var(--ok);
}

#export-checklist-status.warn {
  color: var(--warn);
}

.csv-tolerance-grid {
  margin-top: 0.52rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.csv-tolerance-field {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.csv-tolerance-field label {
  font-size: 0.78rem;
  color: #385685;
}

.csv-tolerance-field input {
  width: 100%;
  min-width: 0;
}

h2 {
  margin: 0 0 0.72rem;
  font-family: var(--font-heading);
  font-size: 1.06rem;
  letter-spacing: -0.01em;
}

label {
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid #bdd0ea;
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #abc3e5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #5f92d3;
  box-shadow: 0 0 0 3px rgba(15, 91, 184, 0.12);
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.64rem 0.98rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #0f5bb8 0%, #1f79d5 100%);
  color: #fff;
  width: fit-content;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px -16px rgba(15, 91, 184, 0.75);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ghost {
  background: #edf4ff;
  border: 1px solid #c6d7ee;
  color: #1f4d87;
  border-radius: 11px;
}

.danger {
  background: #fee6e8;
  border: 1px solid #f7c8cd;
  color: #9e1f2d;
}

.hint {
  margin: 0.45rem 0 0;
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.hint.warning {
  color: var(--warn);
}

#review-canvas-status.ok {
  color: var(--ok);
}

#review-canvas-status.warn {
  color: var(--warn);
}

#review-canvas-status.error {
  color: var(--error);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.uploads-card {
  border-color: #d1deef;
  padding: 1.45rem;
}

.uploads-card #uploads-title {
  margin: 0;
  color: #111f39;
  font-size: clamp(1.65rem, 2.7vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.uploads-card .uploads-controls {
  gap: 0.62rem;
}

.uploads-card .uploads-controls .ghost {
  border-radius: 22px;
  border: 2px solid #c5d4e7;
  background: #ffffff;
  color: #3f516e;
  padding: 0.66rem 1.34rem;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: none;
}

.uploads-card .uploads-controls .ghost:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #a8bfdc;
  background: #f4f8ff;
  color: #2f4262;
  box-shadow: 0 14px 24px -20px rgba(15, 57, 114, 0.65);
}

.uploads-card .uploads-hint {
  margin: 0.9rem 0 1rem;
  font-size: 0.98rem;
  color: #4d6180;
}

.uploads-card .uploads-hint-emphasis {
  font-style: italic;
  font-weight: 700;
}

.uploads-card .uploads-table-wrap {
  border: 1px solid #d3deee;
  border-radius: 21px;
  background: #ffffff;
  overflow: auto;
}

.uploads-card .uploads-table {
  min-width: 960px;
}

.uploads-card .uploads-table th {
  padding: 1.05rem 1.1rem;
  border-bottom: 1px solid #dce6f3;
  background: #f8fbff;
  color: #2f435f;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.uploads-card .uploads-table td {
  padding: 0.98rem 1.1rem;
  border-bottom: 1px solid #e4edf8;
  color: #31445f;
  font-size: 0.84rem;
}

.uploads-card .uploads-table td code {
  font-size: 0.83rem;
  color: #334762;
}

.uploads-card .uploads-table tbody tr:hover td {
  background: #f8fbff;
}

.uploads-card .uploads-table tbody tr:last-child td {
  border-bottom: 0;
}

.uploads-card .status-chip {
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 0.34rem 0.84rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.uploads-card .status-succeeded {
  background: #c9efd8;
  color: #0c6c3f;
}

.uploads-card .status-queued,
.uploads-card .status-processing {
  background: #ffeec8;
  color: #825507;
}

.uploads-card .status-failed,
.uploads-card .status-dead_letter {
  background: #ffdce3;
  color: #a01f33;
}

.uploads-card .view-results-btn.ghost {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #2460e2;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.14em;
}

.uploads-card .view-results-btn.ghost:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: transparent;
  color: #124ec5;
  text-decoration-thickness: 2px;
}

.uploads-card .view-results-btn.ghost:disabled {
  opacity: 1;
  color: #9ab1d4;
  text-decoration: none;
}

.review-canvas-shell {
  margin-top: 0.62rem;
  position: relative;
  min-height: 420px;
  max-height: 78vh;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid #d1e0f3;
  border-radius: 13px;
  background: #f7fbff;
}

.review-canvas-shell.can-pan {
  cursor: grab;
  overscroll-behavior: contain;
}

.review-canvas-shell.can-pan.is-panning {
  cursor: grabbing;
  user-select: none;
}

.review-canvas-shell.is-wheel-zooming .review-balloon {
  pointer-events: none;
}

#review-pdf-canvas {
  display: block;
  background: #fff;
}

#review-balloons-layer {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.review-balloon {
  position: absolute;
  width: 27px;
  height: 27px;
  min-width: 27px;
  min-height: 27px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid #1f65bf;
  background: rgba(82, 151, 242, 0.42);
  color: #0d345d;
  font-weight: 800;
  font-size: 0.8rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: translate(-50%, -50%);
  transition: none;
  pointer-events: auto;
  cursor: grab;
  user-select: none;
}

.review-balloon:hover,
.review-balloon:focus,
.review-balloon:active,
.review-balloon.dragging,
.review-balloon.dragging:hover {
  transform: translate(-50%, -50%);
  box-shadow: none;
}

.review-balloon.manual {
  border-style: dashed;
}

.review-balloon.dragging {
  cursor: grabbing;
  box-shadow: 0 0 0 3px rgba(82, 151, 242, 0.26);
}

.review-balloon.active-target {
  background: rgba(82, 151, 242, 0.66);
  border-color: #0f468f;
  box-shadow: 0 0 0 3px rgba(82, 151, 242, 0.32);
}

.review-balloon.saving {
  opacity: 0.62;
}

.review-dimension-highlight {
  position: absolute;
  pointer-events: none;
  border: 2px solid rgba(245, 164, 25, 0.95);
  background: rgba(255, 214, 130, 0.22);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(245, 164, 25, 0.18);
}

.review-dimension-highlight.point {
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border-radius: 50%;
}

.review-input {
  width: 7.5rem;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #bdd0ea;
  font-size: 0.82rem;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.review-actions button {
  padding: 0.4rem 0.68rem;
  border-radius: 8px;
  font-size: 0.78rem;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #e0ebf8;
  padding: 0.58rem 0.36rem;
  font-size: 0.85rem;
  vertical-align: top;
}

.review-row-highlight td {
  background: rgba(255, 236, 173, 0.42);
}

th {
  color: #244d8e;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #f8fbff;
}

.empty {
  text-align: center;
  color: var(--ink-muted);
  padding: 1rem;
}

.results {
  margin: 0;
  background: #0c1930;
  color: #d8e7fd;
  border-radius: 12px;
  padding: 0.86rem;
  max-height: 360px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.77rem;
  line-height: 1.42;
}

.event-log {
  min-height: 46px;
  border: 1px dashed #c4d6ef;
  border-radius: 10px;
  background: #f7fbff;
  padding: 0.74rem;
  color: #1f4e8c;
  font-size: 0.84rem;
}

.event-log .item {
  margin: 0.18rem 0;
}

.event-log .ok {
  color: var(--ok);
}

.event-log .warn {
  color: var(--warn);
}

.event-log .error {
  color: var(--error);
}

/* Workspace event log: terminal-style panel matching product mock */
#event-log.event-log {
  min-height: 162px;
  border: 1px solid #11315e;
  border-radius: 22px;
  background: linear-gradient(165deg, #071733 0%, #07122a 100%);
  box-shadow:
    inset 0 1px 0 rgba(165, 193, 234, 0.08),
    0 12px 26px -22px rgba(5, 12, 32, 0.86);
  padding: 1.2rem 1.35rem;
  color: #20e79f;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.52;
}

#event-log .item {
  margin: 0;
  padding: 0.2rem 0;
  color: inherit;
  text-shadow: 0 0 12px rgba(32, 231, 159, 0.15);
}

#event-log .ok {
  color: #20e79f;
}

#event-log .warn {
  color: #ffb84f;
}

#event-log .error {
  color: #ff7b92;
}

.status-chip {
  display: inline-flex;
  border-radius: 999px;
  font-size: 0.74rem;
  padding: 0.2rem 0.56rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-queued,
.status-processing {
  background: #fff4dc;
  color: #8c5b0a;
}

.status-succeeded {
  background: #dcf7e7;
  color: #0f7a4f;
}

.status-failed,
.status-dead_letter {
  background: #fee3e8;
  color: #a91b33;
}

.auth-page {
  min-height: 100vh;
}

.auth-shell {
  width: min(100% - 2rem, var(--max-w));
  min-height: calc(100vh - 2.6rem);
  margin: 1.3rem auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  gap: 1rem;
  align-items: stretch;
}

.auth-marketing {
  border: 1px solid #3562ad;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 82% 8%, rgba(74, 145, 240, 0.34), rgba(74, 145, 240, 0) 42%),
    radial-gradient(circle at 0% 100%, rgba(249, 115, 22, 0.24), rgba(249, 115, 22, 0) 35%),
    linear-gradient(145deg, #0c356f 0%, #0d4d9a 52%, #0b61be 100%);
  color: #edf5ff;
  padding: 1.62rem;
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 1rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.18rem;
  font-weight: 800;
}

.auth-brand .brand-badge {
  background: linear-gradient(140deg, #1f79d5, #0f5bb8);
}

.auth-kicker {
  margin: 0;
  color: #bfd5ff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.auth-headline {
  margin: 0.34rem 0 0;
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 2.45vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.auth-copy {
  margin: 0;
  color: #d8e7ff;
  font-size: 0.92rem;
}

.auth-points {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.38rem;
  font-size: 0.88rem;
}

.auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.auth-badges span {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(191, 213, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  font-weight: 700;
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--white);
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
  display: grid;
  align-content: start;
  gap: 0.9rem;
}

.auth-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.46rem;
}

.auth-subtitle {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.auth-form {
  display: grid;
  gap: 0.48rem;
}

.auth-message {
  min-height: 1.25rem;
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.auth-message.warn {
  color: var(--warn);
}

.auth-message.error {
  color: var(--error);
}

.auth-message.ok {
  color: var(--ok);
}

.auth-divider {
  margin: 0.2rem 0 0;
  border: 0;
  border-top: 1px solid #e2ebf8;
}

.auth-footer {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.auth-footer a {
  color: #0f5bb8;
  font-weight: 700;
}

.auth-api {
  margin-top: 0.4rem;
  padding-top: 0.8rem;
  border-top: 1px solid #e2ebf8;
  display: grid;
  gap: 0.45rem;
}

.auth-api label {
  font-size: 0.8rem;
  color: #365482;
}

.auth-api .hint {
  margin-top: 0;
}

.account-grid,
.billing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.account-details {
  margin: 0;
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  row-gap: 0.46rem;
  column-gap: 0.74rem;
  align-items: center;
}

.account-details dt {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2a4b79;
}

.account-details dd {
  margin: 0;
  font-size: 0.88rem;
  color: #173b6c;
}

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

.password-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.46rem;
  align-items: center;
}

.password-toggle {
  min-width: 4.28rem;
  padding: 0.58rem 0.7rem;
  border-radius: 10px;
  border: 1px solid #c2d5ef;
  background: #eef5ff;
  color: #21467f;
  font-size: 0.8rem;
  font-weight: 700;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 0.9rem;
  border-radius: 11px;
  border: 1px solid transparent;
  background: linear-gradient(145deg, #1f79d5 0%, #0f5bb8 100%);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 22px -16px rgba(15, 91, 184, 0.9);
}

.button-link-small {
  padding: 0.44rem 0.78rem;
  font-size: 0.78rem;
  border-radius: 10px;
}

.billing-plan-options {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.74rem;
}

.billing-plan-option {
  border: 1px solid #d3e2f6;
  border-radius: 12px;
  background: #f8fbff;
  padding: 0.74rem;
}

.billing-plan-option.is-current {
  border-color: #93b8eb;
  background: #edf4ff;
}

.billing-plan-option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.billing-plan-option-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-family: var(--font-heading);
  color: #1b447d;
}

.billing-plan-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #96bdec;
  color: #1c5098;
  background: #e4efff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.14rem 0.48rem;
}

.billing-plan-option-price {
  margin: 0.24rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #173c6f;
}

.billing-plan-option-description {
  margin: 0.2rem 0 0.36rem;
  font-size: 0.83rem;
  color: #2d527f;
}

.billing-upgrade-btn {
  margin-top: 0.1rem;
}

@media (max-width: 1080px) {
  .csv-tolerance-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .page-shell,
  .auth-shell {
    width: min(100% - 1.4rem, var(--max-w));
  }

  .grid-two,
  .account-grid,
  .billing-grid {
    grid-template-columns: 1fr;
  }

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

  .uploads-card {
    padding: 1rem;
  }

  .uploads-card #uploads-title {
    font-size: 1.45rem;
  }

  .uploads-card .uploads-controls .ghost {
    border-width: 1px;
    padding: 0.52rem 0.95rem;
    font-size: 0.84rem;
  }

  .uploads-card .uploads-hint {
    font-size: 0.9rem;
  }

  .uploads-card .uploads-table {
    min-width: 860px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    margin: 0.8rem auto;
  }

  .app-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .guest-callout {
    align-items: stretch;
    flex-direction: column;
  }

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

@media (max-width: 700px) {
  .hero {
    padding: 1.2rem 0.95rem 1.15rem;
  }

  .card,
  .auth-card,
  .auth-marketing,
  .app-topbar {
    padding: 0.9rem;
  }

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

  .manual-balloon-row input,
  .review-input {
    width: 100%;
  }

  .manual-balloon-row {
    align-items: stretch;
  }

  .review-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .review-actions button {
    width: 100%;
  }

  th,
  td {
    font-size: 0.82rem;
  }
}
