:root {
  --bg: #070b10;
  --bg-2: #0a1017;
  --panel: #0f1721;
  --panel-2: #0c131b;
  --line: #1a2634;
  --line-2: #263646;
  --text: #dce8f4;
  --muted: #7f94aa;
  --faint: #566a7e;
  --accent: #3ddc97;
  --accent-2: #4da3ff;
  --warn: #f5b942;
  --danger: #ff5d6c;
  --ok: #3ddc97;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; }

::selection { background: rgba(61, 220, 151, .28); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1d2a39; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

[hidden] { display: none !important; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* ---------------------------------------------------------------- login */

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(720px 520px at 18% 8%, rgba(61, 220, 151, .10), transparent 60%),
    radial-gradient(600px 460px at 82% 92%, rgba(77, 163, 255, .10), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 42px 42px, 42px 42px, auto;
}

.login-wrap { width: min(400px, calc(100vw - 32px)); padding: 24px 0; }

.login-card {
  position: relative;
  padding: 34px 30px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 28, 40, .88), rgba(10, 16, 24, .94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(61, 220, 151, .65), rgba(77, 163, 255, .55), transparent);
}

.login-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 16px;
  color: var(--accent);
  background: radial-gradient(circle at 30% 20%, rgba(61, 220, 151, .18), rgba(61, 220, 151, .03) 65%);
  border: 1px solid rgba(61, 220, 151, .28);
}

.login-card h1 { margin: 0; text-align: center; font-size: 22px; letter-spacing: -.01em; }
.login-sub { margin: 4px 0 22px; text-align: center; color: var(--muted); font-size: 12.5px; }

.login-form { display: grid; gap: 14px; }
.login-form label { display: grid; gap: 6px; }
.login-form label span { font-size: 12px; color: var(--muted); }

.login-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(5, 10, 15, .7);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.login-form input:focus {
  border-color: rgba(61, 220, 151, .65);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, .10);
}

.login-foot { margin: 20px 0 0; text-align: center; font-size: 11px; color: var(--faint); }

/* ---------------------------------------------------------------- shell */

.shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  grid-template-rows: 60px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 19, .88);
  backdrop-filter: blur(12px);
  z-index: 20;
  min-width: 0;
}

.menu-btn {
  display: none !important;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #04110b;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 1px rgba(61, 220, 151, .18), 0 0 22px rgba(61, 220, 151, .18);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; overflow: hidden; }
.brand-text strong { font-size: 14px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--faint); font-size: 10.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}

.clock { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--text); font-size: 12px; }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 4px rgba(85, 103, 120, .12);
  transition: background .2s, box-shadow .2s;
}
.live-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(61, 220, 151, .12), 0 0 14px rgba(61, 220, 151, .55); }
.live-dot.bad { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 93, 108, .12); }

.logout-form { margin: 0; }

.sidebar {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 17, 25, .9), rgba(7, 11, 16, .9));
  overflow-y: auto;
  min-width: 0;
}

.nav { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.nav-link {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}

.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .03); text-decoration: none; }

.nav-link.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(61, 220, 151, .11), rgba(61, 220, 151, .02));
  border-color: rgba(61, 220, 151, .18);
  box-shadow: inset 2px 0 0 var(--accent);
}

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  color: var(--faint);
  font-size: 11px;
  border-top: 1px solid var(--line);
}

.main {
  grid-row: 2;
  overflow-y: auto;
  padding: 22px 24px 40px;
  min-width: 0;
}

.view { display: none; }
.view.active { display: block; animation: view-in .18s ease-out; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- cards */

.card {
  background: linear-gradient(180deg, rgba(17, 26, 37, .82), rgba(10, 16, 24, .9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-height: 22px;
}

.card-head h2, .card h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .01em; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 16px;
}

.page-head h1 { margin: 0; font-size: 21px; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; font-size: 12px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-2 > .card { margin-bottom: 14px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 0;
}

.stat-card { min-height: 116px; display: flex; flex-direction: column; }

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.stat-sub { color: var(--faint); font-size: 11px; text-transform: none; letter-spacing: 0; }

.stat-value {
  margin: 8px 0 4px;
  font-size: 31px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.stat-value .unit { margin-left: 2px; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.bar {
  height: 6px;
  margin-top: auto;
  border-radius: 99px;
  background: #17222e;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .45s ease;
}

.bar.warn > span { background: linear-gradient(90deg, var(--warn), #ff8a5c); }
.bar.danger > span { background: linear-gradient(90deg, var(--danger), #ff8a5c); }

.spark { width: 100%; height: 46px; display: block; margin-top: auto; }
.chart { width: 100%; height: 150px; display: block; }
.donut { width: 100%; height: 180px; display: block; }

.cores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.core {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .012);
}

.core-top { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); margin-bottom: 5px; }
.core-bar { height: 4px; background: #16212c; border-radius: 99px; overflow: hidden; }
.core-bar span { display: block; height: 100%; width: 0; background: var(--accent-2); border-radius: 99px; transition: width .4s; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.legend i.sw.used { background: var(--accent); }
.legend i.sw.cache { background: var(--accent-2); }
.legend i.sw.free { background: #223141; }

.net-rates { display: flex; gap: 20px; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.net-rates b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.disk-list { display: grid; gap: 11px; }
.disk-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; margin-bottom: 6px; }
.disk-row .bar { margin-top: 0; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.site-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }

.site-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .012);
}

.site-mini .meta { min-width: 0; flex: 1; }
.site-mini .meta strong { display: block; font-size: 12.5px; font-weight: 600; }
.site-mini .meta small { display: block; color: var(--faint); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-mini .right { text-align: right; font-size: 11px; color: var(--muted); white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .012);
  font-size: 11.5px;
  color: var(--muted);
}

.chip b { color: var(--text); font-weight: 500; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(61, 220, 151, .5); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(245, 185, 66, .4); }
.dot.bad { background: var(--danger); box-shadow: 0 0 8px rgba(255, 93, 108, .4); }
.dot.info { background: var(--accent-2); box-shadow: 0 0 8px rgba(77, 163, 255, .4); }

/* ---------------------------------------------------------------- sites */

.site-list { display: grid; gap: 14px; }

.site-card { margin: 0; }

.site-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.site-name { display: flex; align-items: center; gap: 9px; }
.site-name h3 { margin: 0; font-size: 15px; font-weight: 600; }
.site-domain { color: var(--muted); font-size: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace; margin-top: 2px; }

.site-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, .012);
}
.metric .k { color: var(--faint); font-size: 10.5px; letter-spacing: .02em; }
.metric .v { margin-top: 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.metric .v small { color: var(--muted); font-size: 11px; }

.site-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 2px; }

.extra-checks { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.extra-check { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  background: rgba(255, 255, 255, .02);
  white-space: nowrap;
}
.pill.ok { color: #a9f2d0; border-color: rgba(61, 220, 151, .32); background: rgba(61, 220, 151, .08); }
.pill.warn { color: #ffdda1; border-color: rgba(245, 185, 66, .32); background: rgba(245, 185, 66, .08); }
.pill.bad { color: #ffb7bd; border-color: rgba(255, 93, 108, .32); background: rgba(255, 93, 108, .08); }
.pill.muted { color: var(--muted); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #111b26;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}

.btn:hover { background: #162332; border-color: #344a60; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid rgba(61, 220, 151, .55); outline-offset: 2px; }

.btn.primary {
  background: linear-gradient(135deg, #34d596, #2f9ee0);
  border-color: transparent;
  color: #04110b;
  font-weight: 650;
}
.btn.primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, #34d596, #2f9ee0); }

.btn.danger { background: rgba(255, 93, 108, .08); border-color: rgba(255, 93, 108, .28); color: #ffb7bd; }
.btn.danger:hover { background: rgba(255, 93, 108, .14); }

.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, .04); }

.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.wide { width: 100%; padding: 10px 14px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 8px 9px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10px 8px; border-bottom: 1px solid rgba(26, 38, 52, .7); font-size: 12.5px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, .015); }
.table.compact td { padding: 8px 8px; font-size: 12px; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table .cmd { max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; }
.unit-name { font-size: 10px; margin-top: 1px; }

/* ---------------------------------------------------------------- forms */

.form { display: grid; gap: 12px; margin-top: 10px; }
.form label { display: grid; gap: 6px; }
.form label span { font-size: 12px; color: var(--muted); }
.form input, .form select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(5, 10, 15, .7);
  color: var(--text);
  outline: none;
}
.form input:focus, .form select:focus { border-color: rgba(61, 220, 151, .6); box-shadow: 0 0 0 3px rgba(61, 220, 151, .09); }

.secret {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  background: rgba(3, 7, 11, .65);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
  color: #b7f5d8;
}
.secret.small { color: var(--muted); font-size: 10.5px; }

.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.check input { accent-color: var(--accent); }

/* ---------------------------------------------------------------- logs */

.log-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.log-toolbar select {
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #0b131b;
  color: var(--text);
  outline: none;
}

.log, .console {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #05090d;
  color: #b9c9d8;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: auto;
}
.log { max-height: 62vh; min-height: 220px; }
.console { max-height: 260px; margin: 12px 0 0; }

/* ---------------------------------------------------------------- modal */

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 5, 8, .72); backdrop-filter: blur(5px); }
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: linear-gradient(180deg, #121c27, #0b121a);
  box-shadow: var(--shadow);
}
.modal-card h3 { margin: 0 0 8px; font-size: 16px; }
.modal-card p { margin: 0 0 16px; color: var(--muted); font-size: 13px; white-space: pre-wrap; max-height: 50vh; overflow: auto; overflow-wrap: anywhere; }
.modal-card pre { max-height: 50vh; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------------------------------------------------------------- toasts */

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }

.toast {
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  border-radius: 9px;
  background: rgba(14, 22, 31, .96);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  animation: toast-in .18s ease-out;
}
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }

@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- misc */

.alert { padding: 9px 11px; border-radius: 8px; font-size: 12.5px; margin: 8px 0; }
.alert.danger { background: rgba(255, 93, 108, .08); border: 1px solid rgba(255, 93, 108, .3); color: #ffb7bd; }
.alert.warn { background: rgba(245, 185, 66, .07); border: 1px solid rgba(245, 185, 66, .26); color: #ffdda1; }

.hint { margin: 10px 0 0; color: var(--faint); font-size: 11.5px; }

.iface-list { display: grid; gap: 9px; }
.iface { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .012); }
.iface .name { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; min-width: 74px; }
.iface .addr { color: var(--muted); font-size: 11.5px; flex: 1; overflow-wrap: anywhere; }
.iface .state { font-size: 10.5px; color: var(--faint); }

.chart-empty { color: var(--faint); font-size: 11.5px; text-align: center; padding: 30px 0; }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 56px auto minmax(0, 1fr); height: auto; min-height: 100vh; overflow: visible; }
  .topbar { position: sticky; top: 0; padding: 0 12px; }
  .menu-btn { display: inline-grid !important; }
  body.nav-closed .sidebar { display: none; }
  .sidebar { grid-row: 2; grid-column: 1; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav-link { white-space: nowrap; padding: 7px 10px; }
  .side-foot { display: none; }
  .main { grid-row: 3; overflow: visible; padding: 16px 14px 36px; }
  .grid-2 { grid-template-columns: 1fr; }
  .top-meta .muted { display: none; }
}

@media (max-width: 620px) {
  .stat-grid { grid-template-columns: 1fr; }
  .brand-text small { display: none; }
  .clock { display: none; }
  .top-meta { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .site-top { flex-direction: column; }
  .stat-value { font-size: 28px; }
}
