:root {
  --ink: #f5f2e9;
  --muted: #9ba39d;
  --panel: #161b19;
  --panel-raised: #1d2421;
  --line: #303936;
  --accent: #bdff43;
  --accent-ink: #11150f;
  --danger: #ff756b;
  --warning: #f4c95d;
  --background: #0c100f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 75% 0%, #1b2820 0, transparent 28rem), var(--background); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
code { font-size: .85em; color: var(--accent); }

.site-header { height: 4.5rem; display: flex; align-items: center; justify-content: space-between; max-width: 76rem; margin: 0 auto; padding: 0 1.5rem; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; color: var(--accent-ink); background: var(--accent); border-radius: .35rem; font-family: Georgia, serif; font-style: italic; }
nav { display: flex; align-items: center; gap: 1.25rem; color: var(--muted); font-size: .9rem; }
nav form { display: inline; }
nav a:hover, .nav-button:hover { color: var(--ink); }
.nav-button { padding: 0; border: 0; color: inherit; background: none; }
.page-shell { width: min(100% - 3rem, 72rem); margin: 0 auto; padding: 4rem 0 6rem; }

h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 12ch; margin-bottom: 1rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.5rem, 7vw, 5rem); font-weight: 400; line-height: .95; letter-spacing: -.055em; }
h2 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 400; letter-spacing: -.035em; }
.eyebrow { margin-bottom: .8rem; color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.muted, .hero-copy { color: var(--muted); line-height: 1.6; }
.hero-copy { max-width: 42rem; margin: 0; font-size: 1.05rem; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 3rem; margin-bottom: 3rem; }
.page-heading, .report-header { margin-bottom: 2.5rem; }
.page-heading h1 { max-width: 15ch; }

.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: .75rem 1.15rem; border: 1px solid var(--accent); border-radius: .4rem; font-weight: 750; white-space: nowrap; }
.primary-button { color: var(--accent-ink); background: var(--accent); }
.secondary-button { color: var(--ink); border-color: var(--line); background: transparent; }
.primary-button:hover { background: #d0ff78; }
.primary-button:disabled { cursor: wait; opacity: .5; }

.alert { margin: 1.25rem 0; padding: 1rem 1.15rem; color: var(--ink); background: #1c2920; border: 1px solid #37513d; border-radius: .45rem; line-height: 1.45; }
.alert.error { background: #2a1717; border-color: #62312e; }
.alert.warning { background: #282316; border-color: #514628; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 2rem 0 4rem; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: .55rem; }
.stat-card { min-width: 0; padding: 1.25rem; background: var(--panel); }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: .76rem; }
.stat-card strong { display: block; margin: .5rem 0 .15rem; font-size: 1.25rem; letter-spacing: -.03em; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin: 3.5rem 0 1.25rem; }
.section-heading .eyebrow { margin-bottom: .45rem; }
.text-link, .back-link { color: var(--accent); font-size: .88rem; font-weight: 700; }
.back-link { display: inline-block; margin-bottom: 2rem; }
.report-list { border-top: 1px solid var(--line); }
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.2rem .25rem; border-bottom: 1px solid var(--line); transition: padding .18s, background .18s; }
.report-row:hover { padding-right: .75rem; padding-left: .75rem; background: var(--panel); }
.report-row > div:first-child { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .35rem .75rem; }
.report-row small { grid-column: 2; color: var(--muted); }
.report-result { text-align: right; }
.report-result strong, .report-result span { display: block; }
.report-result strong { font-size: 1.6rem; }
.report-result span { color: var(--muted); font-size: .74rem; }
.status { display: inline-flex; padding: .25rem .5rem; color: var(--warning); background: #2d281b; border-radius: 2rem; font-size: .63rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.status.complete { color: var(--accent); background: #1d2a19; }
.status.failed { color: var(--danger); background: #311d1b; }
.status.large { padding: .4rem .7rem; }
.empty-state { padding: 3rem 1.5rem; text-align: center; background: var(--panel); border: 1px dashed var(--line); border-radius: .55rem; }
.empty-state h3 { margin-bottom: .5rem; font-family: Georgia, serif; font-size: 1.5rem; font-weight: 400; }
.empty-state p { margin-bottom: 0; color: var(--muted); }

.settings-form { display: grid; gap: 1.25rem; }
fieldset { margin: 0; padding: 1.5rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--panel); }
legend { padding: 0 .5rem; font-family: Georgia, serif; font-size: 1.35rem; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
label > span { display: block; margin-bottom: .55rem; color: var(--muted); font-size: .78rem; font-weight: 700; }
input { width: 100%; min-width: 0; padding: .8rem .9rem; color: var(--ink); background: #101513; border: 1px solid var(--line); border-radius: .35rem; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(189, 255, 67, .1); }
.input-unit { display: flex; align-items: center; overflow: hidden; background: #101513; border: 1px solid var(--line); border-radius: .35rem; }
.input-unit:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(189, 255, 67, .1); }
.input-unit input { border: 0; box-shadow: none; }
.input-unit span { padding: 0 .8rem; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.field-note { margin: 1rem 0 0; color: var(--muted); font-size: .8rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: .5rem; }

.login-wrap { display: grid; place-items: center; min-height: calc(100vh - 12rem); }
.login-card { width: min(100%, 31rem); padding: clamp(1.5rem, 6vw, 3rem); background: rgba(22, 27, 25, .96); border: 1px solid var(--line); border-radius: .65rem; box-shadow: 0 2rem 5rem rgba(0, 0, 0, .35); }
.login-card h1 { font-size: clamp(2.6rem, 11vw, 4rem); }
.stack-form { display: grid; gap: .8rem; margin-top: 2rem; }
.stack-form .primary-button { margin-top: .4rem; }

.report-header { display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.report-header h1 { max-width: none; font-size: clamp(2.5rem, 6vw, 4rem); }
.report-stats { margin-bottom: 2rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: .55rem; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: .8rem 1rem; color: var(--muted); background: #111614; font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; }
td { padding: 1rem; border-top: 1px solid var(--line); white-space: nowrap; }
td:first-child { white-space: normal; }
td strong, td span { display: block; }
td span { max-width: 18rem; margin-top: .25rem; overflow: hidden; color: var(--muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.positive { color: var(--accent); font-weight: 800; }

@media (max-width: 760px) {
  .site-header { height: 4rem; padding: 0 1rem; }
  nav { gap: .8rem; font-size: .8rem; }
  .page-shell { width: min(100% - 2rem, 72rem); padding: 2.5rem 0 4rem; }
  .hero { display: block; }
  .hero form, .hero .primary-button { width: 100%; margin-top: 1.5rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; margin-bottom: 3rem; }
  .form-grid { grid-template-columns: 1fr; }
  .schedule-grid { grid-template-columns: 1fr 1fr; }
  .schedule-grid label:last-child { grid-column: 1 / -1; }
  .report-row { align-items: start; }
  .report-row > div:first-child { grid-template-columns: 1fr; }
  .report-row small { grid-column: 1; }
  .status { width: fit-content; }
  .report-header { align-items: start; }
  th:nth-child(3), td:nth-child(3) { display: none; }
}

@media (max-width: 430px) {
  nav a:first-child { display: none; }
  h1 { font-size: 2.65rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; }
  .form-actions > * { flex: 1; }
  fieldset { padding: 1.15rem; }
  th, td { padding: .75rem; }
  th:nth-child(4), td:nth-child(4) { display: none; }
}
