/* PassBell Operator. Colours are the brand tokens (brand/tokens.css). Large, simple controls; colour is never the only signal. */
:root {
  --ink: #0E1320; --night: #151B2B; --night2: #1D2538; --white: #FFFFFF; --mist: #F5F7FA;
  --steel: #5A6376; --steel-light: #D9DEE8; --blue: #0B5FFF; --blue-deep: #0A3FB8; --blue-sky: #5B93FF;
  --aegean: #EAF1FF; --brass: #F5A623; --brass-deep: #8A5A00; --brass-tint: #FFF3DC;
  --ready: #168538; --alert: #D92D48; --alert-deep: #B3162F;
  --bg: var(--mist); --card: var(--white); --text: var(--ink); --muted: var(--steel); --line: var(--steel-light);
  --link: var(--blue); --focus: var(--blue-deep);
  --display: 'Fira Sans Extra Condensed', 'Fira Sans Condensed', 'Arial Narrow', Arial, sans-serif;
  --body: 'Fira Sans', 'Segoe UI', system-ui, Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--ink); --card: var(--night); --text: var(--white); --muted: #A9B2C6; --line: var(--night2);
    --link: var(--blue-sky); --focus: var(--blue-sky); --ready: #1E9E4A; --alert: #FF6B81;
  }
}
* { box-sizing: border-box; }
html { font-size: 15.5px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); line-height: 1.45; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: .01em; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
a { color: var(--link); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; word-break: break-all; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.top { background: var(--ink); color: var(--white); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 6px 16px; border-bottom: 3px solid var(--brass); }
.brand { display: flex; align-items: center; gap: 10px; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 1.4rem; }
.wordmark b { color: var(--blue-sky); font-weight: 800; }
.tag { background: var(--brass); color: var(--ink); font-weight: 700; font-size: .75rem; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .06em; }
.who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top .muted { color: #A9B2C6; }

main { max-width: 1100px; margin: 0 auto; padding: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 0 0 12px; }
.center { text-align: left; max-width: 360px; margin: 48px auto; padding: 22px; }
.center h1 { font-size: 1.4rem; }
.center p { color: var(--muted); margin: 0 0 16px; }
.center .btn { width: 100%; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

#tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
#tabs button { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
#tabs button[aria-current="page"] { background: var(--blue); border-color: var(--blue); color: var(--white); }

button, .btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; }
.primary { background: var(--blue); border-color: var(--blue); color: var(--white); }
.caution { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.danger { background: var(--alert-deep); border-color: var(--alert-deep); color: var(--white); }
.ghost { background: transparent; }
.big { min-height: 46px; font-size: 1rem; }
button.small { min-height: 32px; padding: 0 10px; font-size: .85rem; }
.top button.ghost { color: var(--white); border-color: #44506b; }
button[disabled] { opacity: .45; cursor: not-allowed; }
#tabs button, .top button { padding-left: 14px; padding-right: 14px; }

label { display: block; font-weight: 600; margin: 0 0 10px; }
label > span { display: block; margin-bottom: 4px; }
textarea { width: 100%; font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--steel); background: var(--card); color: var(--text); resize: vertical; }
input, select { width: 100%; min-height: 40px; font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--steel); background: var(--card); color: var(--text); }
input[type="checkbox"] { width: 28px; min-height: 28px; height: 28px; vertical-align: middle; margin-right: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: .85rem; border: 2px solid currentColor; }
.badge.ok { color: var(--ready); } .badge.warn { color: var(--brass-deep); background: var(--brass-tint); } .badge.bad { color: var(--alert); } .badge.off { color: var(--muted); }
@media (prefers-color-scheme: dark) { .badge.warn { color: var(--brass); background: transparent; } }
.attention { list-style: none; padding: 0; margin: 0; }
.attention li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.attention li:last-child { border: 0; }
.big-number { font-family: var(--display); font-weight: 900; font-size: 2rem; line-height: 1; }
.bars .i { fill: var(--blue); } .bars .r { fill: var(--alert); } .bars text { fill: var(--muted); font-size: 10px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.scroll { overflow-x: auto; }
details summary { cursor: pointer; color: var(--link); }
.warn { color: var(--alert); font-weight: 700; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--white); border: 2px solid var(--brass); padding: 14px 22px; border-radius: 12px; font-weight: 700; z-index: 20; max-width: 92vw; }
#toast.bad { border-color: var(--alert); }

dialog { border: 2px solid var(--blue); border-radius: 12px; padding: 18px; max-width: 520px; width: 92vw; background: var(--card); color: var(--text); }
dialog::backdrop { background: rgba(14, 19, 32, .65); }
dialog ul { padding-left: 1.2em; }
dialog .row { justify-content: flex-end; margin-top: 12px; }

@media (max-width: 600px) { html { font-size: 16px; } main { padding: 10px; } .top { padding: 6px 10px; } }
/* Fingers need bigger targets than a mouse. */
@media (pointer: coarse) { button, .btn, input, select, #tabs button { min-height: 44px; } button.small { min-height: 40px; } }
@media (prefers-reduced-motion: no-preference) { button, .btn { transition: background-color .15s; } }

/* Outreach: filters in one row, a two-column settings form, a star that reads as a toggle, action buttons that wrap */
.row.wrap { flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 14px; }
.grid2 label { display: block; }
.grid2 input { width: 100%; }
label.inline { display: inline-flex; align-items: center; gap: 6px; }
button.star { font-size: 1.3rem; line-height: 1; padding: 2px 8px; color: var(--brass); }
button.star[aria-pressed="false"] { color: var(--muted); }
td.acts { white-space: nowrap; }
td.acts button { margin: 2px 4px 2px 0; }
#orBody { width: 100%; font-family: var(--body); font-size: .95rem; }
