:root {
  color-scheme: light;
  --ink: #102641;
  --muted: #495b70;
  --line: #d6e0e9;
  --blue: #14549c;
  --gold: #ffcf56;
  font: 100%/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f0f4f8;
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--blue); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid #af6b00; outline-offset: 4px; }
.hidden { display: none; }
.wrap { width: min(78rem, calc(100% - clamp(2rem, 8vw, 7rem))); margin-inline: auto; }
.mast { background: white; border-bottom: 1px solid var(--line); }
.nav, .brand, .dashboard-head, .history-head, .step-meta, .log-header { display: flex; align-items: center; gap: 1rem; }
.nav { min-height: 4.65rem; }
.brand { gap: .55rem; color: var(--ink); font-size: 1.45rem; font-weight: 800; letter-spacing: -.065em; text-decoration: none; }
.brand img { border-radius: 24%; }
.nav-label { border-left: 1px solid var(--line); padding-left: 1rem; color: var(--muted); }
.home-link { margin-left: auto; }
.home-link, .data-link, footer a { font-size: .94rem; }
h1, h2, h3 { letter-spacing: -.045em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
.login { min-height: calc(100svh - 4.65rem); place-items: center; padding: 2rem 1rem; }
.login:not(.hidden) { display: grid; }
.login-card { width: min(100%, 29rem); background: white; border: 1px solid var(--line); border-radius: 1.2rem; overflow: hidden; box-shadow: 0 1rem 3.5rem #10264112; }
.login-intro, .login-body { padding: clamp(1.4rem, 4vw, 2.5rem); }
.login-intro { color: white; background: radial-gradient(ellipse at top right, #24557e, transparent 70%), var(--ink); }
.login-intro svg { color: var(--gold); margin-bottom: .75rem; }
.login-intro h1 { font-size: clamp(1.85rem, 4vw, 2.5rem); }
.login-intro p { color: #d7e3ee; margin-top: .65rem; }
label { display: block; font-weight: 650; margin-bottom: .38rem; }
input { width: 100%; border: 1px solid #899eb3; border-radius: .5rem; color: var(--ink); padding: .7rem .85rem; margin-bottom: 1.15rem; }
.btn { min-height: 2.75rem; border: 1px solid transparent; border-radius: .56rem; padding: .55rem 1.05rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .6rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.btn:disabled { opacity: .65; cursor: wait; }
.primary { background: var(--gold); color: var(--ink); }
.primary:hover:enabled { background: #ffdb7f; }
.secondary { color: var(--ink); border-color: #b9c8d7; background: white; }
.secondary:hover { background: #edf3f9; }
.login .btn { width: 100%; }
.data-link { display: block; width: fit-content; margin: 1.35rem auto 0; }
.dashboard { padding-block: clamp(1.5rem, 4vw, 3.3rem); }
.dashboard-head, .history-head, .step-meta, .log-header { flex-wrap: wrap; justify-content: space-between; }
.dashboard-head { padding-bottom: 1.6rem; margin-bottom: 1.8rem; border-bottom: 1px solid var(--line); }
.dashboard-head p, .step>p { color: var(--muted); margin-top: .35rem; }
.columns { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(17rem, 1fr); gap: clamp(1.2rem, 3vw, 2.3rem); align-items: start; }
.hint { color: var(--muted); margin: .6rem 0 1.25rem; max-width: 75ch; }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.step, .history { padding: clamp(1rem, 2vw, 1.5rem); border-radius: .9rem; background: white; border: 1px solid var(--line); min-width: 0; }
.step { display: flex; flex-direction: column; }
.step-number { font-size: .86rem; font-weight: 700; color: var(--blue); }
.step-meta { gap: .45rem; margin-bottom: 1.1rem; }
.metrics { margin: 1.2rem 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.metrics div { padding: .55rem 0; border-bottom: 1px solid var(--line); }
dt, .log-time { color: var(--muted); font-size: .875rem; }
dd { font-weight: 600; overflow-wrap: anywhere; }
.step>.btn { margin-top: auto; }
.history-head { padding-bottom: 1rem; }
.logs-container { max-height: 38rem; overflow-y: auto; }
.status { width: fit-content; padding: .17rem .56rem; border-radius: .35rem; font-size: .82rem; font-weight: 650; background: #eaf0f5; color: #42566c; }
.status.running { background: #fff1c5; color: #705009; }
.status.completed, .alert-success { background: #e3f4eb; color: #19563a; }
.status.failed, .alert-error { background: #fff0ee; color: #912f29; }
.log-entry { padding: .95rem .15rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.log-header { gap: .3rem .6rem; margin-bottom: .45rem; }
.log-script { font-weight: 680; }
.log-output, .log-stats { font-size: .94rem; overflow-wrap: anywhere; margin-top: .45rem; }
.log-output { color: #7e3529; white-space: pre-wrap; }
.step>.log-output:not(:empty) { margin: -.3rem 0 1rem; }
.log-stats, .empty { color: var(--muted); }
.empty { padding: 1.7rem .6rem; border-top: 1px solid var(--line); text-align: center; }
.alert { padding: .85rem 1rem; border-radius: .6rem; margin-bottom: 1rem; overflow-wrap: anywhere; }
.loading { width: 1.1rem; height: 1.1rem; flex: none; border: 2px solid #10264144; border-top-color: var(--ink); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading { animation: none; } }
footer { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; }
@media (max-width: 62rem) { .columns { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 38rem) {
  .steps { grid-template-columns: minmax(0,1fr); }
  .nav-label { display: none; }
  .dashboard-head { align-items: flex-start; }
  .login { min-height: auto; }
}
