/* Scheduled Services Log (Story 5612). Phone-first and dense: one line of headline and filter
   chips, then the services grouped by what runs them. Pinned chrome -- only .ss-body scrolls. */

:root {
    --ss-ink:    #1e2530;
    --ss-muted:  #667085;
    --ss-line:   #e3e7ee;
    --ss-bg:     #f2f4f8;
    --ss-card:   #ffffff;
    --ss-head:   #1f2a37;
    --ss-ok:     #2f8a4c;
    --ss-warn:   #c58a10;
    --ss-bad:    #c43d3d;
    --ss-run:    #2a6fb0;
    --ss-off:    #98a2b3;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ss-bg); color: var(--ss-ink);
       font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

.page-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
#lwIconBand, .ct-header, .ss-summary { flex: 0 0 auto; }

.ct-header { display: flex; align-items: center; gap: 8px; background: var(--ss-head); color: #fff; padding: 8px 12px; }
.ct-header h1 { margin: 0; font-size: 16px; font-weight: 800; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-header button {
    font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
    background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 999px; padding: 5px 12px;
}
.ct-header button:disabled { opacity: .55; }

.ss-summary { background: var(--ss-card); border-bottom: 1px solid var(--ss-line); padding: 8px 12px; }
.ss-headline { font-size: 13px; color: var(--ss-muted); margin-bottom: 6px; }
.ss-headline b { color: var(--ss-ink); font-size: 14px; }
.ss-headline .bad { color: var(--ss-bad); font-weight: 800; }
.ss-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ss-chips .sp { flex: 1 1 auto; }
.ss-chip {
    font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid var(--ss-line); background: #fff; color: var(--ss-ink); border-radius: 999px; padding: 4px 10px;
}
.ss-chip .d { width: 8px; height: 8px; border-radius: 50%; }
.ss-chip.on { background: var(--ss-head); color: #fff; border-color: var(--ss-head); }
.ss-chip.ghost { border-style: dashed; color: var(--ss-muted); }

.ss-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 8px 24px; }
.ss-empty { padding: 18px 12px; color: var(--ss-muted); font-size: 14px; }
.ss-err { color: var(--ss-bad); }

.ss-group { background: var(--ss-card); border: 1px solid var(--ss-line); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.ss-group-head {
    width: 100%; display: flex; align-items: center; gap: 8px; font: inherit; text-align: left; cursor: pointer;
    background: transparent; border: 0; padding: 9px 10px; color: var(--ss-ink);
}
.ss-group-head .car { width: 14px; color: var(--ss-muted); font-size: 12px; }
.ss-group-head .nm { flex: 1 1 auto; font-weight: 800; font-size: 14px; }
.ss-group-head .ct { font-size: 12px; color: var(--ss-muted); font-weight: 700; }
.ss-group.closed .ss-group-body { display: none; }
.ss-group-body { border-top: 1px solid var(--ss-line); }

.ss-svc { border-bottom: 1px solid var(--ss-line); border-left: 4px solid var(--ss-ok); }
.ss-svc:last-child { border-bottom: 0; }
.ss-svc.st-failed, .ss-svc.st-overdue, .ss-svc.st-abandoned { border-left-color: var(--ss-bad); background: #fff5f5; }
.ss-svc.st-slow, .ss-svc.st-warning { border-left-color: var(--ss-warn); background: #fffaf0; }
.ss-svc.st-running { border-left-color: var(--ss-run); }
.ss-svc.st-pending, .ss-svc.st-off { border-left-color: var(--ss-off); }
.ss-svc.st-off .ss-name { color: var(--ss-muted); }

.ss-svc-head {
    width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
    font: inherit; text-align: left; background: transparent; border: 0; padding: 7px 10px; cursor: pointer; color: var(--ss-ink);
}
.ss-main { min-width: 0; }
.ss-name { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-state { display: block; font-size: 12px; color: var(--ss-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-svc.open .ss-state { white-space: normal; }
.ss-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ss-took { font-size: 12px; font-weight: 800; white-space: nowrap; }
.ss-vs { font-size: 11px; font-weight: 800; white-space: nowrap; color: var(--ss-muted); }
.ss-vs.slower { color: var(--ss-bad); } .ss-vs.faster { color: var(--ss-ok); }
.ss-bars { display: block; }

.ss-detail { display: none; padding: 0 10px 10px; }
.ss-svc.open .ss-detail { display: block; }
.ss-msg { font-size: 13px; line-height: 1.45; border-radius: 8px; padding: 7px 9px; margin: 2px 0 8px; background: #f4f6fa; word-break: break-word; }
.st-failed .ss-msg, .st-overdue .ss-msg, .st-abandoned .ss-msg { background: #fbe3e3; }
.st-slow .ss-msg, .st-warning .ss-msg { background: #fdf0d8; }
.ss-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px; margin: 4px 0 8px; }
.ss-stat { background: #f7f8fb; border-radius: 8px; padding: 5px 7px; min-width: 0; }
.ss-stat .k { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--ss-muted); font-weight: 700; }
.ss-stat .v { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-chart { width: 100%; height: 84px; display: block; margin: 2px 0 6px; }
.ss-about { font-size: 12px; color: var(--ss-muted); line-height: 1.45; margin: 2px 0 6px; }
.ss-about b { color: var(--ss-ink); }

.ss-runs { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; table-layout: fixed; }
.ss-runs th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--ss-muted); padding: 3px 4px; }
.ss-runs td { padding: 5px 4px; border-top: 1px solid var(--ss-line); vertical-align: top; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-runs tr.run { cursor: pointer; }
.ss-runs td.w { width: 98px; } .ss-runs td.t { width: 62px; text-align: right; } .ss-runs td.o { width: 74px; font-weight: 800; }
.ss-runs th.w { width: 98px; } .ss-runs th.t { width: 62px; text-align: right; } .ss-runs th.o { width: 74px; }
.ss-runs .o-Succeeded { color: var(--ss-ok); } .ss-runs .o-Warning { color: var(--ss-warn); }
.ss-runs .o-Failed, .ss-runs .o-Abandoned { color: var(--ss-bad); } .ss-runs .o-Running { color: var(--ss-run); }
.ss-runs .o-Skipped { color: var(--ss-muted); }
.ss-runs tr.more td { white-space: normal; background: #f7f8fb; color: var(--ss-muted); font-size: 11px; line-height: 1.5; }
.ss-runs tr.more b { color: var(--ss-ink); }
.ss-linkbtn {
    font: inherit; font-size: 12px; font-weight: 700; color: var(--ss-run); background: transparent;
    border: 1px solid var(--ss-line); border-radius: 999px; padding: 4px 10px; cursor: pointer; margin-top: 6px;
}
.ss-flash { animation: ss-flash 1.8s ease-out 1; }
@keyframes ss-flash { 0% { background: #fff3b0; } 100% { background: transparent; } }

@media (min-width: 900px) {
    .ss-body { padding: 10px 16px 24px; }
    .ss-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
