/* RecorderGo – App-Stylesheet (ohne Bibliotheken) */
:root, [data-theme=dark] {
  color-scheme: dark;
  --bg: #16161c; --panel: #1e1f27; --panel2: #272935; --line: #343748; --text: #e9eaf0; --muted: #959bb2;
  --accent: #4a94ff; --accentbg: rgba(74,148,255,.13); --accentline: rgba(74,148,255,.4); --sel: rgba(74,148,255,.16);
  --rec: #ff4d5e; --warn: #f5b041; --ok: #3fd17f; --wave: #4b5168; --bannerbg: #3a2f14; --shadow: 0 10px 34px rgba(0,0,0,.5);
}
[data-theme=light] {
  color-scheme: light;
  --bg: #f4f5f8; --panel: #fff; --panel2: #eef0f5; --line: #dcdfe8; --text: #1d2030; --muted: #686e86;
  --accent: #0d6be0; --accentbg: rgba(13,107,224,.09); --accentline: rgba(13,107,224,.35); --sel: rgba(13,107,224,.1);
  --rec: #e5303f; --warn: #b7700a; --ok: #1a9a52; --wave: #c4c9d8; --bannerbg: #fff4d6; --shadow: 0 10px 30px rgba(20,30,60,.18);
}
html { font-size: 15px; }
[data-fs=s] { font-size: 14px; } [data-fs=l] { font-size: 17px; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.45; -webkit-tap-highlight-color: transparent; opacity: 0; }
body.ready { opacity: 1; transition: opacity .15s; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.fill { fill: currentColor; stroke: none; }
.grow { flex: 1; } .muted { color: var(--muted); } .hint { color: var(--muted); font-size: .9em; margin: 6px 0; } .small { font-size: .82em; } .err { color: var(--rec); }

/* ---------- Grundgerüst ---------- */
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
#top { display: flex; align-items: center; gap: 6px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
body.wco #top { height: env(titlebar-area-height, 40px); padding-top: 0; padding-bottom: 0; padding-left: calc(env(titlebar-area-x, 0px) + 6px); padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) + 6px); -webkit-app-region: drag; app-region: drag; }
body.wco #top > * { -webkit-app-region: no-drag; app-region: no-drag; }
body.wco #top .brand { -webkit-app-region: drag; app-region: drag; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .01em; padding: 0 4px; flex: none; }
.brand img { border-radius: 6px; }
.search { flex: 1; max-width: 480px; display: flex; align-items: center; gap: 6px; background: var(--panel2); border-radius: 10px; padding: 0 10px; color: var(--muted); height: 36px; min-width: 60px; margin: 0 auto; }
.search input { flex: 1; border: 0; background: transparent; color: var(--text); outline: none; min-width: 0; height: 100%; }
#syncBtn[data-state=folder] { color: var(--ok); } #syncBtn[data-state=prompt] { color: var(--warn); } #syncBtn[data-state=error] { color: var(--rec); }
#syncBtn[data-state=none], #syncBtn[data-state=unsupported] { color: var(--muted); }
#banner { display: flex; gap: 10px; align-items: center; padding: 6px 12px; background: var(--bannerbg); font-size: .9em; flex-wrap: wrap; border-bottom: 1px solid var(--line); }

main#main { flex: 1; display: grid; grid-template-columns: 230px 330px minmax(0, 1fr); min-height: 0; position: relative; }
#side { overflow-y: auto; padding: 8px 6px; background: var(--panel); border-right: 1px solid var(--line); }
#scrim { display: none; }
#listpane { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); }
.lp-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.lp-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;color: var(--accent); }
.lp-head small { color: var(--muted); }
#list { overflow-y: auto; overscroll-behavior: contain; }
#editor { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
#editor.empty { align-items: center; justify-content: center; }

@media (min-width: 1100px) { #sideBtn { display: none; } }
@media (max-width: 1099px) {
  main#main { grid-template-columns: 310px minmax(0, 1fr); }
  #side { position: absolute; left: 0; top: 0; bottom: 0; width: 270px; z-index: 40; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  [data-side=open] #side { transform: none; }
  [data-side=open] #scrim { display: block; position: absolute; inset: 0; background: rgba(0,0,0,.45); z-index: 39; }
}
@media (max-width: 759px) {
  main#main { grid-template-columns: minmax(0, 1fr); }
  #listpane { border-right: 0; }
  [data-view=list] #editor { display: none; }
  [data-view=note] #listpane { display: none; }
  .brand span, #newBtn span { display: none; }
  #newBtn { padding: 7px 9px; }
  .ed-title { font-size: 1.12em !important; }
  #toasts { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
}
@media (min-width: 760px) { #editor .backbtn { display: none; } }   /* Zurück-Pfeil nur am Handy: zur Liste */

/* ---------- Bedienelemente ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--accentline); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--rec); } .btn.primary.danger { background: var(--rec); border-color: var(--rec); color: #fff; }
.btn.small { padding: 4px 9px; font-size: .85em; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 4px 6px; }
.btn:disabled { opacity: .6; }
.ibtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 9px; background: none; cursor: pointer; flex: none; padding: 0; }
.ibtn:hover { background: var(--panel2); }
.ibtn.on { color: var(--accent); background: var(--accentbg); }
.ibtn.small { width: 28px; height: 28px; }
.ibtn small { font-size: 11px; font-weight: 600; }
.inp { width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); margin: 4px 0; outline: none; }
.inp:focus { border-color: var(--accent); }
select.inp { width: auto; min-width: 180px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
.chk { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 6px 0; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); font-size: .84em; cursor: pointer; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.on { border-color: var(--accent); color: var(--accent); }
.chip.due { border-color: var(--rec); color: var(--rec); }
.chip.tag { color: var(--warn); }
.chip.auto { border-style: dashed; opacity: .85; }
.chip button { border: 0; background: none; padding: 0 0 0 3px; cursor: pointer; font-size: 1.1em; line-height: 1; }
.chip small { color: var(--muted); }
.badge { background: var(--panel2); border-radius: 999px; padding: 0 7px; font-size: .75em; font-weight: 600; }
.badge.warn { color: var(--warn); }
kbd { font-family: ui-monospace, Consolas, monospace; font-size: .8em; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel2); color: var(--muted); margin-left: auto; }
.cdot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 2px solid var(--muted); box-sizing: border-box; }
.cdot[data-c=none] { background: repeating-linear-gradient(45deg, transparent 0 3px, var(--line) 3px 5px); }
[data-c=red] { --c: #e5484d; } [data-c=orange] { --c: #f76b15; } [data-c=yellow] { --c: #f5c518; } [data-c=green] { --c: #30a46c; } [data-c=blue] { --c: #3b8cff; } [data-c=purple] { --c: #8e4ec6; }
.cdot[data-c], .cbar[data-c] { background: var(--c, transparent); }

/* ---------- Seitenleiste ---------- */
.sitem { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.sitem span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sitem small { margin-left: auto; color: var(--muted); }
.sitem:hover { background: var(--panel2); }
.sitem.on { background: var(--sel); color: var(--accent); }
.sitem.drop { outline: 2px dashed var(--accent); }
.shead { display: flex; justify-content: space-between; align-items: center; padding: 12px 10px 4px; color: var(--muted); font-size: .76em; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 8px; }

/* ---------- Liste ---------- */
.item { display: flex; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; outline-offset: -2px; }
.item:hover { background: var(--panel); }
.item.on { background: var(--sel); }
.cbar { width: 4px; margin-right: 9px; border-radius: 0 3px 3px 0; flex: none; }
.ibody { flex: 1; min-width: 0; }
.ititle { font-weight: 600; display: flex; gap: 5px; align-items: center; white-space: nowrap; overflow: hidden; }
.ititle span { overflow: hidden; text-overflow: ellipsis; }
.ititle .ic { color: var(--muted); }
.isnip { color: var(--muted); font-size: .87em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 1px; }
.imeta { display: flex; gap: 6px; align-items: center; color: var(--muted); margin-top: 4px; font-size: .9em; min-width: 0; }
.imeta .ml { display: inline-flex; gap: 2px; align-items: center; font-size: .82em; }
.mtag { color: var(--warn); font-size: .8em; white-space: nowrap; }
.listempty { text-align: center; padding: 40px 16px; color: var(--muted); }
.listempty .ic { opacity: .5; }
.more { display: block; margin: 10px auto; }
.quickbar { display: flex; justify-content: space-around; align-items: flex-end; padding: 4px 4px max(4px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); }
.qb { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 0; background: none; font-size: .7em; padding: 4px 6px; border-radius: 8px; cursor: pointer; min-width: 52px; color: var(--muted); }
.qb:hover { color: var(--text); background: var(--panel2); }
.qb.rec { background: var(--rec); color: #fff; border-radius: 50%; width: 56px; height: 56px; justify-content: center; min-width: 0; margin-top: -18px; box-shadow: 0 4px 14px rgba(255,77,94,.4); }
.qb.rec span { display: none; }

/* ---------- Editor ---------- */
.ed-top { display: flex; align-items: center; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ed-title { flex: 1; min-width: 0; font-size: 1.3em; font-weight: 700; border: 0; background: transparent; outline: none; padding: 4px 6px; border-radius: 6px; }
.ed-title:focus { background: var(--panel2); }
.ed-title::placeholder { color: var(--muted); opacity: .7; }
.trashbar { display: flex; gap: 8px; align-items: center; padding: 6px 12px; background: var(--bannerbg); flex-wrap: wrap; }
.ed-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 12px; max-height: 70px; overflow-y: auto; border-bottom: 1px solid var(--line); }
.taginp { border: 0; background: transparent; outline: none; font-size: .85em; width: 84px; color: var(--warn); }
.ed-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 8px 0 4px; }
.ed-tail { min-height: 100px; cursor: text; color: var(--muted); padding: 10px 30px; }
.ed-add { display: flex; justify-content: center; gap: 2px; padding: 4px 4px max(4px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); overflow-x: auto; scrollbar-width: none; }
.ed-add .recbtn { color: var(--rec); }
.dictbtn.on { background: var(--rec) !important; color: #fff; }
@media (max-width: 420px) { .ed-add .ibtn { width: 34px; } }

.blk { position: relative; padding: 3px 8px 3px 30px; border-radius: 8px; }
.blk + .blk { margin-top: 8px; }
.bhandle { position: absolute; left: 2px; top: 4px; width: 26px; height: 26px; border: 0; background: none; border-radius: 6px; cursor: pointer; opacity: 0; color: var(--muted); display: flex; align-items: center; justify-content: center; padding: 0; }
.blk:hover .bhandle, .blk:focus-within .bhandle { opacity: .8; }
.bhandle:hover { background: var(--panel2); opacity: 1; }

.blk-text { line-height: 1.6; }
.blk-text.editing .tview, .blk-text:not(.editing) .tedit { display: none; }
.tview { cursor: text; min-height: 1.6em; outline: none; overflow-wrap: anywhere; }
.tview p { margin: 0 0 .25em; } .tview p.empty { min-height: .8em; }
.tview .ph { color: var(--muted); }
.tview .h1 { font-size: 1.35em; font-weight: 700; margin: .3em 0; } .tview .h2 { font-size: 1.18em; font-weight: 700; margin: .25em 0; } .tview .h3 { font-weight: 700; margin: .2em 0; }
.tview ul { margin: 0 0 .3em; padding-left: 1.3em; }
.tview blockquote { margin: .2em 0; padding: 2px 10px; border-left: 3px solid var(--accent); color: var(--muted); }
.tview code { background: var(--panel2); padding: 0 4px; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.tview hr { border: 0; border-top: 1px solid var(--line); }
a.wl { color: var(--accent); background: var(--accentbg); border-radius: 4px; padding: 0 3px; text-decoration: none; }
a.wl:hover { text-decoration: underline; }
a.wl.missing { background: none; color: var(--muted); border-bottom: 1px dashed var(--muted); border-radius: 0; }
a.tg { color: var(--warn); text-decoration: none; }
a.url { word-break: break-all; }
.tedit { display: block; width: 100%; box-sizing: border-box; resize: none; border: 0; background: transparent; outline: none; padding: 0; min-height: 1.6em; overflow: hidden; line-height: 1.6; }
.blk-text.editing { box-shadow: -3px 0 0 var(--accent); margin-left: -3px; padding-left: 3px; }

.crow { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.crow input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--accent); flex: none; margin: 0; }
.citem { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 5px 0; border-bottom: 1px solid transparent; }
.citem:focus { border-bottom-color: var(--line); }
.crow.done .citem { text-decoration: line-through; color: var(--muted); }
.cdel { opacity: 0; }
.crow:hover .cdel, .crow:focus-within .cdel { opacity: .6; }
.addrow { padding-left: 22px; }

.blk-audio { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px 8px; }
.arow { display: flex; align-items: center; gap: 2px; }
.arow .ibtn small { white-space: nowrap; }
@media (max-width: 400px) { .arow .ibtn { width: 32px; } .atime { font-size: .8em; margin-left: 2px; } }
.ibtn.big { width: 44px; height: 44px; background: var(--accent); color: #fff; border-radius: 50%; margin-right: 4px; }
.atime { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9em; margin-left: 6px; }
canvas.awave { width: 100%; height: 56px; display: block; cursor: pointer; touch-action: none; margin: 4px 0; }
.transcript { font-size: .9em; resize: vertical; min-height: 2.4em; background: transparent; }

figure.blk-image { margin: 0; }
.imgwrap { position: relative; border-radius: 10px; overflow: hidden; background: var(--panel2); display: inline-block; max-width: 100%; vertical-align: top; }
.imgwrap img { display: block; max-width: 100%; max-height: 55vh; width: auto; height: auto; cursor: zoom-in; }
.imgtools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.imgwrap:hover .imgtools, .imgwrap:focus-within .imgtools { opacity: 1; }
.imgtools .ibtn { background: rgba(0,0,0,.55); color: #fff; width: 34px; height: 34px; }
.caption { display: block; border: 0; background: transparent; color: var(--muted); width: 100%; font-size: .88em; padding: 4px 2px; outline: none; }
.missing { padding: 20px; color: var(--muted); }
.blk-ink { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; background: #fdfcf7; }
canvas.ink-prev { display: block; }

.ed-links { border-top: 1px solid var(--line); background: var(--panel); max-height: 32%; display: flex; flex-direction: column; flex: none; }
.ed-links.drop { outline: 2px dashed var(--accent); outline-offset: -3px; }
.lhead { display: flex; align-items: center; gap: 6px; padding: 3px 8px; }
.ltoggle { display: flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; padding: 4px; font-weight: 600; border-radius: 6px; }
.ltoggle:hover { background: var(--panel2); }
.lbody { overflow-y: auto; padding: 0 10px 6px; }
.lgroup { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 6px; }
.lgroup > small { width: 100%; color: var(--muted); font-size: .76em; text-transform: uppercase; letter-spacing: .05em; }
.lchip { display: inline-flex; border: 1px solid var(--accentline); border-radius: 999px; overflow: hidden; max-width: 100%; }
.lchip button { border: 0; background: var(--accentbg); color: var(--accent); padding: 3px 9px; font-size: .85em; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lchip button:hover { filter: brightness(1.2); }
.lchip .peek { padding: 3px 7px; border-left: 1px solid var(--accentline); }
.lchip.missing { border-style: dashed; } .lchip.missing button { background: none; color: var(--muted); }
.lchip.mention { border-color: var(--line); } .lchip.mention button { background: var(--panel2); color: var(--muted); }
@media (max-width: 759px) { .lhead .btn span { display: none; } .lhead .btn { padding: 5px 8px; } .ed-links { max-height: 28%; } }

.empty-state { text-align: center; padding: 20px; max-width: 520px; }
.empty-state h2 { margin: 10px 0 4px; }
.qgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 18px 0; }
.qbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: .85em; }
.qbtn:hover { border-color: var(--accent); color: var(--accent); }
.lockscreen { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 320px; margin: 40px auto; text-align: center; }
.lockscreen .ic { color: var(--muted); }

/* ---------- Dialoge, Menüs, Toasts ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 12px; padding-top: max(12px, env(safe-area-inset-top)); }
.backdrop.clear { background: transparent; }
.backdrop.full { padding: 0; }
.modal { background: var(--panel); border-radius: 14px; max-width: min(520px, 100%); width: 100%; max-height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow); border: 1px solid var(--line); animation: pop .14s ease; }
.modal.wide { max-width: min(880px, 100%); }
.modal.full { max-width: none; height: 100%; border-radius: 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.mhead { display: flex; align-items: center; gap: 8px; padding: 8px 8px 0 16px; padding-top: max(8px, env(safe-area-inset-top)); }
.modal:not(.full) .mhead { padding-top: 8px; }
.mhead h2 { flex: 1; font-size: 1.1em; margin: 0; }
.mbody { overflow-y: auto; padding: 10px 16px 12px; flex: 1; min-height: 0; }
.mbody p { margin: 4px 0 8px; }
.mfoot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px 14px; flex-wrap: wrap; }
.menu { position: fixed; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; min-width: 210px; max-width: min(320px, calc(100vw - 8px)); max-height: 72vh; overflow-y: auto; box-shadow: var(--shadow); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; text-align: left; border-radius: 6px; cursor: pointer; }
.mi span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi:hover, .mi:focus { background: var(--panel2); outline: none; }
.mi.active { color: var(--accent); } .mi.danger { color: var(--rec); }
.mi > span.ic { width: 18px; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 20px); }
.toast { pointer-events: auto; background: #2b2e3b; color: #fff; padding: 10px 14px; border-radius: 10px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; }
.toast .btn.link { color: #8fbcff; font-weight: 600; }
.toast.out { opacity: 0; transform: translateY(8px); }

.acpop { position: fixed; z-index: 150; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; min-width: 230px; max-width: min(360px, calc(100vw - 8px)); box-shadow: var(--shadow); }
.acitem { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.acitem span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acitem.on { background: var(--sel); }
.acitem small { margin-left: auto; color: var(--muted); padding-left: 8px; }
.acitem.create { color: var(--accent); }
.picklist { max-height: 46vh; overflow-y: auto; margin-top: 6px; }
.pickitem { display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; }
.pickitem .pt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pickitem.on { background: var(--sel); }
.pickitem small { margin-left: auto; color: var(--muted); white-space: nowrap; padding-left: 8px; }
.peek-title { font-weight: 700; font-size: 1.1em; }
.peek-ta { resize: vertical; line-height: 1.5; }
.peek-media { display: flex; gap: 6px; align-items: center; color: var(--muted); padding: 4px 0; font-size: .9em; }
.dictpill { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--rec); color: #fff; padding: 8px 14px; border-radius: 999px; z-index: 120; display: flex; gap: 8px; align-items: center; max-width: 86vw; box-shadow: var(--shadow); }
.dictpill { cursor: pointer; }
.dictpill .dtext { display: flex; flex-direction: column; min-width: 0; }
.dictpill .dtext > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dictpill .dtrace { opacity: .75; font-size: .72em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dictpill .dtrace:empty { display: none; }
.dictpill .rec-dot { background: #fff; }

/* Aufnahme */
.recorder .mbody { text-align: center; }
.rec-head { display: flex; align-items: center; justify-content: center; gap: 12px; }
.rec-time { font-size: 44px; font-variant-numeric: tabular-nums; font-weight: 300; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--rec); animation: blink 1s infinite; flex: none; display: inline-block; }
@keyframes blink { 50% { opacity: .25; } }
canvas.rec-wave { width: 100%; height: 120px; display: block; }
.rec-interim { min-height: 1.4em; color: var(--muted); font-size: .9em; text-align: left; }
.rec-btns { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 12px 0; }
.btn.round { width: 58px; height: 58px; border-radius: 50%; padding: 0; }
.btn.round.rec { background: var(--rec); border-color: var(--rec); color: #fff; width: 74px; height: 74px; }
.recorder .chk { justify-content: center; }

/* Kamera, Scan, Zeichnen, Bildansicht */
.cammodal .mbody, .scanmodal .mbody, .inkmodal .mbody, .viewer .mbody { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
video.cam { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; }
.cambar, .scanbar { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 10px; flex-wrap: wrap; }
.shutter { width: 70px !important; height: 70px !important; }
.scanmodal .hint { padding: 0 16px; }
.scan-stage { flex: 1; position: relative; min-height: 0; background: #111; overflow: hidden; }
canvas.scan-cv { position: absolute; }
.handle { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid #3b8cff; background: rgba(59,140,255,.25); touch-action: none; cursor: grab; box-sizing: border-box; }
.handle.on { background: rgba(59,140,255,.6); transform: scale(1.3); }
.ink-tools { display: flex; flex-wrap: wrap; gap: 3px; padding: 5px 8px; border-bottom: 1px solid var(--line); align-items: center; justify-content: center; }
.ink-stage { flex: 1; min-height: 0; overflow-y: auto; background: #6b6f7a; padding: 1px; position: relative; }
.ink-er { position: absolute; display: none; border-radius: 50%; border: 1.5px solid #222; box-shadow: 0 0 0 1.5px rgba(255,255,255,.9); background: rgba(255,255,255,.25); pointer-events: none; box-sizing: border-box; }
canvas.ink-cv.erasing { cursor: none; }
.tgrp { display: inline-flex; align-items: center; gap: 2px; }
.wbtn i.ring { background: none; border: 2px solid currentColor; box-sizing: border-box; }
.ermode { min-width: 96px; }
.mfoot .cancelbtn { margin-right: auto; background: #f59e0b; border-color: #f59e0b; color: #1d1300; font-weight: 600; }
.mfoot .cancelbtn:hover { background: #fbb33a; }
canvas.ink-cv { display: block; touch-action: none; margin: 0 auto; cursor: crosshair; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 2px var(--panel); }
.swatch.on { border-color: var(--text); }
.wbtn i { display: block; border-radius: 50%; background: currentColor; }
.sep { width: 1px; height: 24px; background: var(--line); margin: 0 3px; }
.inkmodal .mfoot { padding: 6px 10px; }
.view-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.view-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Einstellungen, Versionen */
.settings section { margin-bottom: 20px; }
.settings h3 { margin: 0 0 8px; font-size: 1.05em; }
.settings h4 { margin: 12px 0 4px; font-size: .95em; }
.lbl { display: block; margin: 10px 0 4px; color: var(--muted); font-size: .85em; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; align-items: center; }
table.keys { border-collapse: collapse; } table.keys td { padding: 3px 12px 3px 0; } table.keys kbd { margin: 0; }
.vwrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; }
.vlist, .vprev { overflow-y: auto; max-height: 56vh; }
.vitem { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; }
.vitem small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vitem.on { background: var(--sel); }
.vprev { border-left: 1px solid var(--line); padding-left: 12px; }
@media (max-width: 640px) { .vwrap { grid-template-columns: 1fr; } .vlist { max-height: 22vh; } .vprev { border: 0; padding: 0; max-height: 34vh; } .qgrid { grid-template-columns: repeat(3, 1fr); } }

@media (pointer: coarse) {
  .bhandle { opacity: .5; }
  .imgtools { opacity: 1; }
  .cdel { opacity: .5; }
  .ibtn { width: 40px; height: 40px; }
}
@media (max-height: 520px) {
  .quickbar .qb span { display: none; }
  .qb.rec { width: 46px; height: 46px; margin-top: -8px; }
  .ed-meta { max-height: 40px; }
  .lbody .hint { display: none; }
  .ed-links { max-height: 26%; }
}
@media print { #top, #side, #listpane, .ed-add, .ed-links, .bhandle { display: none !important; } }

/* ---------- Weblinks ---------- */
.blk-links { display: flex; flex-direction: column; gap: 6px; }
.lkcard { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
.lkcard:hover { border-color: var(--accentline); }
.lkmain { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
.lktitle { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lkhost { display: flex; align-items: center; gap: 4px; color: var(--accent); font-size: .84em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lkdesc { color: var(--muted); font-size: .84em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lkwarn { color: var(--warn); display: inline-flex; }
.lkadd { align-self: flex-start; }
.fav { border-radius: 7px; flex: none; object-fit: contain; background: #fff; }
.fav.letter { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; background-clip: padding-box; }
.favbox { display: inline-flex; flex: none; }
.row.nowrap { flex-wrap: nowrap; }
.warnlist { margin: 6px 0; padding: 8px 10px 8px 28px; border-radius: 8px; background: var(--bannerbg); color: var(--text); font-size: .9em; }
.warnlist li { margin: 2px 0; }
.hint.url { word-break: break-all; }
.webitem { align-items: center; gap: 10px; padding-left: 12px; }
.webitem .fav { align-self: flex-start; margin-top: 2px; }
.notechip { max-width: 45%; font-size: .78em; padding: 1px 7px; }
.webhead { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.webhead small { line-height: 1.3; }
#editor.dropping, #listpane.dropping { outline: 3px dashed var(--accent); outline-offset: -6px; }
@media (max-width: 480px) {
  .ink-tools { gap: 1px; padding: 4px; }
  .ink-tools .ibtn { width: 34px; height: 34px; }
  .ink-tools .swatch { width: 22px; height: 22px; }
  .ink-tools .sep { display: none; }
  .ermode { min-width: 0; padding: 4px 7px; }
}

/* Weblinks: Themen */
.topicbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: var(--bg); }
.chip.topic small { margin-left: 2px; }
.chip.drop, .tophead.drop { outline: 2px dashed var(--accent); outline-offset: 1px; background: var(--accentbg); }
.chip.addtopic { border-style: dashed; color: var(--accent); }
.tophead { display: flex; align-items: center; gap: 6px; padding: 10px 12px 4px; color: var(--muted); font-size: .78em; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.tophead small { margin-left: auto; }
.webtip { width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: help; }
.selbar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--accentbg); border-bottom: 1px solid var(--line); }
.selchk { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.topicchip { color: var(--warn); max-width: 40%; }
.lktopic { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: var(--warn); font-size: .95em; }
.btn.on { border-color: var(--accent); color: var(--accent); }

/* Liste: Weblinks als getrennte Chips, Ordner-Ansicht, Checklisten-Kopf */
.ilinks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; min-width: 0; }
.ilink { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 8px 2px 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel2); font-size: .8em; color: var(--text); }
.ilink span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.ilink .fav { border-radius: 4px; }
.ilink.more { padding: 2px 8px; color: var(--muted); }
.webadd2 { padding: 4px 8px 10px; border-bottom: 1px solid var(--line); }
.chead { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .78em; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 0 4px; cursor: help; }
.sitem.drop { outline: 2px dashed var(--accent); background: var(--accentbg); }

/* Getrennte Bereiche: Notizen | Weblinks */
.shead.sect { color: var(--text); font-size: .72em; letter-spacing: .08em; padding-top: 14px; }
.shead.sect:first-child { padding-top: 4px; }
.sitem.sub { padding-left: 22px; }
.sitem.sub .ic { width: 16px; height: 16px; }
.sbottom { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
#app[data-mode=web] .quickbar { display: none; }
.webhead .webadd { padding: 8px 14px; }
.openbtn { color: var(--accent); }
.webitem .imeta { gap: 8px; }
.topicchip { display: inline-flex; align-items: center; gap: 3px; color: var(--warn); font-size: .8em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 50%; }
.webitem.trashed { opacity: .85; }
/* Detailansicht eines Weblinks */
.wd-crumb { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; padding: 0 6px; min-width: 0; overflow: hidden; white-space: nowrap; }
.ed-body.wd { padding: 18px 20px; max-width: 760px; }
.wd-card { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; min-width: 0; }
.wd-card .fav { border-radius: 12px; }
.wd-head { min-width: 0; }
.wd-head h2 { margin: 0; font-size: 1.35em; overflow-wrap: anywhere; }
.wd-host { color: var(--accent); }
.wd-actions { margin: 10px 0 18px; }
.btn.big { padding: 10px 18px; font-size: 1.05em; }
.wd-form { display: grid; grid-template-columns: 1fr; gap: 0; }
.wd-form textarea { resize: vertical; }
.wd-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
#app[data-mode=web] #sortBtn { display: none; }
.webitem .imeta small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.restorebtn { color: var(--accent); }

/* ---------- Weblinks: Übersicht mit Ordner-Kästen ---------- */
#app[data-mode=web] main#main { grid-template-columns: 230px minmax(0, 1fr); }
#app[data-mode=web] #listpane { display: none !important; }
#app[data-mode=web] #editor { display: flex !important; }
@media (max-width: 1099px) { #app[data-mode=web] main#main { grid-template-columns: minmax(0, 1fr); } }
.board-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.board-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.15em;color: var(--accent); }
.board { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 20px; display: flex; flex-direction: column; gap: 16px; }
.fbox { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 8px 12px 12px; }
.fbox.drop { outline: 2px dashed var(--accent); background: var(--accentbg); }
.fbox-head { display: flex; align-items: center; gap: 6px; padding: 2px 0 8px; color: var(--muted); }
.fbox-name { font-weight: 700; color: var(--text); background: none; border: 0; padding: 2px 4px; border-radius: 6px; cursor: text; font-size: 1em; }
button.fbox-name:hover { background: var(--panel2); }
.fbox-head .ibtn:disabled { opacity: .3; cursor: default; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); min-width: 0; cursor: default; }
.tile:hover, .tile:focus-visible, .tile:has(:focus-visible) { border-color: var(--accentline); }
.tile.dragging { opacity: .4; }
.tile.flash { box-shadow: 0 0 0 3px var(--accent); transition: box-shadow .3s; }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.tile-icon { display: inline-flex; border-radius: 10px; }
.tile-icon .fav { border-radius: 10px; }
.tile-btns { display: flex; flex-direction: column; gap: 2px; }
.tbtn { width: 26px; height: 24px; border: 0; border-radius: 6px; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.tbtn:hover { background: var(--panel2); color: var(--accent); }
.tile-title { font-weight: 600; font-size: .92em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tile-host { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: .76em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-host .ic { color: var(--warn); flex: none; }
.addtile { align-items: center; justify-content: center; border-style: dashed; color: var(--accent); cursor: pointer; min-height: 112px; font: inherit; font-size: .85em; }
.addtile:hover { background: var(--accentbg); }
.boardhint { margin: 0; }
.mfoot .leftdanger { margin-right: auto; color: var(--rec); }
@media (max-width: 480px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; } .board { padding: 10px; } .board-head .btn span { display: none; } }
.tile-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; min-height: 2.5em; overflow-wrap: anywhere; }
/* Weblinks: Listenansicht */
.lrows { display: flex; flex-direction: column; }
.lrow { display: flex; align-items: flex-start; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); min-width: 0; }
.lrow:first-child { border-top: 0; }
.lrow:hover, .lrow:focus-visible, .lrow:has(:focus-visible) { background: var(--panel2); border-radius: 8px; }
.lrow.dragging { opacity: .4; }
.lrow-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lrow-title { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.lrow-title:hover { color: var(--accent); }
.lrow-desc { color: var(--muted); font-size: .88em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lrow-url { display: flex; align-items: center; gap: 4px; color: var(--accent); font-size: .8em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lrow-url .ic { color: var(--warn); flex: none; }
.lrow-btns { display: flex; gap: 2px; flex: none; }
.lrow-add { margin-top: 6px; align-self: flex-start; }
@media (max-width: 480px) { .lrow-btns { flex-direction: column; } }
/* Anheften direkt in der Liste */
.pinbtn { margin-left: auto; flex: none; border: 0; background: none; padding: 2px 4px; border-radius: 6px; color: var(--muted); opacity: 0; cursor: pointer; display: inline-flex; }
.item:hover .pinbtn, .item:focus-within .pinbtn, .pinbtn.on { opacity: 1; }
.pinbtn.on { color: var(--accent); }
.pinbtn:hover { background: var(--panel2); color: var(--accent); }
@media (pointer: coarse) { .pinbtn { opacity: .5; } }
/* Papierkorb: Nur-Ansicht */
.ed-title.ro { display: flex; align-items: center; color: var(--muted); }
.trashbar { gap: 10px; padding: 10px 14px; }
.ed-body.readonly { opacity: .8; }
#app[data-mode=trash] .quickbar { display: none; }

/* Überschriften der Blöcke in der Mitte wie aktive Links */
.fbox-head > .ic { color: var(--accent); }
.tile:focus { outline: none; }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Weblinks-Liste: lange Titel und Adressen umbrechen statt abschneiden */
.lrow-title { white-space: normal; }
.lrow-url { white-space: normal; word-break: break-all; overflow: visible; text-overflow: clip; align-items: flex-start; }
.mfoot .leftbtn { margin-right: auto; }
.mfoot .leftdanger + .leftbtn { margin-left: -2px; }
.mfoot .leftdanger:has(+ .leftbtn) { margin-right: 0; }

/* Bildschirmaufnahme */
.scr-setup { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; }
.scr-setup .btn.big { margin-top: 10px; align-self: center; }
video.scr-prev { width: 100%; max-height: 40vh; background: #000; border-radius: 10px; }
figure.blk-video { margin: 0; }
video.vid { display: block; width: 100%; max-height: 60vh; background: #000; border-radius: 10px; }
.vmeta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82em; margin-top: 4px; }
textarea.urlinp { resize: none; overflow: hidden; word-break: break-all; line-height: 1.4; min-height: 38px; }
.linkdlg .row.nowrap { align-items: flex-start; }
.linkdlg .mfoot { flex-wrap: nowrap; }
@media (max-width: 480px) { .linkdlg .mfoot { flex-wrap: wrap; } }

/* 1.7.1: Checkliste mehrzeilig, Kopieren-Knopf, Neu-Pfeil */
textarea.citem { box-sizing: border-box; resize: none; overflow: hidden; font: inherit; color: inherit; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; display: block; }
.crow { align-items: flex-start; }
.crow input[type=checkbox] { margin-top: 6px; }
.cbtns { display: flex; flex: none; gap: 2px; margin-top: 2px; }
.splitbtn { display: inline-flex; }
.splitbtn #newBtn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
#newMore { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 7px 6px; border-left: 1px solid rgba(255,255,255,.35); }

/* 1.8.0: neu eingefügter Block leuchtet kurz auf */
.blk.flash { animation: blkflash 2.4s ease-out; border-radius: 10px; }
@keyframes blkflash { 0%, 35% { box-shadow: 0 0 0 3px var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; background: transparent; } }
.wherehint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); font-size: .92em; }
.wherehint small { flex-basis: 100%; color: var(--muted); }
.vmeta { display: flex; align-items: center; gap: 6px; }

/* Bild bearbeiten */
.ie-stage { touch-action: none; }
.ie-crop { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); cursor: move; touch-action: none; box-sizing: border-box;
  background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px); background-size: 33.33% 33.33%; background-position: -1px -1px; }
.ie-h { width: 26px; height: 26px; margin: -13px 0 0 -13px; background: #fff; border-color: var(--accent); z-index: 2; }
.ie-h[data-k=nw], .ie-h[data-k=se] { cursor: nwse-resize; } .ie-h[data-k=ne], .ie-h[data-k=sw] { cursor: nesw-resize; }
.ie-bar { gap: 10px; padding: 8px 12px; }
.ie-sliders { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.ie-sl { display: flex; align-items: center; gap: 6px; font-size: .9em; }
.ie-sl input { width: 120px; accent-color: var(--accent); }
.ie-sl output { min-width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; }
.flipx { display: inline-flex; transform: scaleX(-1); }

/* Kürzen */
.trimmodal video.trim-vid { width: 100%; max-height: 46vh; background: #000; border-radius: 8px; display: block; }
.trim-row { padding: 18px 12px 8px; }
.trim-track { position: relative; height: 36px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); cursor: pointer; touch-action: none; }
.trim-sel { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 30%, transparent); border-top: 3px solid var(--accent); border-bottom: 3px solid var(--accent); box-sizing: border-box; }
.trim-head { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--rec); pointer-events: none; }
.trim-h { position: absolute; top: -8px; bottom: -8px; width: 16px; margin-left: -8px; border-radius: 5px; background: var(--accent); cursor: ew-resize; touch-action: none; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.trim-h::after { content: ''; position: absolute; left: 6px; top: 30%; bottom: 30%; width: 4px; border-left: 1px solid #fff; border-right: 1px solid #fff; }
.trim-h.on { transform: scaleX(1.25); }
.trim-ctrl { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.trim-foot { display: flex; justify-content: space-between; gap: 10px; font-size: .9em; color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 4px; }
.trim-now { color: var(--rec); }

/* 1.8.2: Block-Menü ⋮ immer sichtbar und gut erkennbar */
.bhandle { opacity: 1 !important; width: 24px; height: 34px; top: 2px; left: 0; border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); color: var(--accent); }
.bhandle svg { width: 20px; height: 20px; stroke-width: 3; }
.blk:hover .bhandle, .blk:focus-within .bhandle { background: var(--accent); color: #fff; border-color: var(--accent); }
.bhandle:hover { background: var(--accent) !important; color: #fff !important; }
.blk:hover { background: color-mix(in srgb, var(--panel2) 45%, transparent); }

.toast .tclose { color: #fff; opacity: .7; width: 26px; height: 26px; margin-right: -6px; }
.toast .tclose:hover { opacity: 1; background: rgba(255,255,255,.12); }

/* 1.9.0: In Kalender eintragen */
.calwhen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.calwhen span { color: var(--muted); }
.callist { display: flex; flex-direction: column; gap: 8px; }
.calopt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); cursor: pointer; color: inherit; }
.calopt:hover, .calopt:focus-visible { border-color: var(--accent); }
.calic { flex: none; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.caltx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.caltx small { color: var(--muted); }

/* 1.10.0: Werkzeugleiste der Notiz und Menü für markierten Text */
.ed-tools { display: inline-flex; align-items: center; gap: 1px; padding: 0 2px; margin-left: 4px; border-left: 1px solid var(--line); }
.ed-tools .ibtn { width: 34px; height: 30px; color: var(--text); }
.ed-tools .ibtn svg { width: 20px; height: 20px; }
.ed-tools .ibtn:hover:not(:disabled) { color: var(--accent); background: var(--panel2); }
.ed-tools .ibtn:disabled { opacity: .3; cursor: default; }
.ed-tools .t-clear:hover:not(:disabled) { color: var(--rec); }
.ed-tools .tsep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.selpop { position: fixed; z-index: 300; display: flex; gap: 2px; padding: 4px; border-radius: 10px; background: #2b2e3b; box-shadow: var(--shadow); }
.selpop button { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: #fff; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: .92em; }
.selpop button:hover { background: rgba(255,255,255,.12); }
.selpop button:last-child svg { color: #ff8a8a; }
@media (pointer: coarse) { .ed-tools .ibtn { width: 38px; height: 34px; } .selpop button { padding: 10px 12px; } }

/* 1.11.0: Ausrichtung von Bild, Zeichnung, Video */
.ed-tail { clear: both; }
.blk[data-align=left], .blk[data-align=right] { box-sizing: border-box; }
.blk[data-align=left] { float: left; width: 45%; margin: 0 34px 8px 0; z-index: 2; }
.blk[data-align=right] { float: right; width: 45%; margin: 0 0 8px 12px; z-index: 2; }
.blk[data-align=left] + .blk, .blk[data-align=right] + .blk { margin-top: 0; }
.blk[data-align=center] > figure, .blk[data-align=center] > .blk-ink { width: 60%; margin-left: auto; margin-right: auto; }
.blk[data-align] .imgtools { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 520px) {
  .blk[data-align=left], .blk[data-align=right] { width: 50%; }
  .blk[data-align=center] > figure, .blk[data-align=center] > .blk-ink { width: 80%; }
}

/* 1.11.1: Block mit offenem Menü deutlich markieren */
.blk.marked { outline: 2px solid var(--accent); outline-offset: 2px; background: color-mix(in srgb, var(--accent) 10%, transparent) !important; }
.blk.marked > .bhandle { background: var(--accent); color: #fff; border-color: var(--accent); }
/* Text fließt um ein links/rechts stehendes Bild; beim Bearbeiten steht das Eingabefeld unter dem Bild */
.blk[data-align=left] + .blk:not([data-align]) > .bhandle { left: calc(45% + 4px); }
@media (max-width: 520px) { .blk[data-align=left] + .blk:not([data-align]) > .bhandle { left: calc(50% + 4px); } }

/* 1.12.0: Leiste oben statt mittlerer Spalte (PC/Tablet); am Handy bleibt die Liste */
.sitem.empty, .sitem:disabled { opacity: .38; cursor: default; }
.sitem.empty:hover { background: none; }
#strip { display: none; }
@media (min-width: 760px) {
  main#main { grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  #side { grid-row: 1 / span 2; }
  #strip { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel); min-width: 0; }
  #editor { grid-column: 2; grid-row: 2; }
  #listpane { display: none; position: absolute; z-index: 45; right: 10px; width: min(440px, calc(100% - 20px)); max-height: 72%; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; background: var(--bg); }
  #listpane.open { display: grid; }
  #listpane .quickbar { display: none; }
  #app[data-mode=web] #strip { display: none; }
  #app[data-mode=web] #editor { grid-row: 1 / span 2; }
}
@media (min-width: 760px) and (max-width: 1099px) {
  main#main { grid-template-columns: minmax(0, 1fr); }
  #strip, #editor { grid-column: 1; }
}
.st-head { display: flex; flex-direction: column; flex: none; max-width: 170px; line-height: 1.2; padding-right: 6px; border-right: 1px solid var(--line); }
.st-head b { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-head small { color: var(--muted); }
.st-chips { position: relative; flex: 1; min-width: 0; display: flex; gap: 6px; overflow: hidden; }
.schip { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; max-width: 240px; padding: 4px 10px 4px 9px; border: 1px solid var(--line); border-left: 3px solid var(--c, var(--line)); border-radius: 8px; background: var(--bg); color: inherit; cursor: pointer; text-align: left; }
.schip[data-c=none] { border-left-color: var(--line); }
.schip:hover { border-color: var(--accent); border-left-color: var(--c, var(--accent)); }
.schip.on { background: var(--sel); border-color: var(--accent); border-left-color: var(--c, var(--accent)); }
.schip.on .sc1 { color: var(--accent); }
.schip[hidden] { display: none; }
.sc1 { display: flex; align-items: center; gap: 4px; font-weight: 600; max-width: 100%; }
.sc1 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc2 { display: flex; align-items: center; gap: 4px; font-size: .78em; color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; }
.scf { display: inline-flex; align-items: center; gap: 2px; overflow: hidden; text-overflow: ellipsis; }
.st-empty { color: var(--muted); align-self: center; font-size: .92em; }
.st-more { flex: none; display: flex; align-items: center; gap: 4px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); color: inherit; cursor: pointer; font-weight: 600; }
.st-more.hasmore { color: var(--accent); }
.st-more:hover, .st-more.on { border-color: var(--accent); }
.st-more.on svg { transform: rotate(180deg); }
/* Breite Ansicht: Ordner … Datum in der Titelzeile */
.metaslot { display: contents; }
#editor.widehead .metaslot { display: flex; flex: 0 1 auto; min-width: 0; }
#editor.widehead .metaslot .ed-meta { flex-wrap: nowrap; border-bottom: 0; padding: 0 6px; max-height: none; overflow: hidden; }
#editor.widehead .ed-title { flex: 1 1 200px; }

/* 1.12.1: Liste „+ mehr“: ganze Höhe nutzen und in Spalten – möglichst ohne Scrollen */
@media (min-width: 760px) {
  #listpane { left: 10px; right: 10px; width: auto; bottom: 10px; max-height: none; }
  #listpane #list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); align-content: start; }
  #listpane #list > :not(.item) { grid-column: 1 / -1; }
  #listpane .item { border-right: 1px solid var(--line); }
  #listpane .isnip { -webkit-line-clamp: 1; line-clamp: 1; }
}
/* Bildschirmaufnahme: Auswahl Video / Bildschirmfoto */
.scr-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.scr-mode { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--panel2); color: inherit; cursor: pointer; text-align: left; }
.scr-mode span { display: flex; flex-direction: column; gap: 2px; }
.scr-mode small { color: var(--muted); }
.scr-mode.on { border-color: var(--accent); background: var(--sel); }
.scr-mode.on svg { color: var(--accent); }
@media (max-width: 520px) { .scr-modes { grid-template-columns: 1fr; } }

/* 1.13.0: Synchronisation */
#syncBtn[data-state=busy] { color: var(--accent); animation: syncpulse 1.2s ease-in-out infinite; }
@keyframes syncpulse { 50% { opacity: .35; } }
.synccode { font: 600 1.08em/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; padding: 12px 14px; margin: 10px 0; border: 1px dashed var(--accent); border-radius: 10px; background: var(--panel2); text-align: center; word-break: break-all; user-select: all; }
.codeinp { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .03em; width: 100%; }
.meter { height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; margin: 6px 0 2px; }
.meter span { display: block; height: 100%; background: var(--accent); }
.hint.warn { color: var(--warn); }

/* 1.14.0 */
.scr-audio { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 12px; }
.scr-audio .chk { margin: 0; }

/* Sync per QR-Code */
.qrbox { margin: 8px auto 4px; text-align: center; }
.qrbox svg { display: block; margin: 0 auto; border-radius: 10px; width: 200px; height: 200px; max-width: 70vw; max-height: 70vw; }
.qrbox figcaption { margin-top: 8px; }
.qrframe { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 1; max-height: 60vh; margin: 0 auto; }
.qrframe video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qrframe::after { content: ''; position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); pointer-events: none; }

/* Kopfzeile: nichts darf rechts hinausgeschoben werden */
#top > :not(.search) { flex-shrink: 0; }
#top .search { min-width: 36px; }
#installBtn { display: inline-flex; align-items: center; gap: 5px; }
#installBtn[hidden] { display: none; }
@media (max-width: 640px) { #installBtn .lbl { display: none; } #installBtn { padding-left: 8px; padding-right: 8px; } }
.qrtools { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.dictpill.done { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.dictpill.done .rec-dot { display: none; }
