/* Dashboard (SmartOLT-style), OLT pages, charts with hover. Uses the colour variables from index.html. */
.dashgrid { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:var(--s4,1rem); align-items:start; }
@media (max-width:980px) { .dashgrid { grid-template-columns:minmax(0,1fr); } }
.dashgrid .panel > h3 { display:flex; align-items:center; justify-content:flex-start; gap:.5rem; margin-top:0; }
.dashgrid .panel > h3 .sp { flex:1; }
.cards .card small { display:block; opacity:.92; }
.cardsub { display:flex; justify-content:space-between; gap:.5rem; font-size:.78rem; opacity:.92; margin-top:.15rem; }
.freshness { text-align:right; font-size:.8rem; color:var(--mute); margin:-.25rem 0 .6rem; display:flex; justify-content:flex-end; align-items:center; gap:.6rem; }
.freshness .led { width:.55rem; height:.55rem; border-radius:50%; background:var(--green); display:inline-block; margin-right:.25rem; }
.freshness .led.old { background:var(--amber); }

/* icon buttons in panel headers */
.ibtn { background:transparent; border:0; color:var(--mute); padding:.2rem .35rem; min-height:0; border-radius:var(--r-sm,6px); cursor:pointer; font-size:1rem; line-height:1; }
.ibtn:hover { color:var(--text); background:var(--inset); }
.ibtn svg { width:1.05rem; height:1.05rem; display:block; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.menu { position:relative; display:inline-block; }
.menu > .items { position:absolute; right:0; top:100%; z-index:30; margin-top:.2rem; min-width:11rem; background:var(--panel-solid); border:1px solid var(--line); border-radius:var(--r-sm,6px); box-shadow:0 8px 24px rgba(0,0,0,.3); padding:.25rem; }
.menu .items button { display:block; width:100%; text-align:left; background:transparent; color:var(--text); border-radius:4px; padding:.4rem .6rem; font-weight:400; min-height:0; }
.menu .items button:hover, .menu .items button.on { background:var(--inset); }
.menu .items button.on::before { content:"✓ "; color:var(--green); }

/* hover charts */
.mchart .chwrap { position:relative; }
.mchart .tip, .barchart .tip { position:absolute; pointer-events:none; background:var(--panel-solid); color:var(--text); border:1px solid var(--line); border-radius:6px; padding:.4rem .6rem; font-size:.8rem; box-shadow:0 6px 18px rgba(0,0,0,.35); z-index:5; white-space:nowrap; }
.mchart .tip i, .barchart .tip i { display:inline-block; width:.6rem; height:.6rem; border-radius:2px; margin-right:.35rem; }
.mchart svg .xh { stroke:var(--mute); stroke-width:1; stroke-dasharray:3 3; }
.mchart svg .dotp { stroke:var(--panel-solid); stroke-width:1.5; }

/* bar chart */
.barchart { position:relative; }
.barchart svg { width:100%; height:auto; display:block; }
.barchart .gl { stroke:var(--line); stroke-width:1; }
.barchart .tx { fill:var(--mute); font-size:11px; }
.barchart rect.bb { fill:#2f6bff; transition:fill .12s; }
.barchart rect.bb:hover, .barchart rect.bb.hot { fill:#6c9bff; }
.barchart rect.hit { fill:transparent; }

/* PON outage window */
.outwin .osec { border-top:1px solid var(--line); }
.outwin .osec:first-of-type { border-top:0; }
.outwin .ohead { display:flex; align-items:center; gap:.5rem; padding:.55rem .2rem; cursor:pointer; user-select:none; }
.outwin .ohead:hover { background:var(--inset); }
.outwin .oico { width:1.25rem; text-align:center; }
.outwin .ostate { margin-left:.2rem; font-size:.85rem; }
.outwin .ostate.ok { color:var(--green); }
.outwin .ostate.bad { color:#fff; background:var(--red); border-radius:999px; padding:0 .5rem; font-size:.75rem; font-weight:700; }
.outwin .ostate.warn { color:#1a1200; background:var(--amber); border-radius:999px; padding:0 .5rem; font-size:.75rem; font-weight:700; }
.outwin .obody .okline { color:var(--mute); }
.outwin .orow { padding:.3rem 0; border-bottom:1px dashed var(--line); }
.outwin .orow:last-child { border-bottom:0; }

/* OLT card */
.oltcard .hd { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.oltcard .hd select { max-width:60%; }
.oltcard .pic { display:flex; justify-content:center; padding:.5rem 0; position:relative; }
.oltcard .pic svg { max-width:100%; height:auto; }
.oltcard .acts { display:flex; justify-content:center; gap:.9rem; margin:.25rem 0 .6rem; }
.oltcard .acts .ibtn { font-size:1.15rem; padding:.35rem .5rem; border:1px solid var(--line); }
.oltcard .acts .ibtn.blue { color:#5b9bff; } .oltcard .acts .ibtn.amber { color:var(--amber); } .oltcard .acts .ibtn.green { color:var(--green); }
.oltcard .upt { display:flex; align-items:center; gap:.5rem; background:var(--inset); border-radius:6px; padding:.45rem .7rem; font-size:.9rem; }
.oltcard .upt .sp { flex:1; }
.oltcard .upt i { color:var(--mute); font-style:italic; }
.oltcard .meters { display:grid; grid-template-columns:repeat(3,1fr); gap:.4rem; margin-top:.5rem; text-align:center; font-size:.8rem; color:var(--mute); }
.oltcard .meters b { display:block; color:var(--text); font-size:1rem; }

/* info feed */
.infolist { max-height:26rem; overflow:auto; margin:0 -.2rem; }
.infolist .it { display:flex; gap:.5rem; padding:.45rem .3rem; border-bottom:1px solid var(--line); font-size:.86rem; }
.infolist .it:last-child { border-bottom:0; }
.infolist .it .t { white-space:nowrap; color:var(--mute); font-style:italic; font-size:.78rem; margin-left:auto; padding-left:.5rem; }
.infolist .it .m { flex:1; overflow-wrap:anywhere; }
.infolist .it .u { color:var(--mute); }

/* OLT page */
.oltpage .toolbar { display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:1rem; align-items:center; }
.oltpage table.kvt td:first-child { width:18rem; color:var(--mute); }
.oltpage .loadbar { display:flex; align-items:center; gap:.4rem; min-width:9rem; }
.oltpage .loadbar .bar { flex:1; height:.7rem; }
.oltpage .loadbar span { font-size:.75rem; color:var(--mute); white-space:nowrap; }
.oltpage .editgrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(15rem,1fr)); gap:.75rem; }
.oltpage .editgrid label { display:block; font-size:.8rem; color:var(--mute); margin-bottom:.2rem; }
.oltpage .editgrid input, .oltpage .editgrid textarea { width:100%; }
.sigavg { display:inline-flex; align-items:center; gap:.3rem; }

/* real device photographs */
.devphoto { background:transparent; border-radius:8px; overflow:hidden; }
.devphoto img { width:100%; height:100%; display:block; object-fit:cover; }
.devphoto.wide { aspect-ratio:3.4/1; } .devphoto.mid { aspect-ratio:1.5/1; } .devphoto.onu { aspect-ratio:1.25/1; width:100%; max-width:260px; }
.oltcard .pic .devphoto { width:100%; }
.detrow { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:1rem; align-items:start; }
.detrow .devphoto.side { margin-top:2.2rem; }
@media (max-width:900px) { .detrow { grid-template-columns:minmax(0,1fr); } .detrow .devphoto.side { margin-top:0; } }

/* ---------- ONU list: compact, one line per ONU ---------- */
.onulist table { border-collapse:separate; border-spacing:0; }
.onulist th { font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; color:var(--mute); padding:.5rem .6rem; white-space:nowrap; }
.onulist td { padding:.38rem .6rem; vertical-align:middle; white-space:nowrap; border-bottom:1px solid var(--line); }
.onulist tr.row { cursor:pointer; transition:background .12s; } .onulist tr.row:hover td { background:color-mix(in srgb, var(--blue) 7%, transparent); }
.onulist .nmcell { display:flex; flex-direction:column; line-height:1.2; } .onulist .nmcell small { color:var(--mute); font-size:.74rem; font-variant-numeric:tabular-nums; max-width:14rem; overflow:hidden; text-overflow:ellipsis; }
.onulist .nmcell b { font-weight:600; max-width:16rem; overflow:hidden; text-overflow:ellipsis; }
.onulist .dim { color:var(--mute); opacity:.55; }
.onulist .chips { display:flex; gap:.25rem; flex-wrap:nowrap; } .chip { background:var(--inset); border:1px solid var(--line); border-radius:999px; padding:.05rem .5rem; font-size:.72rem; color:var(--text); }
.typechip { display:inline-block; max-width:12rem; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; font-size:.78rem; color:var(--mute); }
.vbtn { background:transparent; color:var(--link); border:1px solid var(--line); padding:.18rem .7rem; min-height:0; font-size:.78rem; border-radius:999px; font-weight:500; }
.vbtn:hover { background:var(--blue); color:#fff; border-color:var(--blue); }
.onulist .sigcell { flex-direction:row; gap:.3rem; align-items:center; } .onulist .sigcell small.note { display:none; }
.onulist .loading { padding:3rem 1rem; }
.busy { position:relative; opacity:.55; pointer-events:none; transition:opacity .15s; }
.busy::after { content:""; position:absolute; top:.9rem; right:1rem; width:1.4rem; height:1.4rem; border:3px solid var(--line); border-top-color:var(--blue); border-radius:50%; animation:spin .8s linear infinite; }

/* ---------- ONU page: photo, status and signal boxes ---------- */
.imgrow { display:flex; flex-direction:column; align-items:center; gap:.5rem; margin-bottom:var(--s3); }
.devphoto.onu { aspect-ratio:1.5/1; max-width:300px; border-radius:12px; box-shadow:none; }
.devphoto.onu img { object-fit:contain; }   /* never crop an ONU photo: every picture is a whole device on a 3:2 transparent canvas */
.gauges { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; max-width:26rem; }
.gcard { min-width:0; padding:.55rem .8rem; border-radius:.6rem; }
.gcard > small { color:var(--mute); font-size:.76rem; }
.gval { margin-top:.1rem; line-height:1.15; } .gval small { font-size:.7rem; font-weight:500; color:var(--mute); }
.gbar { height:.42rem; margin-top:.5rem; }
.gnote { color:var(--mute); font-size:.78rem; margin-top:.4rem; max-width:26rem; }
.statbox { padding:.35rem .75rem; border-radius:.6rem; }
.setlink { font-size:.8rem; opacity:.9; }

/* ---------- icons ---------- */
svg.ic { fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none; vertical-align:middle; }
.ibtn svg.ic { width:1.05rem; height:1.05rem; stroke-width:1.8; }
button.eye, button.ico { color:var(--mute); } button.eye:hover, button.ico:hover { color:var(--text); }
button.eye { background:transparent; border:0; padding:.1rem .25rem; min-height:0; line-height:0; border-radius:6px; }
button.ico svg.ic { width:1rem; height:1rem; }
.oltcard .acts { display:flex; justify-content:center; gap:1.1rem; margin:.4rem 0 .9rem; }
.oact { background:transparent; border:0; padding:0; min-height:0; display:flex; flex-direction:column; align-items:center; gap:.35rem; color:var(--mute); font-weight:500; }
.oact .oc { width:2.9rem; height:2.9rem; border-radius:50%; display:grid; place-items:center; color:#fff; box-shadow:0 4px 14px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.28);
  transition:transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s, filter .18s; }
.oact small { font-size:.72rem; letter-spacing:.02em; }
.oact:hover { background:transparent; color:var(--text); } .oact:hover .oc { transform:translateY(-3px) scale(1.04); filter:brightness(1.08); box-shadow:0 9px 22px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.3); }
.oact:active .oc { transform:translateY(0) scale(.97); }
@media (prefers-reduced-motion:reduce) { .oact .oc { transition:none; } }

/* ---------- living background: light on the GPU (only transform / translate animate), still when the user prefers no motion ---------- */
#bgfx { position:fixed; inset:0; z-index:-1; overflow:hidden; pointer-events:none; --mx:0; --my:0; contain:strict; }

/* ===================== critique fixes ===================== */
/* skip link and screen-reader-only text */
.skip { position:fixed; left:.75rem; top:-4rem; z-index:100; background:var(--blue); color:#fff; padding:.6rem 1rem; border-radius:var(--r-sm); text-decoration:none; font-weight:600; transition:top .15s; }
.skip:focus { top:.75rem; }
.sr { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; }
main:focus { outline:none; }

/* navigation: real links and menu buttons, one look */
nav .nmbtn { background:transparent; color:var(--mute); border:0; border-bottom:2px solid transparent; border-radius:0; padding:.95rem .7rem; min-height:0; font:inherit; font-weight:500; letter-spacing:.01em; cursor:pointer; display:inline-flex; align-items:center; gap:.3rem; white-space:nowrap; }
nav .nmbtn:hover { color:var(--text); background:transparent; } nav .nmbtn[aria-expanded="true"] { color:var(--text); }
nav .nmbtn svg.ic { width:.75rem; height:.75rem; transition:transform .2s var(--ease); } nav .nmbtn[aria-expanded="true"] svg.ic { transform:rotate(180deg); }
nav a:focus-visible, nav .nmbtn:focus-visible, .navpop a:focus-visible { outline:2px solid var(--blue); outline-offset:-2px; }
.navpop a:focus-visible { background:var(--inset); }

/* outage window: buttons, dots instead of side stripes */
.outwin .ohead { width:100%; background:transparent; color:var(--text); border:0; border-radius:0; text-align:left; font:inherit; font-weight:500; min-height:2.6rem; }
.outwin .ohead:hover { background:var(--inset); }
.outwin .t-acc-chevron { color:var(--mute); }
.outwin .obody { padding:.1rem .2rem .7rem 2.1rem; font-size:.9rem; }
.outwin .orow { position:relative; padding:.35rem 0 .35rem 1.1rem; --dot:var(--mute); }
.outwin .orow::before { content:""; position:absolute; left:.15rem; top:.95em; width:.5rem; height:.5rem; border-radius:50%; background:var(--dot); }
.outwin .orow.red { --dot:var(--red); } .outwin .orow.amber { --dot:var(--amber); } .outwin .orow.blue { --dot:#5b8cff; }
.outwin .offmark { display:inline-flex; position:relative; opacity:.7; } .outwin .offmark i { position:absolute; left:-1px; right:-1px; top:50%; height:1.5px; background:currentColor; transform:rotate(-40deg); }
.linkbtn { background:transparent; color:var(--link); border:0; padding:.4rem 0; min-height:0; font-weight:500; text-decoration:underline; text-underline-offset:3px; }
.linkbtn:hover { background:transparent; color:var(--text); }
.notice { background:var(--inset); border:1px solid var(--line); padding:.7rem .9rem; border-radius:var(--r-sm); margin:.5rem 0; color:var(--text); }

/* OLT card actions: one neutral surface; colour is kept for status */
.oact .oc { background:linear-gradient(160deg, var(--chip), var(--inset)); color:var(--text); border:1px solid var(--line); box-shadow:0 3px 10px rgba(0,0,0,.22); }
.oact.blue .oc, .oact.amber .oc, .oact.green .oc, .oact.slate .oc { background:linear-gradient(160deg, var(--chip), var(--inset)); }
.oact:hover .oc { border-color:color-mix(in srgb, var(--blue) 60%, var(--line)); color:var(--link); }
.oact small { font-size:.78rem; }

/* list filters, chips, selection */
.fbtn { min-height:2.25rem; display:inline-flex; align-items:center; gap:.4rem; } .cnt { background:var(--blue); color:#fff; border-radius:999px; padding:0 .45rem; font-size:.75rem; font-weight:700; }
.fpanel .frow .sp { flex:1; }
.chiprow { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.6rem; } .chiprow[hidden] { display:none; }
.chipx { background:var(--inset); color:var(--text); border:1px solid var(--line); border-radius:999px; padding:.2rem .7rem; min-height:0; font-size:.8rem; font-weight:500; }
.chipx:hover { border-color:var(--red); background:var(--inset); }
.bulkbar { position:sticky; top:3.4rem; z-index:20; display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; padding:.6rem .9rem; margin:0 0 var(--s4); background:var(--panel-solid); border:1px solid color-mix(in srgb, var(--blue) 55%, var(--line)); border-radius:var(--r); box-shadow:var(--shadow-sm); }
.bulkbar[hidden] { display:none; }
.onulist th.selcol, .onulist td:first-child { width:2.2rem; padding-right:0; }
input[type=checkbox].rowsel, #sel_all { width:1.1rem; height:1.1rem; cursor:pointer; accent-color:var(--blue); }

/* a floor of 12px for supporting text */
small, .note, .tx, .legend2 small, .cardsub, .nmcell small, .typechip, .chip, .sigcell small, .infolist .it .t, .gcard > small, .gnote, .oact small, th { font-size:max(.75rem, .85em); }
.onulist th { font-size:.75rem; }
.chart .tx, .barchart .tx, svg.ich .tx { font-size:12px; }
.chip, .typechip { font-size:.78rem; }

/* keyboard focus on the custom chart */
svg.ich:focus-visible { outline:2px solid var(--blue); outline-offset:3px; border-radius:6px; }

/* dialogs and toasts use the transitions from motion.css, not older keyframes */
.modal.t-modal { animation:none; }
.toast.t-toast { animation:none !important; }

/* background: two quiet fields; amber / red only when there is a reason */

/* phones and touch: bigger targets, no sideways scrolling, a lighter ONU list */
@media (pointer:coarse), (max-width:700px) {
  main button, main select, main input:not([type=checkbox]):not([type=radio]), .vbtn, .ibtn, .chipx, .linkbtn { min-height:44px; }
  main a.setlink, main a[data-onu], main a[data-go], main a[data-oltpage], #f_more, #f_ie { display:inline-flex; align-items:center; min-height:44px; padding:0 .25rem; }
  input[type=checkbox].rowsel, #sel_all { width:1.5rem; height:1.5rem; }
  .onulist td, .onulist th { padding-top:.55rem; padding-bottom:.55rem; }
  .vbtn { padding:.3rem 1rem; }
}
@media (max-width:700px) {
  .onulist th:nth-child(6), .onulist td:nth-child(6), .onulist th:nth-child(7), .onulist td:nth-child(7), .onulist th:nth-child(9), .onulist td:nth-child(9),
  .onulist th:nth-child(10), .onulist td:nth-child(10) { display:none; }
  .onupage .onutop { grid-template-columns:minmax(0,1fr); }
  .onupage dl.kv2 .r { grid-template-columns:minmax(0,1fr); gap:.1rem; } .onupage dl.kv2 dt { text-align:left; color:var(--mute); font-size:.8rem; }
  .onupage dd, .onupage dl.kv2 dd { min-width:0; overflow-wrap:anywhere; }
  .gauges { max-width:none; } .devphoto.onu { max-width:100%; }
  .fpanel .frow .sp { display:none; }
  .oltcard .acts { gap:.6rem; }
}

nav .navbtn { background:transparent; color:var(--mute); border:0; border-radius:0; padding:.95rem .7rem; min-height:0; font:inherit; font-weight:500; cursor:pointer; white-space:nowrap; }
nav .navbtn:hover { color:var(--text); background:transparent; }
nav .navbtn:focus-visible { outline:2px solid var(--blue); outline-offset:-2px; }

nav a, .navpop a { text-decoration:none; }

@media (max-width:700px) { .onupage .onutop .onuright { order:-1; } }

/* the round action buttons draw only their circle: no filled button behind it */
button.oact, button.oact:hover, button.oact:active, button.oact:focus-visible { background:transparent; box-shadow:none; }
button.oact:focus-visible .oc { outline:2px solid var(--blue); outline-offset:3px; }
.oact small { color:var(--mute); } .oact:hover small { color:var(--text); }

/* Font Awesome glyphs, flat like the reference portal */
i.fa.ic { stroke:none; line-height:1; vertical-align:middle; width:auto; }
.oact .oc { width:auto; height:auto; background:none !important; border:0 !important; box-shadow:none !important; font-size:1.5rem; padding:.1rem .35rem; }
.oact:nth-child(1) .oc { color:#3b82f6; } .oact:nth-child(2) .oc { color:#f59e0b; } .oact:nth-child(3) .oc { color:#22a447; } .oact:nth-child(4) .oc { color:var(--mute); }
.oact:hover .oc { transform:translateY(-2px); filter:brightness(1.2); box-shadow:none !important; color:inherit; }
.oact:nth-child(1):hover .oc { color:#60a5fa; } .oact:nth-child(2):hover .oc { color:#fbbf24; } .oact:nth-child(3):hover .oc { color:#34d399; } .oact:nth-child(4):hover .oc { color:var(--text); }
.oact .oc i.fa { font-size:1.5rem !important; }
nav .nmbtn i.fa { margin-left:.2rem; transition:transform .2s var(--ease); } nav .nmbtn[aria-expanded="true"] i.fa { transform:rotate(180deg); }
.t-acc-chevron i.fa { font-size:.95rem; }
.oico i.fa { font-size:1rem; width:1.2rem; text-align:center; }
button.ibtn, button.ibtn.amber, button.ibtn.amber:hover { background:transparent; box-shadow:none; }
button.ibtn.amber { color:#f59e0b; } button.ibtn:hover { color:var(--text); background:var(--chip); }
i.stic { font-size:1.3rem; width:1.4rem; text-align:center; line-height:1; }
i.sigic { font-size:1.25rem; line-height:1; }
.sigcell svg, td .statbox svg { max-width:none; }
.cards .card { position:relative; }
.cards .card .kic { position:absolute; left:.85rem; top:.8rem; font-size:2.4rem; line-height:1; color:#fff; opacity:.95; pointer-events:none; }
.cards .card .n { text-align:right; }
.cards .card > .cardsub { margin-top:.2rem; }
/* cut-out photos keep their own proportions */
.devphoto.wide, .devphoto.mid { aspect-ratio:auto; }
.devphoto.wide img, .devphoto.mid img { height:auto; object-fit:contain; }
.devphoto.mid img { max-height:150px; }
.tabs button i.fa, .t-tab i.fa { margin-right:.45rem; width:1em; text-align:center; font-size:.95em; }
.vlanadd { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem .8rem; margin:.4rem 0 1rem; }
.vlanadd input { background:var(--inset); border:1px solid var(--line); color:var(--text); border-radius:8px; padding:.45rem .6rem; min-height:2.2rem; }
.vlanadd input:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
button.sm { padding:.3rem .7rem; min-height:0; font-size:.85rem; }

/* OLT console (every page of the OLT's own interface) */
.con { display:grid; grid-template-columns:15.5rem minmax(0,1fr); gap:1rem; align-items:start; }
.con-nav { display:block !important; flex-direction:column; position:sticky; top:.5rem; max-height:calc(100vh - 2rem); overflow:auto; background:var(--inset); border:1px solid var(--line); border-radius:12px; padding:.4rem; }
.con-nav summary { cursor:pointer; padding:.5rem .6rem; font-weight:600; border-radius:8px; list-style:none; display:flex; justify-content:space-between; }
.con-nav summary::after { content:"\f107"; font-family:FontAwesome; opacity:.6; transition:transform .2s var(--ease); }
.con-nav details[open] > summary::after { transform:rotate(180deg); }
.con-nav summary:hover { background:var(--chip); }
.con-it { display:block; width:100%; text-align:left; background:transparent; border:0; box-shadow:none; color:var(--mute); padding:.4rem .7rem; min-height:0; font-weight:500; border-radius:8px; font-size:.88rem; }
.con-it.sub { padding-left:1.6rem; font-size:.85rem; }
.con-it:hover { background:var(--chip); color:var(--text); }
.con-it.on { background:color-mix(in srgb, var(--blue) 22%, transparent); color:var(--text); box-shadow:0 0 0 1px color-mix(in srgb, var(--blue) 50%, transparent) inset; }
.con-hint { padding:.4rem .6rem; }
.con-main { min-width:0; }
.con-head { display:flex; align-items:center; gap:.7rem; margin-bottom:.6rem; } .con-head h4 { margin:0; font-size:1.05rem; } .con-head .sp { flex:1; }
.warnbox { border-color:#b97a00; background:color-mix(in srgb, #e08a00 14%, var(--inset)); margin-bottom:.8rem; }
.cform { overflow-x:auto; font-size:.9rem; }
.cform table { border-collapse:collapse; margin:.5rem 0 1rem; max-width:100%; }
.cform th { background:var(--inset); text-align:left; font-weight:600; font-size:.78rem; text-transform:uppercase; letter-spacing:.03em; color:var(--mute); }
.cform th, .cform td { border:1px solid var(--line); padding:.35rem .6rem; vertical-align:middle; }
.cform h1, .cform h2, .cform h3, .cform h4 { font-size:.95rem; margin:1rem 0 .3rem; }
.cform input[type=text], .cform input[type=password], .cform select, .cform textarea { background:var(--inset); border:1px solid var(--line); color:var(--text); border-radius:6px; padding:.3rem .5rem; min-height:2rem; max-width:100%; }
.cform input:focus-visible, .cform select:focus-visible, .cform textarea:focus-visible { outline:2px solid var(--blue); outline-offset:1px; }
.cform input:disabled, .cform select:disabled { opacity:.55; }
.cform input[type=checkbox], .cform input[type=radio] { width:1.05rem; height:1.05rem; accent-color:var(--blue); vertical-align:middle; margin-right:.25rem; }
.cform .ocb { padding:.3rem .8rem; min-height:0; font-size:.85rem; margin:.15rem .25rem .15rem 0; }
.cform .ocb-del { background:#b33a3a; }
.cform .ocb:disabled { opacity:.45; cursor:not-allowed; }
.oc-hide { display:none !important; }
@media (max-width:900px) { .con { grid-template-columns:minmax(0,1fr); } .con-nav { position:static; max-height:16rem; } }
.con-nav details { display:block !important; margin:0 0 .2rem; }
.con-nav summary { width:100%; box-sizing:border-box; }
.makerlogo { display:flex; justify-content:center; margin:.2rem 0 .5rem; } .makerlogo img { height:2.6rem; width:auto; background:#eef3fa; border-radius:8px; padding:.15rem .6rem; } .makerlogo b { font-size:1.35rem; letter-spacing:.06em; }
.detrow .makerlogo { justify-content:flex-end; margin-top:0; }
.oltcard .pic { display:flex !important; flex-direction:column; align-items:center; gap:.35rem; }
.oltcard .pic .makerlogo { width:100%; margin:0; } .oltcard .pic .devphoto { width:100%; }
.oltcard .pic { gap:.8rem; } .oltcard .pic .makerlogo img { height:2.1rem; }

/* ---------- living background: deep night sky, slow light beams, a fading dot grid, a glow on the horizon (transform-only motion, no filters) ---------- */

/* the OLT picture on a lit stage, the maker's logo crisp above it */
.oltcard .pic { padding:.7rem .4rem .5rem; isolation:isolate; }
.oltcard .pic::before { content:""; position:absolute; inset:18% 4% 4%; z-index:-1; background:radial-gradient(ellipse 60% 55% at 50% 60%, rgba(70,130,255,.34), rgba(20,184,166,.14) 55%, transparent 75%); }
.oltcard .pic .devphoto { filter:drop-shadow(0 12px 16px rgba(0,0,0,.55)) drop-shadow(0 0 1px rgba(255,255,255,.25)); transform:scale(1.06); }
.oltcard .pic .devphoto img { image-rendering:auto; }
.makerlogo img { height:2.3rem !important; padding:.25rem .8rem !important; background:linear-gradient(#ffffff,#eaf0fa) !important; border-radius:10px !important; box-shadow:0 4px 14px rgba(0,0,0,.35); }
/* panels let a little of the sky through */
:root { --panel:rgba(18,28,50,.62); }
.panel, .card, .oltcard { backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); }
@media (max-width:760px) { .panel, .oltcard { backdrop-filter:none; -webkit-backdrop-filter:none; } :root { --panel:rgba(18,28,50,.78); } }


/* ================= phones and small tablets ================= */
.navtog, nav .mnav, nav .mgrp { display:none; }
@media (max-width:760px) {
  html { -webkit-text-size-adjust:100%; }
  body { padding-bottom:env(safe-area-inset-bottom); }
  nav { flex-wrap:wrap; overflow:visible; padding:0 .9rem; padding-left:max(.9rem, env(safe-area-inset-left)); padding-right:max(.9rem, env(safe-area-inset-right)); min-height:3.4rem; }
  nav > b { margin-right:auto; padding:.8rem 0; font-size:1rem; display:flex; align-items:center; gap:.5rem; }
  nav > b img.brandlogo { height:1.6rem; }
  nav > .note { display:none; }
  .navtog { display:inline-flex; align-items:center; gap:.45rem; min-height:44px; padding:0 .9rem; background:var(--chip); color:var(--text); border:1px solid var(--line); border-radius:12px; box-shadow:none; font-weight:600; }
  nav > a, nav > .nmbtn, nav > .who, nav > #logout, nav > .sp, nav > .mnav, nav > .mgrp { display:none !important; }
  nav.open { padding-bottom:.8rem; max-height:100dvh; overflow-y:auto; }
  nav.open > a[data-v], nav.open > .mnav, nav.open > #logout, nav.open > .who { display:flex !important; width:100%; align-items:center; box-sizing:border-box; }
  nav.open > a[data-v] { padding:.85rem .6rem; border-bottom:1px solid var(--line); min-height:44px; }
  nav.open > .mnav { padding:.75rem .6rem .75rem 1.6rem; min-height:44px; border-bottom:1px solid color-mix(in srgb, var(--line) 60%, transparent); }
  nav.open > .mgrp { display:block !important; width:100%; padding:.9rem .6rem .25rem; font-size:.75rem; letter-spacing:.08em; text-transform:uppercase; color:var(--mute); }
  nav.open > .who { padding:.7rem .6rem; }
  nav.open > #logout { justify-content:center; margin-top:.4rem; min-height:46px; }
  nav .nmbtn { display:none !important; }
  body.navopen { overflow:hidden; }

  main { padding-left:max(.75rem, env(safe-area-inset-left)); padding-right:max(.75rem, env(safe-area-inset-right)); }
  /* touch size and no zoom-on-focus on iOS */
  button, .btn, select, input, textarea { font-size:16px; }
  button:not(.ocb):not(.sm):not(.mini):not(.navtog):not(.oc):not(.oact) , select:not(.mini) { min-height:44px; }
  input[type=checkbox], input[type=radio] { min-width:22px; min-height:22px; }

  /* the five figures: two columns, compact, the last one across */
  .cards { grid-template-columns:repeat(2, minmax(0,1fr)); gap:.6rem; }
  .cards .card { padding:.7rem .75rem; min-height:0; border-radius:14px; }
  .cards .card:last-child { grid-column:1 / -1; }
  .cards .card .kic { font-size:1.6rem; left:.7rem; top:.6rem; }
  .cards .card .n { font-size:1.9rem; }
  .cards .card .cardsub { gap:.3rem .6rem; flex-wrap:wrap; font-size:.75rem; }
  .cards .card:not(:last-child) { padding-top:.6rem; }
  .freshness { flex-wrap:wrap; justify-content:center; gap:.2rem .6rem; font-size:.78rem; }

  /* panels, headers, charts */
  .panel { padding:.8rem .8rem; border-radius:14px; }
  .panel h3 { flex-wrap:wrap; gap:.4rem .6rem; }
  .panel h3 .menu, .panel h3 select, .panel h3 .ibtn { flex:none; }
  .dashgrid { gap:.8rem; }
  .oltcard .pic { padding:.5rem 0 .3rem; }
  .oact .oc { font-size:1.5rem; }
  .makerlogo img { height:2rem !important; }
  .toolbar, .tabs { flex-wrap:wrap; gap:.4rem; }
  .tabs { overflow-x:auto; flex-wrap:nowrap; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  .tabs::-webkit-scrollbar { display:none; }
  .tabs button { flex:none; }
  .t-tabs { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; } .t-tabs::-webkit-scrollbar { display:none; } .t-tab { flex:none; }

  /* tables scroll sideways inside their panel, never the page */
  .tablewrap, .panel > table, .cform, .scrollx { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  table { font-size:.85rem; }
  .modal { width:calc(100vw - 1.2rem) !important; max-width:none !important; max-height:92dvh; }
  .modal.wide { width:calc(100vw - 1.2rem) !important; }
  .modal .mb { max-height:calc(92dvh - 4rem); overflow:auto; }
  .cf-actions { flex-direction:column-reverse; } .cf-actions button { width:100%; }
  .toast, #toasts { left:.6rem; right:.6rem; max-width:none; }

  /* the console on a phone: the page menu is a short scrolling list above the page */
  .con-nav { max-height:13rem; }
  .con-head { flex-wrap:wrap; }
  .cform table { display:block; overflow-x:auto; max-width:100%; }
  .cform input[type=text], .cform input[type=password], .cform select { max-width:100%; min-height:44px; }
  .cform .ocb { min-height:44px; padding:.5rem 1rem; }
  .vlanadd { flex-direction:column; align-items:stretch; }
  .vlanadd input { width:100% !important; }
}
@media (max-width:420px) {
  .cards .card .n { font-size:1.65rem; }
  .cards .card { font-size:.85rem; }
  .panel h3 { font-size:.9rem; }
  nav > b { font-size:.95rem; }
}
@media (max-width:760px) {
  main .cards { grid-template-columns:repeat(2, minmax(0,1fr)); }
  main .cards .card:last-child { grid-column:1 / -1; }
  .navtog { margin-left:auto; }
  nav.open > .who { order:90; } nav.open > #logout { order:99; }
}
[hidden] { display:none !important; }
/* the ONU list as cards on a phone: status, name and port, signal, type, View */
@media (max-width:760px) {
  table.cardrows { display:block; width:100%; }
  table.cardrows > tbody, table.cardrows > tr { display:block; }
  table.cardrows tr:first-child { display:none; }
  table.cardrows tr.row { display:grid; grid-template-columns:auto auto minmax(0,1fr) auto; grid-template-areas:"sel st nm sg" "sel st on sg" "sel st ty vw"; gap:.1rem .6rem; align-items:center; padding:.65rem .35rem; border-bottom:1px solid var(--line); }
  table.cardrows td { display:block; border:0; padding:0; min-width:0; }
  table.cardrows td:nth-child(1) { grid-area:sel; } table.cardrows td:nth-child(2) { grid-area:st; }
  table.cardrows td:nth-child(4) { grid-area:nm; overflow:hidden; } table.cardrows td:nth-child(5) { grid-area:on; font-size:.8rem; color:var(--mute); }
  table.cardrows td:nth-child(8) { grid-area:sg; justify-self:end; } table.cardrows td:nth-child(10) { grid-area:ty; font-size:.78rem; color:var(--mute); }
  table.cardrows td:nth-child(3) { grid-area:vw; justify-self:end; }
  table.cardrows td:nth-child(6), table.cardrows td:nth-child(7), table.cardrows td:nth-child(9), table.cardrows td:nth-child(11) { display:none; }
  table.cardrows .sigcell { flex-direction:row; }
  .toppager { flex-wrap:wrap; gap:.4rem; } .toppager .pgs { overflow-x:auto; white-space:nowrap; max-width:100%; }
}
@media (max-width:760px) { table.cardrows td:nth-child(8), table.cardrows td:nth-child(10) { display:block !important; } table.cardrows tr.row td:nth-child(5) { font-size:.8rem; } }
@media (max-width:760px) { main { overflow-x:clip; } .devphoto { max-width:100%; overflow:hidden; } .devphoto.onu { margin-inline:auto; } }

/* ================= theme: ApniOLT night =================
   One set of tokens. Every colour, text size and radius used below comes from here, so a change of look is a change of these values.
   Colour has a job: blue = the action on this page, green / amber / red / grey = ONU and alarm status, nothing else.
   Text sizes: 12 micro (tags, legends), 13 small (notes, table heads, buttons), 14 body and tables, 16 panel titles, 20 page titles, 34 the dashboard figures. */
html:root {
  color-scheme:dark;
  --bg:#07142a; --surface:#0e1b31; --surface-2:#14233c; --surface-3:#1c2e4b;
  --panel:var(--surface); --panel-solid:#0c1729; --inset:rgba(148,170,210,.07); --chip:rgba(148,170,210,.13); --hover:rgba(64,140,255,.11);
  --line:rgba(148,170,210,.15); --line-2:rgba(148,170,210,.3);
  --text:#e6ecf5; --mute:#a3b1c8; --faint:#8493ab; --link:#6cb0ff;
  --blue:#1f6fe0; --blue-2:#3a85f0; --glow:rgba(64,140,255,.2);
  --green:#1c9a41; --red:#d9363e; --amber:#f0a020; --grey:#5b6b82;
  --ok:#49d17d; --warn:#f6b445; --bad:#ff8080;
  --fs-micro:12px; --fs-small:13px; --fs-body:14px; --fs-title:16px; --fs-page:20px;
  --shadow:0 10px 30px rgba(2,8,20,.42); --shadow-sm:0 1px 2px rgba(2,8,20,.45);
  --r:10px; --r-sm:6px;
}
html:root body { background:var(--bg); color:var(--text); font-family:"Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif; font-size:var(--fs-body); line-height:1.45; }
html:root a { color:var(--link); text-underline-offset:2px; text-decoration-thickness:1px; }
html:root ::selection { background:rgba(64,140,255,.38); color:#fff; }
html:root * { scrollbar-width:thin; scrollbar-color:rgba(148,170,210,.32) transparent; }
html:root input, html:root textarea { caret-color:var(--blue-2); }
html:root :focus-visible { outline:2px solid var(--blue-2); outline-offset:2px; }
html:root main:focus, html:root main:focus-visible { outline:none; }

/* page background: light only at the top of the page, behind the bar and the first row; flat and quiet under tables and graphs */
html:root #bgfx { display:block !important; background:radial-gradient(1100px 480px at 80% -10%, rgba(40,120,255,.2), transparent 70%), radial-gradient(900px 420px at 6% -14%, rgba(0,96,220,.13), transparent 70%), linear-gradient(180deg, #081833, var(--bg) 440px) !important; }
html:root #bgfx > * { display:none !important; }
html:root #bgfx::before { content:""; position:absolute; inset:0 0 auto 0; height:460px; opacity:.5;
  -webkit-mask-image:linear-gradient(#000, transparent); mask-image:linear-gradient(#000, transparent);
  background:linear-gradient(115deg, transparent 0, transparent 32%, rgba(29,139,255,.16) 32.2%, transparent 32.6%, transparent 100%),
             linear-gradient(155deg, transparent 0, transparent 45%, rgba(29,139,255,.11) 45.2%, transparent 45.6%, transparent 100%); }
html:root #bgfx::after { content:none; }

/* top bar */
html:root nav { background:rgba(7,20,42,.86); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); box-shadow:0 1px 0 var(--line); gap:0; min-height:54px; }
@media (min-width:761px) {
  html:root nav { padding:0 max(16px, calc((100% - 1400px) / 2 + 24px)); overflow:visible; }
  html:root nav > b { font-size:17px; font-weight:650; color:#fff; margin-right:18px; letter-spacing:-.01em; }
  html:root nav a, html:root nav .nmbtn, html:root nav .navbtn { color:var(--mute) !important; font-weight:500 !important; font-size:var(--fs-body); padding:17px 11px !important; border:0 !important; border-radius:0 !important; background:transparent !important; letter-spacing:0; min-height:0; box-shadow:none !important; transition:color .15s; }
  html:root nav a:hover, html:root nav .nmbtn:hover, html:root nav .nmbtn[aria-expanded="true"], html:root nav .navbtn:hover { color:#fff !important; }
  html:root nav a.active, html:root nav .nmbtn.active { color:#fff !important; font-weight:600 !important; box-shadow:inset 0 -2px 0 var(--blue-2) !important; }
  html:root nav .who { color:var(--faint); font-size:var(--fs-small); }
  html:root nav #logout::before { content:"\f011"; font-family:FontAwesome; margin-right:6px; }
}
html:root .navpop { background:var(--panel-solid); border:1px solid var(--line-2); border-radius:8px; box-shadow:var(--shadow); padding:6px; min-width:13rem; }
html:root .navpop a { color:var(--text); padding:6px 12px; border-radius:5px; font-size:var(--fs-body); }
html:root .navpop a:hover, html:root .navpop a.active { background:var(--hover); color:#fff; }
html:root .navpop .nvh { display:block; padding:8px 12px 3px; font-size:var(--fs-micro); font-weight:600; color:var(--faint); letter-spacing:.04em; text-transform:uppercase; }
html:root .navpop .nvh:not(:first-child) { margin-top:4px; border-top:1px solid var(--line); padding-top:10px; }
html:root .modal, html:root .con-nav { background:var(--panel-solid); border-color:var(--line-2); }

/* page */
html:root main { max-width:1400px; padding:16px 24px 48px; }
@media (max-width:760px) { html:root main { padding:10px 12px 30px; } }

/* panels */
html:root .panel, html:root .oltcard, html:root .gcard, html:root .chbox { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow-sm); -webkit-backdrop-filter:none; backdrop-filter:none; }
html:root .panel { padding:14px 16px 16px; margin-bottom:16px; }
html:root .panel > h3:first-child { margin:-14px -16px 14px !important; padding:11px 16px; min-height:48px; background:transparent; border-bottom:1px solid var(--line); border-radius:0; font-size:var(--fs-title); font-weight:650; text-transform:none; letter-spacing:-.005em; color:#fff; }
/* the title of a panel on the left, whatever belongs to it (buttons, a count, a hint) together on the right */
html:root .panel > h3:first-child { justify-content:flex-start; gap:8px; flex-wrap:wrap; }
html:root .panel > h3:first-child > :first-child:not(i):not(svg):not(.sp):not(.ibtn) { margin-left:auto; }
html:root .panel h3 { text-transform:none; letter-spacing:0; font-size:15px; font-weight:650; color:var(--text); margin:22px 0 8px; }
html:root .panel h3:first-child { margin-top:0; }
html:root .gcard, html:root .chbox { background:var(--surface-2); box-shadow:none; }
html:root .panel .panel { background:var(--surface-2); box-shadow:none; }

/* the five figures at the top of the dashboard. --kc is the colour of the figure; each has white text at 4.5:1 or better */
html:root .cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(168px, 1fr)); gap:14px; margin-bottom:10px; }
html:root .cards .card { position:relative; padding:12px 14px 12px; border:1px solid rgba(255,255,255,.1); border-radius:var(--r); overflow:hidden; background:var(--kc, var(--blue)); box-shadow:var(--shadow-sm); text-align:right; color:#fff; font-size:var(--fs-small); font-weight:600; display:flex; flex-direction:column; transition:transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s; }
html:root .cards .card:has(.cardsub) { padding-bottom:0; }
html:root .cards .card:hover { filter:none; transform:translateY(-2px); box-shadow:0 8px 22px rgba(2,8,20,.45); }
html:root .cards .card .kic { left:14px; top:13px; font-size:30px; opacity:.82; }
html:root .cards .card .n { font-size:34px; font-weight:650; line-height:40px; letter-spacing:-.02em; min-height:40px; }
html:root .cards .card small { font-weight:500; opacity:.86; }
html:root .cards .card::after { content:""; order:2; flex:1 0 8px; }
html:root .cards .card > .cardsub { order:3; margin:0 -14px 0; padding:7px 14px 9px; background:rgba(4,12,28,.34); border-top:0; color:rgba(255,255,255,.88); font-size:var(--fs-micro); font-weight:500; opacity:1; text-align:left; }
html:root .card.k-wait { --kc:#1565c8; } html:root .card.k-on { --kc:#167f34; } html:root .card.k-off { --kc:#46505f; } html:root .card.k-low { --kc:#ad5c08; } html:root .card.k-tix { --kc:#6842c2; }
html:root .card.k-down { --kc:#167f34; } html:root .card.k-up { --kc:#1565c8; } html:root .card.k-peak { --kc:#6842c2; }
@media (max-width:760px) {
  html:root .cards { grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; }
  html:root .cards .card:last-child:nth-child(odd) { grid-column:1 / -1; }
  html:root .cards .card .n { font-size:28px; line-height:34px; min-height:34px; } html:root .cards .card .kic { font-size:24px; }
}
@media (prefers-reduced-motion:reduce) { html:root .cards .card { transition:none; } html:root .cards .card:hover { transform:none; } }
html:root .freshness { color:var(--faint); font-size:var(--fs-micro); margin:0 0 12px; }

/* tables: quiet head, hairlines, the row under the pointer lit; figures line up */
html:root table { font-variant-numeric:tabular-nums; }
html:root table th, html:root .cform th { background:transparent; color:var(--faint); font-size:var(--fs-micro); font-weight:600; text-transform:none; letter-spacing:.02em; border-bottom:1px solid var(--line-2); padding:8px 10px; white-space:nowrap; }
html:root table td, html:root .cform td { border-color:var(--line); padding:8px 10px; }
html:root table tr:last-child > td { border-bottom:0; }
@media (min-width:761px) { html:root tr.row:hover > td { background:var(--hover); color:#fff; } }
html:root tr.row:hover { background:transparent; }
html:root th.sortable:hover { color:var(--text); }
html:root td.num, html:root th.num { text-align:right; }
html:root td.acts { white-space:nowrap; text-align:right; }
html:root td.acts > * + * { margin-left:6px; }

/* form fields */
html:root input[type=text], html:root input[type=password], html:root input[type=number], html:root input[type=search], html:root input[type=email], html:root input[type=date], html:root input[type=datetime-local], html:root input[type=tel], html:root input[type=url], html:root input:not([type]), html:root select, html:root textarea { background:rgba(4,12,28,.5); border:1px solid var(--line-2); color:var(--text); border-radius:var(--r-sm); min-height:34px; padding:5px 10px; font-size:var(--fs-body); }
html:root input:hover, html:root select:hover, html:root textarea:hover { border-color:rgba(148,170,210,.45); }
html:root input:focus, html:root select:focus, html:root textarea:focus { border-color:var(--blue-2); outline:none; box-shadow:0 0 0 3px rgba(64,140,255,.22); }
html:root select option { background:var(--panel-solid); color:var(--text); }
html:root input::placeholder, html:root textarea::placeholder { color:#7b8aa2; }
html:root input[type=checkbox], html:root input[type=radio] { width:16px; height:16px; min-height:0; accent-color:var(--blue-2); vertical-align:-3px; margin:0 6px 0 0; }
html:root label { color:var(--mute); }
html:root .filters label, html:root .filters b { font-weight:600; }
html:root .row2 label, html:root .oltpage .editgrid label { font-size:var(--fs-small); font-weight:600; color:var(--mute); margin-bottom:4px; }

/* buttons. Solid blue is the action of the page. Grey is every other action. Green, amber and red are tinted, not solid, so a row of
   buttons never shouts louder than the data; the solid red only appears on the final button of a confirmation. */
html:root button, html:root .btn { font-size:var(--fs-small); letter-spacing:0; gap:6px; }
html:root button:not(.grey):not(.red):not(.green):not(.amber):not(.ibtn):not(.oact):not(.navtog):not(.con-it):not(.pgn):not(.t-tab), html:root .btn:not(.grey):not(.red):not(.green) { background:var(--blue); border:1px solid var(--blue); color:#fff; border-radius:var(--r-sm); font-weight:600; box-shadow:var(--shadow-sm); }
html:root button.grey, html:root .btn.grey { background:var(--surface-3); border:1px solid var(--line-2); color:var(--text); border-radius:var(--r-sm); font-weight:600; box-shadow:none; }
html:root button.green, html:root .btn.green { background:rgba(40,180,90,.14); border:1px solid rgba(73,209,125,.42); color:var(--ok); font-weight:600; border-radius:var(--r-sm); box-shadow:none; }
html:root button.amber { background:rgba(240,160,32,.13); border:1px solid rgba(246,180,69,.42); color:var(--warn); font-weight:600; border-radius:var(--r-sm); box-shadow:none; }
html:root button.red, html:root .ocb-del { background:rgba(217,54,62,.15); border:1px solid rgba(255,128,128,.42); color:var(--bad); font-weight:600; border-radius:var(--r-sm); box-shadow:none; }
html:root .cf-actions button.red { background:var(--red); border-color:var(--red); color:#fff; }
html:root button:hover, html:root .btn:hover { filter:brightness(1.08); }
html:root button:disabled { filter:none; opacity:.45; }
html:root nav .nmbtn, html:root nav .navbtn, html:root .ohead, html:root button.lg, html:root button.ico, html:root .oact, html:root .ibtn, html:root button.pgn, html:root .eye, html:root .linkbtn, html:root .chipx, html:root .menu .items button { background:transparent !important; border-color:transparent; box-shadow:none; color:var(--text); }
html:root nav .nmbtn, html:root nav .navbtn, html:root .ohead, html:root .oact, html:root .ibtn, html:root .eye, html:root .linkbtn, html:root .menu .items button { border-color:transparent !important; }
html:root .linkbtn { color:var(--link); } html:root .chipx { border-color:var(--line-2) !important; background:var(--inset) !important; }
html:root button.lg { background:var(--inset) !important; border:1px solid var(--line) !important; border-radius:var(--r-sm); padding:4px 8px; }
html:root button.lg.off { opacity:.5; }
html:root button.ico { border:1px solid var(--line-2) !important; border-radius:var(--r-sm); } html:root button.ico.on, html:root button.ico[aria-pressed="true"] { background:rgba(64,140,255,.26) !important; border-color:rgba(64,140,255,.6) !important; }
html:root .icogroup { background:transparent; border:0; padding:0; gap:4px; }
html:root .ohead:hover { background:var(--inset) !important; }
/* the button on every row of a list: quiet until the pointer is on it */
html:root .vbtn, html:root button[data-onu] { background:transparent !important; border:1px solid var(--line-2) !important; color:var(--link) !important; font-weight:600; font-size:12.5px; border-radius:var(--r-sm); box-shadow:none !important; padding:3px 12px; min-height:28px; }
html:root .vbtn:hover, html:root button[data-onu]:hover, html:root tr.row:hover .vbtn, html:root tr.row:hover button[data-onu] { background:var(--blue) !important; border-color:var(--blue) !important; color:#fff !important; filter:none; }
html:root button.pgn { background:transparent !important; border:1px solid var(--line-2) !important; color:var(--mute); border-radius:var(--r-sm); min-height:30px; min-width:30px; padding:2px 8px; justify-content:center; } html:root button.pgn.on { background:var(--blue) !important; border-color:var(--blue) !important; color:#fff; }
html:root button.pgn:hover { color:#fff; border-color:var(--blue-2) !important; }
html:root .t-tabs-pill { background:var(--surface-3); box-shadow:0 0 0 1px var(--line-2) inset; border-radius:7px; }
html:root .t-tabs { border-radius:9px; background:rgba(4,12,28,.4); border:1px solid var(--line); } html:root .t-tab { border-radius:7px; min-height:32px; font-size:var(--fs-small); font-weight:600; }
html:root .con-it.on { background:var(--hover); box-shadow:none; }
html:root .navtog { background:var(--inset); border:1px solid var(--line-2); color:#fff; }
html:root button.sm, html:root .btn.sm { font-size:12.5px; padding:3px 10px; min-height:28px; }

/* labels on things: status words are tinted, plain facts are grey */
html:root .tag { background:var(--chip); color:var(--text); font-weight:600; font-size:var(--fs-micro); border-radius:4px; padding:1px 7px 2px; letter-spacing:0; }
html:root .tag.green { background:rgba(40,180,90,.17); color:var(--ok); } html:root .tag.red { background:rgba(217,54,62,.2); color:#ff9c9c; } html:root .tag.amber { background:rgba(240,160,32,.17); color:var(--warn); }
html:root .tag.blue { background:rgba(64,140,255,.2); color:#9cc8ff; }
html:root .chip { background:var(--inset); border-color:var(--line); font-size:var(--fs-micro); }
html:root .tabs button.on, html:root .tabs button[aria-selected="true"] { background:rgba(64,140,255,.14) !important; color:#fff; box-shadow:inset 0 -2px 0 var(--blue-2) !important; }
html:root .osec, html:root .chwrap { background:rgba(4,12,28,.28); border:1px solid var(--line); border-radius:8px; }
html:root .outwin .osec { margin-bottom:6px; } html:root .outwin .osec:first-of-type { border-top:1px solid var(--line); }
html:root .notice { background:rgba(64,140,255,.1); border-color:rgba(64,140,255,.3); color:#cfe3ff; border-radius:8px; }
html:root .note, html:root small { color:var(--mute); font-size:12.5px; }
html:root .unset, html:root .note.unset, html:root dd .note { color:var(--faint); opacity:1; }
html:root .kv2 dt, html:root dl dt { color:var(--mute); }
html:root .kv { grid-template-columns:11rem 1fr; gap:8px 16px; } html:root .kv div:nth-child(odd) { color:var(--mute); }
html:root svg.ich .gl { stroke:rgba(148,170,210,.13); } html:root svg.ich .tx, html:root .chart .tx { fill:var(--mute); }
html:root .oltcard .pic::before { background:radial-gradient(ellipse 60% 55% at 50% 60%, rgba(64,140,255,.2), rgba(0,100,200,.07) 55%, transparent 75%); }
html:root .infolist .it, html:root .oltrow { border-color:var(--line); }
html:root .infolist .it { font-size:var(--fs-small); } html:root .infolist .it .t { font-style:normal; color:var(--faint); font-size:var(--fs-micro); }
html:root .sig-good { color:var(--ok); } html:root .sig-warn { color:var(--warn); } html:root .sig-crit { color:var(--bad); font-weight:600; }
html:root .err { color:var(--bad); } html:root .okmsg { color:var(--ok); }
html:root pre.cli, html:root pre.logbox, html:root .difflist { background:#050d1c; border:1px solid var(--line); border-radius:8px; color:#cdd9ea; font:12.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; }
@media (max-width:760px) { html:root { --panel:var(--surface); } }

/* dialogs: the page behind stays still, the title and Close stay in view while the content scrolls */
html:root .modal-back { background:rgba(3,9,20,.68); z-index:1100; }
html:root .modal { border-radius:12px; box-shadow:0 24px 70px rgba(0,0,0,.55); overscroll-behavior:contain; }
html:root .modal .mh { position:sticky; top:0; z-index:3; background:var(--panel-solid); padding:12px 16px; border-bottom:1px solid var(--line); font-size:var(--fs-title); } html:root .modal .mh b { font-weight:650; color:#fff; }
html:root .modal .mb { padding:16px; }
html:root body:has(.modal-back) { overflow:hidden; }
html:root details.acc { background:var(--surface-2); border:1px solid var(--line); border-radius:8px; margin-bottom:6px; }
html:root details.acc > summary { padding:9px 12px; font-size:var(--fs-body); font-weight:600; border-radius:8px; }
html:root details.acc > summary:hover { background:var(--inset); }
html:root details.acc[open] > summary { border-bottom:1px solid var(--line); border-radius:8px 8px 0 0; margin-bottom:8px; }
html:root details.acc > summary::before { content:"\f105"; font-family:FontAwesome; font-size:14px; line-height:1; vertical-align:-1px; width:1rem; color:var(--faint); transition:transform .2s cubic-bezier(.22,1,.36,1); } html:root details.acc[open] > summary::before { content:"\f105"; transform:rotate(90deg); }
html:root .toast { background:var(--surface-3); border:1px solid var(--line-2); border-radius:8px; font-size:var(--fs-body); -webkit-backdrop-filter:none; backdrop-filter:none; }
html:root .toast.ok { border-color:rgba(73,209,125,.6); } html:root .toast.warn { border-color:rgba(246,180,69,.7); }

/* while a page is fetched: the shape of the page instead of an empty screen */
.skel { display:grid; gap:16px; } .skel .sk-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(168px, 1fr)); gap:14px; }
.skel i { display:block; border-radius:var(--r); background:linear-gradient(100deg, rgba(148,170,210,.07) 30%, rgba(148,170,210,.14) 50%, rgba(148,170,210,.07) 70%) 0 0 / 300% 100%; animation:skel 1.6s linear infinite; }
.skel .sk-tile { height:96px; } .skel .sk-panel { height:230px; } .skel .sk-line { height:44px; border-radius:8px; }
.skel .sk-msg { color:var(--faint); font-size:var(--fs-small); display:flex; gap:8px; align-items:center; min-height:20px; }
@keyframes skel { to { background-position:-300% 0; } }
@media (prefers-reduced-motion:reduce) { .skel i { animation:none; } }
html:root main.busy { opacity:.6; transition:opacity .2s .15s; } html:root main.busy::after { top:6px; right:24px; }
html:root .empty, html:root .emptybox { text-align:center; padding:36px 16px; color:var(--mute); } html:root .emptybox b { display:block; color:var(--text); font-size:15px; margin-bottom:4px; } html:root .emptybox button { margin-top:12px; }

/* Settings and Reports: the list of pages down the left, the page on the right */
.setlay { display:grid; grid-template-columns:216px minmax(0, 1fr); gap:24px; align-items:start; }
.setnav { position:sticky; top:70px; display:flex; flex-direction:column; gap:1px; }
.setnav .sg { font-size:var(--fs-micro); font-weight:600; color:var(--faint); letter-spacing:.04em; text-transform:uppercase; padding:14px 10px 5px; } .setnav .sg:first-child { padding-top:2px; }
html:root .setnav a { display:block; padding:7px 10px; border-radius:var(--r-sm); color:var(--mute); text-decoration:none; font-weight:500; cursor:pointer; }
html:root .setnav a:hover { background:var(--inset); color:#fff; }
html:root .setnav a.on { background:var(--hover); color:#fff; font-weight:600; box-shadow:inset 2px 0 0 var(--blue-2); }
.setmain { min-width:0; } .setmain #rt td:first-child, .setmain #tbl td:first-child { white-space:nowrap; } html:root .setmain > h3:first-child { margin-top:0; font-size:var(--fs-title); color:#fff; }
html:root .setmain > h3 { margin-top:28px; padding-top:20px; border-top:1px solid var(--line); } html:root .setmain > h3:first-child, html:root .setmain > div:first-child > h3:first-child { padding-top:0; border-top:0; margin-top:0; }
@media (max-width:860px) {
  .setlay { grid-template-columns:minmax(0, 1fr); gap:12px; }
  .setnav { position:static; flex-direction:row; overflow-x:auto; gap:4px; padding-bottom:6px; scrollbar-width:none; } .setnav::-webkit-scrollbar { display:none; }
  .setnav .sg { display:none; } html:root .setnav a { flex:none; white-space:nowrap; border:1px solid var(--line); } html:root .setnav a.on { box-shadow:none; border-color:var(--blue-2); }
}

/* the head of a page about one thing (an ONU, an OLT): what it is, how it is, what you can do */
.phead { display:flex; flex-wrap:wrap; align-items:center; gap:10px 16px; margin:2px 0 14px; }
.phead .pt { min-width:0; flex:1 1 18rem; } .phead h1 { margin:0; font-size:var(--fs-page); font-weight:650; letter-spacing:-.01em; color:#fff; line-height:1.25; overflow-wrap:anywhere; text-wrap:balance; }
.phead .psub { color:var(--mute); font-size:var(--fs-small); margin-top:2px; display:flex; flex-wrap:wrap; gap:2px 12px; }
.phead .pacts { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.phead .back { color:var(--mute); text-decoration:none; font-size:var(--fs-small); display:inline-flex; align-items:center; gap:6px; } .phead .back:hover { color:#fff; }
.pstats { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:1px; background:var(--line); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; margin-bottom:16px; }
.pstats > div { background:var(--surface); padding:10px 14px; min-width:0; } .pstats > div > span { display:block; color:var(--faint); font-size:var(--fs-micro); font-weight:600; letter-spacing:.02em; }
.pstats b { display:block; font-size:17px; font-weight:650; margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-variant-numeric:tabular-nums; } .pstats small { color:var(--mute); font-weight:500; }
.spill { display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:2px 10px 2px 8px; font-size:var(--fs-small); font-weight:600; background:var(--chip); color:var(--text); white-space:nowrap; }
.spill::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--grey); }
.spill.online { background:rgba(40,180,90,.16); color:var(--ok); } .spill.online::before { background:var(--ok); }
.spill.power_fail { background:rgba(240,160,32,.16); color:var(--warn); } .spill.power_fail::before { background:var(--warn); }
.spill.los { background:rgba(217,54,62,.2); color:#ff9c9c; } .spill.los::before { background:var(--bad); }

/* the list of OLTs: two lines per OLT, never a sideways scroll bar on a laptop */
.oltlistt td { vertical-align:middle; } .oltlistt .o-nm { min-width:13rem; }
/* the map in the colours of the page: the standard OpenStreetMap tiles, turned to night */
html:root #map { border:1px solid var(--line); background:#0b1626; } html:root #map .leaflet-tile-pane { filter:invert(1) hue-rotate(195deg) brightness(.92) contrast(.9) saturate(.55); }
html:root .leaflet-container a { color:var(--link); } html:root .leaflet-control-attribution { background:rgba(7,20,42,.8); color:var(--mute); }
html:root .leaflet-bar a { background:var(--surface-3); color:var(--text); border-color:var(--line-2); } html:root .leaflet-bar a:hover { background:var(--blue); color:#fff; }
html:root .leaflet-popup-content-wrapper, html:root .leaflet-popup-tip { background:var(--panel-solid); color:var(--text); box-shadow:var(--shadow); } .oltlistt .o-nm a { font-weight:650; font-size:15px; text-decoration:none; } .oltlistt .o-nm a:hover { text-decoration:underline; }
.oltlistt .o-sub { display:block; color:var(--mute); font-size:12.5px; margin-top:1px; } .oltlistt .o-sub .tag { margin-left:4px; }
.oltlistt .mini-bar { display:block; width:84px; height:4px; border-radius:2px; background:var(--chip); margin-top:5px; overflow:hidden; } .oltlistt .mini-bar i { display:block; height:100%; background:var(--ok); border-radius:2px; }

/* Configured list: the filter bar stays on one line on a laptop; the figures in the signal column line up */
html:root .fpanel .frow { gap:10px 12px; align-items:center; } html:root .fpanel #f_q { width:15rem; max-width:100%; } html:root .fpanel #f_olt { max-width:13rem; } html:root .fpanel #f_tr { max-width:11rem; }
html:root .fpanel .fl { font-size:var(--fs-small); color:var(--mute); }
html:root .onulist .sigcell small { font-size:var(--fs-small); font-variant-numeric:tabular-nums; } html:root .onulist .dim, html:root .dim { color:var(--faint); opacity:1; }
html:root .onulist .nmcell b { font-weight:600; color:var(--text); } html:root .onulist .nmcell small { color:var(--faint); font-size:var(--fs-micro); }
html:root .onulist td { padding-top:7px; padding-bottom:7px; }
html:root .toppager { margin:4px 0 6px; } html:root .toppager b { font-weight:500; color:var(--mute); font-size:var(--fs-small); }
html:root .trb { font-size:var(--fs-micro); border-radius:4px; } html:root .trb.live { background:rgba(40,180,90,.17); color:var(--ok); } html:root .trb.quiet { background:var(--chip); color:var(--mute); }

/* ONU page: labels to the left and quiet, values in the text colour; wide things (graphs, tables) under a small heading of their own */
html:root .onupage dl.kv2 .r { grid-template-columns:10.5rem minmax(0, 1fr); padding:4px 0; gap:12px; }
html:root .onupage dl.kv2 dt { text-align:left; font-weight:500; color:var(--mute); }
html:root .onupage .kvh { font-size:var(--fs-micro); font-weight:600; color:var(--faint); letter-spacing:.04em; text-transform:uppercase; margin:18px 0 4px; padding-bottom:6px; border-bottom:1px solid var(--line); }
html:root .onupage .kvh:first-child { margin-top:0; }
html:root .onupage > dl.kv2 { margin:20px 0 0; padding-top:16px; border-top:1px solid var(--line); }
html:root .onupage > dl.kv2 .r { grid-template-columns:minmax(0, 1fr); gap:8px; padding:0; }
html:root .onupage > dl.kv2 dt { font-size:15px; font-weight:650; color:var(--text); }
html:root .onupage .onuright dl.kv2 { margin-top:8px; }
.facts { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:10px 20px; }
.facts span { display:block; color:var(--faint); font-size:var(--fs-micro); font-weight:600; } .facts b { display:block; font-weight:500; overflow-wrap:anywhere; }
.livedot { width:8px; height:8px; border-radius:50%; background:currentColor; margin-right:1px; }
html:root .vipstar { color:#f5c542; }
html:root .wifibox, html:root .statbox { background:var(--surface-2); border:1px solid var(--line); border-radius:8px; }
#lv > * + * { margin-top:10px; } #lv .statbox { display:inline-flex; }
/* router dialog */
.acc-g { font-size:var(--fs-micro); font-weight:600; color:var(--faint); letter-spacing:.04em; text-transform:uppercase; margin:16px 2px 6px; }
.trbar { margin-bottom:0 !important; align-items:center !important; }
#trb .filters .fl small { color:var(--mute); font-size:var(--fs-micro); font-weight:600; text-align:left; }
#trb .accb .filters { margin:12px 0 4px; }

/* dangerous actions sit apart from everyday ones */
.dzone { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; margin-top:16px; padding:10px 12px; border:1px solid rgba(255,128,128,.25); border-radius:8px; background:rgba(217,54,62,.06); }
.dzone > span { color:var(--mute); font-size:var(--fs-small); flex:1 1 14rem; }
.tb-sep { flex:1; }

/* sign-in */
html:root .login { max-width:22.5rem; margin:10vh auto 0; padding:24px; } html:root .login > h3:first-child { margin:0 0 4px !important; padding:0; border:0; min-height:0; font-size:var(--fs-page); }
html:root .login .lsub { color:var(--mute); margin:0 0 18px; } html:root .login label { display:block; font-size:var(--fs-small); font-weight:600; margin:12px 0 4px; }
html:root .login input { width:100%; margin-bottom:0; min-height:40px; } html:root .login #lgo { width:100%; justify-content:center; min-height:40px; margin-top:18px; font-size:var(--fs-body); }
html:root .login.wide { max-width:30rem; } html:root .login.paused { max-width:46rem; }

/* dashboard of one OLT: the strip above the cards, and the list of OLTs shown while "All OLTs" is chosen */
.subdash { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .5rem .8rem; margin: 0 0 .7rem; border-radius: .5rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.subdash a { margin-left: auto; }
.oltlist { display: flex; flex-direction: column; }
.oltrow { display: flex; align-items: center; gap: .55rem; padding: .55rem .3rem; border-bottom: 1px solid rgba(255,255,255,.1); color: inherit; text-decoration: none; }
.oltrow:hover, .oltrow:focus-visible { background: rgba(255,255,255,.08); }
.oltrow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.oltrow small { opacity: .7; }
.oltrow .cnt { white-space: nowrap; opacity: .9; }

/* OLT page: side panel and PON port groups */
.sidepanel { margin-top:.7rem; border:1px solid var(--line); border-radius:8px; background:var(--inset); }
.sidepanel > div { display:flex; justify-content:space-between; gap:.6rem; padding:.5rem .75rem; font-size:.88rem; border-top:1px solid var(--line); }
.sidepanel > div:first-child { border-top:0; } .sidepanel span { color:var(--mute); } .sidepanel b { text-align:right; }
.slothd { margin:1rem 0 .4rem; font-size:.95rem; }
.pontbl .props { font-size:.8rem; } .pontbl .pact a { display:flex; align-items:center; gap:.3rem; font-size:.85rem; white-space:nowrap; }
button.amber { background:var(--amber); color:#1a1200; }
/* Configured list: filters and table sit straight on the page like the reference (no box around them) */
html:root .panel.fpanel, html:root .panel.onulist { background:transparent; border:0; box-shadow:none; padding:0; border-radius:0; }
html:root .panel.fpanel label.fl { font-weight:700; color:#cbd5e1; }

/* installer mode (phone page): one field per line, big touch targets */
html:root .inst label { display:block; margin:.7rem 0; color:var(--mute, #93a2bf); font-size:.85rem; }
html:root .inst label input, html:root .inst label select { display:block; width:100%; margin-top:.25rem; font-size:1rem; padding:.6rem .7rem; }
html:root .inst .filters input { font-size:1.05rem; padding:.6rem .7rem; }
html:root .inst-sig .kv > div:nth-child(odd) { color:var(--mute, #93a2bf); }

/* router panel forms: each box shows its current value, with a small label above it */
#trb .filters .fl { display:flex; flex-direction:column; gap:.15rem; }
#trb .filters .fl small { color:var(--muted, #8a93a3); font-size:.75rem; }
#trb .pw { display:flex; gap:.3rem; align-items:center; }
#trb .eye { padding:.35rem .5rem; line-height:1; }
#trb .filters { align-items:flex-end; }
