:root {
  --ink: #18201d;
  --muted: #66706b;
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --line: #ddd8ce;
  --green: #164c3a;
  --green-soft: #dcebe3;
  --orange: #e8663b;
  --orange-dark: #c94e27;
  --red: #9b322a;
  --red-soft: #f7dfdc;
  --shadow: 0 18px 50px rgba(24, 32, 29, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 90% 0%, rgba(232, 102, 59, 0.09), transparent 28rem),
    var(--paper);
}

button, input, select { font: inherit; }
a { color: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  border-bottom: 1px solid rgba(24, 32, 29, 0.1);
  background: rgba(244, 241, 234, 0.86);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: var(--green);
  font-family: Georgia, serif;
  font-size: 24px;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -0.01em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #a5aaa7; }
.status-ready { color: var(--green); background: var(--green-soft); border-color: #c3d9cc; }
.status-ready .status-dot { background: #2b8a5f; box-shadow: 0 0 0 4px rgba(43,138,95,.12); }

.page { padding-block: 58px 72px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 36px; margin-bottom: 40px; }
.eyebrow { margin: 0 0 12px; color: var(--orange-dark); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.hero h1 { max-width: 760px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5.2vw, 66px); line-height: .98; letter-spacing: -.045em; font-weight: 500; }
.hero p:not(.eyebrow) { max-width: 650px; margin: 20px 0 0; color: var(--muted); line-height: 1.65; font-size: 16px; }
.hero-stat { min-width: 160px; padding: 22px; border-left: 1px solid var(--line); }
.hero-stat strong { display: block; font-family: Georgia, serif; font-size: 42px; font-weight: 500; }
.hero-stat span { color: var(--muted); font-size: 13px; }

.alert { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; padding: 15px 18px; border: 1px solid; border-radius: 14px; font-size: 14px; }
.alert > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; }
.alert a { display: inline-block; margin-left: 10px; font-weight: 750; }
.alert-success { color: var(--green); background: var(--green-soft); border-color: #bcd5c7; }
.alert-success > span { color: white; background: #2b8a5f; }
.alert-error { color: var(--red); background: var(--red-soft); border-color: #e8bbb6; }
.alert-error > span { color: white; background: var(--red); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: 24px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.card-export, .card-settings { padding: 30px; }
.card-heading { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 28px; }
.card-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 27px; font-weight: 500; letter-spacing: -.02em; }
.card-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.step { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #eee9df; color: var(--green); font-size: 11px; font-weight: 850; letter-spacing: .05em; }

.read-only-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -7px 0 23px;
  padding: 12px 14px;
  border: 1px solid #c3d9cc;
  border-radius: 11px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  line-height: 1.45;
}
.read-only-note strong { flex: none; }
.read-only-note span { color: #416455; }

.field { display: block; margin-bottom: 18px; }
.field > span, .auth-choice legend { display: block; margin-bottom: 8px; color: #343d39; font-size: 13px; font-weight: 720; }
.field > span small { color: #929894; font-weight: 500; }
.field > small, .form-hint { display: block; margin-top: 7px; color: #858c88; font-size: 11px; line-height: 1.45; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.date-hint { margin: -10px 0 18px; color: #858c88; font-size: 11px; line-height: 1.45; }
input, select {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #d3cec4;
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color .16s, box-shadow .16s;
}
input:focus, select:focus { border-color: #58917b; box-shadow: 0 0 0 3px rgba(22,76,58,.1); }
input::placeholder { color: #a7aaa8; }
.check-field { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 20px; cursor: pointer; }
.check-field input { flex: none; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--green); }
.check-field span, .check-field strong, .check-field small { display: block; }
.check-field strong { color: #343d39; font-size: 12px; line-height: 1.4; }
.check-field small { margin-top: 4px; color: #858c88; font-size: 10px; line-height: 1.45; }
.input-suffix { display: flex; align-items: center; border: 1px solid #d3cec4; border-radius: 11px; background: #fff; overflow: hidden; }
.input-suffix:focus-within { border-color: #58917b; box-shadow: 0 0 0 3px rgba(22,76,58,.1); }
.input-suffix input { min-width: 80px; border: 0; border-radius: 0; box-shadow: none; }
.input-suffix span { flex: none; padding-right: 13px; color: #7d8581; font-size: 13px; }

.auth-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 20px; padding: 0; border: 0; }
.auth-choice legend { grid-column: 1 / -1; }
.auth-choice label { position: relative; cursor: pointer; }
.auth-choice input { position: absolute; opacity: 0; pointer-events: none; }
.auth-choice label > span { display: block; height: 100%; padding: 13px; border: 1px solid #d8d3c9; border-radius: 11px; background: #fff; }
.auth-choice strong, .auth-choice small { display: block; }
.auth-choice strong { font-size: 13px; }
.auth-choice small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.auth-choice input:checked + span { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.auth-choice input:focus-visible + span { outline: 3px solid rgba(22,76,58,.18); }
[hidden] { display: none !important; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
  transition: transform .15s, background .15s, border-color .15s;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.button-primary { color: #fff; background: var(--orange); box-shadow: 0 8px 20px rgba(232,102,59,.2); }
.button-primary:hover { background: var(--orange-dark); }
.button-secondary { color: #fff; background: var(--green); }
.button-secondary:hover { background: #0f3d2e; }
.button-outline { color: var(--green); border-color: #bfc9c3; background: #fff; }
.button-outline:hover { border-color: var(--green); background: #f8fbf9; }
.button-wide { width: 100%; margin-top: 8px; min-height: 50px; }
.button-small { min-height: 34px; padding-inline: 12px; font-size: 11px; }
.button-loading { display: none; }
.is-active-loading .button-label { display: none; }
.is-active-loading .button-loading { display: inline; }

.history { margin-top: 24px; box-shadow: none; }
.history-heading { justify-content: space-between; align-items: end; margin: 0; padding: 25px 28px; border-bottom: 1px solid var(--line); }
.history-heading .eyebrow { margin-bottom: 7px; }
.history-heading > span { color: var(--muted); font-size: 12px; }
.empty-state { padding: 58px 20px 64px; text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 15px; border-radius: 15px; color: var(--green); background: var(--green-soft); font-size: 25px; }
.empty-state h3 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 15px 28px; border-bottom: 1px solid #ebe7df; text-align: left; white-space: nowrap; }
th { color: #868d89; background: #fbf9f4; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
tbody tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.table-actions form { margin: 0; }
.icon-button { width: 34px; height: 34px; border: 1px solid #e1d4d1; border-radius: 9px; color: var(--red); background: #fff; cursor: pointer; font-size: 20px; line-height: 1; }
.icon-button:hover { background: var(--red-soft); }

.site-footer { padding: 22px 0 34px; color: #7c8580; font-size: 11px; }
.site-footer .shell { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; }
  .hero-stat { display: none; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1180px); }
  .page { padding-block: 38px 52px; }
  .status { padding: 8px; }
  .status:not(.status-ready) { font-size: 0; }
  .hero { margin-bottom: 28px; }
  .hero h1 { font-size: 39px; }
  .card-export, .card-settings { padding: 22px; }
  .field-row, .auth-choice { grid-template-columns: 1fr; }
  .button-row .button { width: 100%; }
  th, td { padding-inline: 18px; }
  .site-footer .shell { flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
