/* Notizen N1: dugme i alatke u traci pregleda, sloj beleski na strani, popover, tab Notizen (app/ui/assets/notes-v1.js).
   Samo tokeni (v5 uz data-ui="v5", inace postojeci); boje beleski = semanticki tokeni kroz color-mix (bez sirovih boja). */
.nt-c-yellow { --nt-c: var(--v5-warn, var(--amber)); }
.nt-c-green { --nt-c: var(--v5-good, var(--green)); }
.nt-c-blue { --nt-c: var(--v5-info, var(--blue)); }
.nt-c-red { --nt-c: var(--v5-bad, var(--red)); }

/* traka pregleda: dugme Notizen + alatke (rezim u mestu, ista tamna traka) */
.vbar .nt-btn { display: inline-flex; align-items: center; gap: 5px; }
.vbar .nt-btn svg, .nt-tools svg { flex: none; }
.vbar .nt-btn.nt-na { opacity: .6; cursor: default; }   /* tabele beleski jos nisu primenjene (503): dugme pokazuje stanje, alatki nema */
.nt-bn { min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--v5-r-pill, var(--r-lg)); background: color-mix(in srgb, currentColor 22%, transparent); font-size: var(--fs-xs); line-height: 16px; text-align: center; }
.nt-tools { display: flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--viewer-chrome); color: var(--paper); border-top: 1px solid color-mix(in srgb, var(--paper) 12%, transparent); flex: none; overflow-x: auto; white-space: nowrap; }
.nt-tools[hidden] { display: none; }
.nt-tools .zb { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: inherit; opacity: .82; cursor: pointer; font-size: var(--fs-xs); padding: 4px 8px; border-radius: var(--r-sm); }
.nt-tools .zb:hover, .nt-tools .zb.on { opacity: 1; background: color-mix(in srgb, var(--paper) 16%, transparent); }
.nt-tools .zb:focus-visible, .vbar .nt-btn:focus-visible { outline: 2px solid var(--v5-focus, var(--blue)); outline-offset: 1px; }
.nt-sep { width: 1px; align-self: stretch; margin: 2px 4px; background: color-mix(in srgb, var(--paper) 22%, transparent); }
.nt-hint { margin-left: 8px; opacity: .7; font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; }

/* sloj na strani: koordinate 0..1 u procentima (element.style), skalira se sa zumom */
.nt-ov { position: absolute; inset: 0; pointer-events: none; z-index: 2; container-type: inline-size; }
.nt-ov.nt-off > * { display: none; }
.nt-ov.nt-draw { pointer-events: auto; cursor: crosshair; touch-action: none; }
.nt-ov > [data-nid] { position: absolute; pointer-events: none; }
.nt-ov.nt-mode > [data-nid] { pointer-events: auto; cursor: pointer; }   /* klik na belesku samo u rezimu; van rezima klik ide okviru dokaza ispod */
.nt-hl { background: color-mix(in srgb, var(--nt-c) 34%, transparent); mix-blend-mode: multiply; border-radius: var(--v5-r-xs, var(--r-sm)); }
.nt-rect { border: 2px solid var(--nt-c); border-radius: var(--v5-r-xs, var(--r-sm)); }
.nt-text { padding: 2px 5px; color: var(--nt-c); font-family: var(--v5-font, inherit); font-size: 2.1cqw; font-weight: 600; line-height: 1.2; white-space: pre-wrap; overflow: hidden; background: color-mix(in srgb, var(--paper) 70%, transparent); border: 1px dashed color-mix(in srgb, var(--nt-c) 60%, transparent); }
.nt-pin { width: 24px; height: 24px; transform: translate(-50%, -100%); border-radius: 50% 50% 50% 14%; background: var(--nt-c); color: var(--paper); display: grid; place-items: center; font-size: var(--fs-xs); box-shadow: var(--shadow); }
.nt-ov > .nt-sel { outline: 2px solid var(--v5-focus, var(--blue)); outline-offset: 2px; }
.nt-ov > [data-nid]:focus-visible { outline: 2px solid var(--v5-focus, var(--blue)); outline-offset: 2px; }
.nt-ghost { position: absolute; border: 1.5px dashed var(--v5-focus, var(--blue)); background: color-mix(in srgb, var(--v5-focus, var(--blue)) 10%, transparent); pointer-events: none; }
.nt-pin, .nt-ov > [data-nid]:hover { filter: saturate(1.15); }
/* pomeranje / velicina (alatka Izaberi): pomerive beleske, rucke u uglovima (okvir, tekst), beleska verzije zakljucana */
.nt-ov.nt-mode > .nt-mv { cursor: move; touch-action: none; }
.nt-ov.nt-mode > .nt-lock { cursor: not-allowed; }
.nt-ov > .nt-drag { opacity: .85; box-shadow: var(--v5-sh-pop, var(--shadow)); }
.nt-hd { position: absolute; width: 12px; height: 12px; transform: translate(-50%, -50%); border-radius: var(--v5-r-xs, var(--r-sm)); background: var(--paper); border: 2px solid var(--v5-focus, var(--blue)); pointer-events: none; touch-action: none; z-index: 1; }
.nt-ov.nt-mode > .nt-hd { pointer-events: auto; }
.nt-hd-nw, .nt-hd-se { cursor: nwse-resize; }
.nt-hd-ne, .nt-hd-sw { cursor: nesw-resize; }
.nt-tlk { font-size: var(--fs-xs); color: var(--v5-muted, var(--muted)); }
@media (pointer: coarse) { .nt-hd { width: 22px; height: 22px; } }

/* popover beleske */
.nt-pop { position: absolute; z-index: 5; width: 300px; max-width: calc(100% - 8px); margin-top: 6px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--v5-card, var(--card)); color: var(--v5-ink, var(--ink)); border-radius: var(--v5-r, var(--r)); box-shadow: var(--v5-sh-pop, var(--shadow)); border: 1px solid var(--v5-line, var(--line)); font-size: var(--fs-sm); }
.nt-pop.nt-sheet { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; margin: 0; border-radius: var(--v5-r-lg, var(--r-lg)) var(--v5-r-lg, var(--r-lg)) 0 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
.nt-ph { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nt-pm { color: var(--v5-faint, var(--faint)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.nt-x { border: 0; background: none; color: var(--v5-muted, var(--muted)); cursor: pointer; font-size: var(--fs-md); padding: 0 4px; }
.nt-pop textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px; padding: 8px; border: 0; border-radius: var(--v5-r-sm, var(--r-sm)); box-shadow: var(--v5-ring, var(--ring)); background: var(--v5-bg, var(--bg)); color: inherit; font: inherit; }
.nt-pop.nt-sheet textarea { font-size: var(--fs-md); }
.nt-ptx { white-space: pre-wrap; word-break: break-word; }
.nt-cols { display: flex; gap: 8px; }
.nt-sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; background: var(--nt-c); cursor: pointer; padding: 0; }
.nt-sw.on { border-color: var(--v5-ink, var(--ink)); }
.nt-pop.nt-sheet .nt-sw { width: 30px; height: 30px; }
.nt-pa { display: flex; align-items: center; gap: 6px; }
.nt-del { color: var(--v5-bad, var(--red)); }
.nt-ic { flex: none; width: 20px; height: 20px; border-radius: var(--v5-r-xs, var(--r-sm)); display: inline-grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; color: var(--paper); background: var(--nt-c, var(--v5-muted, var(--muted))); }
.nt-ph .nt-ic { background: var(--v5-muted, var(--muted)); }

/* oblacic na hover / fokus (#ntTip, jedan, position: fixed u body; z-index iznad Vollbild-a 65, ispod pomoci 75) */
.nt-tip { position: fixed; z-index: 70; left: 0; top: 0; max-width: min(320px, calc(100vw - 16px)); padding: 7px 10px; display: flex; flex-direction: column; gap: 3px; background: var(--v5-card, var(--card)); color: var(--v5-ink, var(--ink)); border: 1px solid var(--v5-line, var(--line)); border-left: 3px solid var(--nt-c, var(--v5-line, var(--line))); border-radius: var(--v5-r-sm, var(--r-sm)); box-shadow: var(--v5-sh-pop, var(--shadow)); font-size: var(--fs-sm); line-height: 1.35; pointer-events: none; opacity: 0; transition: opacity .12s; }
.nt-tip[hidden] { display: none; }
.nt-tip.on { opacity: 1; }
.nt-tk { font-size: var(--fs-xs); color: var(--v5-muted, var(--muted)); font-weight: 600; }
.nt-tt { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.nt-tm { font-size: var(--fs-xs); color: var(--v5-faint, var(--faint)); }
@media (prefers-reduced-motion: reduce) { .nt-tip { transition: none; } }

/* tab Notizen u desnom panelu */
.nt-panel { display: flex; flex-direction: column; }
.nt-pg { border-bottom: 1px solid var(--v5-line, var(--line)); }
.nt-pg.cur .nt-pgh { color: var(--v5-ink, var(--ink)); box-shadow: inset 3px 0 0 var(--v5-acc, var(--blue)); }
.nt-pgh { display: flex; gap: 6px; align-items: center; padding: 8px 12px 4px; color: var(--v5-muted, var(--muted)); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.nt-pgh .ct { margin-left: auto; font-weight: 500; text-transform: none; }
.nt-it { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; color: inherit; padding: 8px 12px; cursor: pointer; font: inherit; }
.nt-it:hover { background: var(--v5-card2, var(--bg)); }
.nt-it.on { background: var(--v5-acc-soft, var(--blue-soft)); }
.nt-it:focus-visible { outline: 2px solid var(--v5-focus, var(--blue)); outline-offset: -2px; }
.nt-ib { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt-ik { font-size: var(--fs-xs); color: var(--v5-muted, var(--muted)); }
.nt-itx { color: var(--v5-ink, var(--ink)); white-space: pre-wrap; word-break: break-word; }
.nt-im { font-size: var(--fs-xs); color: var(--v5-faint, var(--faint)); }
.nt-empty { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 16px 12px; }
.nt-foot { padding: 10px 12px; }
.nt-shared { display: flex; gap: 6px; align-items: center; padding-top: 0; }

/* N3b: "Als Version speichern" + "Version wird erstellt…" u traci beleski (notes-versions-v1.js nvSaveBtn) */
.nt-tools .nt-vsave, .nt-vbusy { position: sticky; right: 0; z-index: 1; box-shadow: -10px 0 8px -4px var(--viewer-chrome); }   /* uvek vidljivo i kad alatke ne staju */
.nt-tools .nt-vsave { margin-left: auto; flex: none; opacity: 1; font-weight: 600; background: var(--v5-acc, var(--blue)); color: var(--v5-acc-on, var(--paper)); }
.nt-tools .nt-vsave:hover { background: var(--v5-acc, var(--blue)); filter: brightness(1.08); }
.nt-tools .nt-vsave:disabled { opacity: .55; cursor: default; }
.nt-vbusy { margin-left: auto; flex: none; background: var(--viewer-chrome); display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); opacity: .9; padding: 4px 8px; }
.nt-vbusy .spin, .nvchip .spin, .nvdl .spin { width: 10px; height: 10px; }

@media (max-width: 600px) {
  .nt-tools { padding: 6px 8px; gap: 2px; }
  .nt-tools .zb { padding: 8px 9px; }
  .nt-tools .nt-tl { display: none; }
  .nt-pin { width: 30px; height: 30px; }
  .nt-it { padding: 12px; }
}
