/* Часть стилей ЗамерПро. Исходный public/css/app.css разбит для надёжной загрузки через туннель. */
.viewer.is-drawing .viewer-stage { padding: 56px 16px 20px; }
.viewer.is-drawing .viewer-stage svg { max-height: 74vh; }
.viewer-tabs { display: flex; gap: 2px; background: rgba(9, 15, 24, .8); border: 1px solid #243247; border-radius: 9px; padding: 3px; }
.viewer-tabs button {
  border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 650;
  padding: 5px 12px; border-radius: 7px; cursor: pointer;
}
.viewer-tabs button:hover { color: var(--ink-2); }
.viewer-tabs button.is-active { background: var(--surface-3); color: #fff; }

@media (max-width: 860px) {
  .viewer.is-drawing .viewer-stage { padding: 50px 8px 12px; }
  .viewer.is-drawing .viewer-stage svg { max-height: 46vh; }
}
@media print {
  .drawing-svg { box-shadow: none; }
  .viewer.is-drawing .viewer-stage { padding: 0; }
  .viewer.is-drawing .viewer-stage svg { max-height: none; }
}

/* ---------- фото в очереди и черновик ---------- */
.photo.is-pending { border-color: rgba(251, 191, 36, .45); }
.photo.is-pending img { opacity: .82; }
.photo-badge {
  position: absolute; left: 4px; bottom: 4px; right: 4px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  background: rgba(146, 64, 14, .88); color: #fde68a;
  font-size: 9.5px; font-weight: 700; border-radius: 5px; padding: 2px 4px;
  letter-spacing: .02em;
}
.photo-hint { font-size: 11px; color: var(--muted-2); margin-top: 9px; line-height: 1.4; }

/* ---------- переход между узлами ---------- */
.node-nav {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  background: linear-gradient(180deg, #121d2e, #0b121b);
  border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px;
}
.nn-btn {
  width: 34px; height: 34px; flex: none; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--ink-2); cursor: pointer; display: grid; place-items: center;
}
.nn-btn:hover:not([disabled]) { background: var(--surface-3); color: #fff; border-color: #33445e; }
.nn-btn[disabled] { opacity: .35; cursor: default; }
.nn-dots { display: flex; gap: 4px; }
.nn-dot {
  min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 700; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.nn-dot:hover { color: var(--ink); border-color: var(--line-2); }
.nn-dot.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.nn-label { margin-left: auto; font-size: 11.5px; color: var(--muted-2); }

/* ---------- шаг ввода ---------- */
.step-pick { display: flex; gap: 2px; background: var(--field-bg); border: 1px solid var(--line); border-radius: 7px; padding: 2px; }
.step-pick button {
  border: 0; background: none; color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  padding: 3px 6px; border-radius: 5px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.step-pick button:hover { color: var(--ink-2); }
.step-pick button.is-active { background: var(--surface-3); color: var(--accent-hi); }

/* ---------- режим замера ---------- */
.measure-overlay {
  position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column;
  background: radial-gradient(120% 80% at 50% 0%, #14213a 0%, #070b11 70%);
  color: var(--ink); animation: moIn .16s ease-out;
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes moIn { from { opacity: 0; transform: scale(.99); } }
.mo-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; }
.mo-close { width: 40px; height: 40px; flex: none; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.mo-close:hover { background: var(--surface-3); color: #fff; }
.mo-titles { flex: 1; min-width: 0; }
.mo-node { font-size: 14px; font-weight: 700; color: #fff; }
.mo-progress { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.mo-bar { height: 3px; background: #16202f; }
.mo-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8b5cf6, #22d3ee); transition: width .18s; }
.mo-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; text-align: center; }
.mo-key {
  width: 62px; height: 62px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(160deg, #312e81, #1e293b); border: 1px solid rgba(139, 92, 246, .45);
  color: #ddd6fe; font-family: var(--mono); font-size: 26px; font-weight: 700;
  box-shadow: 0 10px 26px -14px rgba(139, 92, 246, .9);
}
.mo-label { font-size: 17px; font-weight: 650; color: #fff; margin-top: 6px; }
.mo-hint { font-size: 12px; color: var(--muted); max-width: 320px; line-height: 1.35; }
.mo-value { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 4px; }
.mo-value span { font-size: 64px; font-weight: 750; letter-spacing: -.04em; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.mo-value small { font-size: 16px; color: var(--accent-hi); font-weight: 650; }
.mo-controls { display: flex; gap: 14px; margin-top: 6px; }
.mo-btn {
  width: 96px; height: 96px; border-radius: 24px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #182337, #101a29); color: #fff;
  font-size: 40px; font-weight: 400; line-height: 1; cursor: pointer;
  display: grid; place-items: center; user-select: none;
  box-shadow: 0 12px 26px -18px rgba(0, 0, 0, 1);
}
.mo-btn:active { transform: scale(.97); background: #1d2b44; }
.mo-minus { color: #fca5a5; }
.mo-plus { color: #86efac; }
.mo-steps { display: flex; align-items: center; gap: 5px; margin-top: 14px; }
.mo-step-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); font-weight: 700; margin-right: 3px; }
.mo-step {
  min-width: 42px; height: 32px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.mo-step.is-active { background: rgba(59, 130, 246, .18); border-color: rgba(59, 130, 246, .5); color: #bfdbfe; }
.mo-presets { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 12px; max-width: 420px; }
.mo-preset {
  height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 650; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.mo-preset:hover { border-color: var(--line-2); color: #fff; }
.mo-preset.is-active { background: rgba(34, 211, 238, .14); border-color: rgba(34, 211, 238, .5); color: #a5f3fc; }
.mo-foot { display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.mo-nav {
  flex: 1; height: 52px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--ink-2); font-size: 14px; font-weight: 650;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.mo-nav[disabled] { opacity: .35; cursor: default; }
.mo-nav.mo-primary { background: linear-gradient(180deg, #3b82f6, #2563eb); border-color: #2563eb; color: #fff; }

@media (max-width: 480px) {
  .mo-value span { font-size: 54px; }
  .mo-btn { width: 86px; height: 86px; font-size: 36px; }
  .mo-label { font-size: 15.5px; }
  .mo-preset { height: 32px; font-size: 12px; }
}

@media (max-width: 860px) {
  .node-nav { position: sticky; top: 52px; z-index: 12; }
  .nn-label { display: none; }
}

.nn-hint { display: none; font-size: 10.5px; color: var(--muted-2); }
@media (max-width: 860px) {
  .nn-hint { display: inline; }
  .nn-label { display: none; }
}

/* =========================================================
   Светлая тема «улица» — для работы на солнце
   ========================================================= */
html[data-theme="light"] {
  --field-bg: #ffffff;
  --field-bg-2: #ffffff;
  --field-bg-3: #f4f7fb;
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f4f7fb;
  --surface-3: #e9eff7;
  --line: #dde5ef;
  --line-2: #c8d4e4;
  --ink: #0b1524;
  --ink-2: #22303f;
  --muted: #5b6b7f;
  --muted-2: #8496ab;
  --accent: #1d4ed8;
  --accent-hi: #1d4ed8;
  --violet: #6d28d9;
  --accent-soft: rgba(29, 78, 216, .10);
  --ok: #047857;
  --ok-soft: rgba(4, 120, 87, .10);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, .10);
  --danger: #b91c1c;
  --danger-soft: rgba(185, 28, 28, .09);
  --sidebar: #ffffff;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-2: 0 12px 28px -18px rgba(15, 23, 42, .35);
  --shadow-3: 0 24px 50px -24px rgba(15, 23, 42, .45);
}
html[data-theme="light"] body {
  background: radial-gradient(1100px 600px at 80% -20%, #dfe9f7 0%, transparent 60%), var(--bg);
}
html[data-theme="light"] .sidebar { border-right: 1px solid var(--line); }
html[data-theme="light"] .brand-title { color: var(--ink); }
html[data-theme="light"] .brand-sub { color: var(--muted-2); }
html[data-theme="light"] .brand-ver { color: #4338ca; background: rgba(99, 102, 241, .12); border-color: rgba(99, 102, 241, .25); }
html[data-theme="light"] .tree-row { color: var(--ink-2); }
html[data-theme="light"] .tree-row:hover { background: var(--surface-3); color: var(--ink); }
html[data-theme="light"] .tree-row.is-active {
  background: linear-gradient(90deg, rgba(29, 78, 216, .16), rgba(29, 78, 216, .04));
  border-color: rgba(29, 78, 216, .3); color: var(--ink);
}
html[data-theme="light"] .sync-card { background: var(--surface-2); }
html[data-theme="light"] .sync-card b { color: var(--ink-2); }
html[data-theme="light"] .user-card .u-name { color: var(--ink); }
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, .9); }
html[data-theme="light"] .kpi { background: var(--surface); }
html[data-theme="light"] .card { background: var(--surface); }
html[data-theme="light"] .node-card { background: var(--surface); }
html[data-theme="light"] .node-thumb { background: radial-gradient(120% 120% at 20% 0%, #eaf1fa 0%, #f7fafd 75%); }
html[data-theme="light"] .node-dims { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
html[data-theme="light"] .viewer {
  background: radial-gradient(140% 110% at 30% 0%, #e8eef8 0%, #f4f8fd 62%, #ffffff 100%);
}
