@import url('/vendor/vazirmatn/misc/Farsi-Digits/Vazirmatn-FD-font-face.css');

:root {
  --bg: #e9f1ec;           /* pale bottle-glass green */
  --surface: #ffffff;
  --surface-2: #f3f8f4;
  --ink: #102219;
  --ink-2: #3f5a4b;
  --ink-3: #6f8a7b;
  --line: #d5e3da;
  --brand: #0b5d3b;        /* AKO bottle green */
  --brand-deep: #073d27;   /* top bar */
  --brand-ink: #ffffff;
  --brand-soft: #dcefe3;
  --signal: #e2a834;       /* beacon amber */
  --ok: #1f8a5b; --ok-soft: #e2f3ea;
  --warn: #b7791f; --warn-soft: #fbf0dc;
  --fail: #c0392b; --fail-soft: #fbe5e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 30, 40, .06), 0 4px 16px rgba(16, 30, 40, .05);
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1711; --surface: #12221a; --surface-2: #172a20; --ink: #e6f1ea; --ink-2: #b1c8ba; --ink-3: #7f998a;
  --line: #23392d; --brand: #4fbf86; --brand-deep: #0a2a1b; --brand-ink: #062113; --brand-soft: #173a28; --signal: #f0b456;
  --ok: #4cc28c; --ok-soft: #173326; --warn: #e2a84a; --warn-soft: #3a2e17; --fail: #ef6b5b; --fail-soft: #3d1d1a; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1711; --surface: #12221a; --surface-2: #172a20; --ink: #e6f1ea; --ink-2: #b1c8ba; --ink-3: #7f998a;
    --line: #23392d; --brand: #4fbf86; --brand-deep: #0a2a1b; --brand-ink: #062113; --brand-soft: #173a28; --signal: #f0b456;
    --ok: #4cc28c; --ok-soft: #173326; --warn: #e2a84a; --warn-soft: #3a2e17; --fail: #ef6b5b; --fail-soft: #3d1d1a;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-image: radial-gradient(circle at 100% 0, rgba(11,93,59,.08), transparent 40%);
  font-family: 'Vazirmatn FD', 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: .98rem; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); } .small { font-size: .85rem; }
.hidden { display: none !important; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--brand-deep); color: #fff;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: inherit; min-width: 0; }
.topbar .brand img { height: 30px; width: auto; border-radius: 6px; background: #fff; padding: 2px; }
.topbar .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar nav { margin-inline-start: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a, .topbar nav button {
  color: inherit; text-decoration: none; background: transparent; border: 0; font: inherit; font-size: .9rem;
  padding: 6px 10px; border-radius: 8px; cursor: pointer; opacity: .88;
}
.topbar nav a:hover, .topbar nav button:hover, .topbar nav a.active { background: rgba(255,255,255,.14); opacity: 1; }
.mark { width: 26px; height: 26px; flex: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 980px) { .grid.cols-2 { grid-template-columns: 1.05fr .95fr; align-items: start; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.section-title { font-size: .78rem; letter-spacing: .02em; color: var(--ink-3); font-weight: 600; margin: 14px 0 8px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: .85rem; color: var(--ink-2); font-weight: 500; }
.row { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .row.three { gap: 6px; } .row.three .addon .unit { padding: 0 5px; font-size: .74rem; } .row.three input { padding: 9px 7px; } }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px; min-height: 42px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="number"], input.ltr { direction: ltr; text-align: left; }
.addon { display: flex; align-items: stretch; }
.addon input { border-start-end-radius: 0; border-end-end-radius: 0; }
.addon .unit {
  display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-inline-start: 0;
  border-start-end-radius: 10px; border-end-end-radius: 10px; background: var(--surface); color: var(--ink-3); font-size: .82rem; white-space: nowrap;
}
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-size: .85rem; padding: 5px 12px; border-radius: 7px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 10px; font-size: .8rem; cursor: pointer; color: var(--ink-2); font-family: inherit; }
.chip:hover, .chip.on { border-color: var(--brand); color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .92rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 16px; border-radius: 10px;
  cursor: pointer; text-decoration: none; min-height: 42px; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(.97); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.signal { background: var(--signal); border-color: var(--signal); color: #2a1c05; }
.btn.danger { color: var(--fail); }
.btn.block { width: 100%; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .82rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* auth */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.auth-brand img { height: 44px; }
.auth-brand .mark { width: 40px; height: 40px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 16px; }
.tabs button { background: none; border: 0; font: inherit; padding: 8px 12px; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.otp-input { letter-spacing: .5em; text-align: center !important; font-size: 1.3rem; font-weight: 700; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--brand); }

/* map */
#map, .map { height: 360px; border-radius: 12px; border: 1px solid var(--line); z-index: 1; }
@media (min-width: 980px) { #map { height: 440px; } }
.map-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.pin { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-family: 'Vazirmatn FD', sans-serif; }
.pin.a { background: #0b5d3b; } .pin.b { background: #c0392b; }

/* results */
.verdict { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; }
.verdict .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.verdict.ok { background: var(--ok-soft); } .verdict.ok .dot { background: var(--ok); }
.verdict.warn { background: var(--warn-soft); } .verdict.warn .dot { background: var(--warn); }
.verdict.fail { background: var(--fail-soft); } .verdict.fail .dot { background: var(--fail); }
.verdict strong { display: block; font-size: 1rem; }
.verdict ul { margin: 2px 0 0; padding-inline-start: 18px; font-size: .86rem; color: var(--ink-2); }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 620px) { .kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.kpi .label { font-size: .78rem; color: var(--ink-3); }
.kpi .value { font-size: 1.45rem; font-weight: 800; line-height: 1.3; direction: ltr; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .value small { font-size: .78rem; font-weight: 500; color: var(--ink-3); margin-inline-start: 3px; }
.kpi .sub { font-size: .76rem; color: var(--ink-3); }
.kpi.good .value { color: var(--ok); } .kpi.bad .value { color: var(--fail); } .kpi.mid .value { color: var(--warn); }

table.kv { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.kv td { padding: 7px 4px; border-bottom: 1px dashed var(--line); }
table.kv td:last-child { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.kv tr.total td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--ink-3); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th { text-align: right; font-weight: 600; color: var(--ink-3); background: var(--surface-2); padding: 9px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--surface-2); }

.badge { display: inline-block; font-size: .74rem; padding: 1px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.badge.ok, .badge.active { background: var(--ok-soft); color: var(--ok); }
.badge.warn, .badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge.fail, .badge.blocked { background: var(--fail-soft); color: var(--fail); }
.badge.admin { background: var(--brand-soft); color: var(--brand); }

.profile-box { position: relative; }
canvas.profile { width: 100%; height: 240px; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-inline-end: 4px; border-radius: 2px; }

.aim { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.aim .site { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.aim .site h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(10, 20, 26, .55); display: grid; place-items: center; z-index: 2000; padding: 12px; }
.modal .card { width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; }

/* compass */
.compass { position: relative; width: min(78vw, 320px); aspect-ratio: 1; margin: 8px auto; }
.compass svg { width: 100%; height: 100%; }
.compass .needle { transition: transform .12s linear; transform-origin: 50% 50%; }
.turn { text-align: center; font-size: 1.2rem; font-weight: 700; margin: 6px 0; }
.turn.aligned { color: var(--ok); }

.toast { position: fixed; bottom: 18px; inset-inline: 0; margin: 0 auto; width: max-content; max-width: 92vw; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 3000; font-size: .9rem; box-shadow: var(--shadow); }
.toast.err { background: var(--fail); color: #fff; }

.empty { text-align: center; padding: 36px 12px; color: var(--ink-3); }
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 12px; font-size: .85rem; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.toolbar .field { margin: 0; min-width: 140px; flex: 1; }
.toolbar .field.narrow { flex: 0 0 auto; min-width: 110px; }

.chart { width: 100%; height: 220px; }
.bars .bar-row { display: grid; grid-template-columns: 70px 1fr 48px; gap: 8px; align-items: center; font-size: .82rem; margin: 5px 0; }
.bars .track { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--brand); border-radius: 6px; }
.bars .n { direction: ltr; text-align: left; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.link-card { display: grid; gap: 4px; }
.link-list { display: grid; gap: 10px; }
@media (min-width: 760px) { .link-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* report / print */
.report { max-width: 820px; margin: 0 auto; background: var(--surface); padding: 22px; }
.report header { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--brand); padding-bottom: 10px; margin-bottom: 14px; gap: 12px; }
.report header img { max-height: 56px; max-width: 180px; }
.report .band { background: var(--brand); color: var(--brand-ink); padding: 5px 10px; border-radius: 6px; font-weight: 600; font-size: .9rem; margin: 16px 0 6px; }
.report table.kv td { padding: 5px 4px; }
.report .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report .map { height: 280px; }
.report footer { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 8px; font-size: .78rem; color: var(--ink-3); }
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; }
  body { background: #fff; font-size: 12px; }
  .no-print, .topbar { display: none !important; }
  .report { padding: 0; max-width: none; }
  .report .band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card { box-shadow: none; }
  @page { size: A4; margin: 10mm; }
}
@media (max-width: 600px) { .report .two { grid-template-columns: 1fr; } .report { padding: 14px; } }

/* radio selection */
.radio-info { color: var(--ink-3); }
.radio-info.warn { color: var(--warn); }
.radio-info button { border: 0; background: none; color: var(--brand); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
input[readonly] { background: var(--brand-soft); color: var(--ink-2); }
input.need { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(232,163,61,.2); }

/* icons */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
h2 .ic, h3 .ic, .section-title .ic, label .ic, .btn .ic, .kpi .label .ic, summary .ic, .topbar nav .ic, .tabs .ic { margin-inline-end: 5px; }
.section-title { display: flex; align-items: center; color: var(--brand); font-size: .82rem; }
.kpi .label { display: flex; align-items: center; }
.kpi .label .ic { color: var(--brand); }
.topbar nav a, .topbar nav button { display: inline-flex; align-items: center; }
.equip-line { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* picker buttons */
.pick-btn { width: 100%; display: flex; align-items: center; gap: 10px; text-align: start; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; font: inherit; color: var(--ink); cursor: pointer; margin-top: 6px; }
.pick-btn:hover { border-color: var(--brand); }
.pick-btn.ant { background: var(--brand-soft); border-style: dashed; }
.pb-ic, .ri-ic, .sheet-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.pb-ic .ic, .ri-ic .ic, .sheet-ic .ic { width: 22px; height: 22px; }
.pb-main, .ri-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pb-main strong, .ri-main strong { font-size: .92rem; }
.pb-sub, .ri-sub { font-size: .78rem; color: var(--ink-3); }
.pb-warn { font-size: .76rem; color: var(--warn); display: flex; gap: 4px; align-items: center; }
.pb-chev, .ri-chev { color: var(--ink-3); flex: none; }
.lock-note { align-self: flex-start; border: 0; background: none; color: var(--brand); font: inherit; font-size: .76rem; cursor: pointer; padding: 2px 0; display: inline-flex; gap: 4px; align-items: center; }

/* bottom sheet */
.sheet-wrap { position: fixed; inset: 0; background: rgba(4, 20, 12, .5); z-index: 2500; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 760px) { .sheet-wrap { align-items: center; } }
.sheet { background: var(--surface); width: 100%; max-width: 620px; max-height: 88vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -8px 30px rgba(0,0,0,.2); }
@media (min-width: 760px) { .sheet { border-radius: 18px; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; flex: 1; font-size: 1.02rem; }
.sheet-search { display: flex; align-items: center; gap: 8px; padding: 10px 16px; color: var(--ink-3); }
.sheet-search input { min-height: 38px; }
.sheet-body { overflow-y: auto; padding: 8px 16px 18px; }
.row-item { width: 100%; display: flex; align-items: center; gap: 10px; text-align: start; border: 1px solid transparent; background: none; font: inherit; color: var(--ink);
  padding: 8px; border-radius: 12px; cursor: pointer; }
.row-item:hover { background: var(--surface-2); }
.row-item.on { border-color: var(--brand); background: var(--brand-soft); }
.row-item .ri-ic { width: 36px; height: 36px; background: var(--brand-soft); color: var(--brand); }
.grp { font-size: .76rem; font-weight: 700; color: var(--ink-3); margin: 14px 4px 4px; display: flex; align-items: center; gap: 4px; }
.band { border-bottom: 1px solid var(--line); }
.band .ri-chev .ic { transition: transform .15s; }
.band.open .ri-chev .ic { transform: rotate(-90deg); }
.band-body { display: none; padding: 4px 4px 14px 4px; }
.band.open .band-body { display: block; }
.bb-row { margin-top: 8px; }
.bb-lbl { display: flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--ink-2); font-weight: 600; }
.chips.chan { max-height: 210px; overflow-y: auto; }
.chips.chan .chip small { color: var(--ink-3); }
.gain-chips .chip { min-width: 44px; text-align: center; }
@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; row-gap: 4px; }
  .topbar nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; margin-inline-start: 0; scrollbar-width: none; }
  .topbar nav a, .topbar nav button { flex: none; }
}
.pb-sub bdi, .ri-sub bdi { white-space: nowrap; }

input, select, textarea, button, .leaflet-container { font-family: 'Vazirmatn FD', 'Vazirmatn', system-ui, sans-serif; }
table.kv td:first-child .ic { color: var(--brand); margin-inline-end: 6px; opacity: .85; }

/* weather */
.wtitle { display: flex; align-items: center; gap: 6px; }
.wsum { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 6px; }
.wsum .wv { display: flex; flex-direction: column; font-weight: 700; font-size: .92rem; line-height: 1.6; margin-top: 2px; }
.wweek { display: flex; align-items: center; gap: 6px; margin: 18px 0 8px; }
.wweek .muted { font-weight: 400; }
.wgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
@media (max-width: 520px) { .wgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .wday { padding: 8px; } .wmeta { font-size: .72rem; } .wic { width: 32px; height: 32px; } .wtemp { flex-wrap: wrap; gap: 2px 10px; font-size: .82rem; } }
.wday { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wday.low { border-style: dashed; background: var(--surface); }
.wday header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.wday header div { display: flex; flex-direction: column; line-height: 1.4; }
.wic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.wic .ic { width: 24px; height: 24px; }
.wdesc { font-weight: 600; font-size: .9rem; }
.wtemp { display: flex; gap: 12px; font-size: .9rem; }
.wtemp span, .wmeta li { display: flex; align-items: center; gap: 5px; }
.wtemp .ic, .wmeta .ic { color: var(--brand); width: 1em; height: 1em; }
.wmeta { list-style: none; margin: 2px 0; padding: 0; font-size: .8rem; color: var(--ink-2); display: grid; gap: 2px; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.wchip { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.wchip .ic { width: 1em; height: 1em; }
.wchip.ok { background: var(--ok-soft); color: var(--ok); } .wchip.warn { background: var(--warn-soft); color: var(--warn); } .wchip.fail { background: var(--fail-soft); color: var(--fail); }
.wwhy { margin: 0; }

/* environment chips & notes */
.env-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.env-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  border-radius: 999px; padding: 5px 11px; font: inherit; font-size: .8rem; cursor: pointer; }
.env-chip .ic { color: var(--brand); }
.env-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.env-chip.on .ic { color: #fff; }
.env-notes { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.env-notes li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: .85rem; line-height: 1.7; }
.env-notes li .ic { flex: none; margin-top: 3px; }
.env-notes li.fail { background: var(--fail-soft); } .env-notes li.fail .ic { color: var(--fail); }
.env-notes li.warn { background: var(--warn-soft); } .env-notes li.warn .ic { color: var(--warn); }
.env-notes li.ok .ic { color: var(--ok); } .env-notes li.info .ic { color: var(--brand); }
.env-notes .std { display: inline-block; font-size: .72rem; color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-inline-start: 4px; white-space: nowrap; }
.env-notes .tagenv { font-weight: 700; margin-inline-end: 4px; }

/* install guide */
:root { --sc-sky: #eef6f1; --sc-ground: #d7e7dc; --sc-steel-l: #c9d2cf; --sc-steel-d: #7c8a86; --sc-dish-l: #fbfcfb; --sc-dish-d: #c4cec9;
  --sc-dev: #ffffff; --sc-ink: #2c3e35; --sc-cable: #33413a; --sc-earth: #3f9a3a; --sc-tape: #1d2a24; --sc-water: #3d8fd6; --sc-skin: #e2b48c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sc-sky: #10201a; --sc-ground: #1a3127; --sc-steel-l: #8a9893; --sc-steel-d: #55625e; --sc-dish-l: #cfd8d3;
  --sc-dish-d: #7d8a85; --sc-dev: #e9efec; --sc-ink: #0b1510; --sc-cable: #0b1510; --sc-earth: #6cc35f; --sc-tape: #0b1510; --sc-water: #6fb2ee; } }
:root[data-theme="dark"] { --sc-sky: #10201a; --sc-ground: #1a3127; --sc-steel-l: #8a9893; --sc-steel-d: #55625e; --sc-dish-l: #cfd8d3;
  --sc-dish-d: #7d8a85; --sc-dev: #e9efec; --sc-ink: #0b1510; --sc-cable: #0b1510; --sc-earth: #6cc35f; --sc-tape: #0b1510; --sc-water: #6fb2ee; }
.inst-grid { display: grid; gap: 16px; }
@media (min-width: 980px) { .inst-grid { grid-template-columns: 300px 1fr; align-items: start; } }
.inst-grid > * { min-width: 0; }
.inst-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: st; }
.inst-steps button { width: 100%; display: flex; gap: 8px; align-items: center; text-align: start; background: none; border: 1px solid transparent; border-radius: 10px;
  padding: 7px 8px; font: inherit; font-size: .86rem; color: var(--ink-2); cursor: pointer; }
.inst-steps button::before { counter-increment: st; content: counter(st); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); font-size: .76rem; flex: none; }
.inst-steps button.on { background: var(--brand-soft); color: var(--ink); border-color: var(--brand); font-weight: 600; }
.inst-steps button.on::before { background: var(--brand); color: #fff; border-color: var(--brand); }
.inst-steps button.done::before { background: var(--ok-soft); color: var(--ok); }
.scene-box { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--sc-sky); }
.scene { width: 100%; height: auto; display: block; aspect-ratio: 400 / 280; max-width: 100%; }
.sc-label { font: 600 13px 'Vazirmatn FD', 'Vazirmatn', sans-serif; fill: var(--ink); }
.sc-label.muted { fill: var(--ink-3); font-weight: 400; font-size: 12px; } .sc-label.big { font-size: 20px; } .sc-label.north { fill: var(--fail); font-weight: 800; }
.inst-body ul { margin: 8px 0; padding-inline-start: 20px; line-height: 1.9; }
.inst-nav { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; }
.inst-progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 10px 0 4px; } .inst-progress i { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.inst-facts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 10px 0; }
.tools-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tools-list span { font-size: .78rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }

.scene { direction: rtl; }
.a-spin, .a-slide-down, .a-slide-in, .a-dock, .a-twist, .a-click, .a-pol, .a-drip, .a-pulse, .a-climb, .a-sweep, .a-check, .a-dock-odu { transform-box: fill-box; transform-origin: center; }
.a-bar { transform-box: fill-box; }
.a-spin { animation: aSpin 1.6s linear infinite; }
.a-slide-down { animation: aSlideDown 3s ease-in-out infinite; } .a-slide-down.d2 { animation-delay: .4s; }
.a-slide-in { animation: aSlideIn 3s ease-in-out infinite; }
.a-dock { animation: aDock 3.6s ease-in-out infinite; } .a-twist { animation: aTwist 3.6s ease-in-out infinite; }
.a-click { opacity: 0; animation: aClick 3.6s ease-out infinite; }
.a-pol { animation: aPol 4s ease-in-out infinite; }
.a-draw { stroke-dasharray: 400; animation: aDraw 3.5s ease-in-out infinite; }
.a-drip { animation: aDrip 1.8s ease-in infinite; } .a-drip.d2 { animation-delay: .9s; }
.a-flash { animation: aFlash 2.4s steps(1) infinite; }
.a-tape { opacity: 0; animation: aTape 3.6s linear infinite; }
.a-pulse { animation: aPulse 2s ease-in-out infinite; }
.a-blink { animation: aBlink 1.2s steps(2) infinite; }
.a-climb { animation: aClimb 4s ease-in-out infinite alternate; }
.a-dash { stroke-dasharray: 6 5; animation: aDash 1s linear infinite; }
.a-rotate-az { transform-box: view-box; transform-origin: 200px 140px; animation: aAz 4s ease-in-out infinite; }
.a-tilt { transform-box: view-box; transform-origin: 150px 130px; animation: aTiltK 4s ease-in-out infinite; }
.a-sweep { animation: aSweep 4s ease-in-out infinite; }
.a-rssi { transform-box: fill-box; transform-origin: left center; animation: aRssi 4s ease-in-out infinite; }
.a-dock-odu { animation: aSlideIn 3.4s ease-in-out infinite; }
.a-check { opacity: 0; animation: aCheck 4s ease-out infinite; }
.a-bar { animation: aBar 1.6s ease-in-out infinite alternate; transform-origin: bottom; }
@keyframes aSpin { to { transform: rotate(360deg); } }
@keyframes aSlideDown { 0% { transform: translateY(-60px); opacity: 0; } 30%, 85% { transform: none; opacity: 1; } 100% { opacity: 1; } }
@keyframes aSlideIn { 0% { transform: translateX(120px); opacity: 0; } 35%, 100% { transform: none; opacity: 1; } }
@keyframes aDock { 0% { transform: translate(160px, 0) scale(.9); opacity: 0; } 35%, 100% { transform: none; opacity: 1; } }
@keyframes aTwist { 0%, 40% { transform: rotate(-30deg); } 55%, 100% { transform: rotate(0); } }
@keyframes aClick { 0%, 55% { opacity: 0; transform: scale(.6); } 62% { opacity: 1; } 80%, 100% { opacity: 0; transform: scale(1.5); } }
@keyframes aPol { 0%, 30% { transform: rotate(0); } 50%, 80% { transform: rotate(90deg); } 100% { transform: rotate(0); } }
@keyframes aDraw { 0% { stroke-dashoffset: 400; } 60%, 100% { stroke-dashoffset: 0; } }
@keyframes aDrip { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(46px); opacity: 0; } }
@keyframes aFlash { 0%, 70% { opacity: 0; } 72%, 80% { opacity: 1; } 82%, 100% { opacity: 0; } }
@keyframes aTape { 0% { opacity: 0; } 8%, 85% { opacity: 1; } 100% { opacity: 1; } }
@keyframes aPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes aBlink { 50% { opacity: .2; } }
@keyframes aClimb { from { transform: translateY(0); } to { transform: translateY(-70px); } }
@keyframes aDash { to { stroke-dashoffset: -11; } }
@keyframes aAz { 0%, 10% { transform: rotate(0); } 60%, 100% { transform: rotate(var(--az)); } }
@keyframes aTiltK { 0%, 10% { transform: rotate(0); } 60%, 100% { transform: rotate(var(--tilt)); } }
@keyframes aSweep { 0% { transform: translateX(-130px); } 50% { transform: translateX(110px); } 75% { transform: translateX(-20px); } 100% { transform: translateX(0); } }
@keyframes aRssi { 0% { transform: scaleX(.12); } 20% { transform: scaleX(.3); } 50% { transform: scaleX(.18); } 75% { transform: scaleX(.85); } 100% { transform: scaleX(1); } }
@keyframes aCheck { 0% { opacity: 0; transform: scale(.4); } 15%, 100% { opacity: 1; transform: none; } }
@keyframes aBar { from { transform: scaleY(.5); } to { transform: scaleY(1); } }
.scene-paused .scene * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .scene * { animation: none !important; opacity: 1 !important; } }
@media (max-width: 979px) { .inst-grid > :first-child { order: 2; } }

/* mounting & obstacles */
.mount { margin: 4px 0 10px; }
.mount .seg button { display: inline-flex; align-items: center; gap: 4px; }
.obst-list { display: grid; gap: 8px; margin-bottom: 8px; }
.obst { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.obst-head { display: flex; align-items: center; gap: 8px; }
.obst-head input { flex: 1; min-width: 0; }
.obst-no { width: 26px; height: 26px; flex: none; border-radius: 7px; background: #8a5a2b; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.obst-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.obst-grid .addon .unit, .obst-grid .addon .u { padding: 0 6px; font-size: .74rem; }
.obst-grid input { padding-inline: 7px; }
.obst-grid label { display: flex; align-items: center; gap: 4px; min-height: 26px; }
.icon-btn { flex: none; width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; color: var(--ink-2); cursor: pointer; padding: 0; }
.icon-btn.danger { color: var(--fail); }
.icon-btn.mini { width: 26px; height: 26px; border-radius: 7px; color: var(--brand); }
.icon-btn .ic { margin: 0 !important; }
.obst .field { margin: 0; } .obst label { font-size: .74rem; }
.obst-pin { width: 22px; height: 22px; border-radius: 6px; background: #8a5a2b; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.heights { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 6px; }
.heights td, .heights th { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.heights th { color: var(--ink-3); font-weight: 600; font-size: .78rem; }
.heights td.num { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; font-weight: 700; }
canvas.profile { cursor: crosshair; }

/* ---- mobile layout polish ---- */
/* inputs in a row line up even when one label wraps to two lines */
.row > .field { justify-content: flex-end; }
.row > .field > label { line-height: 1.35; }
.row.roof-only > .field { justify-content: flex-start; }
/* segmented controls fill their space */
.mount .seg, .field > .seg { display: flex; width: 100%; }
.mount .seg button, .field > .seg button { flex: 1 1 0; white-space: nowrap; font-size: .82rem; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 8px; min-height: 36px; }
table.kv td:first-child .ic { margin-inline-end: 6px; vertical-align: -3px; }
table.kv td:first-child { padding-inline-end: 8px; }
/* required-height options as cards (no cramped table on phones) */
.hopts { display: grid; gap: 8px; margin-bottom: 6px; }
.hopt { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.hopt.now { background: var(--surface-2); }
.hopt-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hopt-t strong { font-size: .9rem; }
.hopt-v { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: left; white-space: nowrap; }
.hopt.now .hopt-v { flex-direction: row; gap: 12px; }
.hopt-n { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .hopt { grid-template-columns: minmax(0, 1fr) auto; }
  .hopt .btn { grid-column: 1 / -1; justify-self: stretch; }
  .row { gap: 8px; }
}

/* ---- plain-language summary ---- */
.lsum { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 10px 0 12px; background: var(--surface); border-inline-start: 5px solid var(--ok); }
.lsum.warn { border-inline-start-color: var(--warn); } .lsum.fail { border-inline-start-color: var(--fail); }
.lsum-h { font-weight: 800; font-size: 1.02rem; margin-bottom: 6px; }
.lsum-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.lsum-l li { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; line-height: 1.7; }
.lsum-l li > .ic { flex: none; margin-top: 4px; color: var(--brand); }
.q { padding: 0 6px; border-radius: 6px; } .q.good { background: var(--ok-soft); color: var(--ok); } .q.mid { background: var(--warn-soft); color: var(--warn); } .q.bad { background: var(--fail-soft); color: var(--fail); }

/* ---- signal gauge ---- */
.sg { margin: 4px 0 14px; }
.sg-bar { position: relative; height: 16px; border-radius: 8px; overflow: visible; direction: ltr; margin-top: 30px; background: var(--surface-2); }
.sg-z { position: absolute; top: 0; bottom: 0; } .sg-z.red { background: #e9a39b; border-radius: 8px 0 0 8px; } .sg-z.amb { background: #f3d189; } .sg-z.grn { background: #9fd8b8; border-radius: 0 8px 8px 0; }
.sg-t { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--fail); transform: translateX(-1px); } .sg-t.hi { background: var(--brand); }
.sg-m { position: absolute; top: -30px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-size: .7rem; white-space: nowrap; color: var(--ink); }
.sg-m span { background: var(--ink); color: var(--bg, #fff); padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.sg-m::after { content: ""; border: 6px solid transparent; border-top-color: var(--ink); margin-top: -1px; }
.sg-m.rain span { background: #5b7fa6; } .sg-m.rain::after { border-top-color: #5b7fa6; }
.sg-axis { display: flex; justify-content: space-between; direction: ltr; font-size: .72rem; color: var(--ink-3); margin-top: 4px; }
.sg-axis span { direction: rtl; unicode-bidi: plaintext; }
.sg-leg { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .74rem; color: var(--ink-2); margin-top: 4px; }
.sg-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 4px; vertical-align: -1px; }
.sg-leg i.red { background: #e9a39b; } .sg-leg i.amb { background: #f3d189; } .sg-leg i.hi { background: var(--brand); width: 3px; }

/* ---- aiming dials ---- */
.aim2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.aimc { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--surface-2); }
.aimc-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.aimc-h .pin { width: 26px; height: 26px; font-size: 12px; border-width: 2px; flex: none; }
.aimc-b { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; }
.dial { width: 112px; height: 112px; }
.dial .ring { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.dial .tk line { stroke: var(--ink-3); stroke-width: 1.2; }
.dial text { font: 700 10px 'Vazirmatn FD', sans-serif; fill: var(--ink-3); text-anchor: middle; }
.dial text.n { fill: var(--fail); }
.dial .true { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 3 3; }
.dial .arrow { stroke: var(--brand); stroke-width: 4; stroke-linecap: round; }
.dial .ahp, .tilt .ahp { fill: var(--brand); }
.dial .hub { fill: var(--brand); }
.aimc-v { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aimc-big { font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--brand); }
.aimc-tilt { display: flex; align-items: center; gap: 6px; font-size: .82rem; margin-top: 4px; line-height: 1.4; }
.tilt { width: 54px; height: 28px; flex: none; }
.tilt .hz { stroke: var(--ink-3); stroke-dasharray: 3 3; } .tilt .tl { stroke: var(--brand); stroke-width: 3; stroke-linecap: round; }
.aimc .btn { margin-top: 8px; }
@media print { .lsum, .aimc, .sg { break-inside: avoid; } }
