/* Simple dark theme for the POCSAG monitor. */
:root { color-scheme: dark; }
body { margin: 0; font: 14px system-ui, sans-serif; background: #12151a; color: #e4e7ec; }
header { display: flex; gap: 1.5rem; align-items: center; padding: .6rem 1rem; background: #1b2028; flex-wrap: wrap; }
header h1 { font-size: 1.1rem; margin: 0; }
nav { display: flex; gap: 1rem; flex: 1; }
a { color: #7cb7ff; text-decoration: none; }
main { padding: 1rem; }
.badge { padding: .15rem .6rem; border-radius: 1rem; background: #555; text-transform: uppercase; font-size: .75rem; }
.state-running { background: #1f8a4c; } .state-error { background: #b3261e; } .state-starting { background: #b58900; }
form.inline { display: inline; }
.filters { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.filters label { display: flex; flex-direction: column; gap: .2rem; }
input, select, button { background: #232a35; color: inherit; border: 1px solid #3a4352; border-radius: 4px; padding: .35rem .5rem; }
button { cursor: pointer; }
table.messages { width: 100%; border-collapse: collapse; }
.messages th, .messages td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid #262d38; vertical-align: top; }
.messages td.text { white-space: pre-wrap; word-break: break-word; }
.messages .event-id { text-decoration: underline; }
.agency { white-space: nowrap; }
.agency-link { color: inherit; }
.agency-category { display: inline-block; padding: .2rem .4rem; border-radius: 4px; font-weight: 600; }
.icon { width: 22px; height: 22px; border-radius: 4px; vertical-align: middle; margin-right: .3rem; object-fit: contain; }
.icon.fallback { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: bold; font-size: .8rem; }
.unassigned-icon { display: none !important; background: #555; }
.add-capcode { margin-left: .25rem; }
.mobile-capcode { display: none; }
.mono { font-family: ui-monospace, monospace; }
.muted { color: #8b95a5; }
.pager { margin-top: 1rem; display: flex; gap: 1rem; }
.raw { background: #0b0d10; padding: .6rem; height: 70vh; overflow: auto; margin-top: .5rem; font-size: 12px; }
canvas#wf { width: 100%; max-width: 1024px; height: 400px; background: #000; image-rendering: pixelated; display: block; }
.waterfall-plot { position: relative; width: 100%; max-width: 1024px; }
.listening-band { position: absolute; top: 0; bottom: 0; border-left: 2px solid #ffd45a; border-right: 2px solid #ffd45a; background: rgba(255, 212, 90, .12); pointer-events: none; box-sizing: border-box; }
.audio-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: .75rem; }
.signal-metrics { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.axis { display: flex; justify-content: space-between; max-width: 1024px; font-size: 12px; color: #8b95a5; }
.flash { background: #1f3b2a; padding: .5rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
form.settings > div { display: grid; grid-template-columns: 220px 1fr; gap: .2rem 1rem; margin-bottom: .7rem; }
form.settings .helptext { grid-column: 2; color: #8b95a5; font-size: .85rem; }
form.settings textarea { background: #232a35; color: inherit; border: 1px solid #3a4352; border-radius: 4px; padding: .35rem .5rem; }
.settings-page { max-width: 1100px; }
.settings-section { background: #1b2028; border: 1px solid #303a48; border-radius: 6px; margin: .75rem 0; }
.settings-section summary { cursor: pointer; display: flex; align-items: baseline; gap: .75rem; padding: .85rem 1rem; font-size: 1rem; font-weight: 600; }
.settings-section summary::before { content: "\25b6"; font-size: .65rem; color: #8b95a5; }
.settings-section[open] summary::before { content: "\25bc"; }
.settings-section summary small { color: #aab4c3; font-size: .85rem; font-weight: 400; }
.settings-content { padding: .1rem 1rem 1rem; border-top: 1px solid #303a48; }
.settings-content p { line-height: 1.5; }
form.settings-organized > div:not(.category-settings), form.settings-organized .settings-field { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); align-items: center; gap: .3rem 1rem; margin-bottom: .75rem; }
form.settings-organized .settings-field input:not([type="checkbox"]):not([type="color"]), form.settings-organized .settings-field select, form.settings-organized .settings-field textarea { width: 100%; max-width: 32rem; box-sizing: border-box; }
form.settings-organized input[type="checkbox"] { width: 18px; height: 18px; padding: 0; margin: 0; justify-self: start; }
form.settings-organized input[type="color"] { width: 3rem; height: 2rem; padding: 2px; }
form.settings-organized .helptext, form.settings-organized .field-errors { grid-column: 2; }
.field-errors, .errorlist { color: #ff9a9a; }
.category-settings { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important; gap: .75rem; margin: 1rem 0; }
.category-settings fieldset { min-width: 0; border: 1px solid #3a4352; border-radius: 4px; padding: .75rem; }
.category-settings legend { font-weight: 600; padding: 0 .25rem; }
form.settings-organized .category-settings .settings-field { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 700px) {
  .messages .message-date, .messages .agency-name, .messages .message-capcode { display: none; }
  .messages .mobile-capcode { display: block; white-space: normal; overflow-wrap: anywhere; max-width: 7rem; }
  .messages .unassigned-icon { display: inline-flex !important; }
  .messages .agency .icon { margin-right: 0; }
  .messages th, .messages td { padding: .4rem .3rem; }
  .messages td.text { min-width: 0; }
  .settings-section summary { flex-wrap: wrap; }
  form.settings-organized > div:not(.category-settings), form.settings-organized .settings-field { grid-template-columns: minmax(0, 1fr); }
  form.settings-organized .helptext, form.settings-organized .field-errors { grid-column: 1; }
}
