/* Plain CSS, no build step — the same choice the other internal tools here make. */
:root {
  --ink: #16202a; --muted: #5b6b7a; --line: #d8e0e8; --bg: #f6f8fa; --panel: #fff;
  --warn: #b26b00; --high: #b03030; --ok: #1f7a4d; --doubt: #7a5c00;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
       color: var(--ink); background: var(--bg); }
header { display: flex; align-items: center; gap: 1.5rem; padding: .75rem 1.25rem;
         background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
h1 { font-size: 1.05rem; margin: 0; letter-spacing: .01em; }
nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
nav a { padding: .35rem .7rem; border-radius: 6px; color: var(--muted); text-decoration: none; }
nav a:hover { background: var(--bg); }
nav a.current { background: var(--ink); color: #fff; }
/* Phone: title and sign-out on one row, the menu below as one swipeable row. */
@media (max-width: 720px) {
  header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; padding: .6rem 1rem; }
  nav { grid-column: 1 / -1; grid-row: 2; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none; margin: 0 -1rem; padding: 0 1rem; }
  nav::-webkit-scrollbar { display: none; }
  nav a { white-space: nowrap; padding: .5rem .75rem; }
  main { padding: 1rem; }
}
main { padding: 1.25rem; max-width: 1320px; }
button { font: inherit; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 6px;
         background: var(--panel); cursor: pointer; }
button:hover { border-color: var(--muted); }
h2 { font-size: 1.15rem; margin: 0 0 .25rem; }
h3 { font-size: .95rem; margin: 1.25rem 0 .5rem; }
.muted { color: var(--muted); }

/* Section 26: every screen states the time it describes and the zone it is in. */
.stamp { display: flex; gap: .6rem; align-items: baseline; color: var(--muted);
         font-size: .85rem; margin: .1rem 0 1rem; }
.stamp .tz { padding: .05rem .4rem; border: 1px solid var(--line); border-radius: 4px; }

/* Rendered even when empty. A screen with no panel and a screen with nothing wrong look the
   same, and only one of them is true. */
.uncertainty { border: 1px solid var(--line); border-left-width: 4px; border-radius: 6px;
               padding: .6rem .9rem; margin: 0 0 1.25rem; background: var(--panel); }
.uncertainty.has-doubt { border-left-color: var(--doubt); }
.uncertainty.clear { border-left-color: var(--ok); }
.uncertainty h3 { margin: 0 0 .3rem; }
.uncertainty ul { margin: .2rem 0 0; padding-left: 1.1rem; }

/* Incident detail: what happened, in words, the case behind it, and where to look. */
a.button { display: inline-block; padding: .6rem 1rem; border-radius: 8px; background: var(--ink);
           color: var(--panel); text-decoration: none; font-weight: 600; white-space: nowrap; }
a.button:hover { opacity: .9; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; margin-bottom: 1rem; }
.detail-head h2 { margin: 0 0 .5rem; line-height: 1.25; }
.detail-head > div { min-width: 0; }
.detail-head code { overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.badge { border: 1px solid var(--line); background: var(--panel); border-radius: 4px; padding: .15rem .55rem; font-size: .8rem; }
.badge.strong { border-color: var(--ink); font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.detail-grid .main, .detail-grid .side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } .detail-head { flex-direction: column; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; }
.panel > table { border: 0; }
.detail-grid .panel { overflow-x: auto; min-width: 0; }
.detail-grid .panel td, .detail-grid .panel code { overflow-wrap: anywhere; }
.detail-grid .panel th { white-space: nowrap; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.panel-head h4 { margin: .9rem 0 .4rem; }
.eyebrow { margin: 0 0 .6rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 1.05rem; line-height: 1.55; margin: 0 0 .9rem; }
.late-text { color: var(--high); }
.waitbar .track { position: relative; height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.waitbar .ok { position: absolute; left: 0; top: 0; height: 100%; background: var(--warn); }
.waitbar .late { position: absolute; top: 0; height: 100%; background: var(--high); }
.waitbar .mark { position: absolute; top: 0; width: 2px; height: 100%; background: var(--ink); }
.waitbar .legend { display: flex; justify-content: space-between; gap: 1rem; font-size: .8rem; color: var(--muted); margin-top: .35rem; flex-wrap: wrap; }
.now { display: flex; gap: .6rem; align-items: baseline; background: var(--bg); border-radius: 8px; padding: .55rem .8rem; margin: .9rem 0 0; }
.dot { width: 8px; height: 8px; border-radius: 4px; flex-shrink: 0; }
.dot.dot-late, .dot-late { background: var(--high); } .dot.dot-ok, .dot-ok { background: var(--ok); }
.cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line);
         border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cells .cell { background: var(--panel); padding: .7rem .9rem; display: flex; flex-direction: column; gap: .15rem; }
.cells .k { font-size: .75rem; color: var(--muted); }
.cells .v { font-weight: 600; overflow-wrap: anywhere; }
.cells .s { font-size: .8rem; color: var(--muted); }
.cells .s.good { color: var(--ok); } .cells .s.bad { color: var(--high); }
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.msg { display: flex; flex-direction: column; gap: .2rem; }
.msg.in { align-items: flex-start; } .msg.out { align-items: flex-end; }
.msg .meta { font-size: .75rem; color: var(--muted); }
.bubble { padding: .5rem .8rem; border-radius: 10px; max-width: 75%; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.in { background: #e6f4ee; border-bottom-left-radius: 2px; }
.bubble.out { background: #eef2f6; border-bottom-right-radius: 2px; }
.bubble.bot { background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.bubble.note { background: #fff6e0; }
.bubble.ghost { border: 1px dashed var(--line); color: var(--muted); background: transparent; }
.panel .why { border: 0; padding: 0; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: .75rem 1.25rem; }
.panel .why dt { margin-top: .1rem; }
.panel .why dd { margin: 0; line-height: 1.5; }
.panel .why dd ul { margin: 0; padding-left: 1.1rem; }
.panel .why dd p { margin: .2rem 0 0; }
@media (max-width: 640px) { .panel .why { grid-template-columns: minmax(0, 1fr); gap: .2rem; } .panel .why dd { margin-bottom: .6rem; } }
.technical { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.technical summary { cursor: pointer; font-weight: 600; }
.technical dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: .4rem 1rem; margin: .75rem 0 .5rem; font-size: .9rem; }
.technical dd { margin: 0; overflow-wrap: anywhere; }
.technical code { background: var(--bg); padding: .05rem .35rem; border-radius: 4px; display: inline-block; margin: 0 .2rem .2rem 0; }
.technical dd ul { margin: 0; padding-left: 1rem; }
/* Incident list */
.list-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs { display: flex; gap: .25rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .25rem; }
.tab { font: inherit; border: 0; background: transparent; padding: .5rem .9rem; border-radius: 6px; cursor: pointer; color: var(--muted); min-height: 36px; }
.tab.active { background: var(--ink); color: var(--panel); font-weight: 600; }
.filters summary { cursor: pointer; padding: .55rem 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; }
.tile .n { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.tile .k { color: var(--muted); font-size: .85rem; }
.tile.bad .n { color: var(--high); }
.incident-list td { vertical-align: top; }
.incident-list tr.closed td { color: var(--muted); }
.row-title { font-weight: 600; color: var(--ink); text-decoration: none; }
.row-title:hover { text-decoration: underline; }
.row-sub { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .1rem .6rem; margin-top: .2rem; }
.row-sub code { font-size: .75rem; }
.status { font-size: .85rem; }
.status.bad { color: var(--high); font-weight: 600; } .status.warn { color: var(--warn); } .status.good { color: var(--ok); }
@media (max-width: 800px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .incident-list { display: block; overflow-x: auto; } }
/* Commands on the incident detail, and the list filters: one field style. */
.commands { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.commands label, .filter-row label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
.commands label { margin-bottom: .7rem; }
.commands input, .commands select, .filter-row input, .filter-row select {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid #b7c3cf; border-radius: 6px;
  padding: .55rem .65rem; min-height: 40px; box-sizing: border-box; }
.commands input, .commands select { width: 100%; }
.commands input:focus, .commands select:focus, .filter-row input:focus, .filter-row select:focus {
  outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.btn { font: inherit; font-weight: 600; border-radius: 8px; padding: .6rem 1rem; min-height: 44px; cursor: pointer;
       border: 1px solid #b7c3cf; background: var(--panel); color: var(--ink); width: 100%; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.btn:hover { opacity: .92; }
.cmd-primary { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .4rem; }
.cmd-primary p { margin: 0; font-size: .85rem; }
details.cmd { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
details.cmd > summary { list-style: none; cursor: pointer; padding: .7rem .9rem; font-weight: 600; display: flex;
  justify-content: space-between; align-items: center; min-height: 24px; }
details.cmd > summary::-webkit-details-marker { display: none; }
details.cmd > summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s; margin-right: .2rem; }
details.cmd[open] > summary::after { transform: rotate(-135deg); }
details.cmd[open] > summary { border-bottom: 1px solid var(--line); }
.cmd-body { padding: .8rem .9rem .9rem; }
.cmd-body > p { margin: 0 0 .8rem; font-size: .85rem; line-height: 1.45; }
.filter-row button { font: inherit; font-weight: 600; border-radius: 6px; padding: .55rem 1rem; min-height: 40px; cursor: pointer;
  background: var(--ink); color: var(--panel); border: 1px solid var(--ink); align-self: flex-end; }
/* Overview: support health */
.ov { display: flex; flex-direction: column; gap: 1rem; }
.ov-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; flex-wrap: wrap; }
.ov-head h2 { margin: 0; }
.ov-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ov-meta .stamp { margin: 0; }
.ov-verdict { border-radius: 10px; padding: 1rem 1.25rem; background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--muted); }
.ov-verdict p { margin: .3rem 0 0; font-size: 1.02rem; }
.ov-verdict-title { font-size: 1.35rem; font-weight: 700; }
.ov-verdict .ov-verdict-note { font-size: .88rem; color: var(--muted); }
.ov-verdict.bad { border-left-color: var(--high); } .ov-verdict.bad .ov-verdict-title { color: var(--high); }
.ov-verdict.warn { border-left-color: var(--warn); } .ov-verdict.warn .ov-verdict-title { color: var(--warn); }
.ov-verdict.good { border-left-color: var(--ok); } .ov-verdict.good .ov-verdict-title { color: var(--ok); }
.ov-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.ov-tile { display: flex; flex-direction: column; gap: .15rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: .85rem 1rem; color: var(--ink); text-decoration: none; min-height: 44px; }
a.ov-tile:hover { border-color: var(--ink); }
.ov-tile .n { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ov-tile .k { font-weight: 600; }
.ov-tile .s { font-size: .8rem; color: var(--muted); }
.ov-tile.bad .n { color: var(--high); } .ov-tile.warn .n { color: var(--warn); }
.ov-action { border-left: 4px solid var(--high); }
.ov-action ul { margin: 0; padding-left: 1.1rem; } .ov-action li { margin: .2rem 0; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.ov-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.ov-big { font-size: 1.05rem; margin: .1rem 0 .8rem; }
.ov-big strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.ov-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--bg); gap: 2px; margin-bottom: .7rem; }
.ov-bar span { min-width: 6px; }
.ov-bar .bad, .dot.bad { background: var(--high); } .ov-bar .warn, .dot.warn { background: var(--warn); }
.ov-bar .good, .dot.good { background: var(--ok); } .ov-bar .unknown, .dot.unknown { background: #9aa8b5; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 5px; background: var(--line); flex-shrink: 0; }
.ov-legend { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.ov-legend li { display: flex; align-items: center; gap: .55rem; }
.ov-legend li strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.ov-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.ov-chip { border: 1px solid var(--line); border-radius: 999px; padding: .25rem .75rem; font-size: .85rem; background: var(--bg); }
.ov-sources { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.ov-sources li { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.ov-sources li .muted { font-size: .85rem; margin-left: auto; }
.ov-caveats summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }
.ov-caveats ul { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .88rem; color: var(--muted); }
.ov-overrides { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.ov-overrides li { border-top: 1px solid var(--line); padding-top: .6rem; }
@media (max-width: 900px) { .ov-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .ov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-tile .n { font-size: 1.6rem; }
  .ov-verdict-title { font-size: 1.15rem; }
}
.chat-list { list-style: none; margin: .4rem 0 .8rem; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.chat-list li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .45rem .6rem; background: var(--bg); border-radius: 6px; }
.chat-list .chat-main { flex: 1 1 14rem; min-width: 0; }
.linklike { background: none; border: 0; padding: .5rem 0; color: var(--ink); text-decoration: underline; cursor: pointer; font: inherit; }
@media (max-width: 640px) { .cells { grid-template-columns: minmax(0, 1fr); } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; }
.card .n { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.card .k { color: var(--muted); font-size: .85rem; }

table { width: 100%; border-collapse: collapse; background: var(--panel);
        border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: none; }

.sev-CRITICAL, .sev-HIGH { color: var(--high); font-weight: 600; }
.sev-WARN { color: var(--warn); }
.sev-INFO { color: var(--muted); }

/* The "why?" panel. Rule, threshold, evidence and action rationale — Section 26 names all four. */
.why { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1.1rem; }
.why dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: .6rem; }
.why dd { margin: .15rem 0 0; }
.why code { background: var(--bg); padding: .05rem .3rem; border-radius: 4px; }

.error { border: 1px solid var(--high); border-left-width: 4px; border-radius: 6px;
         padding: .7rem 1rem; background: var(--panel); }
.error h3 { margin-top: 0; color: var(--high); }

#gate { max-width: 460px; margin: 15vh auto; background: var(--panel); padding: 1.5rem;
        border: 1px solid var(--line); border-radius: 10px; }
#gate form { display: grid; gap: .5rem; margin: 1rem 0; }
#gate input { font: inherit; padding: .5rem; border: 1px solid var(--line); border-radius: 6px; }

/* Sign-in gate */
.gate-error { color: #b00020; }
#sso-login { display: block; margin: 12px 0 16px; }
#gate details { margin-bottom: 12px; }
.card.bad .n { color: var(--high); }
.card.warn .n { color: var(--warn); }
/* Queues & SLA */
.pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.bad { color: var(--high); border-color: var(--high); }
.pill.warn { color: var(--warn); border-color: var(--warn); }
.pill.good { color: var(--ok); border-color: var(--ok); }
.small { font-size: .8rem; }
.callout { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: .7rem 1rem; margin: .5rem 0 .75rem; }
.callout.bad { border-left-color: var(--high); }
.callout.warn { border-left-color: var(--warn); }
.button.small { padding: .2rem .6rem; font-size: .8rem; }
