:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #64748b;
  --line: #dbe3ed;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --primary: #075985;
  --primary-hover: #0c4a6e;
  --success: #137333;
  --success-bg: #eaf6ed;
  --danger: #b42318;
  --danger-bg: #fef0ed;
  --shadow: 0 12px 34px rgba(15, 23, 42, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 960px;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, #eef4f8 0%, var(--canvas) 52%, #e7eef6 100%);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
.shell { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 38px 0 64px; }
.brand { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.brand-mark {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px;
  color: white; font-weight: 800; letter-spacing: .04em; background: var(--primary); box-shadow: var(--shadow);
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 27px; letter-spacing: -.02em; }
h2 { margin-bottom: 8px; font-size: 24px; }
h3 { margin-bottom: 16px; font-size: 17px; }
.eyebrow { margin-bottom: 4px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.muted { color: var(--muted); }
.panel { border: 1px solid rgba(203, 213, 225, .85); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.auth-panel { display: grid; grid-template-columns: 1fr 390px; gap: 70px; align-items: center; padding: 42px; }
.auth-panel[hidden], [hidden] { display: none !important; }
label { display: block; margin: 14px 0 7px; font-size: 14px; font-weight: 700; }
input[type="text"], input[type="password"], input:not([type]) {
  width: 100%; padding: 11px 12px; border: 1px solid #b8c4d4; border-radius: 8px; color: var(--ink); background: #fff;
}

input:focus, button:focus-visible { outline: 3px solid rgba(14, 116, 144, .2); outline-offset: 2px; }
.primary, .secondary {
  min-height: 42px; padding: 10px 18px; border-radius: 8px; font-weight: 800;
}
.primary { border: 1px solid var(--primary); color: #fff; background: var(--primary); }
.primary:hover:not(:disabled) { background: var(--primary-hover); }
.secondary { border: 1px solid #aebccc; color: var(--ink); background: #fff; }
.auth-panel .primary { width: 100%; margin-top: 18px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding: 17px 22px; }
.workspace { padding: 26px; }
.file-row { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; }
.file-control small { display: block; margin-top: 7px; color: var(--muted); }
input[type="file"] {
  display: block; width: 100%; padding: 9px; border: 1px dashed #94a3b8; border-radius: 9px; background: #f8fafc;
}
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 7px 12px; border: 0; border-radius: 6px; color: #fff; background: #334155; cursor: pointer;
}
.message { margin: 14px 0 0; padding: 11px 13px; border-radius: 8px; white-space: pre-wrap; }
.message.error { border: 1px solid #f3b8b1; color: var(--danger); background: var(--danger-bg); }
.progress-area { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 14px; }
.progress-copy strong { color: var(--ink); }
progress { width: 100%; height: 14px; accent-color: var(--primary); }
.results { margin-top: 18px; overflow: hidden; }
.results-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 8px; }
.table-wrap { max-height: 480px; overflow: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 13px 16px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; z-index: 1; color: #475569; background: #f8fafc; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
th:first-child, td:first-child { width: 90px; }
th:nth-child(2), td:nth-child(2) { width: 125px; }
td:last-child { overflow-wrap: anywhere; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.45; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge.success { color: var(--success); background: var(--success-bg); }
.badge.error { color: var(--danger); background: var(--danger-bg); }

@media (prefers-reduced-motion: no-preference) {
  .panel { animation: enter .22s ease-out; }
  @keyframes enter { from { opacity: 0; transform: translateY(5px); } }
}
