:root {
  --ink: #17201f;
  --muted: #697774;
  --line: #d7e0de;
  --paper: #f2f6f5;
  --blue: #315b68;
  --blue-dark: #203f49;
  --mint: #dfeee9;
  --amber: #b86c13;
  --red: #a83a30;
  --green: #39745d;
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.bluebox-topbar { height: 72px; padding: 0 max(24px, calc((100vw - 1120px) / 2)); display: flex; align-items: center; border-bottom: 1px solid var(--line); background: #fff; }
.bluebox-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 700 24px Georgia, serif; text-decoration: none; }
.bluebox-brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--blue); color: #fff; font-size: 18px; }
.bluebox-account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.bluebox-account a { color: var(--blue-dark); font-size: 14px; font-weight: 800; text-decoration: none; }
#auth-nav { padding: 9px 15px; border: 1px solid #cbd8d5; border-radius: 999px; }
#auth-nav.is-authenticated { background: var(--mint); }

.bluebox-hero { padding: clamp(50px, 8vw, 90px) max(24px, calc((100vw - 1120px) / 2)) 54px; display: flex; align-items: end; justify-content: space-between; gap: 30px; background: radial-gradient(circle at 82% 18%, #cde1dc 0, transparent 30%), linear-gradient(145deg, #f8f4ef, #eaf2f0); }
.bluebox-hero > div { min-width: 0; }
.eyebrow, .section-heading p { margin: 0 0 10px; color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .16em; }
.bluebox-hero h1 { max-width: 900px; margin: 0; font: 700 clamp(42px, 5.2vw, 66px)/1 Georgia, serif; letter-spacing: -.04em; }
.bluebox-hero p:not(.eyebrow) { margin: 18px 0 0; color: var(--muted); font-size: 18px; }
#bluebox-refresh { flex: 0 0 auto; padding: 11px 18px; border: 1px solid #bfcfcb; border-radius: 999px; background: #fff; color: var(--blue-dark); font-weight: 800; }
#bluebox-refresh:disabled { opacity: .55; }

.bluebox-main { max-width: 1120px; margin: 0 auto; padding: 42px 24px 90px; }
.page-status { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--muted); text-align: center; }
.page-status a { color: var(--blue); font-weight: 800; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.summary-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.summary-card strong { display: block; overflow-wrap: anywhere; font: 700 34px Georgia, serif; }
.summary-card:last-child strong { font: 800 16px/1.35 Inter, ui-sans-serif, system-ui, sans-serif; }
.summary-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.summary-card-attention { border-color: #e6c695; background: #fff9ef; }

.unmount-reminder { margin-top: 20px; padding: 20px 22px; display: flex; align-items: center; gap: 16px; border: 1px solid #e1b5ad; border-radius: 18px; background: #fff4f1; color: #71312a; line-height: 1.5; }
.unmount-reminder[hidden] { display: none; }
.reminder-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff; font-size: 22px; font-weight: 900; }
.jobs-section { margin-top: 42px; }
.section-heading h2 { margin: 0; font: 700 30px Georgia, serif; }
.job-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.job-card { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 15px 36px #2d49420b; }
.job-top { display: flex; justify-content: space-between; gap: 18px; }
.job-top h3 { margin: 0; font: 700 25px Georgia, serif; }
.job-label { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.job-status { height: fit-content; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.status-queued { background: #edf0ef; color: #56635f; }
.status-running { background: #e0edf1; color: var(--blue-dark); }
.status-awaiting_unmount { background: #fff0d9; color: #8d510d; }
.status-failed { background: #f8dfdb; color: var(--red); }
.status-unmounted { background: #e1eee8; color: var(--green); }
.job-stage { margin: 22px 0 5px; font-weight: 850; }
.job-message { min-height: 44px; margin: 0; color: var(--muted); line-height: 1.5; }
.job-meta { margin-top: 18px; padding-top: 16px; display: grid; gap: 6px; border-top: 1px solid #e8edeb; color: var(--muted); font-size: 12px; }
.unmount-commands { margin-top: 18px; padding: 14px; border-radius: 12px; background: #202a28; color: #eff8f5; }
.unmount-commands span { display: block; margin-bottom: 7px; color: #b8cac5; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.unmount-commands code { display: block; overflow-wrap: anywhere; color: inherit; font-size: 12px; }
.unmount-commands code + code { margin-top: 6px; color: #ffdca7; }
.empty-jobs { grid-column: 1 / -1; padding: 28px; border: 1px dashed #bdcbc7; border-radius: 18px; color: var(--muted); text-align: center; }

.history-section { padding-top: 36px; border-top: 1px solid var(--line); }
.history-list { margin-top: 18px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }
.history-row { padding: 16px 20px; display: grid; grid-template-columns: minmax(160px, 1fr) 180px 150px; align-items: center; gap: 18px; border-bottom: 1px solid #e8edeb; }
.history-row:last-child { border-bottom: 0; }
.history-row strong, .history-row span { display: block; }
.history-row small { display: block; margin-top: 3px; color: var(--muted); }

@media (max-width: 800px) {
  .bluebox-hero { align-items: flex-start; flex-direction: column; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .job-grid { grid-template-columns: 1fr; }
  .history-row { grid-template-columns: 1fr auto; }
  .history-row time { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .bluebox-account #users-nav { display: none; }
}
