:root {
  --bg0: #0b1020;
  --bg1: #111a33;
  --bg2: #17203f;
  --line: #2a3760;
  --txt: #e8eef7;
  --mut: #93a4c3;
  --acc: #38bdf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --card: 12px;
  --mono: "Consolas", "Menlo", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Prompt", system-ui, sans-serif;
  background-image:
    linear-gradient(rgba(11, 16, 32, 0.55), rgba(11, 16, 32, 0.55)),
    url('../../images/bg-main.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--txt);
  min-height: 100vh;
}
@media (max-width: 900px) {
  body { background-attachment: scroll; }
}
.hidden { display: none !important; }

/* ---------- shared controls ---------- */
select, button, input[type="date"], input[type="text"] {
  font-family: inherit; font-size: 13px; color: var(--txt);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; cursor: pointer;
}
select:hover, button:hover, input[type="date"]:hover { border-color: var(--acc); }
button.pill { display: inline-flex; align-items: center; gap: 6px; }
button.pill.small { padding: 4px 10px; font-size: 12px; }
button.x { border: 0; background: transparent; font-size: 16px; color: var(--mut); float: right; cursor: pointer; }
.badge { font-size: 12px; padding: 4px 10px; border-radius: 999px; font-weight: 600; border: 1px solid var(--line); background: var(--bg2); }
.cflag { width: 18px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; box-shadow: 0 0 0 1px rgba(128,128,128,.35); object-fit: cover; }
.badge.on { color: var(--ok); border-color: var(--ok); }
.badge.war { color: var(--warn); border-color: var(--warn); }
.badge.off { color: var(--bad); border-color: var(--bad); }
.badge.no { color: var(--mut); }
.spacer { flex: 1; }
.ctl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mut); }
.row { display: flex; gap: 10px; align-items: center; }

/* =====================================================
   V7 layout: left sidebar + main column
   ===================================================== */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50;
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 12px;
  background: linear-gradient(180deg, #0e1730, #0a1020);
  border-right: 1px solid var(--line);
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; border-bottom: 1px solid var(--line); }
.sidebar .brand .logo {
  width: 44px; height: 44px; border-radius: 10px; flex: none;
  object-fit: contain;
}
.sidebar .brand h1 { font-size: 15px; margin: 0; font-weight: 600; line-height: 1.2; }
.sidebar .brand .sub { font-size: 11px; color: var(--mut); }
@media (max-width: 900px) {
  .sidebar .brand .logo { width: 36px; height: 36px; }
}

/* ---------- sidebar main nav (vertical) ---------- */
.mainnav { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; }
.mainnav button {
  font-family: inherit; font-size: 14px; color: var(--mut); text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 9px;
  padding: 9px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.mainnav button .ic { width: 20px; text-align: center; font-size: 15px; }

/* ---------- solar system planet logos per main section ---------- */
.plt {
  display: inline-block; width: 15px; height: 15px; border-radius: 50%; flex: none;
  vertical-align: -2px; position: relative;
  box-shadow: inset -3px -3px 5px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08);
}
.plt-mercury { background: radial-gradient(circle at 35% 30%, #dde2e8, #8e96a3 60%, #56606c); }
.plt-venus   { background: radial-gradient(circle at 35% 30%, #fef3c7, #f5c26b 60%, #a8782c); }
.plt-earth   { background: radial-gradient(circle at 30% 30%, #7dd3fc, #38bdf8 45%, #0e7490 70%, #166534 82%, #1d4ed8 100%); }
.plt-mars    { background: radial-gradient(circle at 35% 30%, #fecaca, #f87171 55%, #b91c1c); }
.plt-jupiter { background: linear-gradient(180deg, #fde68a 0%, #f59e0b 22%, #92400e 38%, #fbbf24 52%, #b45309 68%, #f59e0b 100%); }
.plt-saturn  { background: radial-gradient(circle at 35% 30%, #fde68a, #eab308 65%, #a16207); }
.plt-saturn::after {
  content: ''; position: absolute; left: -1px; right: -1px; top: 5px; height: 4px;
  border: 1.5px solid rgba(251, 191, 36, .95); border-radius: 50%;
  transform: rotate(-24deg) scaleY(.75);
}
.plt-uranus  { background: radial-gradient(circle at 35% 30%, #d9fbfe, #67e8f9 60%, #0891b2); }
.plt-neptune { background: radial-gradient(circle at 35% 30%, #c7d9fe, #3b82f6 60%, #1e40af); }
.plt-pluto   { background: radial-gradient(circle at 35% 30%, #e0f2fe, #38bdf8 60%, #0e7490); }
.plt-data    { background: radial-gradient(circle at 30% 30%, #baf3e8, #2dd4bf 50%, #0f766e 78%, #155e75 100%); }
.plt-analysis { background: linear-gradient(135deg, #fde047 0%, #fb923c 25%, #f43f5e 50%, #a78bfa 75%, #38bdf8 100%); }
.plt-cron    { background: radial-gradient(circle at 35% 30%, #ede9fe, #8b5cf6 60%, #4c1d95); }
.plt-guide   { background: radial-gradient(circle at 35% 30%, #fef9c3, #facc15 55%, #a16207); }
.mainnav button:hover { color: var(--txt); background: var(--bg2); border-color: var(--line); }
.mainnav button.active {
  background: var(--bg2); color: var(--acc); border-color: var(--acc); font-weight: 600;
}
.nav-item { margin-top: 8px; }
.nav-item .nav-parent {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; margin: 0;
  background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--pri);
  border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 700;
  color: var(--mut); text-transform: uppercase; letter-spacing: .06em; text-align: left;
  transition: background .12s, border-color .12s;
}
.nav-item .nav-parent:hover { background: var(--bg3); border-color: var(--pri); }
.nav-item .nav-parent .chev { margin-left: auto; font-size: 9px; transition: transform .15s; }
.nav-item .nav-parent.open .chev { transform: rotate(180deg); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 4px 10px; }
.nav-sub.hidden { display: none; }
.nav-sub button { width: 100%; text-align: left; padding: 8px 12px; font-size: 11px; border-radius: 5px; background: var(--bg1); border: 1px solid transparent; color: var(--text2); transition: background .12s; }
.nav-sub button:hover { background: var(--bg3); }

/* ---------- sidebar bottom controls ---------- */
.side-ctl {
  margin-top: auto; display: flex; flex-direction: column; gap: 10px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.side-ctl .ctl { justify-content: space-between; }
.side-ctl select { flex: 1; min-width: 0; }
.side-actions button { flex: 1; justify-content: center; }

/* ---------- main column ---------- */
.layout { margin-left: 280px; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- top filter bar (V7, sticky under nothing) ---------- */
.filterbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(11,16,32,.92);
  backdrop-filter: blur(6px);
}

/* ---------- graph settings modal (V7: centered + backdrop) ---------- */
.gs {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,8,18,.6);
  backdrop-filter: blur(3px);
}
.gs .card { width: 400px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.55); }
.gs .card h3 { display: flex; justify-content: space-between; align-items: center; }
.gs .card h3 .x { float: none; }
.gs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gs-grid label { display: flex; flex-direction: column; font-size: 12px; color: var(--mut); gap: 4px; }
.gs-grid input[type="color"] { height: 34px; padding: 2px; cursor: pointer; background: var(--bg1); }

/* ---------- layout ---------- */
main { flex: 1; width: 100%; max-width: 1720px; margin: 0 auto; padding: 18px 20px 60px; overflow-wrap: anywhere; word-break: break-word; }
.sec { display: none; }
.sec.active { display: block; }
.section { margin-bottom: 22px; }
.section > h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--mut); margin: 0 0 10px 2px; font-weight: 600;
}
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.subnav button {
  font-family: inherit; font-size: 13px; color: var(--mut);
  background: transparent; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 14px; cursor: pointer;
}
.subnav button.active { background: var(--bg2); color: var(--acc); border-color: var(--acc); }
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.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)); }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: minmax(0, 1fr); } .g2 { grid-template-columns: minmax(0, 1fr); } .row { flex-wrap: wrap; } }
@media (max-width: 640px) { .g4 { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
  border: 1px solid var(--line); border-radius: var(--card);
  padding: 14px 16px; min-width: 0;
}
.card h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--acc); }
.card .note { font-size: 11px; color: var(--mut); margin-top: 6px; }

/* ---------- kpi ---------- */
.kpi .v { font-size: 26px; font-weight: 700; font-family: var(--mono); margin: 2px 0; }
.kpi .l { font-size: 12px; color: var(--mut); }
.kpi .s { font-size: 12px; color: var(--mut); margin-top: 2px; }
.kpi.good .v { color: var(--ok); }
.kpi.warn .v { color: var(--warn); }
.kpi.bad .v { color: var(--bad); }

/* ---------- status row / chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13px; padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg1);
}
.chip b { display: block; font-size: 11px; color: var(--mut); font-weight: 500; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--mut); font-weight: 500; font-size: 12px; white-space: nowrap; }
td { font-family: var(--mono); white-space: nowrap; }
tbody tr:hover { background: rgba(56,189,248,.06); }
.tblwrap { overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg1); }
.d { color: var(--mut); }

/* ---------- progress / meters ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--ok)); }
.gaprow { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12px; font-family: var(--mono); }
.errbox { border: 1px solid var(--bad); background: rgba(248,113,113,.08); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--bad); }

/* ---------- API tester iframe ---------- */
.tester-card { padding: 0; overflow: hidden; }
.tester-card iframe { width: 100%; height: calc(100vh - 220px); min-height: 620px; border: 0; display: block; background: #0b1020; }

/* ---------- notification credentials + guide iframe ---------- */
.guide-card { padding: 0; overflow: hidden; }
.guide-card h3 { border-bottom: 1px solid var(--line); }
.guide-card iframe { width: 100%; height: calc(100vh - 260px); min-height: 620px; border: 0; display: block; background: #0b1020; }
.cfg-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.cfg-row:last-child { border-bottom: 0; }
.cfg-name { width: 210px; flex: none; font-size: 12px; color: var(--mut); font-weight: 600; }
.cfg-val { flex: 1; font-size: 12px; background: var(--bg0); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; word-break: break-all; }
.sec-open, .sec-close { white-space: nowrap; }
.sec-mask { display: inline-block; width: 12ch; height: 12px; background: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 3px; vertical-align: -1px; }
@media (max-width: 640px) { .cfg-row { flex-wrap: wrap; } .cfg-name { width: auto; flex: 1 1 100%; overflow-wrap: anywhere; } }
.cfg-shots { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.cfg-shots figure { flex: 1 1 300px; margin: 0; }
.cfg-shots img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #0b1020; display: block; }
.cfg-shots figcaption { font-size: 12px; color: var(--mut); text-align: center; margin-top: 6px; }

/* ---------- misc ---------- */
.mut { color: var(--mut); }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.good { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
a { color: var(--acc); }
canvas { max-width: 100%; }
#skyplot { width: 100%; height: 460px; }

/* ---------- V8 skyplot 2D + 3D ---------- */
.skymeta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--mut); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.sky-stale { display: none; margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; font-size: 12px; background: rgba(250,204,21,.10); border: 1px solid rgba(250,204,21,.35); color: #fbbf24; }
.skymeta b { color: var(--txt); font-family: var(--mono); font-weight: 600; }
.sky-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.sky-panel { border: 1px solid var(--line); border-radius: 10px; background: var(--bg1); padding: 8px; min-width: 0; }
.sky-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); padding: 4px 6px 8px; }
.skyplot-box { width: 100%; height: 560px; }
.sky-3d-tools { display: inline-flex; gap: 4px; }
.skylegend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.skylegend .lg {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--mut);
  display: inline-flex; align-items: center; gap: 6px;
}
.skylegend .lg i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.skylegend b { font-family: var(--mono); color: var(--txt); }
.sky-note { font-size: 11px; color: var(--mut); margin: 10px 0; line-height: 1.7; }
#skytable tr.hot td, #skytable tr.hot td { background: rgba(56,189,248,.18); }
#fdSkytable tr.hot td { background: rgba(56,189,248,.18); }
#skytable td.rowkey { cursor: pointer; }
#fdSkytable td.rowkey { cursor: pointer; }
@media (max-width: 1100px) { .sky-grid { grid-template-columns: 1fr; } .skyplot-box { height: 480px; } }

/* ---------- V10 satellite icons + animation ---------- */
#skyplot2d { position: relative; }
#skyplot3d { position: relative; }
#fdSkyplot2d, #fdSkyplot3d { position: relative; }
#skyplot3d .sky-ov .sat-ic, #fdSkyplot3d .sky-ov .sat-ic { width: 20px; height: 18px; left: -10px; top: -9px; filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }
#skyplot3d .sky-ov .sat-ic svg, #fdSkyplot3d .sky-ov .sat-ic svg { width: 20px; height: 18px; }
.sky-ov { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 6; }
.sat { position: absolute; width: 0; height: 0; pointer-events: none; }
.sat .sat-ic { position: absolute; left: -11px; top: -10px; width: 22px; height: 20px; color: var(--txt); pointer-events: auto; cursor: pointer; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.sat .sat-ic svg { width: 22px; height: 20px; display: block; overflow: visible; }
.sat .sat-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--bg0); box-shadow: 0 0 0 1px rgba(0,0,0,.25); transform: translate(12px, -12px); pointer-events: auto; cursor: pointer; }
.sat .sat-prn { position: absolute; font-family: var(--mono); font-size: 9px; line-height: 1.1; color: var(--txt); background: var(--bg2); border: 1px solid var(--line); padding: 1px 3px; border-radius: 3px; white-space: nowrap; pointer-events: auto; cursor: pointer; }
.sat.used .sat-ic::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--acc); }
.sat:hover .sat-ic { filter: drop-shadow(0 0 3px var(--acc)); }
.sat.sel .sat-ic { filter: drop-shadow(0 0 3px var(--acc)) saturate(1.4); }
.sat.sel .sat-prn { background: var(--acc); color: #fff; border-color: var(--acc); }
.sat.dim .sat-ic, .sat.dim .sat-dot { opacity: .4; }
@media (prefers-reduced-motion: reduce) { .sat .sat-ic, .sat .sat-dot { transition: none !important; animation: none !important; } }

/* ---------- V9 X-Y satellite analysis ---------- */
.xy-filter { gap: 10px; align-items: flex-end; margin-bottom: 10px; flex-wrap: wrap; }
.xy-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
.xy-panel { border: 1px solid var(--line); border-radius: 10px; background: var(--bg1); padding: 8px; min-width: 0; }
.xy-title { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; color: var(--txt); padding: 2px 6px 6px; }
.xy-title .mut { font-size: 11px; font-weight: 400; }
.xybox { width: 100%; height: 420px; }
@media (max-width: 900px) { .xy-grid { grid-template-columns: 1fr; } .xybox { height: 340px; } }
.meta pre { font-family: var(--mono); font-size: 12px; color: var(--mut); margin: 0; overflow-x: auto; word-break: break-all; }
pre.res, .res { margin: 10px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(2, 10, 25, 0.55); color: #cfe3ff; font-family: var(--mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; overflow-x: auto; }
.setinfo { border-collapse: collapse; width: 100%; font-size: 13px; }
.setinfo td { padding: 3px 8px 3px 0; vertical-align: top; }
.setinfo td:first-child { color: var(--mut); white-space: nowrap; }
.setinfo code { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.footer { text-align: center; color: var(--mut); font-size: 12px; padding: 20px 0; }

/* ---------- พื้นหลังรูปภาพทุกหัวข้อ ---------- */
#sec-overview,
#sec-gnss,
#sec-background,
#sec-tables,
#sec-daily,
#sec-compare,
#sec-tester,
#sec-settings {
  position: relative;
  border-radius: var(--card);
  padding: 18px;
  background-image:
    linear-gradient(rgba(11, 16, 32, 0.5), rgba(11, 16, 32, 0.5)),
    url('../../images/bg-overview.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ---------- GNSS คืออะไร? info ---------- */
.gnss-info {
  margin: 0 0 20px; padding: 20px 24px;
  border-radius: var(--card); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 32, 63, 0.75), rgba(17, 26, 51, 0.75));
  box-shadow: 0 8px 30px rgba(2, 10, 25, 0.4);
}
.gnss-img {
  display: block; width: 100%; max-width: 760px; height: auto; margin: 0 auto 18px;
  border-radius: var(--card); border: 1px solid var(--line); object-fit: contain;
  box-shadow: 0 4px 18px rgba(2, 10, 25, 0.35);
}
.gnss-imgs { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 0 18px; }
.gnss-imgs .gnss-img,
.gnss-imgs .gnss-img2 { flex: 1 1 0; min-width: 260px; margin: 0; max-width: 100%; }
.gnss-img2 {
  display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto 18px;
  border-radius: var(--card); border: 1px solid var(--line); object-fit: contain;
  box-shadow: 0 4px 18px rgba(2, 10, 25, 0.35);
}
.gnss-info h3 { margin: 18px 0 6px; font-size: 15px; color: var(--txt); opacity: 0.92; }
.gnss-info p { margin: 0 0 12px; line-height: 1.75; font-size: 14px; color: var(--txt); }
.gnss-info p:last-child { margin-bottom: 0; }
.gnss-ref {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12px; line-height: 1.6; color: var(--mut);
}
.gnss-ref a { color: var(--acc); text-decoration: none; word-break: break-all; }
.gnss-ref a:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .gnss-info { padding: 16px 14px; }
  .gnss-info p { font-size: 13px; }
}

/* ---------- ความเป็นมาฯ document ---------- */
.doc {
  background: linear-gradient(180deg, rgba(23, 32, 63, 0.78), rgba(17, 26, 51, 0.78));
  border: 1px solid var(--line); border-radius: var(--card);
  padding: 22px 26px; box-shadow: 0 8px 30px rgba(2, 10, 25, 0.4);
}
.doc h1 { font-size: 19px; margin: 0 0 14px; line-height: 1.5; color: var(--acc); font-weight: 700; }
.doc-img {
  display: block; width: 100%; max-width: 900px; height: auto; margin: 0 auto 18px;
  border-radius: var(--card); border: 1px solid var(--line); object-fit: contain;
  box-shadow: 0 4px 18px rgba(2, 10, 25, 0.35);
}
.doc h2 {
  font-size: 16px; margin: 26px 0 10px; color: var(--txt); font-weight: 600;
  border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.doc h3 { font-size: 14.5px; margin: 18px 0 8px; color: var(--acc); font-weight: 600; }
.doc p { margin: 0 0 12px; line-height: 1.8; font-size: 14px; }
.doc ul, .doc ol { line-height: 1.8; font-size: 14px; margin: 0 0 12px; padding-left: 24px; }
.doc li { margin-bottom: 4px; }
.doc ul li::marker { color: var(--acc); }
.doc td, .doc th { font-family: inherit; white-space: normal; }
.doc .tblwrap { max-height: none; margin: 0 0 14px; }
.doc .formula {
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  background: var(--bg0); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin: 10px 0 14px; color: var(--acc); text-align: center;
}
.doc .flow {
  text-align: center; font-family: var(--mono); font-size: 13px; line-height: 1.9;
  margin: 6px 0; color: var(--txt); background: rgba(56, 189, 248, 0.07);
  border: 1px dashed var(--line); border-radius: 10px; padding: 8px;
}
.doc .tblwrap thead th { background: rgba(11, 16, 32, 0.35); }
@media (max-width: 600px) {
  .doc { padding: 16px 14px; }
  .doc p, .doc li { font-size: 13px; }
}

/* ---------- notification settings ---------- */
.ntf-grid { display: grid; gap: 8px; max-width: 520px; }
.ntf-toggle { display: flex; align-items: center; gap: 10px; background: var(--bg1); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.ntf-toggle span:first-child { flex: 1; }
.ntf-toggle input { width: 18px; height: 18px; accent-color: var(--acc); cursor: pointer; }
.ntf-dot { font-size: 12px; padding: 2px 10px; border-radius: 20px; background: var(--bg0); border: 1px solid var(--line); white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: static; width: 100%; height: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .mainnav { flex-direction: row; overflow-x: auto; align-items: stretch; }
  .mainnav button { flex: none; }
  .nav-item { flex: none; margin: 0 4px 0 10px; display: flex; align-items: stretch; }
  .nav-item .nav-parent { border: 0; border-left: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; padding: 9px 8px 9px 4px; white-space: nowrap; }
  .nav-item .nav-parent .chev { margin-left: 6px; }
  .nav-sub { flex-direction: row; gap: 0; padding: 0 4px 0 0; align-items: stretch; }
  .nav-sub button { width: auto; min-width: 120px; border-radius: 0; border: 0; border-right: 1px solid var(--line); background: transparent; white-space: normal; }
  .nav-sub button:hover { background: var(--bg2); }
  .side-ctl { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-ctl .ctl { flex: 1 1 45%; }
  .layout { margin-left: 0; }
}