:root {
  --bg: #efece6;
  --surface: #f7f6f3;
  --ink: #1c1a17;
  --muted: #6f6a62;
  --line: #ddd8d0;
  --line-strong: #1c1a17;
  --accent: #24302b;
  --on-accent: #f6f4ef;
  --danger: #8c3a32;
  --focus: #24302b;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --serif: "IBM Plex Serif", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

button, input { font: inherit; color: inherit; }

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.panel {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 32px 28px 28px;
}

.panel-wide { width: min(100%, 640px); }

.done { width: min(100%, 320px); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  font-size: 15px;
}

.brand-name, .brand-note, .choice-meta { margin: 0; }

.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-note, .choice-meta { color: var(--muted); font-size: 13px; }

h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lede { margin: 0 0 24px; color: var(--muted); }

.field { margin-bottom: 16px; }

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

label, .choice-title {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

input[type="text"], input[type="password"], .file-name {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}

input:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.primary, .ghost, .text-btn, .choice { cursor: pointer; }

.primary, .ghost {
  height: 48px;
  border: 1px solid transparent;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.primary {
  width: 100%;
  margin-top: 8px;
  background: var(--accent);
  color: var(--on-accent);
}

.primary:hover:not(:disabled) { background: #1b2622; }

.primary:disabled { cursor: not-allowed; opacity: 0.4; }

.ghost {
  flex: 0 0 auto;
  padding: 0 16px;
  background: transparent;
  border-color: var(--line-strong);
}

.ghost:hover { background: #efece6; }

.text-btn {
  padding: 8px 0;
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-btn:hover { color: var(--ink); }

.form-error { margin: 0 0 12px; color: var(--danger); font-size: 14px; }

.work-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.work-bar .brand { margin-bottom: 24px; }

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.choice {
  min-height: 88px;
  padding: 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.choice:hover { border-color: #b7b1a7; }

.choice[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: #f3f1ec;
}

.choice-title { margin-bottom: 2px; }

.file-block { margin-bottom: 8px; }

.file-row { display: flex; gap: 8px; }

.file-name { color: var(--muted); }

.file-name.has-file { color: var(--ink); }

.wait {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: turn 900ms linear infinite;
}

@keyframes turn { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .panel { padding: 24px 18px 20px; }
  h1 { font-size: 28px; }
  .choices { grid-template-columns: 1fr; }
  .file-row { flex-direction: column; }
  .ghost { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--ink); }
  *, *::before, *::after { transition: none !important; }
}
