/* Обект Про — светла тема по подразбиране (слънце на обекта), тъмна по избор или от системата */
:root {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --text: #16181d;
  --muted: #5b6070;
  --line: #d9d6cf;
  --accent: #e8590c;          /* сигнално оранжево */
  --accent-ink: #ffffff;
  --accent-soft: #fde7da;
  --primary: #1f3a5f;         /* тъмно синьо — главни бутони */
  --primary-ink: #ffffff;
  --ok: #1b7f3b;   --ok-soft: #dcf2e3;
  --warn: #a35a00; --warn-soft: #fdeccc;
  --err: #c1121f;  --err-soft: #fbe0e2;
  --info: #1d5fbf; --info-soft: #dde9fb;
  --shadow: 0 1px 2px rgba(20, 20, 30, .08), 0 4px 14px rgba(20, 20, 30, .06);
  --radius: 14px;
  --tap: 52px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317; --surface: #1b1e24; --surface-2: #22262e; --text: #eef0f4; --muted: #a3a9b8; --line: #343a45;
    --accent: #ff7a2f; --accent-soft: #3a2416; --primary: #4f86d6; --primary-ink: #0b1220;
    --ok: #46c06c; --ok-soft: #173322; --warn: #f0a63a; --warn-soft: #3a2b12; --err: #ff5d68; --err-soft: #3d1a1d;
    --info: #6aa4ff; --info-soft: #172a45; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111317; --surface: #1b1e24; --surface-2: #22262e; --text: #eef0f4; --muted: #a3a9b8; --line: #343a45;
  --accent: #ff7a2f; --accent-soft: #3a2416; --primary: #4f86d6; --primary-ink: #0b1220;
  --ok: #46c06c; --ok-soft: #173322; --warn: #f0a63a; --warn-soft: #3a2b12; --err: #ff5d68; --err-soft: #3d1a1d;
  --info: #6aa4ff; --info-soft: #172a45; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}
:root[data-size="large"] { font-size: 19px; }

* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.45;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lead { font-size: 1.05rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .grid-2.wrap-sm { grid-template-columns: 1fr; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- обвивка ---------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--primary); color: var(--primary-ink);
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top));
}
:root[data-theme="dark"] .topbar, :root:not([data-theme="light"]) .topbar { }
.topbar .proj {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12);
  border: 0; border-radius: 12px; padding: 8px 12px; min-height: 44px; color: inherit; text-align: left; cursor: pointer;
}
.topbar .proj b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.topbar .proj small { opacity: .8; display: block; font-size: .78rem; }
.sync-pill {
  border: 0; border-radius: 999px; padding: 8px 12px; min-height: 44px; font-size: .85rem; font-weight: 600;
  background: rgba(255,255,255,.14); color: inherit; cursor: pointer; white-space: nowrap;
}
.sync-pill.offline { background: #f0a63a; color: #1d1300; }
.sync-pill.error { background: #ff5d68; color: #fff; }
.demo-bar { background: var(--accent); color: var(--accent-ink); text-align: center; font-size: .85rem; padding: 6px 10px; }
.demo-bar button { background: rgba(0,0,0,.18); border: 0; color: inherit; border-radius: 8px; padding: 4px 10px; margin-left: 6px; cursor: pointer; }
.sub-bar { background: var(--surface); border-bottom: 1px solid var(--line); text-align: center; font-size: .85rem; padding: 7px 12px; }
.sub-bar a { color: var(--accent); font-weight: 700; }
.sub-bar.expired { background: var(--err); color: #fff; border-color: var(--err); }
.sub-bar.expired a { color: #fff; text-decoration: underline; }
.price-card .price { font-size: 1.6rem; font-weight: 800; margin: 2px 0; }
main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px;
  text-decoration: none; color: var(--muted); font-size: .78rem; font-weight: 600; position: relative;
}
.tabbar a .ti { font-size: 1.45rem; line-height: 1; }
.tabbar a.on { color: var(--accent); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; background: var(--accent); border-radius: 0 0 3px 3px; }
.tabbar .tab-count { position: absolute; top: 6px; left: calc(50% + 8px); background: var(--err); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 6px; min-width: 18px; text-align: center; }

/* ---------- страници ---------- */
.page { display: grid; gap: 14px; }
.page-head { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.page-head h1 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.page-actions { display: flex; gap: 8px; }
.back { font-size: 1.8rem; text-decoration: none; color: var(--text); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: grid; gap: 10px; min-width: 0; }
.card-title { font-size: 1rem; color: var(--muted); text-transform: none; font-weight: 700; }
.card.accent { border-left: 6px solid var(--accent); }
.card.ok { border-left: 6px solid var(--ok); }
.card.warn { border-left: 6px solid var(--warn); }
.card.err { border-left: 6px solid var(--err); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }

/* ---------- бутони ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 18px;
  border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700;
  cursor: pointer; text-decoration: none; text-align: center; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-block { width: 100%; }
.btn-big { min-height: 64px; font-size: 1.1rem; }
.btn-sm { min-height: 40px; padding: 6px 12px; font-size: .9rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; border-radius: 12px;
  border: 0; background: transparent; color: inherit; font-size: 1.3rem; cursor: pointer;
}
.row-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions .btn { flex: 1 1 140px; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick .btn { flex-direction: column; min-height: 96px; font-size: 1rem; gap: 6px; border-radius: 16px; }
.quick .btn .qi { font-size: 2rem; line-height: 1; }
@media (min-width: 640px) { .quick { grid-template-columns: repeat(4, 1fr); } }
.fab {
  position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 19; min-height: 60px; padding: 0 22px;
  border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 6px 18px rgba(232, 89, 12, .4); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
}

/* ---------- полета ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-weight: 700; font-size: .95rem; }
.field-hint { color: var(--muted); font-size: .85rem; }
.input {
  width: 100%; min-height: var(--tap); padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 1rem;
}
.input:focus { border-color: var(--primary); outline: none; }
textarea.input { min-height: 96px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.ta-wrap { position: relative; }
.ta-wrap textarea { padding-right: 58px; }
.mic { position: absolute; right: 6px; top: 6px; width: 46px; height: 46px; border-radius: 10px; border: 0; background: var(--surface-2); font-size: 1.3rem; cursor: pointer; }
.mic.on { background: var(--err); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 8px 4px; cursor: pointer; }
.check input { width: 28px; height: 28px; accent-color: var(--ok); flex: none; }
.seg { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 14px; overflow-x: auto; }
.seg-wrap { flex-wrap: wrap; overflow: visible; }
.seg-btn {
  flex: 1 0 auto; min-height: 46px; padding: 6px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text);
  font-weight: 700; cursor: pointer; white-space: nowrap;
}
.seg-btn.on { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 12px; }
.stepper .icon-btn { font-size: 1.6rem; font-weight: 700; }
.stepper-val { min-width: 64px; text-align: center; font-weight: 800; font-size: 1.1rem; }

/* ---------- списъци ---------- */
.list { display: grid; gap: 8px; }
.item {
  display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; text-decoration: none; color: inherit; min-height: 64px; cursor: pointer; border: 0; width: 100%; text-align: left;
}
.item .thumb-sm { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.item .item-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--surface-2); flex: none; }
.item-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.item-title { font-weight: 700; overflow-wrap: anywhere; }
.item-sub { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.item-right { display: grid; justify-items: end; gap: 4px; flex: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.open { background: var(--err-soft); color: var(--err); }
.badge.in_progress { background: var(--warn-soft); color: var(--warn); }
.badge.review { background: var(--info-soft); color: var(--info); }
.badge.accepted, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.prio-urgent { color: var(--err); font-weight: 800; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 42px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .n { opacity: .7; margin-left: 4px; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty-icon { font-size: 2.6rem; }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; display: grid; gap: 2px; text-decoration: none; color: inherit; }
.stat b { font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.err b { color: var(--err); } .stat.warn b { color: var(--warn); } .stat.ok b { color: var(--ok); } .stat.info b { color: var(--info); }
.timeline { display: grid; gap: 10px; border-left: 3px solid var(--line); padding-left: 12px; margin-left: 6px; }
.timeline > div { position: relative; }
.timeline > div::before { content: ""; position: absolute; left: -19px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.timeline > div.done::before { background: var(--ok); }

/* ---------- снимки ---------- */
.photo { background: var(--surface-2); }
.photo-missing { min-height: 56px; }
.photos-edit { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 92px; height: 92px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; cursor: zoom-in; }
.thumb-x { position: absolute; top: -8px; right: -8px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface); background: var(--text); color: var(--bg); cursor: pointer; font-size: .9rem; }
.thumb-add { width: 92px; height: 92px; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface-2); display: grid; place-items: center; align-content: center; gap: 2px; cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--text); }
.thumb-add .big { font-size: 1.7rem; }
.thumb-add-small { width: 72px; }
.photo-strip { display: flex; gap: 8px; overflow-x: auto; }
.photo-strip img { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; flex: none; cursor: zoom-in; }
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.94); display: grid; place-items: center; }
.viewer-img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.viewer .icon-btn { position: absolute; color: #fff; background: rgba(255,255,255,.12); font-size: 1.8rem; }
.viewer-close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
.viewer-prev { left: 8px; top: 50%; } .viewer-next { right: 8px; top: 50%; }
.viewer-count { position: absolute; bottom: 18px; color: #fff; font-weight: 700; }

/* ---------- панели ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 18, .5); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .18s; }
.overlay.in { opacity: 1; }
.overlay.out { opacity: 0; }
.sheet {
  background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column;
  transform: translateY(24px); transition: transform .2s; padding-bottom: env(safe-area-inset-bottom);
}
.overlay.in .sheet { transform: none; }
.sheet-wide { max-width: 860px; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 20px; max-height: 88vh; } }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px 18px; }
.sheet-head h2 { flex: 1; }
.sheet-body { overflow-y: auto; padding: 6px 16px 18px; display: grid; gap: 14px; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 70; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; }
.toast-warn { background: var(--warn); color: #fff; } .toast-err { background: var(--err); color: #fff; } .toast-ok { background: var(--ok); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- вход ---------- */
.login { max-width: 460px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); display: grid; place-items: center; font-size: 1.8rem; color: #fff; flex: none; }
.brand h1 { font-size: 1.6rem; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.person-tile { min-height: 84px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); padding: 10px; text-align: left; cursor: pointer; display: grid; gap: 2px; align-content: center; }
.person-tile b { overflow-wrap: anywhere; }
.person-tile small { color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-size: .95rem; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 6px 0; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--text); }
.pin-dots span.full { background: var(--text); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto; width: 100%; }
.keypad button { min-height: 66px; border-radius: 16px; border: 0; background: var(--surface); box-shadow: var(--shadow); font-size: 1.6rem; font-weight: 700; cursor: pointer; }
.keypad button.k-wide { font-size: 1rem; }
.role-tiles { display: grid; gap: 10px; }
.role-tile { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; min-height: 72px; }
.role-tile .ri { font-size: 1.8rem; }

/* ---------- чертеж ---------- */
.plan-wrap { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius); touch-action: none; height: 62vh; min-height: 320px; }
.plan-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.plan-stage img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.pin { position: absolute; width: 30px; height: 30px; margin: -30px 0 0 -15px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); cursor: pointer; display: grid; place-items: center; }
.pin > span { transform: rotate(45deg); color: #fff; font-size: .72rem; font-weight: 800; }
.pin.open { background: var(--err); } .pin.in_progress { background: #d98200; } .pin.review { background: var(--info); } .pin.accepted { background: var(--ok); }
.pin.new { background: var(--accent); animation: pulse 1s infinite; }
.plan-tools { position: absolute; right: 8px; top: 8px; display: grid; gap: 6px; z-index: 2; }
.plan-tools button { width: 48px; height: 48px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: var(--shadow); font-size: 1.3rem; font-weight: 800; cursor: pointer; }
.plan-hint { position: absolute; left: 8px; bottom: 8px; right: 64px; background: rgba(0,0,0,.65); color: #fff; padding: 8px 12px; border-radius: 10px; font-size: .9rem; z-index: 2; }

/* ---------- таблица ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; font-size: .92rem; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 700; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }

/* ---------- печат ---------- */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body { background: #fff; color: #000; font-size: 11pt; }
}
.print-page { color: #000; background: #fff; font-family: "Times New Roman", Georgia, serif; font-size: 11pt; line-height: 1.35; }
.print-page h1 { font-size: 15pt; text-align: center; margin: 4mm 0; }
.print-page h2 { font-size: 12pt; margin: 4mm 0 2mm; }
.print-page .doc-head { display: flex; justify-content: space-between; gap: 10mm; font-size: 10pt; border-bottom: 1px solid #000; padding-bottom: 2mm; }
.print-page table { width: 100%; border-collapse: collapse; margin: 2mm 0; }
.print-page th, .print-page td { border: 1px solid #000; padding: 1.5mm 2mm; text-align: left; vertical-align: top; font-size: 10pt; }
.print-page .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm 14mm; margin-top: 10mm; }
.print-page .sign div { border-top: 1px solid #000; padding-top: 1mm; font-size: 9.5pt; }
.print-page .photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; }
.print-page .photos img { width: 100%; height: 45mm; object-fit: cover; border: 1px solid #999; }
.print-page .note { font-size: 9pt; color: #333; margin-top: 4mm; }
.print-page .blank { border-bottom: 1px dotted #000; min-height: 6mm; }

/* подпис */
.sig { position: relative; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; overflow: hidden; }
.sig-canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }
.sig-clear { position: absolute; right: 6px; top: 6px; }
.sig-hint { position: absolute; left: 12px; bottom: 8px; color: #8a8f9c; font-size: .85rem; pointer-events: none; }
.sig.signed .sig-hint { display: none; }
.sig-img { height: 54px; max-width: 200px; object-fit: contain; background: #fff; border-radius: 6px; }

/* Колоните не се разпъват от дълги редове (филтри, таблици) — всичко остава в ширината на екрана */
.page, .stack, .stack-sm, .card, .sheet-body, .list, .login { grid-template-columns: minmax(0, 1fr); }
main { overflow-x: clip; }
.grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.input { min-width: 0; }
@media (max-width: 430px) { .grid-2.wrap-sm { grid-template-columns: minmax(0, 1fr); } }

/* покана, първи стъпки, инсталиране */
.invite-text { white-space: pre-wrap; word-break: break-word; font: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; }
.first-steps .steps { list-style: none; padding: 0; margin: 10px 0 6px; display: grid; gap: 8px; }
.first-steps .steps li { display: flex; align-items: center; gap: 10px; }
.first-steps .steps li.done { color: var(--muted); text-decoration: line-through; }
.first-steps .steps a { font-weight: 700; }
.first-steps .step-mark { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); }
.first-steps .done .step-mark { background: var(--ok); color: #fff; border-color: var(--ok); }
.install-card[hidden] { display: none; }

/* известия, линк за възложителя */
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.share-url { font-family: ui-monospace, monospace; font-size: .85rem; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.view-page { max-width: 860px; margin: 0 auto; padding: 16px 14px 40px; display: grid; gap: 14px; }
.view-head { display: flex; gap: 12px; align-items: center; }
.view-head h1 { margin: 0; font-size: 1.4rem; line-height: 1.2; }
.view-head p { margin: 2px 0 0; }
.view-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.view-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.view-daily ul { margin: 6px 0 0; padding-left: 18px; }
