/* 4CAD PointLab — vzhled. Bez CDN, bez buildu.
   Jeden systém barev: tmavá lišta (chrome), světlé stránky správy, tmavý 3D pracovní prostor (.viewer),
   jediná akcentní barva 4CAD (oranžová) pro hlavní akce, výběr a zvýraznění. */

:root {
  /* akcent */
  --acc: #ff541e;
  --acc-hover: #ec4814;
  --acc-press: #d23f10;
  --acc-dark: #c93c0f;
  --acc-soft: #fff1eb;
  --acc-line: #ffc7b1;
  --focus: 0 0 0 3px rgba(255, 84, 30, .28);
  /* povrchy (světlé stránky) */
  --bg: #f1f3f6;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --panel-3: #eef1f4;
  --line: #e1e5ea;
  --line-2: #cbd2da;
  --text: #0f141a;
  --text-2: #3a4450;
  --muted: #6a7482;
  --field: #ffffff;
  --btn: #ffffff;
  --btn-hover: #f2f4f7;
  --chip: #1b2129;
  /* lišta */
  --chrome: #10141a;
  --chrome-2: #171c23;
  --chrome-3: #20262e;
  --chrome-line: #262d36;
  --chrome-text: #e8ebef;
  --chrome-muted: #8d97a4;
  /* 3D scéna */
  --stage: #0b0e12;
  --stage-2: #141920;
  /* stavy */
  --ok: #1f9d55;
  --ok-soft: #e7f6ee;
  --ok-line: #bde5cd;
  --warn: #c27c00;
  --warn-soft: #fff5de;
  --warn-line: #f1d28e;
  --err: #d92d20;
  --err-soft: #fdeceb;
  --err-line: #f4c1bb;
  --info: #2f6fed;
  /* tvar */
  --r: 8px;
  --r-s: 6px;
  --r-l: 12px;
  --h: 32px;
  --h-sm: 28px;
  --sh-1: 0 1px 2px rgba(15, 20, 26, .06);
  --sh: 0 1px 2px rgba(15, 20, 26, .05), 0 6px 20px rgba(15, 20, 26, .07);
  --sh-3: 0 24px 64px rgba(0, 0, 0, .30);
  --ff: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ffd: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --fm: "Cascadia Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* tmavý pracovní prostor – stejné prvky, jiné hodnoty */
.viewer, .dark {
  color-scheme: dark;
  --bg: #0b0e12;
  --panel: #12161c;
  --panel-2: #171c23;
  --panel-3: #1e242c;
  --line: #232a33;
  --line-2: #323a45;
  --text: #e6e9ed;
  --text-2: #c4cad2;
  --muted: #8a94a1;
  --field: #0e1217;
  --btn: #1a2028;
  --btn-hover: #222932;
  --chip: #2a313b;
  --acc-soft: rgba(255, 84, 30, .14);
  --acc-line: rgba(255, 84, 30, .5);
  --ok-soft: rgba(31, 157, 85, .16);
  --ok-line: rgba(31, 157, 85, .45);
  --warn-soft: rgba(224, 150, 20, .16);
  --warn-line: rgba(224, 150, 20, .45);
  --err-soft: rgba(229, 72, 77, .16);
  --err-line: rgba(229, 72, 77, .45);
  --err: #f0645c;
  --ok: #34c177;
  --warn: #e8a53a;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .35);
  --sh: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: var(--app-h, 100%); overflow: hidden; }
body {
  font-family: var(--ff); font-size: 13.5px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
}
.app { height: var(--app-h, 100%); overflow: hidden; }
.boot { display: grid; place-items: center; height: 100%; color: var(--muted); background: var(--chrome); }

h1, h2, h3, h4 { margin: 0; font-family: var(--ffd); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 13px; }
p { margin: 0 0 10px; }
a { color: var(--acc-dark); }
.viewer a { color: var(--acc); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--fm); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
kbd { font: 600 10.5px var(--fm); padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--panel-2); color: var(--text-2); }

/* ikony a značka */
.ic { display: inline-flex; width: 16px; height: 16px; flex: none; }
.ic svg { width: 100%; height: 100%; display: block; }
.ic.ic-lg { width: 22px; height: 22px; }
.ic.ic-xl { width: 26px; height: 26px; }
.logo { display: inline-flex; flex: none; }
.logo svg { display: block; }

/* posuvníky */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- ovládací prvky ---------- */

button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { accent-color: var(--acc); }
:focus-visible { outline: none; box-shadow: var(--focus); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--h); padding: 0 13px; border: 1px solid var(--line-2); border-radius: var(--r-s);
  background: var(--btn); color: var(--text); cursor: pointer; font-weight: 600; font-size: 13px;
  text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.btn:hover:not(:disabled) { background: var(--btn-hover); border-color: var(--muted); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--acc-hover); border-color: var(--acc-hover); }
.btn.primary:active:not(:disabled) { background: var(--acc-press); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--panel-3); color: var(--text); border-color: transparent; }
.btn.danger { color: var(--err); border-color: var(--err-line); background: var(--btn); }
.btn.danger:hover:not(:disabled) { background: var(--err-soft); border-color: var(--err); }
.btn.sm { height: var(--h-sm); padding: 0 10px; font-size: 12.5px; gap: 6px; }
.btn.sm .ic { width: 14px; height: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: var(--h); padding: 0; }
.btn.icon.sm { width: var(--h-sm); }
.btn.on { border-color: var(--acc); color: var(--acc); background: var(--acc-soft); }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=file], input[type=number], select, textarea {
  min-height: var(--h); padding: 5px 10px; border: 1px solid var(--line-2); border-radius: var(--r-s);
  background: var(--field); color: var(--text); width: 100%; transition: border-color .12s, box-shadow .12s;
}
input[type=file] { padding: 5px 8px; }
select { padding-right: 28px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a1' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input[type=text]:focus, input[type=email]:focus, input[type=tel]:focus, input[type=password]:focus, input[type=number]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--acc); box-shadow: var(--focus);
}
input[type=range] { width: 100%; }
input:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
label.chk { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 0; }
label.chk input { width: auto; margin: 0; }
input[type=checkbox], input[type=radio] { width: 15px; height: 15px; }

.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }

/* segmentovaný přepínač */
.seg { display: flex; padding: 2px; gap: 2px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--panel-2); }
.seg button {
  flex: 1 1 auto; min-width: 0; height: 26px; padding: 0 6px; border: 0; border-radius: 4px; background: transparent; cursor: pointer;
  white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--muted);
}
.seg button.on { background: var(--acc); color: #fff; box-shadow: var(--sh-1); }
.seg button:not(.on):hover { background: var(--panel-3); color: var(--text); }

/* ---------- toasty ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 900; }
.toast {
  background: var(--chrome-2); color: var(--chrome-text); padding: 10px 14px 10px 12px; border-radius: var(--r-s);
  border: 1px solid var(--chrome-line); border-left: 3px solid var(--chrome-muted);
  box-shadow: var(--sh-3); max-width: 380px; font-size: 13px; animation: pop .16s ease-out;
}
.toast.err { border-left-color: #f0645c; }
.toast.ok { border-left-color: #34c177; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }

/* ---------- přihlášení ---------- */
.auth {
  height: 100%; display: grid; place-items: center; padding: 20px; color: var(--chrome-text);
  background:
    radial-gradient(900px 480px at 50% 0%, rgba(255, 84, 30, .16), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--chrome);
}
.auth-box { width: 100%; max-width: 380px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-brand .nm { font-family: var(--ffd); font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.auth-brand .nm span { color: var(--chrome-muted); font-weight: 500; }
.auth-brand .tag { font-size: 12.5px; color: var(--chrome-muted); }
.auth-card { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-l); padding: 24px; box-shadow: var(--sh-3); }
.auth-card h2 { margin-bottom: 4px; }
.auth-foot { margin-top: 14px; font-size: 12px; color: var(--chrome-muted); text-align: center; }
.brand { font-family: var(--ffd); font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.brand span { color: var(--acc); }
.err-msg { color: var(--err); font-size: 12.5px; min-height: 18px; margin-top: 8px; }

/* ---------- lišta aplikace ---------- */
.shell { display: flex; flex-direction: column; height: 100%; }
.topbar {
  display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 14px;
  background: var(--chrome); color: var(--chrome-text); border-bottom: 1px solid var(--chrome-line); flex: none;
}
.tb-brand { display: flex; align-items: center; gap: 10px; padding-right: 14px; margin-right: 6px; border-right: 1px solid var(--chrome-line);
  height: 28px; color: var(--chrome-text); text-decoration: none; }
.tb-brand .nm { font-family: var(--ffd); font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
.tb-brand .nm span { color: var(--chrome-muted); font-weight: 500; margin-right: 4px; }
.tb-nav { display: flex; align-items: stretch; gap: 2px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.tb-nav::-webkit-scrollbar { display: none; }
.tb-tab { display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--chrome-muted); text-decoration: none; font-weight: 600;
  font-size: 13px; white-space: nowrap; border-bottom: 2px solid transparent; border-top: 2px solid transparent; transition: color .12s, background .12s; }
.tb-tab:hover { color: var(--chrome-text); background: var(--chrome-2); }
.tb-tab.on { color: var(--chrome-text); border-bottom-color: var(--acc); }
.tb-tab.on .ic { color: var(--acc); }
.topbar .btn.ghost { color: var(--chrome-muted); }
.topbar .btn.ghost:hover:not(:disabled) { background: var(--chrome-3); color: var(--chrome-text); }
.tb-usage { display: flex; flex-direction: column; gap: 3px; min-width: 150px; padding: 0 8px; font-size: 11px; color: var(--chrome-muted); line-height: 1.2; }
.tb-usage .prog { height: 4px; border: 0; background: var(--chrome-3); }
.tb-user { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 4px; border-radius: var(--r-s); cursor: pointer; color: var(--chrome-text);
  border: 1px solid transparent; background: transparent; }
.tb-user:hover { background: var(--chrome-2); border-color: var(--chrome-line); }
.tb-user .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--chrome-3); color: var(--chrome-text);
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.tb-user .who { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.tb-user .who b { font-size: 12.5px; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-user .who span { font-size: 11px; color: var(--chrome-muted); }
.tb-sep { width: 1px; height: 24px; background: var(--chrome-line); margin: 0 6px; }

/* ---------- stránky (moduly, projekty, správa) ---------- */
.scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h1 { font-size: 21px; }
.section-head h2 { font-size: 15px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .crumb { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.page-head .lead { color: var(--muted); max-width: 720px; margin-top: 4px; font-size: 13px; }

.plist { display: flex; flex-direction: column; gap: 8px; }
.pitem { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color .12s, box-shadow .12s; }
.pitem:hover { border-color: var(--line-2); box-shadow: var(--sh); }
.pitem-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pitem-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pitem-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.pitem-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.pitem-meta .ic { width: 13px; height: 13px; opacity: .8; }
.pitem-actions { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.pitem-actions select { width: auto; max-width: 230px; min-width: 0; min-height: var(--h-sm); height: var(--h-sm); font-size: 12.5px; }
.pitem-actions input[type=number] { width: 70px; min-height: var(--h-sm); height: var(--h-sm); }
.dlg-body input[type=number] { width: 100%; }
.pitem-actions.admin-acts { justify-content: flex-end; align-items: center; max-width: 640px; }
.pitem.inactive { opacity: .6; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; font-size: 11.5px; font-weight: 650; padding: 0 9px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.ready { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.badge.run { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-dark); }
.badge.run::before { animation: blink 1.2s ease-in-out infinite; }
.badge.err { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }
.badge.soon { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-dark); }
@keyframes blink { 50% { opacity: .2; } }

.prog { height: 6px; background: var(--panel-3); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.prog > i { display: block; height: 100%; background: var(--acc); width: 0; transition: width .25s; border-radius: 999px; }
.prog-line { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.prog-line .prog { flex: 1; }
.logtail { font-family: var(--fm); font-size: 11.5px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--r-s); padding: 7px 9px; white-space: pre-wrap; max-height: 84px; overflow: auto; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { width: 34px; height: 34px; color: var(--line-2); }
.note { padding: 11px 14px; margin-bottom: 12px; font-size: 13px; color: var(--text-2); background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--acc); border-radius: var(--r-s); box-shadow: none; }
.note b { color: var(--text); }

/* úvodní stránka: výběr modulu */
.wrap.home { max-width: 1180px; padding-top: 34px; }
.home-head { margin-bottom: 22px; }
.home-head .crumb { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.home-head h1 { font-size: 24px; margin-bottom: 4px; }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.home-tile { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px 20px 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-1); color: var(--text); text-decoration: none;
  transition: border-color .12s, box-shadow .12s, transform .12s; }
.home-tile:hover { border-color: var(--acc); box-shadow: var(--sh); transform: translateY(-1px); }
.home-tile h2 { font-size: 17px; }
.home-tile p { margin: 0; flex: 1; font-size: 13px; line-height: 1.5; color: var(--muted); }
.home-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); }
.home-icon .ic { width: 24px; height: 24px; }
.home-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; color: var(--acc-dark); margin-top: 4px; }
.home-go .ic { width: 15px; height: 15px; transition: transform .12s; }
.home-tile:hover .home-go .ic { transform: translateX(3px); }
.home-tile.admin .home-icon { background: var(--panel-3); color: var(--text-2); }

table.plans { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plans th, table.plans td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plans th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; background: var(--panel-2); }
table.plans tr:last-child td { border-bottom: 0; }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: var(--r-l); padding: 0; box-shadow: var(--sh-3); max-width: 92vw; width: 440px;
  background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(8, 11, 15, .55); backdrop-filter: blur(2px); }
.dlg-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 16px; }
.dlg-body { padding: 16px 20px; }
.dlg-foot { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); background: var(--panel-2);
  border-radius: 0 0 var(--r-l) var(--r-l); }

/* ---------- prohlížeč (tmavý pracovní prostor) ---------- */
.viewer { display: flex; flex-direction: column; height: var(--app-h, 100%); background: var(--stage); color: var(--text); }
.v-top {
  flex: none; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 10px 0 12px;
  background: var(--chrome); color: var(--chrome-text); border-bottom: 1px solid var(--chrome-line);
}
.v-top .logo { margin-right: 2px; }
.v-top .btn.ghost { color: var(--chrome-muted); }
.v-top .btn.ghost:hover:not(:disabled) { background: var(--chrome-3); color: var(--chrome-text); }
.v-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v-crumb .mod { color: var(--chrome-muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.v-crumb .slash { color: var(--chrome-line); font-size: 16px; }
.v-title { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--chrome-text); }
.v-sub { color: var(--chrome-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.v-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 284px 1fr var(--right-w, 340px); }
.v-split { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 6; background: transparent; touch-action: none; }
.v-split:hover, .v-split.on { background: rgba(255, 84, 30, .5); }
dialog.dlg-map { width: 94vw; max-width: 94vw; height: 88vh; display: flex; flex-direction: column; }
dialog.dlg-map[open] { display: flex; }
.bigmap-holder { flex: 1; min-height: 0; padding: 0 14px 14px; }
.bigmap-holder .fmap { height: 100% !important; margin: 0; }
.gmap { text-decoration: none; }
/* značka místa skenu v mapě – stálá velikost, pulzující kruh, viditelná i po oddálení */
.fmap-pin { position: relative; }
.fmap-pin .dot { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--acc); border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(255, 84, 30, .35), 0 2px 8px rgba(0, 0, 0, .55); }
.fmap-pin .ring { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid rgba(255, 84, 30, .9);
  animation: fmap-pulse 1.6s ease-out infinite; }
.fmap-pin .lbl { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); white-space: nowrap; font: 600 11px/1 var(--ff); color: #fff; background: rgba(16, 20, 27, .85);
  padding: 3px 7px; border-radius: 6px; pointer-events: none; }
@keyframes fmap-pulse { 0% { transform: scale(.55); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }

.panel { background: var(--panel); border-right: 1px solid var(--line); overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.panel.right { border-right: 0; border-left: 1px solid var(--line); }
.pbox { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); padding: 10px 11px 11px; }
.pbox > h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 9px; }
.pbox + .pbox { margin-top: 0; }
.slider-row { margin-bottom: 10px; }
.slider-row:last-child { margin-bottom: 0; }
.slider-row > label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.slider-row > label b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.viewer input[type=range] { height: 18px; }

.legend { display: flex; flex-direction: column; gap: 1px; max-height: 320px; overflow: auto; }
.lg {
  display: flex; align-items: center; gap: 8px; min-height: 26px; padding: 2px 6px; border-radius: 5px; cursor: pointer;
  border: 1px solid transparent; font-size: 12.5px;
}
.lg:hover { background: var(--panel-3); }
.lg.active { border-color: var(--acc-line); background: var(--acc-soft); }
.lg input { margin: 0; flex: none; }
.lg .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.lg .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg .ct { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.lg .key { color: var(--muted); font-size: 10.5px; font-family: var(--fm); opacity: .7; }

.v-stage { position: relative; overflow: hidden; background: radial-gradient(1200px 700px at 50% 45%, #121820, var(--stage) 70%); touch-action: none; }
.v-stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#ov { pointer-events: none; }
.v-hud {
  position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: #97a1ad; font-family: var(--fm); pointer-events: none;
}
.v-hud span { background: rgba(11, 14, 18, .78); border: 1px solid var(--line); padding: 2px 7px; border-radius: 5px; }
.v-views { position: absolute; right: 10px; top: 10px; display: flex; gap: 2px; padding: 3px; border-radius: var(--r); background: rgba(18, 22, 28, .88);
  border: 1px solid var(--line-2); box-shadow: var(--sh); backdrop-filter: blur(6px); }
.v-views .btn { background: transparent; border-color: transparent; color: var(--text-2); height: 28px; padding: 0 9px; font-size: 12px; }
.v-views .btn:hover:not(:disabled) { background: var(--panel-3); color: var(--text); border-color: transparent; }
.v-load {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 4;
  background: rgba(18, 22, 28, .92); border: 1px solid var(--line-2); color: var(--text); padding: 8px 14px;
  border-radius: 999px; font-size: 12.5px; display: flex; align-items: center; gap: 10px; min-width: 260px; box-shadow: var(--sh);
}
.v-load .prog { flex: 1; }
.v-cursor-lasso { cursor: crosshair; }
.v-err { position: absolute; inset: 0; display: grid; place-items: center; color: #ff9b86; padding: 30px; text-align: center; }

.tag-save { font-size: 12px; font-weight: 650; }
.tag-save.dirty { color: var(--warn); }
.tag-save.clean { color: var(--ok); }

/* vyhodnocení */
.ev-kpi { display: flex; gap: 8px; margin-bottom: 10px; }
.ev-kpi > div { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s); padding: 7px 9px; }
.ev-kpi b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.ev-kpi span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
table.ev { width: 100%; border-collapse: collapse; font-size: 12px; }
table.ev th, table.ev td { padding: 4px 5px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.ev th { color: var(--muted); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
table.ev td:first-child, table.ev th:first-child { text-align: left; }
table.ev .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
table.cm { border-collapse: collapse; font-size: 10.5px; font-variant-numeric: tabular-nums; }
table.cm td, table.cm th { border: 1px solid var(--line); padding: 2px 4px; text-align: right; }
table.cm th { background: var(--panel-2); font-weight: 600; color: var(--muted); font-size: 10px; }
table.cm th.rowh { text-align: left; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.cm-wrap { overflow: auto; max-width: 100%; }

/* nápověda */
.help-ov { position: fixed; inset: 0; background: rgba(8, 11, 15, .72); z-index: 800; display: grid; place-items: center; padding: 20px; }
.help-card { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-l); padding: 22px; max-width: 540px; width: 100%;
  max-height: 80%; overflow: auto; box-shadow: var(--sh-3); }
.help-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 14px; margin: 0; font-size: 13px; }
.help-card dt { font-family: var(--fm); font-size: 12px; color: var(--acc); white-space: nowrap; }
.help-card dd { margin: 0; color: var(--text); }

/* mobilní zásuvky */
.drawer-btns { display: none; gap: 4px; }
@media (max-width: 900px) {
  .v-body { grid-template-columns: 1fr; position: relative; }
  .panel {
    position: absolute; top: 0; bottom: 0; width: min(88%, 340px); z-index: 20;
    box-shadow: 0 0 40px rgba(0, 0, 0, .45); transition: transform .22s ease;
  }
  .panel.left { left: 0; transform: translateX(-104%); }
  .panel.right { right: 0; left: auto; transform: translateX(104%); }
  .panel.open { transform: translateX(0); }
  .drawer-btns { display: flex; }
  .v-views { top: 8px; right: 8px; }
  .v-hud { font-size: 10.5px; }
  .v-crumb .mod, .v-crumb .slash, .v-sub { display: none; }
  .wrap { padding: 16px 12px 50px; }
  .pitem-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .tb-tab .lbl, .tb-user .who, .tb-usage { display: none; }
  .tb-brand .nm { display: none; }
}

/* nabídka tříd po výběru */
.class-picker { position: absolute; z-index: 30; width: 250px; display: flex; flex-direction: column; background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--sh-3); overflow: hidden; }
.class-picker .cp-head { padding: 9px 12px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); }
.class-picker .cp-list { overflow: auto; padding: 4px; }
.class-picker .cp-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; background: none;
  border-radius: 5px; cursor: pointer; font: inherit; font-size: 13px; text-align: left; color: inherit; }
.class-picker .cp-item:hover, .class-picker .cp-item.on { background: var(--acc-soft); }
.class-picker .cp-item .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.class-picker .cp-item kbd { margin-left: auto; }
.class-picker .cp-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.class-picker .cp-foot .btn { flex: 1 1 auto; }
/* rozpracovaný výběr z více tahů (Shift přidat / Ctrl odebrat) */
.class-picker.sel-panel { width: 290px; }
.class-picker .cp-head .cp-hint { margin-top: 4px; font-weight: 400; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.class-picker .cp-opts { display: flex; flex-direction: column; gap: 7px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.class-picker .cp-row { display: flex; align-items: center; gap: 8px; }
.class-picker .cp-seg { display: flex; gap: 4px; flex: 1; }
.class-picker .cp-seg .btn { flex: 1; height: 26px; padding: 0 6px; font-size: 12px; }
.class-picker .cp-seg .btn.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.class-picker .cp-train { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.class-picker .cp-train input { width: 16px; height: 16px; accent-color: var(--acc); }
.class-picker .cp-sub { padding: 7px 12px 2px; font-size: 11.5px; color: var(--muted); }

/* ---- objekty (boxy) – rozmisťování strojů ---- */
.v-cursor-move { cursor: move; }
.obj-list { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 210px; overflow: auto; }
.obj-list .lg { cursor: pointer; }
.obj-warn { color: var(--err); font-weight: 700; flex: none; }
.obj-detail:not(:empty) { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.obj-detail .field { margin-bottom: 0; }
.obj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.obj-grid label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.obj-grid input { width: 74px; }
.obj-collision:empty { display: none; }
.obj-collision.bad { color: var(--err); font-weight: 600; }
.obj-collision.ok { color: var(--ok); }

/* ---- výběr tříd projektu ---- */
.cls-dlg { width: min(540px, calc(100vw - 24px)); }
.cls-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.cls-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; max-height: 300px; overflow: auto; padding: 6px 2px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cls-row { display: flex; align-items: center; gap: 7px; padding: 4px 4px; border-radius: 5px; font-size: 13px; cursor: pointer; min-width: 0; }
.cls-row:hover { background: var(--panel-3); }
.cls-row input { margin: 0; flex: none; }
.cls-row .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.cls-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-tag { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 6px; flex: none; }
.cls-x { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 0 3px; font-size: 13px; flex: none; }
.cls-x:hover { color: var(--err); }
.cls-new { margin-top: 10px; }
.cls-new input[type=color] { width: 38px; height: var(--h); padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--field); flex: none; }
@media (max-width: 520px) { .cls-list { grid-template-columns: 1fr; } }

/* ---- odstupy objektu ---- */
.obj-clear { display: flex; flex-direction: column; gap: 4px; }
.obj-clear-row select, .obj-clear-row input { font-size: 12.5px; }
.obj-clear-row.bad select, .obj-clear-row.bad input { border-color: var(--err); color: var(--err); }

/* ---- srolovatelný panel ---- */
.pbox > h3.fold-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; user-select: none; }
.pbox > h3.fold-head:hover { color: var(--text); }
.pbox > h3.fold-head:focus-visible { box-shadow: var(--focus); border-radius: 4px; }
.fold-arrow { font-size: 12px; line-height: 1; transition: transform .15s ease; }
.pbox.folded > h3.fold-head { margin-bottom: 0; }
.pbox.folded .fold-arrow { transform: rotate(-90deg); }
.pbox.folded > .fold-body { display: none; }

/* ---- předměty rozpoznané AI, čísla objektů ---- */
.inst-no { flex: none; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--chip); color: #fff; font-size: 10.5px;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.inst-no.doubt { background: #b7791f; }
.inst-ok { flex: none; width: 15px; height: 15px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; }
.inst-fix { padding: 6px 8px 8px 12px; border-bottom: 1px solid var(--line); background: var(--ok-soft); }
.inst-fix .row { flex-wrap: wrap; }
.inst-fix select { flex: 1 1 100%; min-width: 0; width: 100%; }
.inst-fix .small { margin-top: 4px; }

/* ---- souhrny rozborů (les, koridory) ---- */
.fst-row { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.fst-row:last-of-type { border-bottom: 0; }
.fst-row .fst-l { color: var(--muted); min-width: 112px; }
.fst-row b { font-weight: 650; }
.fst-strata { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 11.5px; color: var(--text-2); }
.fst-chip { display: inline-flex; align-items: center; gap: 5px; }
.fst-chip .sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.fst-hist { display: flex; align-items: flex-end; gap: 2px; height: 56px; margin-top: 4px; }
.fst-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 9px; color: var(--muted); }
.fst-bar i { display: block; width: 100%; background: var(--acc); border-radius: 2px 2px 0 0; min-height: 1px; opacity: .85; }
.fst-tree .nm { flex: 1; }
.fmap { height: 280px; margin-top: 6px; border-radius: var(--r-s); overflow: hidden; border: 1px solid var(--line); background: var(--panel-3); }
.fmap .leaflet-control-attribution { font-size: 9px; }
.fst-tree .ct { width: 58px; text-align: right; }
.inst-q { flex: none; width: 15px; height: 15px; border-radius: 50%; background: #ffd54f; color: #3b2f00; font-size: 10.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; cursor: help; }
.ic.flip { transform: scaleX(-1); }

/* řádky seznamů: název a údaje vlevo, stav a akce vpravo v jedné lince */
.pitem-main > div:first-child { flex: 1 1 auto; min-width: 0; }
@media (min-width: 901px) {
  .pitem-main { flex-wrap: nowrap; }
  .pitem-actions { flex: none; }
}
.auth-brand .nm span { margin-right: 6px; }
input[type=file]::file-selector-button { height: 24px; margin-right: 10px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 5px;
  background: var(--panel-2); color: var(--text); font: 600 12.5px var(--ff); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--panel-3); }
@media (max-width: 900px) {
  .v-top { gap: 4px; padding: 0 6px; }
  .v-top .lbl { display: none; }
  .v-top .btn.sm { padding: 0 8px; }
  .v-views .btn .ic + * { display: none; }
}

/* ---- hlavní plocha: 3D / mapa (sken usazený do mapy) ---- */
.v-stageseg { position: absolute; left: 10px; top: 10px; z-index: 6; display: flex; gap: 2px; padding: 3px; border-radius: var(--r);
  background: rgba(18, 22, 28, .9); border: 1px solid var(--line-2); box-shadow: var(--sh); backdrop-filter: blur(6px); }
.v-stageseg button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 0; border-radius: 5px; background: transparent;
  color: var(--text-2); font: 600 12.5px var(--ff); cursor: pointer; }
.v-stageseg button:hover { background: var(--panel-3); color: var(--text); }
.v-stageseg button.on { background: var(--acc); color: #fff; }
.v-map { position: absolute; inset: 0; z-index: 3; background: var(--stage); }
.v-map-el { position: absolute; inset: 0; }
.v-map-tools { position: absolute; left: 10px; top: 54px; z-index: 500; width: 232px; }
.v-map-card { background: rgba(18, 22, 28, .92); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; box-shadow: var(--sh);
  backdrop-filter: blur(6px); color: var(--text); }
.v-map-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 12.5px; }
.v-map-head .ic { color: var(--acc); }
.v-map-msg { position: absolute; inset: 0; z-index: 600; display: grid; place-items: center; padding: 20px; }
.v-map-msg .card { max-width: 440px; padding: 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.v-map .leaflet-container { background: #0e1217; font-family: var(--ff); }
.fmap-scan { image-rendering: auto; }
.fmap-tlabel { background: transparent; border: 0; box-shadow: none; color: #fff; font: 700 10.5px var(--ff); text-shadow: 0 0 3px #000, 0 0 2px #000; padding: 0; }
.fmap-tlabel::before { display: none; }
.fmap-plabel span { display: inline-block; transform: translate(-50%, -140%); white-space: nowrap; background: rgba(16, 20, 26, .88); color: #fff;
  font: 600 11.5px var(--ff); padding: 3px 8px; border-radius: 5px; border: 1px solid rgba(255, 84, 30, .7); cursor: pointer; }
.ov-map { height: 380px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--panel-3); }
@media (max-width: 900px) {
  .v-map-tools { top: auto; bottom: 10px; width: min(232px, calc(100% - 20px)); }
  .v-stageseg button span { display: none; }
}
.v-map-head { cursor: pointer; user-select: none; margin-bottom: 0; }
.v-map-head .fold-ic { color: var(--muted); transition: transform .15s; }
.v-map-body { margin-top: 8px; }
.v-map-card.folded .v-map-body { display: none; }
.v-map-card.folded .fold-ic { transform: rotate(-90deg); }
@media (max-width: 1240px) { .v-stage.has-seg .v-views { top: 50px; } }

/* oprava polohy na mape */
.v-map-tools { max-height: calc(100% - 64px); overflow-y: auto; }
.v-map-tools > .v-map-card + .v-map-card { margin-top: 8px; }
.adj-row { display: flex; gap: 4px; margin-top: 6px; align-items: center; }
.adj-row .btn { flex: 1 1 0; min-width: 0; padding-left: 4px; padding-right: 4px; }
.adj-row select { flex: 1.4 1 0; min-width: 0; font-size: 12px; }

/* ---------------------------------------------------------------- Fotogrammetrie (web/photo.js) */
.photo-drop { border: 2px dashed var(--line-2); border-radius: 10px; padding: 22px 16px; text-align: center; cursor: pointer;
  background: var(--panel-2); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color .15s, background .15s; }
.photo-drop:hover, .photo-drop.over { border-color: var(--acc); background: var(--acc-soft); }
.photo-drop.disabled { opacity: .55; pointer-events: none; }
.photo-drop .ic-lg svg { width: 30px; height: 30px; color: var(--acc); }
.photo-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.photo-preset { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  cursor: pointer; background: var(--panel); }
.photo-preset:has(input:checked) { border-color: var(--acc); background: var(--acc-soft); }
.photo-preset input { margin-top: 3px; accent-color: var(--acc); }
.photo-3d { position: relative; width: 100%; height: min(62vh, 640px); min-height: 320px; border-radius: 8px; overflow: hidden;
  background: #e9ecef; border: 1px solid var(--line); }
.photo-3d:fullscreen { height: 100%; border-radius: 0; }
.photo-3d canvas { display: block; touch-action: none; }
.photo-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.photo-dls { display: flex; flex-direction: column; gap: 6px; }
.photo-dl { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); text-decoration: none; background: var(--panel); }
.photo-dl:hover { border-color: var(--acc); background: var(--acc-soft); }
table.kv { border-collapse: collapse; width: 100%; }
table.kv td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kv td:first-child { color: var(--muted); width: 48%; }
@media (max-width: 640px) { .photo-3d { height: 52vh; } }

.photo-3d-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.photo-3d-label { position: absolute; left: 0; top: 0; background: rgba(16, 20, 26, .86); color: #fff; font: 600 12px var(--ff);
  padding: 3px 7px; border-radius: 5px; white-space: nowrap; border: 1px solid var(--acc); }
.photo-3d canvas:focus { outline: none; }
.photo-measures { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.photo-measure { display: flex; gap: 10px; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; }

/* nova verze aplikace pri otevrene karte */
.newbuild { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 950; display: flex; gap: 12px;
  align-items: center; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: var(--r-s); background: var(--chrome-2);
  color: var(--chrome-text); border: 1px solid var(--acc); box-shadow: var(--sh-3); font-size: 13px; }

/* ---------------------------------------------------------------- lišta nástrojů dole ve scéně (web/toolbar.js) */
.v-tbar-wrap { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 8; display: flex; flex-direction: column;
  align-items: center; gap: 6px; max-width: calc(100% - 20px); width: max-content; pointer-events: none; }
.v-tbar-wrap > * { pointer-events: auto; }
.v-tbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 0; padding: 5px 6px; border-radius: 12px;
  background: rgba(18, 22, 28, .92); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); backdrop-filter: blur(8px); }
.tb-grp { display: inline-flex; align-items: center; gap: 2px; }
.tb-sep { width: 1px; height: 24px; background: var(--line-2); margin: 0 6px; flex: none; }
.tb-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0;
  border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; transition: background .12s, color .12s; }
.tb-btn .ic { width: 19px; height: 19px; }
.tb-btn:hover:not(:disabled) { background: var(--panel-3); color: var(--text); }
.tb-btn.on { background: var(--acc); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset; }
.tb-btn.on:hover { background: var(--acc-hover); color: #fff; }
.tb-btn:disabled { opacity: .35; cursor: not-allowed; }
.tb-btn:focus-visible { box-shadow: var(--focus); }
.tb-units { width: auto; min-width: 40px; padding: 0 9px; font: 700 12.5px var(--ff); letter-spacing: .02em; border: 1px solid var(--line-2); height: 32px; }
.tb-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; max-width: 170px; padding: 0 6px 0 9px; border: 1px solid var(--line-2);
  border-radius: 8px; background: var(--panel-2); color: var(--text); cursor: pointer; font: 600 12.5px var(--ff); margin-right: 2px; }
.tb-chip:hover { border-color: var(--muted); }
.tb-chip .sw, .tb-pop .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3); }
.tb-chip .sw.erase, .tb-pop .sw.erase { background: repeating-linear-gradient(45deg, #e5484d 0 2px, transparent 2px 5px) !important; box-shadow: inset 0 0 0 1px #e5484d; }
.tb-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tb-chip .ic { width: 13px; height: 13px; color: var(--muted); }
.tb-anchor, .u-anchor { position: relative; display: inline-flex; }
.tb-pop, .units-pop { position: absolute; bottom: calc(100% + 10px); z-index: 40; background: var(--panel); color: var(--text); border: 1px solid var(--line-2);
  border-radius: var(--r); box-shadow: var(--sh-3); }
.tb-pop { left: 0; width: 250px; max-height: min(360px, 60vh); display: flex; flex-direction: column; overflow: hidden; }
.tb-pop-head, .units-head { padding: 9px 12px; font-weight: 650; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.tb-pop-list { overflow: auto; padding: 4px; }
.tb-pop .cp-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; background: none; border-radius: 5px; cursor: pointer;
  font: inherit; font-size: 13px; text-align: left; color: inherit; }
.tb-pop .cp-item:hover, .tb-pop .cp-item.on { background: var(--acc-soft); }
.tb-pop .cp-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.units-pop { right: 0; width: 290px; padding-bottom: 10px; }
.units-pop.below { bottom: auto; top: calc(100% + 8px); }
.units-presets { display: flex; gap: 6px; padding: 10px 12px 4px; }
.units-presets .btn { flex: 1; min-width: 0; padding: 0 6px; font-size: 12px; }
.units-row { display: flex; align-items: center; gap: 8px; padding: 6px 12px 0; font-size: 12.5px; }
.units-row > span { width: 92px; flex: none; color: var(--muted); font-weight: 600; }
.units-row select { flex: 1; min-width: 0; min-height: 30px; }
.units-note { padding: 10px 12px 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.u-cur { pointer-events: none; }
/* volby aktivního nástroje nad lištou */
.v-tdeck { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; max-width: 100%; padding: 6px 12px; border-radius: 10px;
  background: rgba(18, 22, 28, .9); border: 1px solid var(--line-2); box-shadow: var(--sh); backdrop-filter: blur(8px); font-size: 12.5px; color: var(--text-2); }
.td-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.td-item input[type=checkbox] { margin: 0; }
.td-item input[type=number] { min-height: 28px; padding: 3px 6px; }
.td-item b { min-width: 42px; font-variant-numeric: tabular-nums; }
.td-hint { color: var(--muted); max-width: 520px; }
.td-count { font-weight: 650; color: var(--text); }
.v-tdeck .btn.sm { height: 28px; }
/* měření v panelu */
.meas-detail:not(:empty) { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.meas-detail .fst-row .fst-l { min-width: 150px; }
@media (max-width: 900px) {
  .v-tbar-wrap { bottom: 10px; }
  .tb-btn { width: 34px; height: 34px; }
  .tb-sep { margin: 0 3px; }
  .tb-chip { max-width: 120px; }
  .td-hint { max-width: 100%; }
}
.v-tbar.wrapped { row-gap: 4px; column-gap: 8px; }
.v-tbar.wrapped .tb-sep { display: none; }

/* hlášení chyb a nápadů (web/feedback.js) */
.fb-btn .lbl { margin-left: 2px; }
dialog.dlg-fb { width: 660px; }
.dlg-fb .dlg-head { display: flex; flex-direction: column; gap: 10px; }
.fb-tabs { align-self: flex-start; }
.fb-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.fb-tabs .ic svg { width: 15px; height: 15px; }
.dlg-fb textarea { width: 100%; resize: vertical; min-height: 112px; font: inherit; }
.fb-imgbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.fb-thumb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
.fb-thumb img { width: 136px; height: 86px; object-fit: cover; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); }
.fb-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .62);
        color: #fff; cursor: pointer; font-size: 12px; line-height: 22px; padding: 0; }
.dlg-fb .dlg-foot { align-items: center; }
.fb-note { margin: 0; max-width: 300px; line-height: 1.35; }
.fb-mine { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow: auto; }
.fb-item { border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; background: var(--panel-2); }
.fb-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.fb-text { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.fb-reply { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--acc); background: var(--acc-soft); border-radius: 0 6px 6px 0; font-size: 12.5px; }
.fb-ok { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.fb-ok > .ic { width: 30px; height: 30px; flex: none; color: var(--ok); }
.fb-ok > .ic svg { width: 30px; height: 30px; }
.fb-ok p { margin: 6px 0 0; }
.fb-admin-item .fb-thumb img { width: 168px; height: 104px; }
.fb-ctx summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 6px; }
.fb-ctx pre { max-height: 240px; overflow: auto; font-size: 11px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px;
              padding: 8px; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 720px) {
  .fb-btn .lbl { display: none; }
  .fb-note { max-width: none; }
  .dlg-fb .dlg-foot { flex-wrap: wrap; }
}

/* konec tarifu: pruh dole (web/app.js renderAccountBanner) */
.acct-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; gap: 10px; align-items: center; justify-content: center;
               padding: 9px 16px; font-size: 13px; background: var(--acc-soft); color: var(--text); border-top: 1px solid var(--acc-line); }
.acct-banner.err { background: var(--err-soft); border-top-color: var(--err-line); }
.acct-banner .ic svg { width: 16px; height: 16px; }
body.has-acct-banner .scroll { padding-bottom: 48px; }

/* bezplatny zkusebni provoz (app/plans.py FREE_UNTIL) - prihlaseni a uvod */
.free-note { display: inline-block; margin: 10px 0 2px; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
             background: var(--acc-soft); border: 1px solid var(--acc-line); color: var(--acc-dark); }
.auth-box .free-note { display: block; margin: 0 0 12px; text-align: center; }

/* fotogrammetrie: volba rozmazani obliceju a SPZ (web/photo.js krok 2) */
.photo-anon { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line);
              border-radius: 8px; cursor: pointer; max-width: 860px; }
.photo-anon:has(input:checked) { border-color: var(--acc); background: var(--acc-soft); }
.photo-anon input { margin-top: 3px; }

/* jazyk rozhrani (web/i18n.js renderSwitch; app.js langControl) */
.lang-sw { display: flex; gap: 4px; align-items: center; }
.lang-sw a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px; border-radius: 6px; color: inherit; text-decoration: none; opacity: .75; font-size: 12.5px; }
.lang-sw a:hover { background: var(--hover, rgba(127,127,127,.15)); opacity: 1; }
.lang-sw a.on { font-weight: 700; opacity: 1; }
.lang-sw .lflag { display: inline-block; width: 18px; height: 12px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.18); flex: none; }
.lang-sw .lflag svg { display: block; width: 100%; height: 100%; }
.auth-lang { justify-content: center; margin-top: 10px; }
.tb-lang { position: relative; }
.tb-lang-btn { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent;
               background: transparent; color: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.tb-lang-btn:hover { background: rgba(255,255,255,.08); }
.tb-lang-btn .ic svg { width: 15px; height: 15px; }
.tb-lang-pop { position: absolute; right: 0; top: 36px; z-index: 60; flex-direction: column; align-items: stretch; min-width: 150px; padding: 6px;
               background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh-3); }
.tb-lang-pop.lang-sw { display: flex; }
.tb-lang-pop.hidden { display: none !important; }
.tb-lang-pop a { padding: 7px 9px; }

/* registrace (app.js renderRegister): pole po dvou vedle sebe - kratsi formular */
.auth-box.wide { max-width: 560px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-row .field { min-width: 0; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.reg-chk { align-items: flex-start; line-height: 1.4; margin: 2px 0 6px; }
.reg-chk input { margin-top: 3px; }
.auth-switch { margin: 12px 0 0; text-align: center; color: var(--text-2); }

/* Sdílený projekt (pozvaný z e-mailu): jen režim barev a legenda tříd */
.viewer.guest .v-body { grid-template-columns: 284px 1fr; }
.viewer.guest .panel.right, .viewer.guest .v-split, .viewer.guest .v-tbar-wrap, .viewer.guest .g-hide { display: none !important; }
.v-guest { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.v-guest b { color: var(--text); font-weight: 600; }
@media (max-width: 900px) { .viewer.guest .v-body { grid-template-columns: 1fr; } .v-guest .lbl { display: none; } }
.share-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 260px; overflow: auto; }
.share-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.share-row .grow { flex: 1; min-width: 0; }
.share-row .em { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-link { display: flex; gap: 6px; margin-top: 10px; }
.share-link input { flex: 1; min-width: 0; font-size: 12px; }
