/* © PlanB SPC. All rights reserved. pb.planb.om station panel styles. */
:root {
  --bg: #0b0d0c; --card: #141816; --line: #232a26; --fg: #e8ece9; --muted: #8f9993;
  --accent: #76b94f; --accent-ink: #0b0d0c; --bad: #e0675a; --warn: #e3b448; --ok: #76b94f;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f6f4; --card: #ffffff; --line: #dfe5e1; --fg: #141816; --muted: #5d6862;
    --accent: #0d8437; --accent-ink: #ffffff; color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 400 15px/1.6 var(--planb-font); display: flex; flex-direction: column; overflow: hidden; }
#scroller { flex: 1; overflow-y: auto; padding: 16px 16px 0; -webkit-overflow-scrolling: touch; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); background: var(--card);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 17px; }
.brand img { height: 24px; width: auto; }
.top-end { display: flex; align-items: center; gap: 10px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0 auto 16px; max-width: 1100px; }
.card.narrow { max-width: 380px; text-align: center; margin-top: 8vh; }
.card.narrow .planb-logo { margin: 0 auto 8px; }
h1 { font-size: 20px; margin: 6px 0 16px; font-weight: 400; }
h2 { font-size: 17px; margin: 0 0 6px; font-weight: 400; }
.muted { color: var(--muted); margin: 0 0 10px; font-size: 13.5px; }
.warn { color: var(--warn); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; align-items: flex-start; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); text-align: start; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); }
input[type=password], input:not([type]), input[type=text] {
  font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0;
}
#rawHex { flex: 1; }
small { color: var(--muted); font-size: 12px; }
form#loginForm { display: flex; flex-direction: column; gap: 12px; }

button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--fg); padding: 9px 16px; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.ghost { padding: 6px 12px; font-size: 13px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.msg { min-height: 1.4em; margin: 8px 0 0; font-size: 13.5px; }
.msg.bad { color: var(--bad); } .msg.good { color: var(--ok); }
.note { background: rgba(227, 180, 72, .12); border: 1px solid rgba(227, 180, 72, .35); color: var(--fg); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; font-size: 13.5px; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(118, 185, 79, .18); }
.kv { display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 8px 22px; }
.kv div { display: flex; flex-direction: column; font-size: 13px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 400; unicode-bidi: plaintext; text-align: start; word-break: break-all; }
.kv b[dir="ltr"] { unicode-bidi: isolate; }

.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.slot { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; background: var(--bg); }
.slot .n { font-size: 22px; }
.slot .s { font-size: 12px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: start; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 400; }
td.hex { font-family: ui-monospace, Consolas, monospace; direction: ltr; white-space: normal; word-break: break-all; min-width: 200px; }
.st-sent { color: var(--ok); } .st-failed, .st-blocked { color: var(--bad); } .st-queued, .st-sending { color: var(--warn); }

.events { max-height: 420px; overflow-y: auto; font-family: ui-monospace, Consolas, monospace; font-size: 12px; direction: ltr; text-align: left; }
.ev { border-bottom: 1px dashed var(--line); padding: 6px 2px; }
.ev .h { color: var(--muted); }
.ev .d { display: inline-block; min-width: 3.4em; font-weight: 700; }
.ev .d.in { color: #6cb6ff; } .ev .d.out { color: var(--accent); } .ev .d.up { color: #c792ea; } .ev .d.down { color: #ffcb6b; } .ev .d.sys { color: var(--muted); }
.ev .x { word-break: break-all; } .ev .t { color: var(--muted); word-break: break-all; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid .wide { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .slots { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 14px; }
}
