/* NIQUA PDF – Oberfläche
   Gleiche Designsprache wie die NIQUA Zeiterfassung: dunkle Navigationsleiste + helle Arbeitsfläche mit Karten.
   Schriften: Systemschriften (keine externen Server, DSGVO-freundlich). */
:root{
  /* NIQUA Design Codes 2024: Blau #263F8C, Dunkelblau #223059, Hellblau #5CD7F2, Türkis #0099A8, Sand #D9A86C */
  --bg:#F3F5FA; --surface:#FFFFFF; --surface-2:#ECEFF6; --surface-3:#DFE4EF; --line:#DFE4EE; --ink:#0F1A33; --muted:#56607A; --faint:#8A93AA;
  --accent:#263F8C; --accent-2:#223059; --accent-ink:#FFFFFF; --accent-soft:#E2E8F6;
  --side:#223059; --side-2:#2C3C6E; --side-ink:#DCE3F2; --side-muted:#93A0C2; --side-accent:#5CD7F2;
  --ok:#14915A; --ok-soft:#DCF5E7; --warn:#B07A2E; --warn-soft:#F8EBD8; --bad:#D23A2A; --bad-soft:#FDE3DF; --info:#0099A8; --info-soft:#DDF3F5;
  --av1:#263F8C; --av2:#0099A8; --av3:#8B5CD6; --av4:#C88A45; --av5:#C2366B; --av6:#4F8A1E;
  --viewer:#D5DBE8;
  --shadow-sm:0 1px 2px rgba(15,26,51,.05); --shadow:0 1px 2px rgba(15,26,51,.04),0 8px 24px -6px rgba(15,26,51,.09); --shadow-lg:0 24px 60px -12px rgba(15,26,51,.3);
  --font:"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"SF Pro Text",Roboto,"Helvetica Neue",Arial,sans-serif;
  --font-display:"Segoe UI Variable Display","Segoe UI",system-ui,-apple-system,"SF Pro Display",Roboto,"Helvetica Neue",Arial,sans-serif;
  --r:18px; --r-sm:12px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#0C1222; --surface:#131B30; --surface-2:#1A2440; --surface-3:#22305A; --line:#24314F; --ink:#E8EDF7; --muted:#9AA6C2; --faint:#6E7A98;
  --accent:#5CD7F2; --accent-2:#8BE4F7; --accent-ink:#0B1A33; --accent-soft:#16304A;
  --side:#0A1020; --side-2:#16213D;
  --ok:#43CF8A; --ok-soft:#123323; --warn:#E6BC85; --warn-soft:#3A2D18; --bad:#FF7A68; --bad-soft:#3F1C17; --info:#4FC8D6; --info-soft:#12343C;
  --av1:#5C7BD6; --av2:#2BB8C6; --av3:#9F78E6; --av4:#D9A86C; --av5:#E0608F; --av6:#79B142;
  --viewer:#080D19;
  --shadow-sm:0 1px 2px rgba(0,0,0,.3); --shadow:0 1px 2px rgba(0,0,0,.3),0 10px 30px -8px rgba(0,0,0,.45); --shadow-lg:0 24px 60px -12px rgba(0,0,0,.6);
  color-scheme:dark;
}}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--font);font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
button,input,select,textarea{font:inherit;color:inherit}
h1,h2,h3{font-family:var(--font-display);margin:0;text-wrap:balance;letter-spacing:-.015em}
h1{font-size:1.85rem;font-weight:700;line-height:1.15}
h2{font-size:1.1rem;font-weight:650}
h3{font-size:.98rem;font-weight:650}
p{margin:0}
.muted{color:var(--muted)} .small{font-size:.85rem} .hint{font-size:.82rem;color:var(--muted);font-weight:400}
.tnum{font-variant-numeric:tabular-nums}
.ic{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:8px}
::selection{background:var(--accent-soft)}
.loading{min-height:100dvh;display:flex;flex-direction:column;gap:12px;align-items:center;justify-content:center;color:var(--muted)}
.spin{width:16px;height:16px;border-radius:50%;border:2px solid var(--accent-soft);border-top-color:var(--accent);animation:sp 1s linear infinite;display:inline-block;vertical-align:-3px;flex:none}
@keyframes sp{to{transform:rotate(360deg)}}

/* ---------- Anmeldung ---------- */
.auth{min-height:100dvh;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.auth-brand{background:var(--side);color:var(--side-ink);display:flex;flex-direction:column;justify-content:space-between;padding:48px}
.auth-brand p{color:var(--side-muted);max-width:44ch;margin-top:16px}
.auth-main{display:grid;place-items:center;padding:32px max(16px,env(safe-area-inset-right,0px)) 32px max(16px,env(safe-area-inset-left,0px))}
.auth-card{width:min(400px,100%);display:flex;flex-direction:column;gap:14px}
.auth-card form{display:flex;flex-direction:column;gap:12px}
.err{color:var(--bad);font-size:.88rem;min-height:1.2em}
@media (max-width:820px){.auth{grid-template-columns:minmax(0,1fr)}.auth-brand{padding:28px 20px}}

/* ---------- Grundgerüst ---------- */
.app{display:grid;grid-template-columns:240px minmax(0,1fr);height:100dvh}
.side{display:flex;flex-direction:column;gap:18px;padding:20px 12px 14px;background:var(--side);color:var(--side-ink);overflow-y:auto;min-height:0}
.brand{display:flex;flex-direction:column;gap:8px;padding:2px 10px 4px}
.wordmark{font-family:var(--font-display);font-weight:800;font-size:1.45rem;letter-spacing:.06em;color:#fff}
.brand small{color:var(--side-accent);font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.18em}
.brand small::before{content:"";display:inline-block;width:18px;height:2px;background:var(--side-accent);vertical-align:middle;margin:-2px 8px 0 0}
.nav{display:flex;flex-direction:column;gap:2px}
.nav-label{font-size:.66rem;text-transform:uppercase;letter-spacing:.12em;color:var(--side-muted);padding:12px 10px 5px}
.nav button{position:relative;display:flex;align-items:center;gap:11px;width:100%;padding:9px 10px;border:0;background:none;border-radius:11px;cursor:pointer;color:var(--side-ink);opacity:.82;font-weight:550;font-size:.9rem;text-align:left}
.nav button:hover{background:var(--side-2);opacity:1}
.nav button[aria-current="page"]{background:rgba(92,215,242,.14);opacity:1;color:#fff}
.nav button[aria-current="page"] .ic{color:var(--side-accent)}
.nav button[aria-current="page"]::before{content:"";position:absolute;left:-12px;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--side-accent)}
.nav .ic{width:18px;height:18px}
.nav .badge{margin-left:auto;min-width:19px;height:19px;padding:0 6px;border-radius:10px;background:var(--bad);color:#fff;font-size:.7rem;font-weight:700;display:grid;place-items:center}
.nav .recent{font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.side-card{margin-top:auto;background:var(--side-2);border-radius:14px;padding:10px;display:flex;flex-direction:column;gap:8px}
.who{display:flex;align-items:center;gap:10px;min-width:0}
.who>div{min-width:0}
.who b{display:block;color:#fff;font-size:.88rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.who span:not(.av){display:block;color:var(--side-muted);font-size:.74rem}
.btn-side{display:flex;align-items:center;gap:8px;border:0;background:none;color:var(--side-muted);padding:5px 4px;cursor:pointer;font-size:.82rem;border-radius:8px}
.btn-side:hover{color:#fff}
.btn-side .ic{width:16px;height:16px}
.content{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:auto}
.page{padding-block:24px 64px;padding-left:max(28px,env(safe-area-inset-left,0px));padding-right:max(28px,env(safe-area-inset-right,0px))}
.wrap{max-width:1180px;margin:0 auto;display:flex;flex-direction:column;gap:18px}
.head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap}
.head p{margin-top:4px}
.eyebrow{font-size:.75rem;text-transform:uppercase;letter-spacing:.1em;color:var(--accent);font-weight:700}
.mtop{display:none}
@media (max-width:900px){
  .app{grid-template-columns:minmax(0,1fr)}
  .side{position:fixed;inset:0 auto 0 0;width:260px;z-index:30;transform:translateX(-100%);transition:transform .2s;padding-top:calc(20px + env(safe-area-inset-top,0px))}
  .app.menu .side{transform:none;box-shadow:var(--shadow-lg)}
  .mtop{display:flex;align-items:center;gap:10px;padding:10px max(16px,env(safe-area-inset-right,0px)) 10px max(16px,env(safe-area-inset-left,0px));background:var(--side);color:#fff;flex:none}
  .mtop .wordmark{font-size:1.1rem}
  .page{padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
  h1{font-size:1.5rem}
}

/* ---------- Bausteine ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:20px;box-shadow:var(--shadow-sm);min-width:0}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:8px 16px;border-radius:12px;border:1px solid var(--line);background:var(--surface);cursor:pointer;font-weight:600;font-size:.9rem;white-space:nowrap;transition:background .15s,transform .1s,filter .15s}
.btn:hover{background:var(--surface-2)} .btn:active{transform:scale(.98)}
.btn-primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);box-shadow:0 6px 16px -8px var(--accent)} .btn-primary:hover{background:var(--accent-2)}
.btn-bad{background:var(--bad);border-color:var(--bad);color:#fff} .btn-bad:hover{background:var(--bad);filter:brightness(1.08)}
.btn-soft{background:var(--surface-2);border-color:transparent} .btn-soft:hover{background:var(--surface-3)}
.btn-ghost{border-color:transparent;background:transparent}
.btn-sm{min-height:32px;padding:4px 10px;font-size:.82rem;border-radius:10px}
.btn-icon{width:36px;min-height:36px;padding:0}
.btn-sm.btn-icon{width:32px;min-height:32px}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.btn-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.chip{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;font-size:.76rem;font-weight:650;background:var(--surface-2);color:var(--ink);white-space:nowrap}
.chip .ic{width:13px;height:13px}
.chip.ok,.st-freigegeben{background:var(--ok-soft);color:var(--ok)} .chip.warn,.st-pruefung{background:var(--warn-soft);color:var(--warn)} .chip.info{background:var(--info-soft);color:var(--info)} .chip.acc,.st-entwurf{background:var(--accent-soft);color:var(--accent)} .chip.bad{background:var(--bad-soft);color:var(--bad)}
.av{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:700;font-size:.7rem;flex:none;letter-spacing:.02em}
.avs{display:flex}.avs .av{border:2px solid var(--surface);margin-left:-8px}.avs .av:first-child{margin-left:0}
.avs.sm .av{width:24px;height:24px;font-size:.58rem}
select,input[type=text],input[type=password],input[type=email],input[type=search],input[type=number],textarea{width:100%;min-height:40px;padding:8px 12px;border-radius:11px;border:1px solid var(--line);background:var(--surface);color:var(--ink)}
select:focus,input:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
textarea{min-height:70px;resize:vertical}
label.f{display:flex;flex-direction:column;gap:5px;font-size:.84rem;font-weight:600;min-width:0}
label.f>span{color:var(--muted)}
.check{display:flex;align-items:center;gap:9px;font-size:.88rem;cursor:pointer;font-weight:500}
.check input{width:17px;height:17px;accent-color:var(--accent);margin:0;flex:none}
.seg{display:inline-flex;background:var(--surface-2);border-radius:11px;padding:3px;gap:2px;flex-wrap:wrap}
.seg button{border:0;background:none;padding:6px 11px;border-radius:8px;cursor:pointer;font-weight:600;font-size:.8rem;color:var(--muted)}
.seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:var(--shadow-sm)}
.note{padding:10px 12px;border-radius:12px;font-size:.86rem;background:var(--surface-2)}
.note.warn{background:var(--warn-soft)} .note.bad{background:var(--bad-soft)} .note.ok{background:var(--ok-soft)} .note.info{background:var(--info-soft)}
.fr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
@media (max-width:560px){.fr{grid-template-columns:minmax(0,1fr)}}
.empty{padding:40px 18px;text-align:center;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:8px}
.empty h3{color:var(--ink)}
.empty .ic{width:36px;height:36px;color:var(--faint)}
.tbl-wrap{overflow-x:auto;margin:0 -20px;padding:0 20px}
table{border-collapse:collapse;width:100%;font-size:.9rem}
th{font-size:.72rem;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);font-weight:650;text-align:left;padding:9px 12px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:middle}
tbody tr:hover td{background:var(--surface-2)}
tr:last-child td{border-bottom:0}
td.r,th.r{text-align:right}

/* ---------- Dokumentliste ---------- */
.dropzone{border:2px dashed var(--line);border-radius:var(--r);padding:22px;display:flex;align-items:center;gap:16px;flex-wrap:wrap;background:var(--surface);transition:border-color .15s,background .15s}
.dropzone.on{border-color:var(--accent);background:var(--accent-soft)}
.dropzone .ic{width:32px;height:32px;color:var(--accent)}
.dropzone div{flex:1;min-width:200px}
.uploads{display:flex;flex-direction:column;gap:6px}
.upl{display:grid;grid-template-columns:minmax(0,1fr) 140px;gap:12px;align-items:center;font-size:.86rem}
.upl .bar{height:6px;border-radius:4px;background:var(--surface-2);overflow:hidden}.upl .bar i{display:block;height:100%;background:var(--accent);transition:width .2s}
.doclist{display:flex;flex-direction:column}
.drow{display:grid;grid-template-columns:44px minmax(0,1fr) auto auto;gap:14px;align-items:center;padding:12px 10px;border-top:1px solid var(--line);cursor:pointer;border-radius:0}
.drow:first-child{border-top:0}
.drow:hover{background:var(--surface-2);border-radius:12px}
.dicon{width:44px;height:52px;border-radius:8px;background:var(--bad-soft);color:var(--bad);display:grid;place-items:center;font-size:.66rem;font-weight:800;letter-spacing:.04em}
.dmain{min-width:0;display:flex;flex-direction:column;gap:4px}
.dmain b{font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dmeta{font-size:.8rem;color:var(--muted);display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.dacts{display:flex;gap:4px}
@media (max-width:640px){.drow{grid-template-columns:40px minmax(0,1fr) auto}.drow .dpeople{display:none}.dicon{width:40px;height:46px}}

/* ---------- Editor ---------- */
.editor{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--surface)}
.docbar{display:flex;align-items:center;gap:12px;padding:10px 16px;border-bottom:1px solid var(--line);flex-wrap:wrap;flex:none}
.docbar .dt{min-width:0;flex:1 1 240px;display:flex;align-items:center;gap:10px}
.docbar .dt b{font-family:var(--font-display);font-size:1.05rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.docbar .dt .ic{color:var(--bad)}
.toolbar{display:flex;align-items:center;gap:6px;padding:8px 12px;border-bottom:1px solid var(--line);overflow-x:auto;flex:none;background:var(--surface)}
.tgroup{display:flex;gap:2px;padding:3px;background:var(--surface-2);border-radius:12px;flex:none}
.tbtn{display:inline-flex;align-items:center;gap:7px;border:0;background:none;padding:6px 10px;border-radius:9px;cursor:pointer;font-weight:600;font-size:.8rem;color:var(--muted);white-space:nowrap}
.tbtn:hover{color:var(--ink);background:var(--surface-3)}
.tbtn[aria-pressed="true"]{background:var(--surface);color:var(--accent);box-shadow:var(--shadow-sm)}
.tbtn .ic{width:17px;height:17px}
.tsep{width:1px;height:26px;background:var(--line);flex:none;margin:0 4px}
.zoomval{min-width:60px;font-variant-numeric:tabular-nums}
.searchbox{display:flex;align-items:center;gap:4px;flex:none}
.searchbox input{width:180px;min-height:32px;font-size:.82rem;padding:4px 10px}
.searchbox .cnt{font-size:.74rem;color:var(--muted);min-width:48px;font-variant-numeric:tabular-nums}
.fmt{display:flex;align-items:center;gap:8px;padding:6px 12px;border-bottom:1px solid var(--line);background:var(--surface);flex-wrap:wrap;min-height:46px;flex:none}
.fmt .fl{font-size:.74rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--accent)}
.fmt select,.fmt input{min-height:30px;padding:3px 8px;font-size:.82rem;border-radius:8px;width:auto}
.fbtn{width:30px;height:30px;border-radius:8px;border:1px solid var(--line);background:var(--surface);cursor:pointer;font-weight:700}
.fbtn[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.sw{width:22px;height:22px;border-radius:50%;border:2px solid var(--surface);box-shadow:0 0 0 1px var(--line);cursor:pointer;padding:0}
.sw[aria-pressed="true"]{box-shadow:0 0 0 2px var(--accent)}
.fmt .fhint{margin-left:auto;font-size:.8rem;color:var(--muted)}
.fgrp{display:flex;align-items:center;gap:6px}
.work{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 320px}
.viewer{position:relative;overflow:auto;background:var(--viewer);min-width:0;min-height:0}
.pages{display:flex;flex-direction:column;align-items:center;gap:20px;padding:24px;min-width:max-content}
.pg{position:relative;background:#fff;box-shadow:0 2px 10px rgba(10,20,40,.18);flex:none}
.pg-in{position:absolute;left:0;top:0;transform-origin:0 0}
.pg-in canvas{position:absolute;left:0;top:0;width:100%;height:100%}
.pg-no{position:absolute;right:-2px;bottom:-20px;font-size:.72rem;color:var(--muted);font-variant-numeric:tabular-nums}
.layer{position:absolute;inset:0}
.viewer[data-tool="draw"] .layer,.viewer[data-tool="highlight"] .layer,.viewer[data-tool="redact"] .layer{cursor:crosshair;touch-action:none}
.viewer[data-tool="text"] .layer{cursor:text}
.viewer[data-tool="note"] .layer,.viewer[data-tool="stamp"] .layer,.viewer[data-tool="sign"] .layer{cursor:copy}
.drop{position:absolute;inset:10px;border:2px dashed var(--accent);border-radius:16px;background:color-mix(in srgb,var(--accent) 10%,transparent);display:grid;place-items:center;font-weight:700;color:var(--accent);pointer-events:none;z-index:5}
.busy{position:absolute;inset:0;display:grid;place-items:center;background:color-mix(in srgb,var(--viewer) 70%,transparent);z-index:6;font-weight:600;color:var(--ink)}
.busy>div{display:flex;gap:10px;align-items:center;padding:12px 18px;border-radius:12px;background:var(--surface);box-shadow:var(--shadow)}
.an{position:absolute}
.an.sel{outline:1.5px dashed #263F8C;outline-offset:2px}
.an.locked{outline:1.5px solid #E0742F;outline-offset:2px}
.an.locked::after{content:attr(data-lock);position:absolute;left:-2px;top:-20px;font:600 10px/1 var(--font);color:#fff;background:#E0742F;padding:3px 6px;border-radius:5px;white-space:nowrap}
.an-hl{background:rgba(255,214,0,.45);mix-blend-mode:multiply}
.an-rd{background:repeating-linear-gradient(135deg,rgba(210,58,42,.18) 0 4px,rgba(210,58,42,.05) 4px 8px);border:1.5px solid #D23A2A}
.an-wo{position:absolute;background:#fff}
.an-txt{white-space:pre;line-height:1.15;min-width:6px}
.an-txt .t{outline:none;display:inline-block;min-width:4px}
.an-txt .t[contenteditable="true"]{outline:1.5px solid #263F8C;outline-offset:2px;background:rgba(226,232,246,.6);cursor:text}
.an-ed{background:#fff}
.an-ed.tr{box-shadow:inset 0 -1px 0 rgba(0,153,168,.55)}
.an-note{width:22px;height:22px;border-radius:6px 6px 6px 2px;background:#FFD54A;color:#5A4300;display:grid;place-items:center;box-shadow:0 1px 3px rgba(0,0,0,.25);cursor:pointer}
.an-note .ic{width:14px;height:14px}
.an-stamp{border:2.5px solid;border-radius:6px;padding:3px 10px;font-weight:800;letter-spacing:.06em;font-family:Helvetica,Arial,sans-serif;line-height:1.2;white-space:nowrap;background:rgba(255,255,255,.4)}
.an-sign-img{user-select:none;-webkit-user-drag:none;cursor:default}
.sigpad{width:100%;height:210px;border:1px solid var(--line);border-radius:12px;background:#fff;touch-action:none;cursor:crosshair;display:block}
.sigprev{min-height:120px;border:1px solid var(--line);border-radius:12px;background:#fff;display:grid;place-items:center;padding:12px}
.sigprev img{max-width:100%;max-height:180px}
.sigcur{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:12px;background:var(--surface-2)}
.sigcur img{max-height:56px;max-width:240px;background:#fff;border-radius:8px;padding:4px}
.an-sign{font-family:"Segoe Script","Brush Script MT","Lucida Handwriting",cursive;white-space:nowrap;line-height:1.1}
.drawsvg{position:absolute;left:0;top:0;pointer-events:none;overflow:visible}
.drawsvg path{pointer-events:stroke}
.ti{position:absolute;border-radius:2px;cursor:text}
.ti:hover{background:rgba(38,63,140,.12);outline:1px dashed #263F8C}
.hit{position:absolute;background:rgba(0,153,168,.28);border-radius:2px;pointer-events:none}
.hit.cur{background:rgba(255,140,0,.45);outline:2px solid #E0742F}
.cursor-tag{position:absolute;right:6px;top:6px;display:flex;gap:4px;z-index:2;pointer-events:none}
.cursor-tag .av{width:22px;height:22px;font-size:.56rem;border:2px solid #fff}

/* Seitenleiste rechts */
.panel{border-left:1px solid var(--line);background:var(--surface);display:flex;flex-direction:column;min-height:0;min-width:0}
.ptabs{display:flex;gap:2px;padding:6px;border-bottom:1px solid var(--line);flex:none}
.ptabs button{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;border:0;background:none;padding:6px 2px;border-radius:9px;cursor:pointer;color:var(--muted);font-size:.66rem;font-weight:650;position:relative}
.ptabs button .ic{width:18px;height:18px}
.ptabs button[aria-selected="true"]{background:var(--accent-soft);color:var(--accent)}
.ptabs .dot{position:absolute;top:4px;right:calc(50% - 16px);min-width:15px;height:15px;padding:0 4px;border-radius:8px;background:var(--bad);color:#fff;font-size:.58rem;display:grid;place-items:center}
.pbody{flex:1;min-height:0;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:12px}
.thumbs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.thumb{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:.74rem;color:var(--muted);font-weight:600;position:relative}
.thumb canvas{display:block;background:#fff;box-shadow:0 1px 4px rgba(10,20,40,.2);border:2px solid transparent;border-radius:3px;width:100%;height:auto;cursor:pointer}
.thumb.on canvas{border-color:var(--accent)}
.thumb.on{color:var(--accent)}
.thumb .tacts{display:flex;gap:2px;opacity:.0;transition:opacity .15s}
.thumb:hover .tacts,.thumb:focus-within .tacts{opacity:1}
.thumb .tacts button{width:26px;height:26px;border-radius:7px;border:1px solid var(--line);background:var(--surface);cursor:pointer;display:grid;place-items:center;padding:0}
.thumb .tacts .ic{width:14px;height:14px}
@media (hover:none){.thumb .tacts{opacity:1}}
.cmt{border:1px solid var(--line);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:6px;background:var(--surface);cursor:pointer}
.cmt.on{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.cmt-h{display:flex;align-items:center;gap:8px;font-size:.78rem;color:var(--muted);flex-wrap:wrap}
.cmt-h b{color:var(--ink);font-size:.82rem}
.cmt-h .av{width:22px;height:22px;font-size:.58rem}
.cmt-h .cmt-del{margin-left:auto;width:28px;min-height:28px;color:var(--muted)}
.cmt-h .cmt-del:hover{color:var(--bad);background:var(--bad-soft)}
.cmt .txt{font-size:.86rem;white-space:pre-wrap}
.cmt .rep{font-size:.82rem;padding:6px 8px;border-radius:8px;background:var(--surface-2);white-space:pre-wrap}
.cmt textarea{min-height:44px;font-size:.84rem}
.kv{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;font-size:.84rem}.kv span{color:var(--muted)}.kv b{text-align:right}
.person{display:flex;align-items:center;gap:10px;font-size:.86rem}.person div{min-width:0;flex:1}.person b{display:block}.person small{color:var(--muted)}
.steps{display:flex;flex-direction:column;gap:6px}
.step{display:flex;align-items:center;gap:8px;font-size:.86rem;border:0;background:none;padding:4px;border-radius:8px;cursor:pointer;text-align:left}
.step:hover{background:var(--surface-2)}
.step i{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:var(--surface-2);color:var(--muted);font-style:normal;font-size:.72rem;font-weight:700}
.step.done i{background:var(--ok);color:#fff}.step.now i{background:var(--accent);color:var(--accent-ink)}
.ver{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:2px 10px;padding:8px 0;border-top:1px solid var(--line);font-size:.82rem;align-items:center}
.ver:first-child{border-top:0}.ver b{font-weight:650}.ver small{grid-column:2;color:var(--muted)}
.trlist{display:flex;flex-direction:column;gap:6px;font-size:.82rem}
.trrow{display:grid;gap:2px;padding:6px 8px;border-radius:8px;background:var(--surface-2)}.trrow s{color:var(--muted);text-decoration:none;font-size:.76rem}
.stream{font-size:.82rem;color:var(--muted)}
.bar{height:6px;border-radius:4px;background:var(--surface-2);overflow:hidden}.bar i{display:block;height:100%;background:var(--accent);transition:width .3s}
@media (max-width:1100px){.work{grid-template-columns:minmax(0,1fr) 280px}}
@media (max-width:900px){
  .work{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,42%)}
  .panel{border-left:0;border-top:1px solid var(--line)}
  .fmt .fhint{display:none}
  .docbar .lbl{display:none}
}

/* ---------- Dialog + Hinweis ---------- */
.modal{position:fixed;inset:0;z-index:40;background:rgba(10,16,32,.5);display:grid;place-items:center;padding:16px}
.dlg{width:min(640px,100%);max-height:calc(100dvh - 32px);background:var(--surface);border-radius:var(--r);box-shadow:var(--shadow-lg);display:flex;flex-direction:column;overflow:hidden}
.dlg-h{display:flex;align-items:center;gap:10px;padding:16px 18px;border-bottom:1px solid var(--line)}
.dlg-h h2{flex:1}
.dlg-b{padding:16px 18px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}
.dlg-f{padding:12px 18px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.fmts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
@media (max-width:560px){.fmts{grid-template-columns:minmax(0,1fr)}}
.fopt{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line);border-radius:12px;cursor:pointer}
.fopt input{margin-top:3px;accent-color:var(--accent)}
.fopt b{display:block;font-size:.88rem}.fopt small{display:block;font-size:.76rem;color:var(--muted)}
.fopt:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}
.fopt.off{opacity:.55;cursor:not-allowed}
.attach{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;background:var(--surface-2);font-size:.86rem}
.attach .ic{color:var(--bad)}
.secret{display:flex;gap:8px;align-items:center;padding:12px 14px;border-radius:12px;background:var(--ok-soft);font-variant-numeric:tabular-nums}
.secret code{font-size:1.05rem;font-weight:700;letter-spacing:.04em;flex:1;user-select:all}
.toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:50;background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;font-size:.88rem;font-weight:600;box-shadow:var(--shadow-lg);max-width:calc(100% - 32px)}
.printframe{position:fixed;right:0;bottom:0;width:1px;height:1px;border:0;opacity:0}
@media (prefers-reduced-motion:reduce){.spin{animation:none}}
