:root {
  color-scheme: light;
  --bg: #f3f7f8;
  --surface: #ffffff;
  --line: #d8e2e5;
  --text: #15232b;
  --muted: #62727d;
  --teal: #087f8c;
  --teal-dark: #08606a;
  --green: #20744a;
  --red: #b42318;
  --amber: #8a5a00;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; font: 14px/1.5 "Segoe UI", Arial, sans-serif; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button { min-height: 40px; border: 0; border-radius: 6px; padding: 9px 14px; color: #fff; background: var(--teal); font-weight: 700; cursor: pointer; }
button:hover:not(:disabled) { background: var(--teal-dark); }
button:disabled { opacity: .48; cursor: not-allowed; }
button.secondary { color: var(--teal-dark); background: #e5f1f2; }
button.danger { background: var(--red); }
button.icon-button { min-height: 34px; color: var(--muted); background: transparent; border: 1px solid var(--line); padding: 6px 10px; }
input, select { width: 100%; min-width: 0; border: 1px solid #bdcbd0; border-radius: 6px; padding: 10px 11px; color: var(--text); background: #fff; }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(8, 127, 140, .2); outline-offset: 1px; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px max(20px, calc((100vw - 1180px) / 2)); color: #fff; background: #112a32; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 44px; height: 44px; flex: 0 0 auto; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; }
.brand span { color: #aec1c8; font-size: 12px; }
.topbar button.secondary { flex: 0 0 auto; color: #fff; background: #24434c; }
.status-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: #fff; }
.status-strip > div { min-width: 0; padding: 13px 18px; border-right: 1px solid var(--line); }
.status-strip > div:last-child { border-right: 0; }
.status-strip span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.status-strip strong { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.status.ok { color: var(--green); }
.status.pending { color: var(--amber); }
.status.error { color: var(--red); }
.status.neutral { color: var(--muted); }
.workspace { width: min(1180px, 100%); margin: 0 auto; padding: 24px 20px 40px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 20px; background: var(--surface); }
.setup-panel { grid-row: span 2; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 3px; color: var(--teal); font-size: 11px; font-weight: 800; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 23px; }
h2 { font-size: 18px; }
.step { display: grid; place-items: center; width: 36px; height: 30px; border-radius: 5px; color: var(--teal); background: #e5f1f2; font-size: 12px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
label { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.wide { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 3px; }
.message { min-height: 20px; margin: 0; color: var(--green); font-size: 12px; font-weight: 700; }
.message.error { color: var(--red); }
.supporting { margin: -5px 0 16px; color: var(--muted); }
.push-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.push-actions button:first-child { grid-column: 1 / -1; }
.details { margin: 18px 0 0; border-top: 1px solid var(--line); }
.details div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.details dt { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.details dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.code { font-family: Consolas, "Courier New", monospace; }
.event-panel { min-height: 220px; }
.event-log { max-height: 280px; margin: 0; padding: 0; list-style: none; overflow-y: auto; }
.event-log li { padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.event-log li:first-child { border-top: 0; }
.event-log time { display: block; color: var(--muted); font-size: 11px; }
.event-log strong { color: var(--teal-dark); }
.event-log pre { margin: 5px 0 0; white-space: pre-wrap; color: var(--muted); font: 11px/1.45 Consolas, monospace; }
.event-log .empty { color: var(--muted); }

@media (max-width: 820px) {
  .status-strip { grid-template-columns: 1fr 1fr; }
  .status-strip > div:nth-child(2) { border-right: 0; }
  .status-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workspace { grid-template-columns: 1fr; }
  .setup-panel { grid-row: auto; }
}

@media (max-width: 540px) {
  .topbar { align-items: flex-start; padding: 13px 15px; }
  .brand img { width: 40px; height: 40px; }
  .status-strip > div { padding: 11px 12px; }
  .workspace { padding: 15px 12px 28px; gap: 12px; }
  .panel { padding: 16px; }
  .form-grid, .push-actions { grid-template-columns: 1fr; }
  .push-actions button:first-child { grid-column: auto; }
  .form-grid > * { grid-column: 1; }
  h1 { font-size: 20px; }
}
