/* The status page (public/js/app/status-render.js): the Requester portal's Service status tab, the public page
   (status.html), and the staff screens. The public page doesn't load styles.css, so every colour has a fallback. */
.sp-page { display:grid; gap:var(--space-200); color:var(--ink, #27332f); }
.sp-head h1 { margin:0 0 var(--space-50); font-size:var(--text-3xl); }
.sp-head p { margin:0; color:var(--muted, #626a63); }
.sp-overall { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-150); padding:var(--space-200) var(--space-200); border-radius:var(--radius-xl); font-size:var(--text-md); }
.sp-overall small { margin-left:auto; color:inherit; font-size:var(--text-xs); }
.sp-overall.sp-ok { background:var(--spruce, #356b5d); color:var(--brand-ink, #fff); }
.sp-overall.sp-maint { background:#2e5279; color:#fff; }
.sp-overall.sp-warn { background:var(--saffron, #dba744); color:#27332f; }
.sp-overall.sp-bad { background:#b03e2c; color:#fff; }
.sp-dot { width:10px; height:10px; border-radius:var(--radius-round); background:currentColor; box-shadow:0 0 0 3px rgba(255,255,255,.3); }
.sp-announcement { padding:var(--space-150) var(--space-200); border:1px solid var(--line, #e5e6de); border-left:4px solid #2e5279; border-radius:var(--radius-xl); background:var(--surface, #fffefa); }
.sp-announcement.sp-warn { border-left-color:var(--saffron, #dba744); background:var(--saffron-pale, #f8edcc); }
.sp-announcement p { margin:var(--space-50) 0 0; font-size:var(--text-md); }
.sp-section h2 { margin:0 0 var(--space-100); font-size:var(--text-lg); }
.sp-services { display:grid; gap:var(--space-150); margin:0; padding:0; list-style:none; }
.sp-service { display:grid; gap:var(--space-100); padding:var(--space-200) var(--space-200); border:1px solid var(--line, #e5e6de); border-radius:var(--radius-xl); background:var(--surface, #fffefa); }
.sp-service-head { display:flex; align-items:flex-start; justify-content:space-between; gap:var(--space-150); }
.sp-service-head small { display:block; color:var(--muted, #626a63); font-size:var(--text-xs); font-weight:400; }
.sp-pill { flex:none; padding:var(--space-50) var(--space-150); border-radius:var(--radius-pill); font-size:var(--text-xs); font-weight:700; white-space:nowrap; }
.sp-pill.sp-ok { background:var(--spruce-pale, #e3efe8); color:var(--spruce-dark, #244d43); }
.sp-pill.sp-maint { background:#e6eef7; color:#2e5279; }
.sp-pill.sp-warn { background:var(--saffron-pale, #f8edcc); color:var(--warn-ink, #7a5a12); }
.sp-pill.sp-bad { background:var(--terra-pale, #f7e4de); color:var(--bad, #b03e2c); }
.sp-message { margin:0; font-size:var(--text-md); }
.sp-bars { display:grid; grid-template-columns:repeat(90, 1fr); gap:var(--space-25); height:28px; }
.sp-bar { border-radius:var(--radius-xs); background:var(--spruce, #356b5d); opacity:.85; }
.sp-bar.sp-none { background:var(--line, #e5e6de); opacity:1; }
.sp-bar.sp-maint { background:#5b84b1; }
.sp-bar.sp-warn { background:var(--saffron, #dba744); }
.sp-bar.sp-bad { background:var(--terra, #c96d55); }
.sp-bars-legend { display:flex; justify-content:space-between; color:var(--muted, #626a63); font-size:var(--text-2xs); }
.sp-maint { padding:var(--space-150) var(--space-150); border:1px solid var(--line, #e5e6de); border-radius:var(--radius-xl); background:var(--surface, #fffefa); margin-bottom:var(--space-100); }
.sp-maint.sp-running { border-left:4px solid #2e5279; }
.sp-maint small { display:block; color:var(--muted, #626a63); font-size:var(--text-xs); }
.sp-maint p { margin:var(--space-75) 0 0; font-size:var(--text-sm); }
.sp-empty { color:var(--muted, #626a63); font-size:var(--text-sm); }
.sp-follow { display:flex !important; align-items:center; gap:var(--space-100); margin:0; color:var(--ink-2, #3b4743); font-size:var(--text-sm); }
.sp-follow input { width:auto; margin:0; }
/* A box is saved as it is ticked or cleared (status-page.js spFollowChange): what was saved shows beside it. */
.sp-follow-row { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50) var(--space-150); }
.sp-follow-row .sp-follow { min-height:var(--control-height-lg, 44px); }
.sp-follow-note { color:var(--muted, #626a63); font-size:var(--text-xs); }
.sp-follow-note[data-tone="saved"] { color:var(--spruce-dark, #244d43); font-weight:600; }
/* What the bars' colors mean, once above the services, and what uptime counts. */
.sp-legend { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50) var(--space-200); margin:0 0 var(--space-150); color:var(--muted, #626a63); font-size:var(--text-xs); }
.sp-legend span { display:inline-flex; align-items:center; gap:var(--space-75); }
.sp-legend small { flex-basis:100%; font-size:inherit; }
.sp-key { display:inline-block; width:10px; height:10px; border-radius:var(--radius-xs); background:var(--spruce, #356b5d); }
.sp-key.is-warn { background:var(--saffron, #dba744); }
.sp-key.is-bad { background:var(--terra, #c96d55); }
.sp-key.is-maint { background:#5b84b1; }
/* The portal's tab reads at a comfortable width, like the public page, under its own title. */
#requesterPortalStatus .sp-page, #requesterPortalStatus .sp-portal-head { max-width:48rem; }
[data-portal-tab="status"].sp-tab-alert::after { content:""; display:inline-block; width:7px; height:7px; margin-left:var(--space-75); border-radius:var(--radius-round); background:var(--terra, #c96d55); vertical-align:2px; }

/* The public page (status.html): the column, header, colors and language switch of the pages outside the app
   (login.css, public-pages.css; GitHub issue 203, 1c), which follow the system's light or dark. */
body.sp-public { margin:0; }
.sp-shell { max-width:860px; margin:0 auto; padding:var(--space-400) var(--space-200) var(--space-500); display:grid; gap:var(--space-250); }
.sp-public-foot { color:var(--muted, #626a63); font-size:var(--text-sm); text-align:center; }

/* Staff: Problems › Status page, Admin settings › Status page */
.sp-staff { display:grid; gap:var(--space-200); margin-bottom:var(--space-200); }
.sp-staff[hidden] { display:none; }
.sp-staff-head { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:var(--space-150); }
.sp-staff-head h2 { margin:0 0 var(--space-50); font-size:var(--text-xl); }
.sp-staff-links { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-150); }
.sp-staff-links a { text-decoration:none; display:inline-flex; align-items:center; min-height:32px; padding:0 var(--space-150); }
.sp-staff-services { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:var(--space-150); }
.sp-staff-service { display:grid; gap:var(--space-100); padding:var(--space-200) var(--space-200); }
.sp-override summary { cursor:pointer; color:var(--spruce-dark, #244d43); font-size:var(--text-sm); font-weight:600; }
.sp-override[open] { display:grid; gap:var(--space-100); }
.sp-override label, .sp-ann-form label { display:grid; gap:var(--space-50); font-size:var(--text-sm); font-weight:600; }
.sp-override select, .sp-override input, .sp-override textarea, .sp-ann-form input, .sp-ann-form textarea { width:100%; box-sizing:border-box; padding:var(--space-100) var(--space-100); border:1px solid var(--line, #e5e6de); border-radius:var(--radius-lg); background:var(--surface, #fffefa); color:var(--ink, #27332f); font:inherit; font-size:var(--text-sm); font-weight:400; }
.sp-override-grid { display:grid; grid-template-columns:1fr 1fr; gap:var(--space-100); }
.sp-row-actions { display:flex; flex-wrap:wrap; gap:var(--space-100); }
.sp-row-actions .save-button, .sp-row-actions .outline-button { min-height:30px; padding:0 var(--space-150); font-size:var(--text-sm); }
.sp-staff-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(340px, 1fr)); gap:var(--space-200); }
.sp-staff-card { display:grid; gap:var(--space-150); align-content:start; padding:var(--space-200) var(--space-200); }
.sp-staff-card h3 { margin:0; font-size:var(--text-md); }
.sp-staff-list { display:grid; gap:var(--space-75); margin:0; padding:0; list-style:none; }
.sp-staff-list > li { display:flex; align-items:flex-start; gap:var(--space-150); padding:var(--space-100) var(--space-150); border:1px solid var(--line, #e5e6de); border-radius:var(--radius-lg); font-size:var(--text-sm); }
.sp-staff-list > li > div { flex:1; min-width:0; }
/* An announcement's Approval section (GitHub issue 306): the shared run cards, under its dates. */
.sp-staff-list .rac-runs { margin:var(--space-75) 0 0; }
.sp-staff-list small { display:block; color:var(--muted, #626a63); }
.sp-shown { margin:var(--space-50) 0 0; color:#2e5279; font-weight:600; }
.sp-ann-form { display:grid; gap:var(--space-100); padding-top:var(--space-100); border-top:1px solid var(--line, #e5e6de); }
.sp-ann-form .wf-check { display:flex; align-items:center; gap:var(--space-75); font-weight:400; }
.sp-ann-form .wf-check input { width:auto; }
.sp-settings-card { max-width:980px; padding:var(--space-200) var(--space-250); }
.sp-settings-card h3 { margin:var(--space-200) 0 var(--space-75); font-size:var(--text-md); }
.sp-settings-card h3:first-child { margin-top:0; }
.sp-field { display:grid; gap:var(--space-75); margin-bottom:var(--space-150); font-size:var(--text-sm); font-weight:600; }
.sp-field input, .sp-field textarea, .sp-link-row input { padding:var(--space-100) var(--space-150); border:1px solid var(--line, #e5e6de); border-radius:var(--radius-lg); background:var(--surface, #fffefa); color:var(--ink, #27332f); font:inherit; font-weight:400; }
.sp-service-row { display:grid; grid-template-columns:1fr 1.3fr 1fr 1.3fr auto; gap:var(--space-75); align-items:center; margin-bottom:var(--space-75); }
.sp-service-row input, .sp-service-row select { width:100%; box-sizing:border-box; padding:var(--space-100) var(--space-100); border:1px solid var(--line, #e5e6de); border-radius:var(--radius-lg); background:var(--surface, #fffefa); color:var(--ink, #27332f); font:inherit; font-size:var(--text-sm); }
.sp-row-move { display:inline-flex; gap:var(--space-50); }
.sp-check { display:flex !important; align-items:center; gap:var(--space-100); font-size:var(--text-sm); }
.sp-check input { width:auto; margin:0; }
.sp-link-row { display:flex; flex-wrap:wrap; gap:var(--space-100); align-items:center; margin:var(--space-100) 0; }
.sp-link-row input { flex:1; min-width:220px; font-size:var(--text-xs); }
.sp-staff-button { margin-right:var(--space-100); }
.sp-change-inline { display:flex; align-items:center; gap:var(--space-100); font-size:var(--text-sm); font-weight:400; }
.sp-change-inline input { width:auto; margin:0; }
@media (max-width:700px) { .sp-service-row, .sp-override-grid { grid-template-columns:1fr; } .sp-bars { gap:1px; } .sp-staff-grid { grid-template-columns:1fr; } }
/* On a phone a service's name and description have the card's width: its status goes under them. */
@media (max-width:480px) { .sp-service-head { flex-direction:column; align-items:flex-start; gap:var(--space-75); } }

/* Not available (a wrong link, a page that isn't public, or the status page switched off): only the sentence. */
.sp-unavailable .public-header .login-brand, .sp-unavailable .sp-public-foot { display:none; }
.sp-unavailable .sp-unavailable-note { margin-top:var(--space-600); font-size:var(--text-md); text-align:center; }
#requesterPortalStatus .sp-section h2 { font-size:var(--text-xl); }

/* A partial outage apart from a major one (GitHub issue 203, Phase 1f; docs/adr/0086): terra for partial, the deeper
   red for major, in the bars, the pills and the legend. The banner is red only for a major outage (status-render.js
   STATUS_BANNER_TONE). In dark mode the partial outage takes the darker terra, so the two stay apart there too. */
.sp-bar.sp-part, .sp-key.is-part { background:var(--terra, #c96d55); }
.sp-bar.sp-bad, .sp-key.is-bad { background:var(--bad, #b03e2c); }
.sp-pill.sp-part { background:var(--terra-pale, #f7e4de); color:var(--bad, #b03e2c); }
.sp-pill.sp-bad { box-shadow:inset 0 0 0 1px var(--bad, #b03e2c); }
[data-theme="dark"] .sp-bar.sp-part, [data-theme="dark"] .sp-key.is-part { background:#c96d55; }
@media (prefers-color-scheme: dark) {
  body.sp-public .sp-bar.sp-part, body.sp-public .sp-key.is-part { background:#c96d55; }
}
