/* Raspberry Control — сине-белая тема. Анимации: transform/opacity, 150–260 мс, ease-out-quint. */
:root {
  --bg: #f2f6ff; --bg2: #e8f0ff; --surface: #ffffff; --surface2: #f6f9ff; --ink: #0a1a3a; --muted: #5b6d90; --faint: #8fa0c2;
  --line: #dce6f8; --blue: #1f6bff; --blue2: #4d8dff; --cyan: #1fb6f2; --indigo: #5b6dfa;
  --ok: #0fb58a; --warn: #f2a31f; --bad: #ef4560; --shadow: 0 1px 2px rgba(15,40,100,.06), 0 8px 28px -12px rgba(31,107,255,.22);
  --glass: rgba(255,255,255,.72); --ring: rgba(31,107,255,.18);
  --ease: cubic-bezier(.23, 1, .32, 1); --ease-io: cubic-bezier(.77, 0, .175, 1);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #060e1f; --bg2: #0a1630; --surface: #0e1b36; --surface2: #122244; --ink: #e8f0ff; --muted: #8ea3cc; --faint: #5d7099;
  --line: #1b2f58; --blue: #4d8dff; --blue2: #78a8ff; --cyan: #3cc8ff; --indigo: #8391ff;
  --ok: #2ad3a4; --warn: #ffbf47; --bad: #ff6a80; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -14px rgba(0,0,0,.6);
  --glass: rgba(14,27,54,.7); --ring: rgba(77,141,255,.28); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060e1f; --bg2: #0a1630; --surface: #0e1b36; --surface2: #122244; --ink: #e8f0ff; --muted: #8ea3cc; --faint: #5d7099;
    --line: #1b2f58; --blue: #4d8dff; --blue2: #78a8ff; --cyan: #3cc8ff; --indigo: #8391ff;
    --ok: #2ad3a4; --warn: #ffbf47; --bad: #ff6a80; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -14px rgba(0,0,0,.6);
    --glass: rgba(14,27,54,.7); --ring: rgba(77,141,255,.28); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45;
  background-image: radial-gradient(1100px 520px at 85% -10%, rgba(31,107,255,.14), transparent 60%), radial-gradient(800px 480px at -10% 110%, rgba(31,182,242,.12), transparent 60%);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; flex: none; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }

/* логин */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .4s var(--ease); }
.login-card { width: min(380px, 100%); background: var(--glass); backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 22px; padding: 30px 28px; box-shadow: var(--shadow); display: grid; gap: 14px; animation: rise .55s var(--ease); }
.login-card h1 { margin: 6px 0 0; font-size: 24px; letter-spacing: -.02em; }
.login-card p { margin: -8px 0 6px; color: var(--muted); }
.login-err { min-height: 18px; color: var(--bad); font-size: 13px; }
.field { display: grid; gap: 6px; } .field span { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.field input { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 14px; font: inherit; transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--ring); }
.btn { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px var(--font); cursor: pointer; transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #fff; border: 0; box-shadow: 0 10px 22px -10px rgba(31,107,255,.7); }
.btn.primary:hover { transform: translateY(-1px); }
.logo-mark { width: 52px; height: 52px; border-radius: 16px; background: #000; display: grid; place-items: center; position: relative; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 10px 26px -10px rgba(31,107,255,.7); }
.logo-mark img { width: 74%; height: 74%; object-fit: contain; display: block; }
.logo-mark::after { content: ""; position: absolute; inset: -3px; border-radius: 19px; border: 1.5px solid rgba(77,141,255,.55); opacity: 0; animation: ping 3.2s var(--ease) infinite; }
.logo-mark.sm { width: 38px; height: 38px; border-radius: 12px; } .logo-mark.sm::after { border-radius: 14px; }

/* каркас */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100%; }
.rail { position: sticky; top: 0; height: 100vh; padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; border-right: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(16px); }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 6px; } .brand b { display: block; font-size: 16px; letter-spacing: -.01em; } .brand small { color: var(--muted); font-size: 12px; }
#nav { position: relative; display: grid; gap: 4px; }
#nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 12px; color: var(--muted); font-weight: 600; transition: color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease); }
#nav a:hover { color: var(--ink); background: var(--surface2); transform: translateX(2px); }
#nav a.on { color: var(--blue); }
.nav-ind { position: absolute; left: 0; right: 0; height: 42px; border-radius: 12px; background: linear-gradient(90deg, rgba(31,107,255,.14), rgba(31,182,242,.08)); box-shadow: inset 0 0 0 1px var(--ring); transition: transform .32s var(--ease); top: 0; }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font: 700 11px/20px var(--font); text-align: center; color: #fff; background: var(--bad); font-style: normal; }
.rail-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.conn { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); } .conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); } .conn.ok i { background: var(--ok); animation: pulse 2s infinite; } .conn.bad i { background: var(--bad); }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: transform .16s var(--ease), color .16s, border-color .16s; }
.icon-btn:hover { color: var(--blue); border-color: var(--blue); transform: translateY(-1px); } .icon-btn:active { transform: scale(.94); }
.main { padding: 26px 32px 60px; min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.top h2 { margin: 0; font-size: 28px; letter-spacing: -.025em; } .sub { color: var(--muted); margin-top: 2px; }
.top-right { display: flex; align-items: center; gap: 14px; } .upd { color: var(--faint); font-size: 12px; font-family: var(--mono); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 12px; border-radius: 16px; font-weight: 700; font-size: 13px; background: var(--surface); border: 1px solid var(--line); transition: all .3s var(--ease); }
.pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); } .pill.ok i { background: var(--ok); animation: pulse 2.2s infinite; }
.pill.warn { color: var(--warn); } .pill.warn i { background: var(--warn); animation: pulse 1.4s infinite; }
.pill.bad { color: var(--bad); } .pill.bad i { background: var(--bad); animation: pulse .9s infinite; }

/* контент */
.view { display: grid; gap: 18px; }
.view.enter > * { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 16px; box-shadow: var(--shadow); position: relative; min-width: 0; transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; }
.card.hover:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); }
.card h3 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; word-break: break-all; }
.big { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; } .big small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 700; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); }
.tag.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.tag.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }
.tag.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.tag.blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); border-color: color-mix(in srgb, var(--blue) 28%, transparent); }

/* hero */
.hero { overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 26px 28px; background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 14%, var(--surface)), var(--surface) 60%); }
.hero h1 { margin: 6px 0 4px; font-size: 30px; letter-spacing: -.03em; } .hero p { margin: 0; color: var(--muted); }
.problems { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.orb { width: 150px; height: 150px; position: relative; display: grid; place-items: center; }
.orb .core { width: 64px; height: 64px; border-radius: 50%; background: var(--c, var(--ok)); box-shadow: 0 0 40px var(--c, var(--ok)); position: relative; z-index: 2; transition: background .5s var(--ease), box-shadow .5s var(--ease); }
.orb .core::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: rgba(255,255,255,.85); }
.orb .r { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--c, var(--ok)); opacity: 0; animation: ping 3.4s var(--ease) infinite; }
.orb .r:nth-child(2) { animation-delay: 1.1s; } .orb .r:nth-child(3) { animation-delay: 2.2s; }
.orb .sweep { position: absolute; inset: 10px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 70%, color-mix(in srgb, var(--c, var(--ok)) 55%, transparent) 100%); animation: spin 4.5s linear infinite; -webkit-mask: radial-gradient(circle, transparent 36%, #000 38%); mask: radial-gradient(circle, transparent 36%, #000 38%); }
.hero[data-level="warn"] { --c: var(--warn); } .hero[data-level="bad"] { --c: var(--bad); }

/* кольцевые показатели */
.ring { --p: 0; width: 92px; height: 92px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); } .ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring .bg { stroke: var(--surface2); } .ring .fg { stroke: var(--rc, var(--blue)); stroke-dasharray: 251.3; stroke-dashoffset: calc(251.3 * (1 - var(--p))); transition: stroke-dashoffset .9s var(--ease), stroke .4s; }
.ring .t { position: absolute; inset: 0; display: grid; place-items: center; font: 700 17px var(--mono); }
.tile { display: flex; align-items: center; gap: 14px; }
.bar { height: 7px; border-radius: 4px; background: var(--surface2); overflow: hidden; } .bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--blue), var(--cyan)); width: 0; transition: width .8s var(--ease), background .3s; }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); }
.cores { display: grid; gap: 8px; }
.cores .row { display: grid; grid-template-columns: 38px 1fr 46px; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }

/* сигнал */
.sigbars { display: inline-flex; align-items: flex-end; gap: 3px; height: 20px; } .sigbars i { width: 5px; border-radius: 2px; background: var(--line); transition: background .4s, height .4s var(--ease); } .sigbars i.on { background: var(--c, var(--ok)); }
.sigbars i:nth-child(1) { height: 25%; } .sigbars i:nth-child(2) { height: 45%; } .sigbars i:nth-child(3) { height: 65%; } .sigbars i:nth-child(4) { height: 82%; } .sigbars i:nth-child(5) { height: 100%; }

/* модем-карточка */
.modem { display: grid; gap: 12px; } .modem .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modem .name { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.dot-op { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.modem.down { opacity: .8; } .modem.down .name::after { content: "нет связи"; font: 700 11px var(--font); color: var(--bad); margin-left: 6px; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .mini div { background: var(--surface2); border-radius: 12px; padding: 9px 11px; } .mini small { display: block; color: var(--muted); font-size: 11px; } .mini b { font: 700 14px var(--mono); }
.spark { width: 100%; height: 44px; display: block; overflow: visible; } .spark path.l { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } .spark path.a { fill: url(#sg); opacity: .5; }
.spark.draw { animation: reveal 1s var(--ease) both; }

/* таблицы */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; } .tbl th { text-align: left; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 6px 8px; } .tbl td { padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr { transition: background .15s; } .tbl tbody tr:hover { background: var(--surface2); } .tbl .r { text-align: right; } .scroll { overflow-x: auto; }

/* график */
.chart { position: relative; } .chart svg { width: 100%; height: 190px; overflow: visible; display: block; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 3 5; } .chart text { fill: var(--faint); font: 11px var(--mono); }
.chart .tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font: 12px var(--mono); box-shadow: var(--shadow); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s var(--ease); white-space: nowrap; z-index: 3; }
.chart .tip.on { opacity: 1; transform: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--muted); } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.seg { display: inline-flex; background: var(--surface2); border-radius: 11px; padding: 3px; gap: 2px; } .seg button { border: 0; background: transparent; color: var(--muted); font: 700 12px var(--font); height: 28px; padding: 0 11px; border-radius: 9px; cursor: pointer; transition: all .18s var(--ease); } .seg button.on { background: var(--surface); color: var(--blue); box-shadow: var(--shadow); }

/* схема связи */
.topo { padding: 10px 6px 4px; } .topo svg { width: 100%; height: 300px; overflow: visible; } .topo .ln { stroke: var(--line); stroke-width: 2; fill: none; } .topo .ln.on { stroke: var(--blue); stroke-dasharray: 5 9; animation: dash 1.1s linear infinite; } .topo .ln.main { stroke: var(--ok); stroke-width: 3; }
.topo text { fill: var(--ink); font: 700 12px var(--font); } .topo .s { fill: var(--muted); font: 500 11px var(--mono); }
.topo .nd { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; transition: stroke .4s; } .topo .nd.up { stroke: var(--ok); } .topo .nd.dn { stroke: var(--bad); }

/* события */
.timeline { display: grid; gap: 2px; } .ev { display: grid; grid-template-columns: 16px 1fr auto; gap: 14px; align-items: start; padding: 11px 6px; border-radius: 12px; transition: background .15s; } .ev:hover { background: var(--surface2); }
.ev .d { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--faint); } .ev .d.ok { background: var(--ok); } .ev .d.warn { background: var(--warn); } .ev .d.bad { background: var(--bad); } .ev .d.info { background: var(--blue); }
.ev b { font-weight: 700; } .ev small { color: var(--muted); display: block; } .ev time { color: var(--faint); font: 12px var(--mono); text-align: right; white-space: nowrap; }
.empty { color: var(--faint); text-align: center; padding: 26px 0; }
.logbox { font: 12px/1.6 var(--mono); color: var(--muted); background: var(--surface2); border-radius: 12px; padding: 12px 14px; max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { transform: scale(.45); opacity: .55; } 80%, 100% { transform: scale(1.15); opacity: 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 40%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@keyframes dash { to { stroke-dashoffset: -28; } }
@keyframes draw { from { stroke-dashoffset: var(--len, 1000); } to { stroke-dashoffset: 0; } }
@keyframes flash { 0% { background: color-mix(in srgb, var(--blue) 18%, transparent); } 100% { background: transparent; } }
.flash { animation: flash .9s var(--ease); border-radius: 6px; }

@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; } .main { padding: 18px 16px 96px; }
  .rail { position: fixed; z-index: 20; inset: auto 0 0 0; height: 68px; flex-direction: row; padding: 8px 10px; gap: 6px; border-right: 0; border-top: 1px solid var(--line); }
  .brand, .conn { display: none; } #nav { grid-auto-flow: column; grid-auto-columns: 1fr; flex: 1; } #nav a { flex-direction: column; justify-content: center; gap: 2px; height: 50px; padding: 0; font-size: 10.5px; } .nav-ind { display: none; } #nav a.on { background: var(--surface2); }
  .rail-foot { margin: 0; } .g2, .g3, .g4 { grid-template-columns: 1fr; } .g6 { grid-template-columns: repeat(2, 1fr); } .hero { grid-template-columns: 1fr; } .orb { display: none; } .top h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

.nt { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; padding: 0 9px; border-radius: 12px; font: 800 12px var(--mono); letter-spacing: .02em; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); }
.nt.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); border-color: color-mix(in srgb, var(--ok) 32%, transparent); }
.nt.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); border-color: color-mix(in srgb, var(--warn) 36%, transparent); animation: breathe 2.4s var(--ease-io) infinite; }
.nt.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); border-color: color-mix(in srgb, var(--bad) 34%, transparent); animation: breathe 1.4s var(--ease-io) infinite; }
.nt.big { height: 32px; min-width: 52px; font-size: 18px; border-radius: 16px; }
.notice { border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); background: var(--surface2); border: 1px solid var(--line); } .notice.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn) 9%, transparent); } .notice.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad) 9%, transparent); }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.legend2 { display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12px; color: var(--muted); flex-wrap: wrap; justify-content: flex-end; }
.legend2 .lg { display: inline-block; width: 22px; height: 0; border-top: 3px dashed var(--faint); margin-left: 8px; } .legend2 .lg.g { border-color: var(--ok); } .legend2 .lg.b { border-color: var(--blue); } .legend2 .lg.n { border-top-style: solid; border-color: var(--line); }

/* --- мобильные исправления --- */
html, body { overflow-x: hidden; max-width: 100%; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
.app, .main, .view, .card, .grid > * { min-width: 0; max-width: 100%; }
.card h3 { flex-wrap: wrap; row-gap: 8px; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; } .seg::-webkit-scrollbar { display: none; } .seg button { white-space: nowrap; flex: none; }
.tag { white-space: nowrap; }
.legend2 { justify-content: flex-start; }
.mtopo { display: none; }
@media (max-width: 860px) {
  .topo svg { display: none; } .mtopo { display: grid; gap: 14px; padding: 4px 0 2px; }
  .mtopo .hub { justify-self: center; padding: 10px 22px; border-radius: 14px; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--blue), var(--cyan)); box-shadow: 0 10px 24px -10px rgba(31,107,255,.7); position: relative; }
  .mtopo .hub::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 14px; background: repeating-linear-gradient(var(--blue) 0 4px, transparent 4px 8px); transform: translateX(-50%); }
  .mtopo .nodes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .mnode { position: relative; overflow: hidden; border-radius: 14px; padding: 10px 8px 9px; background: var(--surface2); border: 1.5px solid var(--line); text-align: center; transition: border-color .4s, box-shadow .4s; }
  .mnode.up { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); } .mnode.dn { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
  .mnode.main { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
  .mnode i { display: block; width: 10px; height: 10px; border-radius: 50%; margin: 0 auto 6px; background: var(--c); }
  .mnode b { display: block; font-size: 12.5px; } .mnode small { display: block; margin-top: 2px; font: 11px var(--mono); color: var(--muted); }
  .mnode.act::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 40%; background: linear-gradient(90deg, transparent, var(--blue), transparent); animation: slide 1.6s linear infinite; }
  .mnode.main.act::before { background: linear-gradient(90deg, transparent, var(--ok), transparent); }
  .legend2 { gap: 4px 6px; } .legend2 .lg { margin-left: 4px; width: 16px; }
  .card { padding: 15px 14px 14px; } .big { font-size: 26px; }
  .tbl { font-size: 12.5px; } .tbl td, .tbl th { padding: 8px 6px; }
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

@media (pointer: coarse) {
  .seg button { height: 36px; padding: 0 14px; font-size: 13px; } .seg { padding: 3px; }
  .icon-btn { width: 44px; height: 44px; } .btn { height: 48px; }
}
@media (hover: none) { .card.hover:hover { transform: none; } #nav a:hover { transform: none; } }
