/* GPTGenie: Heft-Editor (js/notes/notes.js). Aufbau wie eine Notiz-App: feste Leiste oben (Heft, Rückgängig,
 * Seiten), Werkzeuge (PC/Tablet in der Leiste, Handy unten), darunter eine Zeile mit den Einstellungen des
 * Werkzeugs. Ruhige, matte Flächen statt Glas, Seiten wie Papier auf einem Schreibtisch.
 * Heller Modus: Farben (Variablen) in light.css. */

.gn {
  --gn-desk: #19191b;
  --gn-bar: #242426;
  --gn-strip: #1f1f21;
  --gn-pop: #2b2b2e;
  --gn-ink: #ededef;
  --gn-ink2: rgba(237,237,239,0.64);
  --gn-ink3: rgba(237,237,239,0.4);
  --gn-line: rgba(255,255,255,0.08);
  --gn-line2: rgba(255,255,255,0.14);
  --gn-hover: rgba(255,255,255,0.065);
  --gn-press: rgba(255,255,255,0.11);
  --gn-field: rgba(255,255,255,0.06);
  --gn-chip-bg: #1c1c1f;
  --gn-chip-ink: #f2f2f4;
  --gn-acc: rgb(var(--a-a855f7,168,85,247));
  --gn-acc-soft: rgba(var(--a-a855f7,168,85,247),0.16);
  --gn-shadow: 0 12px 32px -12px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.28);
  --gn-bar-h: 52px;
  --gn-strip-h: 48px;
  --gn-top: 100px;
  --gn-tabs-h: 0px;   /* Höhe der Tab-Zeile (nur mit .gn-tabbed) */
  --gn-st: calc(env(safe-area-inset-top, 0px) + var(--gn-tabs-h));   /* oberer Rand der Leisten */
  --gn-bot: 0px;
  position: fixed; inset: 0; z-index: 9400; background: var(--gn-desk); color: var(--gn-ink);
  font-family: inherit; font-size: 14px; line-height: 1.4; text-align: left; -webkit-user-select: none; user-select: none; overscroll-behavior: none;
  opacity: 0; transition: opacity .2s ease;
}
.gn.on { opacity: 1; }
.gn[hidden], .gn [hidden] { display: none !important; }
html.gn-open, html.gn-open body { overflow: hidden !important; }
html.gn-open #gga-side { display: none !important; }
.gn button { font-family: inherit; color: inherit; -webkit-tap-highlight-color: transparent; line-height: 1.2; }
.gn-i { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── Arbeitsfläche ─────────────────────────────────────────────────────── */
.gn-view { position: absolute; inset: 0; overflow: hidden; touch-action: none; outline: none; cursor: crosshair; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.gn[data-tool="hand"] .gn-view { cursor: grab; }
.gn[data-tool="lasso"] .gn-view { cursor: default; }
.gn[data-tool="text"] .gn-view { cursor: text; }
.gn-stack { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.gn-pg {
  position: absolute; left: 0; top: 0; background: #fff; border-radius: 2px; overflow: hidden;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.3), 0 10px 26px -10px rgba(0,0,0,0.55);
  will-change: transform;
}
.gn-pg canvas { position: absolute; display: block; }
.gn-live, .gn-selcv { position: absolute; left: 0; top: 0; pointer-events: none; }
.gn-live { width: 100%; height: 100%; }
.gn-selcv { transform-origin: 0 0; will-change: transform; }
.gn-selbox {
  position: absolute; left: 0; top: 0; border: 1.5px dashed var(--gn-acc); border-radius: 6px;
  background: rgba(var(--a-a855f7,168,85,247),0.045); pointer-events: none;
}
.gn-handle {
  position: absolute; width: 20px; height: 20px; border-radius: 50%; box-sizing: border-box;
  background: #fff; border: 2px solid var(--gn-acc); box-shadow: 0 1px 4px rgba(0,0,0,.35); pointer-events: auto; cursor: nwse-resize; touch-action: none;
}
/* größere Fläche zum Greifen (Finger), unsichtbar */
.gn-handle::before { content: ''; position: absolute; inset: -12px; }
.gn-handle[data-h="nw"] { left: -10px; top: -10px; }
.gn-handle[data-h="ne"] { right: -10px; top: -10px; cursor: nesw-resize; }
.gn-handle[data-h="sw"] { left: -10px; bottom: -10px; cursor: nesw-resize; }
.gn-handle[data-h="se"] { right: -10px; bottom: -10px; }
/* Seiten-Griffe (nur bei Bildern): längliche Griffe in der Mitte jeder Seite, Bild strecken oder stauchen */
.gn-h-e { display: none; border-radius: 6px; }
.gn-selbox.gn-sel-stretch .gn-h-e { display: block; }
.gn-handle[data-h="n"], .gn-handle[data-h="s"] { width: 28px; height: 12px; left: calc(50% - 14px); cursor: ns-resize; }
.gn-handle[data-h="n"] { top: -6px; } .gn-handle[data-h="s"] { bottom: -6px; }
.gn-handle[data-h="w"], .gn-handle[data-h="e"] { width: 12px; height: 28px; top: calc(50% - 14px); cursor: ew-resize; }
.gn-handle[data-h="w"] { left: -6px; } .gn-handle[data-h="e"] { right: -6px; }
.gn.gn-has-anchors .gn-handle { display: none; }
/* gesperrtes Bild: grauer Rahmen mit Schloss, nicht verschieb- oder vergrößerbar */
.gn-selbox.gn-locked { border-style: solid; border-color: rgba(142,142,147,.9); background: rgba(142,142,147,.08); }
.gn-selbox.gn-locked .gn-handle { display: none; }
.gn-selbox.gn-locked::after {
  content: ""; position: absolute; right: -10px; top: -10px; width: 22px; height: 22px; border-radius: 50%;
  background: #8e8e93 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='6' y='11' width='12' height='9' rx='2'/%3E%3Cpath d='M9 11V8a3 3 0 0 1 6 0v3'/%3E%3C/svg%3E") center / 14px no-repeat;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
/* Ankerpunkte einer Form */
.gn-anch { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 2; }
.gn-anchor {
  position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%; pointer-events: auto; touch-action: none; cursor: move;
  background: #fff; border: 2.5px solid var(--gn-acc); box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.gn-anchor::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; }
/* Auswahl-Menü: dunkler Streifen wie das Bearbeiten-Menü im System, in beiden Modi */
.gn-selbar {
  position: absolute; left: 0; top: 0; display: flex; padding: 3px; border-radius: 12px; z-index: 3;
  background: var(--gn-chip-bg); color: var(--gn-chip-ink); box-shadow: 0 8px 24px -8px rgba(0,0,0,.55), 0 0 0 0.5px rgba(255,255,255,.08);
}
.gn-selbar button {
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 60px; padding: 6px 8px 5px; border: 0; border-radius: 9px;
  background: transparent; font-size: 11px; font-weight: 600; cursor: pointer; color: inherit;
}
.gn-selbar button + button { box-shadow: -0.5px 0 0 rgba(255,255,255,.12); border-radius: 0; }
.gn-selbar button:first-child { border-radius: 9px 0 0 9px; }
.gn-selbar button:last-child { border-radius: 0 9px 9px 0; }
.gn-selbar button .gn-i { width: 18px; height: 18px; }
.gn-selbar button:hover { background: rgba(255,255,255,.08); }
/* Handy: viele Knöpfe (z. B. Bild mit „Herunterladen“) passen nicht in eine Reihe → zwei Reihen à 4 statt über den Rand */
@media (max-width: 480px) {
  .gn-selbar:not(:has(.gn-selbar-tbl)):has(> button:nth-of-type(7)) { flex-wrap: wrap; width: min(330px, calc(100vw - 16px)); row-gap: 2px; }
  .gn-selbar:not(:has(.gn-selbar-tbl)):has(> button:nth-of-type(7)) > button { flex: 1 0 24%; min-width: 0; border-radius: 9px; box-shadow: none; }
}
.gn-danger { color: #ff5a52 !important; }

/* ── Leiste oben ───────────────────────────────────────────────────────── */
.gn-bar {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0; height: calc(var(--gn-bar-h) + var(--gn-st));
  padding: var(--gn-st) max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--gn-bar); box-shadow: 0 0.5px 0 var(--gn-line);
}
.gn-bar-l, .gn-bar-r { display: flex; align-items: center; gap: 2px; min-width: 0; }
.gn-bar-l { flex: 0 1 auto; }
.gn-bar-r { flex: 0 0 auto; }
.gn-ib {
  width: 40px; height: 40px; flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; transition: background .12s ease;
}
.gn-ib:hover { background: var(--gn-hover); }
.gn-ib:active { background: var(--gn-press); }
.gn-ib:disabled { opacity: .3; cursor: default; background: transparent; }
.gn-ib:focus-visible, .gn-tool:focus-visible, .gn-penb:focus-visible, .gn-strip button:focus-visible { outline: 2px solid var(--gn-acc); outline-offset: 1px; }
.gn-ib-s { width: 30px; height: 30px; flex-basis: 30px; border-radius: 8px; }
.gn-ib-s .gn-i { width: 18px; height: 18px; }
.gn-sep { width: 1px; height: 22px; background: var(--gn-line2); margin: 0 6px; }
.gn-title {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; max-width: 260px; height: 40px; padding: 0 10px 0 4px;
  border: 0; background: transparent; cursor: pointer; text-align: left; border-radius: 10px;
}
.gn-title:hover { background: var(--gn-hover); }
.gn-title-t { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.gn-title-s { display: flex; gap: 5px; max-width: 100%; overflow: hidden; font-size: 11.5px; color: var(--gn-ink3); white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.3; }
.gn-title-s.gn-nostat .gn-dot { display: none; }
#gn-status[data-state="saving"], #gn-status[data-state="dirty"] { color: var(--gn-ink2); }
#gn-status[data-state="error"] { color: #ff5a52; }

/* ── Werkzeuge ─────────────────────────────────────────────────────────── */
.gn-tools {
  position: absolute; z-index: 6; top: var(--gn-st); left: 50%; transform: translateX(-50%);
  height: var(--gn-bar-h); display: flex; align-items: center; gap: 2px;
}
.gn-tool {
  position: relative; width: 40px; height: 40px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--gn-ink2); cursor: pointer; transition: background .12s ease, color .12s ease;
}
.gn-tool:hover { background: var(--gn-hover); color: var(--gn-ink); }
.gn-tool.on { background: var(--gn-press); color: var(--gn-acc); }
.gn-tool-dot { position: absolute; right: 6px; bottom: 6px; width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--gn-bar); }
.gn-tool:not(.on) .gn-tool-dot { opacity: .7; }

/* ── Zeile mit den Einstellungen des Werkzeugs ─────────────────────────── */
.gn-strip {
  position: absolute; z-index: 4; left: 0; right: 0; top: calc(var(--gn-bar-h) + var(--gn-st)); height: var(--gn-strip-h);
  background: var(--gn-strip); box-shadow: 0 0.5px 0 var(--gn-line), 0 6px 14px -12px rgba(0,0,0,.6);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain;
}
.gn-strip::-webkit-scrollbar { display: none; }
/* Hand (nur ansehen): Hinweis blendet nach ein paar Sekunden aus (notes.js renderStrip) */
.gn-strip.gn-strip-gone { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .35s ease, visibility 0s .35s; }
.gn-strip-in { display: flex; align-items: center; gap: 4px; width: max-content; min-width: 100%; height: 100%; padding: 0 14px; justify-content: center; box-sizing: border-box; }
.gn-sec { display: flex; align-items: center; gap: 2px; height: 100%; }
.gn-ssep { flex: 0 0 1px; height: 22px; margin: 0 8px; background: var(--gn-line2); }
.gn-slabel, .gn-shint { font-size: 13px; color: var(--gn-ink2); white-space: nowrap; margin-right: 4px; }
.gn-shint { margin-right: 10px; }
/* Federmäppchen: Stifte stehen im Fach, der gewählte ist herausgezogen */
.gn-case { gap: 0; overflow: hidden; }
.gn-penb {
  position: relative; flex: 0 0 auto; width: 30px; height: 100%; border: 0; background: transparent; cursor: pointer; padding: 0;
  display: flex; align-items: flex-start; justify-content: center; overflow: hidden;
}
.gn-penb svg { width: 24px; height: 58px; margin-top: 2px; transform: translateY(16px); transition: transform .2s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.35)); }
.gn-penb:hover svg { transform: translateY(11px); }
.gn-penb.on svg { transform: translateY(3px); }
.gn-penb > i { width: 16px; height: 16px; margin-top: 16px; border-radius: 50%; }
.gn-penb-style { position: absolute; left: 50%; bottom: 2px; width: 22px; height: 12px; margin-left: -11px; border-radius: 4px; background: var(--gn-strip); display: flex; align-items: center; justify-content: center; }
.gn-penb-style .gn-i { width: 16px; height: 12px; stroke-width: 2.2; }
.gn-penadd {
  flex: 0 0 auto; width: 28px; height: 28px; margin: 0 2px 0 6px; border-radius: 50%; border: 1.5px dashed var(--gn-ink3);
  background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--gn-ink2); padding: 0;
}
.gn-penadd:hover { border-color: var(--gn-ink2); color: var(--gn-ink); }
.gn-penadd .gn-i { width: 15px; height: 15px; }
/* Stärke */
.gn-size { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; color: var(--gn-ink2); }
.gn-size i { display: block; border-radius: 99px; background: currentColor; }
.gn-size:hover { background: var(--gn-hover); color: var(--gn-ink); }
.gn-size.on { background: var(--gn-press); color: var(--gn-ink); box-shadow: inset 0 0 0 1.5px var(--gn-line2); }
/* Farben */
.gn-colors { gap: 6px; padding: 0 2px; }
.gn-colors .gn-swb { width: 24px; height: 24px; flex: 0 0 24px; }
.gn-swb {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; background: var(--c); padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.gn-swb.on { box-shadow: 0 0 0 2px var(--gn-strip), 0 0 0 3.5px var(--gn-ink); }
.gn-pop .gn-swb.on { box-shadow: 0 0 0 2px var(--gn-pop), 0 0 0 3.5px var(--gn-ink); }
.gn-swc { background: conic-gradient(#ff5252, #ffd740, #69f0ae, #40c4ff, #7c4dff, #ff4081, #ff5252); overflow: hidden; display: block; }   /* accent-keep */
.gn-swc.on { background: var(--c); }
.gn-swc input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
/* Knöpfe, Schalter, Umschalter in der Zeile */
.gn-sbtn { height: 32px; min-width: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; color: var(--gn-ink2); white-space: nowrap; font-size: 13px; font-weight: 600; flex: 0 0 auto; }
.gn-sbtn:hover { background: var(--gn-hover); color: var(--gn-ink); }
.gn-sbtn .gn-i { width: 19px; height: 19px; }
.gn-sbtn-t { padding: 0 10px 0 8px; }
.gn-seg { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--gn-field); box-shadow: inset 0 0 0 0.5px var(--gn-line); }
.gn-seg button { flex: 1; min-height: 30px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0 12px; white-space: nowrap; color: var(--gn-ink2); }
.gn-seg button:hover { color: var(--gn-ink); }
.gn-seg button.on { background: var(--gn-pop); color: var(--gn-ink); box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 0 0 0.5px var(--gn-line2); }
.gn-sec-seg { flex: 0 0 auto; }
.gn-chip { height: 30px; display: inline-flex; align-items: center; gap: 5px; padding: 0 11px 0 8px; margin: 0 2px; border-radius: 15px; border: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--gn-line2); font-size: 12.5px; font-weight: 600; color: var(--gn-ink2); cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
.gn-chip:hover { color: var(--gn-ink); }
.gn-chk { width: 15px; height: 15px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--gn-ink3); display: inline-flex; align-items: center; justify-content: center; }
.gn-chk .gn-i { width: 11px; height: 11px; stroke-width: 3; opacity: 0; }
.gn-chip.on { background: var(--gn-acc-soft); box-shadow: inset 0 0 0 1px rgba(var(--a-a855f7,168,85,247),0.45); color: var(--gn-ink); }
.gn-chip.on .gn-chk { background: var(--gn-acc); box-shadow: none; color: #fff; }
.gn-chip.on .gn-chk .gn-i { opacity: 1; }
.gn-styles, .gn-shapes-row { gap: 2px; }
.gn-styleb, .gn-shapeb { height: 34px; min-width: 34px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; color: var(--gn-ink2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.gn-styleb:hover, .gn-shapeb:hover { background: var(--gn-hover); color: var(--gn-ink); }
.gn-styleb.on, .gn-shapeb.on { background: var(--gn-press); color: var(--gn-acc); box-shadow: inset 0 0 0 1.5px var(--gn-line2); }
.gn-shapeb span { display: none; }
.gn-styleb .gn-i, .gn-shapeb .gn-i { width: 20px; height: 20px; }
.gn-srange { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gn-ink2); white-space: nowrap; }
.gn-srange input { width: 120px; accent-color: var(--gn-acc); }
.gn-srange b { min-width: 34px; font-variant-numeric: tabular-nums; color: var(--gn-ink); font-weight: 600; }

/* Zoom unten rechts (antippen = 100 %), Seitenzahl unten links (erscheint beim Scrollen), wie GoodNotes */
.gn-zoom, .gn-pageno {
  position: absolute; z-index: 4; bottom: calc(var(--gn-bot) + 12px);
  height: 30px; padding: 0 12px; border-radius: 15px; border: 0; background: var(--gn-chip-bg); color: var(--gn-chip-ink);
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: var(--gn-shadow);
  display: inline-flex; align-items: center; white-space: nowrap;
}
.gn-zoom { right: max(12px, env(safe-area-inset-right, 0px)); cursor: pointer; }
/* Zoom erscheint wie die Seitenzahl nur kurz (beim Zoomen, gezoomt auch beim Scrollen) und blendet dann aus */
.gn-zoom { pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease; }
.gn-zoom.on { opacity: 1; transform: none; pointer-events: auto; transition-duration: .12s; }
.gn-pageno { left: max(12px, env(safe-area-inset-left, 0px)); pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease; }
.gn-pageno.on { opacity: 1; transform: none; transition-duration: .12s; }
@media (min-width: 700px) { .gn.gn-panel-on .gn-pageno { left: calc(min(300px, calc(100vw - 20px)) + 22px); } }
/* Am Ende weiterziehen = neue Seite (notes.js pullSet): Kreis mit Plus unten, Ring füllt sich mit --k (0…1),
   voll = Akzentfarbe und kurzes Aufploppen, darunter „Neue Seite“ / „Loslassen: neue Seite“ */
.gn-pull {
  position: absolute; z-index: 4; left: 50%; bottom: calc(var(--gn-bot) + 14px); pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 7px; opacity: 0;
  transform: translate(-50%, calc((1 - var(--k, 0)) * 26px)) scale(calc(.72 + .28 * var(--k, 0)));
  transition: opacity .15s ease;
}
.gn-pull.on { opacity: 1; }
.gn-pull-c { position: relative; width: 52px; height: 52px; border-radius: 50%; box-shadow: var(--gn-shadow); transition: transform .22s cubic-bezier(.3,1.6,.5,1); }
.gn-pull-c svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gn-pull-bg { fill: var(--gn-chip-bg); stroke: var(--gn-line2, rgba(127,127,140,.35)); stroke-width: 2.5; transition: fill .18s ease; }
.gn-pull-ring { fill: none; stroke: var(--gn-acc); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--k, 0) * 100);
  transform: rotate(-90deg); transform-origin: 50% 50%; }
.gn-pull-plus { inset: 13px !important; width: 26px !important; height: 26px !important; fill: none; stroke: var(--gn-ink2); stroke-width: 2.4; stroke-linecap: round; transition: stroke .18s ease, transform .22s ease; }
.gn-pull.full .gn-pull-c { transform: scale(1.12); }
.gn-pull.full .gn-pull-bg { fill: var(--gn-acc); stroke: var(--gn-acc); }
.gn-pull.full .gn-pull-plus { stroke: #fff; transform: rotate(90deg); }
.gn-pull-t { height: 26px; padding: 0 11px; border-radius: 13px; display: inline-flex; align-items: center; white-space: nowrap;
  font-size: 12.5px; font-weight: 700; background: var(--gn-chip-bg); color: var(--gn-chip-ink); box-shadow: var(--gn-shadow); }
.gn-pull.full .gn-pull-t { color: var(--gn-acc); }
html.gg-perf .gn-pull, html.gg-perf .gn-pull-c, html.gg-perf .gn-pull-bg, html.gg-perf .gn-pull-plus { transition: none; }
@media (prefers-reduced-motion: reduce) { .gn-pull-c, .gn-pull-plus { transition: none; } }
/* Text in deiner Handschrift / Weiterschreiben (notes.js writeSheet): Textfeld wie auf „Schreiben“, darunter dieselbe
   Leiste (Leeren, Fett, Textmarker, Tabelle, Formel: dialogs.js ggFmtTools), Zeichen/Wörter und fehlende Buchstaben */
.gn-sheet.gn-sheet-hw { width: min(640px, 100%); }
.gn-hw-ta {
  display: block; width: 100%; box-sizing: border-box; min-height: 190px; max-height: 45vh; resize: vertical;
  border: 0; border-radius: 18px; background: var(--gn-field); color: var(--gn-ink); outline: none;
  font: inherit; font-size: 16.5px; line-height: 1.55; padding: 16px 18px; box-shadow: inset 0 0 0 1px var(--gn-line2);
  transition: box-shadow .15s ease;
}
.gn-hw-ta::placeholder { color: var(--gn-ink3); }
.gn-hw-ta:focus { box-shadow: inset 0 0 0 2px var(--gn-acc); }
.gn-hw-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 9px 2px 0; }
/* Leeren, Fett, Textmarker, Tabelle, Formel: dieselben Knöpfe und Stile wie auf „Schreiben“ (app-shell.css, ios.css) */
.gn-hw-bar .text-tools { flex: 0 1 auto; }
/* Knopffarbe wie unter dem Textfeld auf „Schreiben“ (dort eine Stufe heller als die Karte) */
.gn-hw-bar { --ios-inner: rgb(58,58,60); } /* accent-keep */
@media (max-width: 440px) { .gn-hw-bar [data-clear] span { display: none; } .gn-hw-bar [data-clear] { padding: 0 9px; } }
.gn-hw-n { margin-left: auto; font-size: 12.5px; color: var(--gn-ink3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gn-hw-miss { margin: 10px 2px 0; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4; font-weight: 600;
  color: #ffc061; background: rgba(255,176,32,.14); } /* accent-keep */
.gn-hw-hint { margin: 10px 4px 0; font-size: 12.5px; line-height: 1.45; color: var(--gn-ink3); }
.gn-hw-ok { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.gn-hw-ok .gn-i { width: 19px; height: 19px; stroke: currentColor; }
@media (max-width: 560px) {
  .gn-hw-ta { min-height: 150px; font-size: 16px; padding: 14px 15px; }
  .gn-hw-n { flex-basis: 100%; margin-left: 2px; }
}
html.gg-perf .gn-hw-ta { transition: none; }
/* Knöpfe oben links: Seitenvorschau und Nur lesen (an = getönt) */
#gn-pagesbtn.on, #gn-robtn.on { background: var(--gn-acc-soft, rgba(10,132,255,.16)); color: var(--gn-acc); }
#gn-pagesbtn.on .gn-i, #gn-robtn.on .gn-i { stroke: var(--gn-acc); }

/* ── kleine Fenster ────────────────────────────────────────────────────── */
.gn-pop {
  position: fixed; z-index: 20; width: min(300px, calc(100vw - 16px)); max-height: calc(100dvh - 24px); overflow: auto;
  padding: 12px; border-radius: 22px; background: var(--gn-pop); box-shadow: var(--gn-shadow), 0 0 0 0.5px var(--gn-line2);
  /* wie die Ausklapp-Menüs der Schreiben-Seite: wächst mit leichtem Nachfedern aus dem Knopf (Ursprung setzt notes.js) */
  opacity: 0; transform: scale(.6); transition: opacity .16s ease, transform .34s cubic-bezier(.2, 1.2, .35, 1); will-change: transform, opacity;
}
.gn-pop-wide { width: min(380px, calc(100vw - 16px)); }
.gn-pop.on { opacity: 1; transform: none; }
.gn-pop.out { opacity: 0; transform: scale(.8); transition: opacity .12s ease, transform .14s cubic-bezier(.4, 0, .6, .2); pointer-events: none; }
.gn-pop:has(> .gn-menu) { padding: 6px; border-radius: 20px; min-width: 230px; width: auto; max-width: calc(100vw - 16px); }
.gn-pop-h { font-size: 13px; font-weight: 700; color: var(--gn-ink2); margin: 0 4px 10px; }
.gn-row { display: flex; align-items: center; gap: 10px; margin: 10px 4px; font-size: 13.5px; }
.gn-row > span { width: 86px; flex: 0 0 86px; color: var(--gn-ink2); }
.gn-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--gn-acc); }
.gn-row b { width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; }
.gn-row-col { flex-direction: column; align-items: stretch; gap: 6px; }
.gn-row-col > span { width: auto; flex: none; }
.gn-row-col .gn-seg button { padding: 0 6px; font-size: 12.5px; }
.gn-seg-wrap { flex-wrap: wrap; margin-bottom: 4px; }
.gn-seg-wrap button { flex: 1 1 30%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 11.5px; }
.gn-styles-pop { flex-wrap: wrap; margin-bottom: 4px; }
.gn-styles-pop button { flex: 1 1 30%; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; font-size: 11px; }
.gn-styles-pop .gn-i { width: 22px; height: 18px; }
.gn-mini { display: block; height: 34px; overflow: hidden; }
.gn-mini svg { width: 15px; height: 38px; }
.gn-preview { width: 100%; height: 42px; margin: 2px 0 4px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,.2); }
.gn-sw { display: grid; grid-template-columns: repeat(7, 1fr); gap: 9px; margin: 10px 4px 6px; }
.gn-link { display: flex; align-items: center; gap: 9px; width: 100%; margin-top: 4px; padding: 9px 6px; border: 0; border-radius: 8px; background: transparent; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; }
.gn-link:hover { background: var(--gn-hover); }
.gn-link .gn-i { width: 18px; height: 18px; }
.gn-hint { margin: 8px 4px 2px; font-size: 12.5px; line-height: 1.45; color: var(--gn-ink3); }
.gn-check { display: flex; align-items: flex-start; gap: 10px; margin: 10px 4px 2px; font-size: 13.5px; line-height: 1.35; cursor: pointer; }
.gn-check input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--gn-acc); margin-top: 1px; }
.gn-tpl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gn-tpl button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 4px 2px; border: 0; border-radius: 10px; background: transparent; font-size: 11px; font-weight: 600; cursor: pointer; text-align: center; line-height: 1.15; }
.gn-tpl button:hover { background: var(--gn-hover); }
.gn-tpl img { width: 100%; aspect-ratio: 595/842; border-radius: 2px; box-shadow: 0 0 0 0.5px rgba(0,0,0,.35), 0 3px 8px -4px rgba(0,0,0,.5); background: #fff; }
.gn-menu { display: flex; flex-direction: column; margin: 0; }
.gn-menu button { display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 12px; border: 0; border-radius: 12px; background: transparent; font-size: 16px; text-align: left; cursor: pointer; transition: background-color .15s ease; }
.gn-menu button:hover { background: var(--gn-hover); }
.gn-menu button:active { background: var(--gn-press); transition: background-color 0s; }
.gn-menu .gn-i { width: 19px; height: 19px; opacity: .85; }
.gn-menu-sep { height: 0.5px; margin: 5px 10px; background: var(--gn-line2); }
.gn-xl-alt, .gn-lg-alt, .gn-md-alt { display: none !important; }

/* ── Seitenübersicht ───────────────────────────────────────────────────── */
.gn-panel {
  position: absolute; z-index: 6; top: calc(var(--gn-top) + 10px); left: max(10px, env(safe-area-inset-left, 0px)); bottom: 10px;
  width: min(300px, calc(100vw - 20px)); display: flex; flex-direction: column; border-radius: 14px;
  background: var(--gn-pop); box-shadow: var(--gn-shadow), 0 0 0 0.5px var(--gn-line2);
  animation: gn-in .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes gn-in { from { opacity: 0; transform: translateX(-12px); } }
.gn-panel[hidden] { display: none; }
.gn-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 6px 4px 16px; }
.gn-panel-head h2 { margin: 0; font-size: 16px; font-weight: 700; flex: 1 1 auto; }
.gn-panel-selb { height: 32px; padding: 0 12px; margin-right: 4px; border: 0; border-radius: 16px; background: var(--gn-hover); color: var(--gn-acc); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.gn-panel-selb.on { background: var(--gn-acc); color: #fff; }
.gn-thumb-pg { position: relative; }
.gn-thumb-check {
  position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.85); box-shadow: 0 0 0 1.5px rgba(0,0,0,.35);
}
.gn-thumb-check .gn-i { width: 15px; height: 15px; stroke: transparent; stroke-width: 3; }
.gn-thumb-picked .gn-thumb-check { background: var(--gn-acc); box-shadow: 0 0 0 2px #fff; }
.gn-thumb-picked .gn-thumb-check .gn-i { stroke: #fff; }
.gn-thumb-picked .gn-thumb-pg { box-shadow: 0 0 0 2.5px var(--gn-acc), 0 6px 14px -8px rgba(0,0,0,.6); }
.gn-psel .gn-thumb-add, .gn-psel .gn-thumb-row .gn-ib { display: none !important; }
.gn-panel-act { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-top: 0.5px solid var(--gn-line2); }
.gn-panel-act[hidden] { display: none; }
.gn-panel-act button { height: 36px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--gn-acc); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.gn-panel-act button:hover { background: var(--gn-hover); }
.gn-panel-act button:disabled { opacity: .35; cursor: default; background: transparent; }
.gn-panel-act button .gn-i { width: 20px; height: 20px; stroke: currentColor; }
.gn-panel-act .gn-danger { color: #ff453a; }
.gn-panel-actn { flex: 1 1 auto; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--gn-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn.gn-ro .gn-ro-hide { display: none !important; }
.gn-panel-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; padding: 6px 14px 16px; align-content: start; }
.gn-thumb { display: flex; flex-direction: column; gap: 4px; }
.gn-thumb-pg { padding: 0; border: 0; border-radius: 2px; overflow: hidden; cursor: pointer; background: #fff; box-shadow: 0 0 0 0.5px rgba(0,0,0,.4), 0 6px 14px -8px rgba(0,0,0,.6); }
.gn-thumb { min-width: 0; }
.gn-thumb-pg { width: 100%; aspect-ratio: 595 / 842; }
/* Vorschaubilder sind <canvas>: die Regel „canvas { touch-action: none }“ (main.css, fürs Zeichnen) hier aufheben,
   sonst lässt sich die Seitenvorschau mit dem Finger nicht scrollen */
.gn-thumb-pg canvas { display: block; width: 100%; height: 100%; touch-action: auto; cursor: pointer; }
.gn-thumb.on .gn-thumb-pg { box-shadow: 0 0 0 2.5px var(--gn-acc), 0 6px 14px -8px rgba(0,0,0,.6); }
.gn-thumb-row { display: flex; align-items: center; justify-content: space-between; padding-left: 4px; font-size: 12.5px; font-weight: 700; color: var(--gn-ink2); font-variant-numeric: tabular-nums; }
.gn-thumb-add {
  aspect-ratio: 595/842; border: 1.5px dashed var(--gn-line2); border-radius: 4px; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--gn-ink2); font-size: 13px; font-weight: 700;
}
.gn-thumb-add:hover { border-color: var(--gn-acc); color: var(--gn-acc); }

/* Hinweis kurz unten */
.gn-toast {
  position: absolute; z-index: 7; left: 50%; bottom: calc(var(--gn-bot) + 22px); transform: translate(-50%, 6px);
  max-width: calc(100vw - 32px); padding: 9px 15px; border-radius: 10px; background: var(--gn-chip-bg); color: var(--gn-chip-ink);
  font-size: 13.5px; font-weight: 600; text-align: center; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .22s ease;
  box-shadow: 0 8px 22px -8px rgba(0,0,0,.5);
}
.gn-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Fenster (Text, Hilfe, Einstellungen, Bestätigen) */
.gn-sheet-ov {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0,0,0,.42); opacity: 0; transition: opacity .18s ease;
}
.gn-sheet-ov.on { opacity: 1; }
.gn-sheet {
  width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; padding: 18px 20px 20px;
  border-radius: var(--ios-radius, 34px);
  background: var(--gn-pop); color: var(--gn-ink); box-shadow: var(--ios-shadow, var(--gn-shadow)); -webkit-user-select: text; user-select: text;
  transform: translateY(10px); transition: transform .24s cubic-bezier(.2,.8,.2,1);
}
/* Auf- und Zugehen wie alle Fenster der Schreiben-Seite (dialogs.js ggPopOpen / morph.js) */
.gn-sheet-ov.on .gn-sheet { transform: none; }
.gn-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.gn-sheet-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
/* runder Schließen-Knopf wie in den Fenstern der Schreiben-Seite */
.gn-sheet-head [data-x] { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: var(--gn-press); color: var(--gn-ink); transition: transform .2s cubic-bezier(.3,1.5,.5,1), background-color .15s; }
.gn-sheet-head [data-x] .gn-i { width: 17px; height: 17px; stroke-width: 2.4; opacity: .8; }
.gn-sheet-head [data-x]:active { transform: scale(.9); }
.gn-sheet-text { margin: 0 0 12px; color: var(--gn-ink2); font-size: 14.5px; line-height: 1.5; }
.gn-input { width: 100%; box-sizing: border-box; border: 0; box-shadow: inset 0 0 0 1px var(--gn-line2); border-radius: 10px; background: var(--gn-field); color: var(--gn-ink); font: inherit; font-size: 16px; padding: 12px 14px; outline: none; }
.gn-input:focus { box-shadow: inset 0 0 0 1.5px var(--gn-acc), 0 0 0 3px var(--gn-acc-soft); }
.gn-textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.gn-sheet-act { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.gn-btn { min-height: 44px; border: 0; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; padding: 0 18px; transition: transform .15s ease, filter .15s ease; }
.gn-btn:active:not(:disabled) { transform: scale(.97); }
/* in Fenstern: Hauptknopf als volle Pille wie auf der Schreiben-Seite */
.gn-sheet .gn-btn { min-height: 50px; border-radius: 999px; font-size: 16px; }
.gn-sheet .gn-btn-primary { box-shadow: 0 8px 22px -10px var(--gn-acc); }
.gn-btn-block { width: 100%; }
.gn-btn-primary { background: var(--gn-acc); color: #fff; }
.gn-btn-danger { background: #e5483e; color: #fff; }
.gn-btn:disabled { opacity: .6; }
.gn-help p { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding: 10px 2px; border-bottom: 1px solid var(--gn-line); font-size: 14px; color: var(--gn-ink2); }
.gn-help p b { color: var(--gn-ink); font-weight: 700; }
.gn-help p span { text-align: right; }
.gn-set { display: flex; flex-direction: column; }
.gn-set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 2px; border-bottom: 1px solid var(--gn-line); cursor: pointer; }
.gn-set-row:last-child { border-bottom: 0; }
.gn-set-row b { display: block; font-size: 14.5px; font-weight: 650; }
.gn-set-row small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.4; color: var(--gn-ink3); }
.gn-set-r { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.gn-set-r input { width: 120px; accent-color: var(--gn-acc); }
.gn-set-r b { min-width: 52px; font-size: 13px; font-weight: 600; color: var(--gn-ink2); }
.gn-switch { position: relative; flex: 0 0 44px; width: 44px; height: 26px; }
.gn-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.gn-switch i { position: absolute; inset: 0; border-radius: 13px; background: var(--gn-line2); transition: background .15s ease; pointer-events: none; }
.gn-switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.gn-switch input:checked + i { background: var(--gn-acc); }
.gn-switch input:checked + i::after { transform: translateX(18px); }
.gn-switch input:focus-visible + i { outline: 2px solid var(--gn-acc); outline-offset: 2px; }

/* ── Breiten ───────────────────────────────────────────────────────────── */
@media (min-width: 1300px) { .gn-shapeb span { display: inline; } }
@media (max-width: 1239px) { .gn-lg { display: none !important; } .gn-lg-alt { display: flex !important; } }
@media (max-width: 1039px) {
  .gn-md { display: none !important; } .gn-md-alt { display: flex !important; }
  .gn-xl { display: none !important; } .gn-xl-alt { display: flex !important; }
  .gn-title { max-width: 150px; }
}
@media (max-width: 899px) and (min-width: 700px) { .gn-title { max-width: 104px; } .gn-tool { width: 37px; } }
@media (min-width: 700px) and (max-width: 1039px) { .gn-title-s { display: none; } }

/* Handy: Werkzeuge unten, Einstellungszeile darüber */
@media (max-width: 699px) {
  .gn { --gn-bar-h: 50px; --gn-strip-h: 46px; }
  .gn-title { max-width: none; flex: 1 1 auto; }
  .gn-bar-l { flex: 1 1 auto; }
  .gn-tools {
    top: auto; bottom: 0; left: 0; right: 0; transform: none; height: calc(54px + env(safe-area-inset-bottom, 0px));
    padding: 0 6px env(safe-area-inset-bottom, 0px); background: var(--gn-bar); box-shadow: 0 -0.5px 0 var(--gn-line);
    justify-content: space-between; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .gn-tools::-webkit-scrollbar { display: none; }
  .gn-tool { flex: 1 1 0; width: auto; min-width: 34px; max-width: 54px; height: 44px; }
  .gn-strip { top: auto; bottom: calc(54px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -0.5px 0 var(--gn-line), 0 -6px 14px -12px rgba(0,0,0,.6); }
  .gn-strip-in { justify-content: flex-start; padding: 0 10px; }
  .gn-ssep { margin: 0 5px; }
  .gn-panel { left: 8px; right: 8px; width: auto; top: auto; height: min(62vh, 560px); bottom: calc(var(--gn-bot) + 8px); }
  .gn-selbar button { min-width: 50px; font-size: 10px; padding: 6px 5px 5px; }
  .gn-shint { white-space: normal; font-size: 12px; line-height: 1.3; max-width: 200px; }
  .gn-set-slide { flex-direction: column; align-items: stretch; gap: 10px; }
  .gn-set-slide .gn-set-r input { flex: 1; width: auto; }
}
@media (max-width: 380px) { .gn-ib { width: 36px; height: 36px; flex-basis: 36px; } }
@media (prefers-reduced-motion: reduce) { .gn, .gn-sheet, .gn-penb svg, .gn-switch i::after { transition: none; } .gn-panel { animation: none; }
  .gn-pop, .gn-pop.out { transform: none; transition: opacity .15s ease; } }

/* ── Lineal ────────────────────────────────────────────────────────────── */
.gn-ruler {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; z-index: 2;
  border-radius: 5px; background: rgba(var(--a-fafafc,250,250,252),0.62); border: 1px solid rgba(0,0,0,0.22);
  box-shadow: 0 8px 22px -10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.7);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  background-image:
    repeating-linear-gradient(90deg, rgba(20,20,30,.75) 0 1px, transparent 1px calc(var(--mm) * 10)),
    repeating-linear-gradient(90deg, rgba(20,20,30,.55) 0 1px, transparent 1px calc(var(--mm) * 5)),
    repeating-linear-gradient(90deg, rgba(20,20,30,.4) 0 1px, transparent 1px var(--mm));
  background-size: 100% 16px, 100% 11px, 100% 7px;
  background-repeat: no-repeat;
  background-position: 0 0, 0 0, 0 0;
}
html.gg-perf .gn-ruler { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: rgba(var(--a-fafafc,250,250,252),0.86); }
.gn-ruler-nums { position: absolute; left: 0; top: 17px; right: 0; height: 14px; }
.gn-ruler-nums span { position: absolute; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: rgba(20,20,30,.75); font-variant-numeric: tabular-nums; }
.gn-ruler-nums span:first-child { transform: none; }
.gn-ruler-deg {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); padding: 1px 8px; border-radius: 6px;
  background: rgba(20,20,30,.8); color: #fff; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
}

/* Suche im Heft */

/* Papier-Auswahl: Reiter, Hochladen */
.gn-tabs { margin-bottom: 10px; }
.gn-tpl-up {
  border: 1.5px dashed var(--gn-line2) !important; border-radius: 4px !important; aspect-ratio: 595/842; justify-content: center; margin: 4px 2px; padding: 4px !important; font-size: 10.5px !important;
  color: var(--gn-ink2);
}
.gn-tpl-up:hover { border-color: var(--gn-acc) !important; color: var(--gn-acc); }
.gn-tpl-up .gn-i { width: 22px; height: 22px; }
.gn-tpl img[loading] { object-fit: cover; }
.gn-span { grid-column: 1 / -1; }

/* Seite hinzufügen / Papier ändern */
.gn-sheet.gn-sheet-wide { width: min(640px, 100%); }
.gn-ps-tabs { margin-bottom: 14px; }
.gn-ps-body { min-height: 120px; }
.gn-ps-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 12px; }
.gn-ps-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--gn-ink2); text-align: center; line-height: 1.2; }
.gn-ps-img {
  position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 595/842; border-radius: 3px; overflow: hidden; background: #fff;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,.35), 0 4px 10px -5px rgba(0,0,0,.5); transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .15s ease;
}
.gn-ps-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gn-ps-tile:hover .gn-ps-img { transform: translateY(-2px); }
.gn-ps-tile.on .gn-ps-img { box-shadow: 0 0 0 2.5px var(--gn-acc), 0 6px 14px -6px rgba(0,0,0,.5); }
.gn-ps-tile.on .gn-ps-name { color: var(--gn-ink); }
.gn-ps-tick { position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px; border-radius: 50%; background: var(--gn-acc); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.gn-ps-tick .gn-i { width: 14px; height: 14px; stroke-width: 3; }
.gn-ps-up .gn-ps-img { background: transparent; box-shadow: none; border: 1.5px dashed var(--gn-line2); color: var(--gn-ink2); }
.gn-ps-up:hover .gn-ps-img { border-color: var(--gn-acc); color: var(--gn-acc); }
.gn-ps-tone { display: flex; justify-content: center; gap: 6px; margin: 0 0 14px; transition: opacity .15s ease; }
.gn-ps-tone.gn-off { opacity: .35; pointer-events: none; }
.gn-ps-tone button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 8px; border: 0; border-radius: 16px; background: transparent; box-shadow: inset 0 0 0 1px var(--gn-line2); color: var(--gn-ink2); font-size: 13px; font-weight: 600; cursor: pointer; }
.gn-ps-tone button.on { box-shadow: inset 0 0 0 1.5px var(--gn-acc); color: var(--gn-ink); background: var(--gn-acc-soft); }
.gn-ps-tone i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.gn-tone-white { background: #ffffff; } .gn-tone-cream { background: #f7f2dc; } .gn-tone-dark { background: #303030; }   /* accent-keep */
.gn-ps-opts { margin-top: 14px; border-top: 1px solid var(--gn-line); }
.gn-ps-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 2px 0; font-size: 14px; font-weight: 600; color: var(--gn-ink2); }
.gn-ps-row .gn-seg { margin: 0; }
.gn-ps-all { cursor: pointer; padding-bottom: 2px; }
.gn-step { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 9px; background: var(--gn-field); box-shadow: inset 0 0 0 0.5px var(--gn-line); }
.gn-step button { width: 34px; height: 30px; border: 0; border-radius: 7px; background: transparent; font-size: 18px; font-weight: 600; cursor: pointer; color: var(--gn-ink); }
.gn-step button:hover { background: var(--gn-hover); }
.gn-step b { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; color: var(--gn-ink); }
.gn-btn-primary:disabled { opacity: .45; }
/* Wohin/Anzahl und Knopf „Seite hinzufügen“ / „Papier übernehmen“ schweben unten im Fenster (auch bei langen Vorlagen) */
.gn-ps-foot {
  position: sticky; bottom: -20px; z-index: 2; margin: 14px -20px -20px; padding: 0 20px 20px;
  background: var(--gn-pop); box-shadow: 0 -10px 12px -10px rgba(0,0,0,.35);
}
.gn-ps-foot .gn-ps-opts { margin-top: 0; border-top: 0; }
.gn-ps-foot .gn-sheet-act { margin-top: 14px; }
@media (max-width: 560px) {
  .gn-ps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
  .gn-ps-row { flex-wrap: wrap; }
  .gn-sheet { padding: 16px 16px 18px; border-radius: 28px; }
  .gn-ps-foot { bottom: -18px; margin: 12px -16px -18px; padding: 0 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
}

/* Seitenübersicht: Ziehen zum Umsortieren */
.gn-panel-head h2 .gn-panel-n { margin-left: 4px; font-size: 13px; font-weight: 700; color: var(--gn-ink3); font-variant-numeric: tabular-nums; }
.gn-thumb { position: relative; }
.gn-thumb-pg { -webkit-touch-callout: none; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .15s ease; }
.gn-thumb-pg:hover { transform: translateY(-2px); }
.gn-thumb-moving { opacity: .3; }
.gn-thumb-ghost { position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; padding: 0; border: 0; border-radius: 3px; overflow: hidden; background: #fff; box-shadow: 0 0 0 2px var(--gn-acc), 0 18px 40px -10px rgba(0,0,0,.6); }
.gn-thumb-ghost canvas { display: block; width: 100%; height: auto; }
.gn-drop-l::before, .gn-drop-r::before { content: ''; position: absolute; top: 0; bottom: 26px; width: 3px; border-radius: 2px; background: var(--gn-acc); box-shadow: 0 0 0 3px var(--gn-acc-soft); }
.gn-drop-l::before { left: -8px; }
.gn-drop-r::before { right: -8px; }

/* Seite hinzufügen: Häkchen nur an der gewählten Kachel, weiche Übergänge (Reiter, Farben), Drehen bei eigenen Bildern */
.gn-ps-tick { opacity: 0; transform: scale(.4); transition: opacity .18s ease, transform .28s cubic-bezier(.34,1.56,.64,1); }
.gn-ps-tile.on .gn-ps-tick { opacity: 1; transform: none; }
.gn-ps-img { transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease; }
.gn-ps-tile:active .gn-ps-img { transform: scale(.96); }
.gn-ps-img img { transition: opacity .16s ease; background: transparent; }
.gn-ps-tile[data-key^="own:"] .gn-ps-img img:not(.gn-ps-loaded) { opacity: 0; }
.gn-ps-rot {
  position: absolute; left: 5px; bottom: 5px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(30,30,32,.72); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.gn-ps-rot .gn-i { width: 15px; height: 15px; stroke-width: 2.4; }
.gn-ps-rot:hover { transform: scale(1.08); }
.gn-ps-rot.gn-spin { transform: rotate(90deg); }
.gn-ps-tone { transition: opacity .2s ease, max-height .28s cubic-bezier(.2,.8,.2,1), margin .28s ease; max-height: 48px; overflow: hidden; }
.gn-ps-tone.gn-tones-hide { opacity: 0; max-height: 0; margin: 0; pointer-events: none; }
.gn-ps-tabs button { transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
@keyframes gnPsIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes gnPsInR { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes gnPsInL { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
.gn-ps-body.gn-ps-in { animation: gnPsIn .26s cubic-bezier(.2,.8,.2,1) both; }
.gn-ps-body.gn-ps-in-r { animation: gnPsInR .3s cubic-bezier(.2,.8,.2,1) both; }
.gn-ps-body.gn-ps-in-l { animation: gnPsInL .3s cubic-bezier(.2,.8,.2,1) both; }
.gn-ps-body .gn-ps-tile { animation: gnPsIn .32s cubic-bezier(.2,.8,.2,1) both; }
.gn-ps-body .gn-ps-tile:nth-child(2) { animation-delay: .02s; } .gn-ps-body .gn-ps-tile:nth-child(3) { animation-delay: .04s; }
.gn-ps-body .gn-ps-tile:nth-child(4) { animation-delay: .06s; } .gn-ps-body .gn-ps-tile:nth-child(5) { animation-delay: .08s; }
.gn-ps-body .gn-ps-tile:nth-child(n+6) { animation-delay: .1s; }
html.gg-perf .gn-ps-body, html.gg-perf .gn-ps-body .gn-ps-tile { animation: none; }
@media (prefers-reduced-motion: reduce) { .gn-ps-body, .gn-ps-body .gn-ps-tile { animation: none !important; } }
/* neue Seite erscheint weich (scale statt transform, die Lage steht im transform) */
@keyframes gnPgIn { from { opacity: 0; scale: .94; } to { opacity: 1; scale: 1; } }
.gn-pg.gn-pg-new { animation: gnPgIn .38s cubic-bezier(.2,.8,.2,1) both; transform-origin: 50% 0; }
html.gg-perf .gn-pg.gn-pg-new { animation-duration: .01s; }
@media (prefers-reduced-motion: reduce) { .gn-pg.gn-pg-new { animation: none; } }

/* Textfeld mit Tastatur: liegt genau über der Stelle auf der Seite, kleine Leiste darüber */
.gn-tb { position: absolute; left: 0; top: 0; z-index: 6; transform-origin: 0 0; }
.gn-tb-ta {
  display: block; margin: -4px 0 0 -4px; padding: 3px 4px; border: 1.5px solid var(--gn-acc); border-radius: 6px; background: rgba(255,255,255,.5);
  resize: none; overflow: hidden; outline: none; box-shadow: 0 0 0 4px rgba(var(--a-a855f7,168,85,247),.14); -webkit-user-select: text; user-select: text; touch-action: manipulation;
}
.gn-tb-bar {
  position: absolute; left: -4px; bottom: calc(100% + 10px); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; white-space: nowrap;
  background: rgba(28,28,30,.94); color: #fff; box-shadow: 0 10px 28px -8px rgba(0,0,0,.55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transform: translateY(6px) scale(.97); transition: opacity .18s ease, transform .26s cubic-bezier(.2,.8,.2,1);
}
.gn-tb.on .gn-tb-bar { opacity: 1; transform: none; }
.gn-tb-bar button { height: 32px; min-width: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: 600 13px/1 -apple-system, system-ui, sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.gn-tb-bar button:hover { background: rgba(255,255,255,.12); }
.gn-tb-bar button small { font-size: 10px; margin-left: 1px; }
.gn-tb-bar .gn-tb-b { font-weight: 800; }
.gn-tb-bar .gn-tb-b.on { background: rgba(255,255,255,.2); }
.gn-tb-cols { display: inline-flex; gap: 4px; padding: 0 4px; }
.gn-tb-bar .gn-tb-c { min-width: 22px; width: 22px; height: 22px; padding: 0; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.gn-tb-bar .gn-tb-c.on { box-shadow: 0 0 0 2px rgba(28,28,30,.94), 0 0 0 4px #fff; }
.gn-tb-bar .gn-tb-del .gn-i { width: 17px; height: 17px; color: #ff6961; }
.gn-tb-bar .gn-tb-ok { background: var(--gn-acc); color: #fff; padding: 0 12px; }
.gn-tb-bar .gn-tb-ok:hover { background: var(--gn-acc); filter: brightness(1.08); }
.gn-tb-bar > * { flex: 0 0 auto; }
/* schmaler Bildschirm: Leiste bricht in zwei Zeilen um (alles bleibt sichtbar, auch „Fertig“) */
.gn-tb-bar { flex-wrap: wrap; row-gap: 2px; white-space: normal; width: max-content; }
.gn-tb-bar .gn-tb-it { font-style: italic; font-family: Georgia, serif; font-weight: 700; }
.gn-tb-bar .gn-tb-u { text-decoration: underline; text-underline-offset: 2px; }
.gn-tb-bar .gn-tb-it.on, .gn-tb-bar .gn-tb-u.on, .gn-tb-bar .gn-tb-bgb.on { background: rgba(255,255,255,.2); }
.gn-tb-bar .gn-tb-al .gn-i { width: 18px; height: 18px; }
.gn-tb-bar .gn-tb-f { min-width: 64px; font-weight: 500; }
.gn-tb-szi { width: 40px; height: 28px; box-sizing: border-box; padding: 0 2px; border: 1px solid rgba(255,255,255,.18); border-radius: 7px;
  background: rgba(255,255,255,.08); color: inherit; text-align: center; font: 600 13px/1 -apple-system, system-ui, sans-serif; outline: none; -webkit-user-select: text; user-select: text; }
.gn-tb-szi:focus { border-color: var(--gn-acc); background: rgba(255,255,255,.14); }
.gn-tb-bar .gn-tb-li .gn-i { width: 18px; height: 18px; }
.gn-tb-bar .gn-tb-li.on { background: rgba(255,255,255,.2); }
.gn-tb-sep { width: 1px; height: 20px; margin: 0 3px; background: rgba(255,255,255,.18); }
.gn-tb-bar .gn-tb-cc { position: relative; display: inline-block; overflow: hidden; cursor: pointer;
  background: conic-gradient(#f44336, #ffeb3b, #4caf50, #00bcd4, #3f51b5, #e91e63, #f44336); }   /* accent-keep */
.gn-tb-cc input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.gn-tb-bar .gn-tb-bgb span { display: block; width: 18px; height: 14px; border-radius: 3px; border: 1.5px dashed rgba(255,255,255,.55); }
.gn-tb-bar .gn-tb-bgb.on span { border-style: solid; border-color: transparent; }
/* Griffe: verschieben (links oben) und Breite ziehen (rechts) */
.gn-tb-move, .gn-tb-wd { position: absolute; z-index: 1; touch-action: none; cursor: move; }
.gn-tb-move { left: -18px; top: -16px; width: 22px; height: 22px; border-radius: 50%; background: var(--gn-acc);
  box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.gn-tb-move::before { content: ''; position: absolute; inset: 3px; background: center / contain no-repeat
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v18M3 12h18M9 6l3-3 3 3M9 18l3 3 3-3M6 9l-3 3 3 3M18 9l3 3-3 3'/%3E%3C/svg%3E"); }
.gn-tb-wd { top: 50%; right: -12px; width: 14px; height: 30px; margin-top: -19px; cursor: ew-resize; border-radius: 7px; background: var(--gn-acc); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.gn-tb-wd::before { content: ''; position: absolute; left: 4px; right: 4px; top: 9px; bottom: 9px; border-left: 1.5px solid #fff; border-right: 1.5px solid #fff; }
.gn-tb-move::after, .gn-tb-wd::after { content: ''; position: absolute; inset: -10px; }   /* größere Fläche für den Finger */
.gn-tb-move.on, .gn-tb-wd.on { filter: brightness(1.12); transform: scale(1.1); }
.gn-tb.gn-tb-below .gn-tb-move { top: auto; bottom: -14px; }
@media (max-width: 600px) { .gn-tb-bar { gap: 0; row-gap: 2px; } .gn-tb-bar button { min-width: 30px; padding: 0 6px; } .gn-tb-ok { margin-left: auto; } }
.gn-tb.gn-tb-below .gn-tb-bar { bottom: auto; top: calc(100% + 8px); }

/* Tabelle: Spalten / Zeilen / Kopfzeile (Zeile des Werkzeugs und Auswahl-Leiste) */
.gn-tblctl { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--gn-ink2); }
.gn-tblctl .gn-step b { min-width: 34px; font-size: 13px; }
.gn-tblctl .gn-step button { width: 30px; height: 28px; }
.gn-selbar-tbl { display: flex; align-items: center; padding: 0 8px 0 10px; margin-right: 4px; border-right: 1px solid rgba(255,255,255,.14); }
.gn-selbar .gn-tblctl { color: rgba(255,255,255,.75); }
.gn-selbar .gn-tblctl .gn-step { background: rgba(255,255,255,.1); box-shadow: none; }
.gn-selbar .gn-tblctl .gn-step button, .gn-selbar .gn-tblctl .gn-step b { color: #fff; }
.gn-selbar .gn-tblctl .gn-chip { color: #fff; }
@media (max-width: 600px) { .gn-selbar-tbl { padding: 0 6px; } .gn-selbar .gn-tblctl > span { display: none; } }
.gn-selbar .gn-tblctl .gn-chip { flex-direction: row; gap: 6px; height: 30px; padding: 0 10px; }
.gn-selbar .gn-tblctl .gn-step button { flex-direction: row; }
@media (max-width: 600px) {
  .gn-selbar:has(.gn-selbar-tbl) { flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 16px); }
  .gn-selbar .gn-selbar-tbl { flex: 1 0 100%; justify-content: center; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.14); margin: 0 0 2px; padding: 4px 0 6px; }
  .gn-selbar .gn-tblctl { gap: 6px; }
}
@media (max-width: 600px) { .gn-selbar .gn-tblctl .gn-step button { width: 28px; min-width: 28px; padding: 0; } .gn-selbar .gn-tblctl .gn-step b { min-width: 26px; } .gn-selbar .gn-tblctl .gn-chip { padding: 0 8px; } }
/* Tabelle: Zahl antippen = zurück auf „Auto“ (sieht aus wie die Zahl, mit feinem Unterstrich als Hinweis) */
.gn-tblctl .gn-step .gn-step-v { width: auto; min-width: 34px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: underline dotted; text-underline-offset: 3px; }

/* Nur lesen (Heft über der Heft-Grenze des Tarifs): keine Werkzeuge, Hinweis unten in der Mitte */
.gn-ro-pill { display: none; }
.gn.gn-ro .gn-ro-pill {
  position: absolute; z-index: 6; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); height: 40px; padding: 0 12px 0 12px;
  border: 0; border-radius: 20px; background: var(--gn-chip-bg); color: var(--gn-chip-ink); box-shadow: var(--gn-shadow);
  font: inherit; font-size: 13.5px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.gn-ro-pill .gn-i { width: 17px; height: 17px; flex: 0 0 auto; }
.gn-ro-pill small { font-size: 12.5px; font-weight: 500; opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.gn-ro-tag { display: inline-flex; flex: 0 0 auto; }
.gn.gn-ro .gn-tools, .gn.gn-ro .gn-strip, .gn.gn-ro #gn-undo, .gn.gn-ro #gn-redo, .gn.gn-ro #gn-write, .gn.gn-ro #gn-addpage,
.gn.gn-ro #gn-paper, .gn.gn-ro .gn-bar-r .gn-sep,
.gn.gn-ro .gn-menu [data-a="write"], .gn.gn-ro .gn-menu [data-a="add"], .gn.gn-ro .gn-menu [data-a="paper"],
.gn.gn-ro .gn-menu [data-a="hand"], .gn.gn-ro .gn-menu [data-a="set"], .gn.gn-ro .gn-menu .gn-menu-sep,
.gn.gn-ro .gn-thumb-add, .gn.gn-ro .gn-thumb-row .gn-ib { display: none !important; }
.gn.gn-ro .gn-view { cursor: grab; }
.gn.gn-ro:not(.gn-ro-user) .gn-zoom, .gn.gn-ro:not(.gn-ro-user) .gn-pageno { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
.gn.gn-ro-user .gn-ro-pill { display: none !important; }
.gn.gn-ro-user .gn-zoom, .gn.gn-ro-user .gn-pageno { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 699px) { .gn-ro-pill small { display: none; } }

/* ══ Design 2026-11 (nach Apples Human Interface Guidelines: Toolbars, Liquid Glass, Sidebars) ══════════════════
 * Zwei Ebenen: die Seiten (Inhalt) und darüber schwebende Bedienung. Die Leisten sind Glas: die Seiten gleiten beim
 * Scrollen sichtbar darunter durch. Oben höchstens drei Gruppen (links Navigation, Mitte Werkzeuge, rechts Aktionen),
 * Symbole einfarbig, Farbe nur für den Zustand (gewähltes Werkzeug, Seitenvorschau/Nur lesen an). Leistungsmodus und
 * „Transparenz reduzieren“: feste Flächen ohne Unschärfe. */
.gn {
  --gn-desk: #141416;
  --gn-glass: rgba(34,34,37,0.74);
  --gn-glass-strong: rgba(40,40,44,0.9);
  --gn-glass-line: rgba(255,255,255,0.1);
  --gn-glass-hi: inset 0 0.5px 0 rgba(255,255,255,0.1);
  --gn-grp: rgba(255,255,255,0.06);
  --gn-blur: blur(24px) saturate(1.5);
  --gn-r: 14px;
  --gn-panel-bg: #26262a;
}
/* Leiste oben: Glas, feine Kante, die Seiten scrollen darunter */
.gn-bar {
  background: var(--gn-glass); -webkit-backdrop-filter: var(--gn-blur); backdrop-filter: var(--gn-blur);
  box-shadow: 0 0.5px 0 var(--gn-glass-line); padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px));
}
.gn-bar-l, .gn-bar-r { gap: 8px; }
/* Gruppen als ruhige Kapseln, Ecken konzentrisch (Kapsel 14, Knopf 11 bei 3 Abstand) */
.gn-grp { display: flex; align-items: center; gap: 0; padding: 3px; border-radius: var(--gn-r); background: var(--gn-grp); }
.gn-grp .gn-ib { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; color: var(--gn-ink); }
.gn-grp .gn-ib .gn-i { width: 21px; height: 21px; }
.gn-grp:empty { display: none; }
.gn-title { height: 44px; padding: 0 10px 0 6px; }
.gn-title-t { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; }
/* Werkzeuge in der Mitte: eine Gruppe, gewähltes Werkzeug als erhabene Taste mit Akzent-Symbol */
.gn-tools { gap: 0; }
@media (min-width: 700px) {
  .gn-tools { height: 44px; top: calc(var(--gn-st) + (var(--gn-bar-h) - 44px) / 2); padding: 3px; border-radius: var(--gn-r); background: var(--gn-grp); }
  .gn-tool { width: 38px; height: 38px; border-radius: 11px; }
}
.gn-tool { color: var(--gn-ink); opacity: .82; }
.gn-tool:hover { opacity: 1; }
.gn-tool.on { opacity: 1; background: var(--gn-glass-strong); color: var(--gn-acc); box-shadow: 0 1px 3px rgba(0,0,0,.35), var(--gn-glass-hi); }
.gn-tool-dot { box-shadow: 0 0 0 1.5px var(--gn-glass-strong); }
/* Einstellungen des Werkzeugs: am PC/Tablet als schwebende Kapsel unter der Leiste (statt einer vollen Zeile) */
@media (min-width: 700px) {
  .gn-strip {
    left: 50%; right: auto; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px);
    top: calc(var(--gn-bar-h) + var(--gn-st) + 8px); height: 50px; border-radius: 18px;
    background: var(--gn-glass); -webkit-backdrop-filter: var(--gn-blur); backdrop-filter: var(--gn-blur);
    box-shadow: 0 0 0 0.5px var(--gn-glass-line), var(--gn-glass-hi), 0 14px 30px -16px rgba(0,0,0,.6);
  }
  .gn-strip-in { padding: 0 12px; min-width: 0; }
  .gn-strip:empty { display: none; }
}
.gn-penb-style { background: var(--gn-glass-strong); }
.gn-swb.on { box-shadow: 0 0 0 2px var(--gn-glass-strong), 0 0 0 3.5px var(--gn-ink); }
/* Seite: ein Hauch Rundung und weicherer Schatten (Papier auf dem Schreibtisch) */
.gn-pg { border-radius: 3px; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.45), 0 2px 4px rgba(0,0,0,0.22), 0 18px 40px -18px rgba(0,0,0,0.6); }
/* Seitenzahl und Zoom: kleine Glas-Kapseln */
.gn-zoom, .gn-pageno {
  height: 32px; padding: 0 13px; border-radius: 16px; background: var(--gn-glass); color: var(--gn-ink);
  -webkit-backdrop-filter: var(--gn-blur); backdrop-filter: var(--gn-blur);
  box-shadow: 0 0 0 0.5px var(--gn-glass-line), 0 8px 20px -10px rgba(0,0,0,.55); font-size: 13px; font-weight: 650;
}
.gn:not(.gn-zoomed) .gn-zoom { color: var(--gn-ink2); }
/* Seitenvorschau links: Glas-Seitenleiste (dichter, damit die Vorschaubilder ruhig wirken) */
.gn-panel {
  border-radius: 22px; background: var(--gn-panel-bg, var(--gn-glass-strong)); -webkit-backdrop-filter: var(--gn-blur); backdrop-filter: var(--gn-blur);
  box-shadow: 0 0 0 0.5px var(--gn-glass-line), var(--gn-glass-hi), 0 24px 50px -20px rgba(0,0,0,.65);
}
.gn-panel-head { padding: 12px 8px 6px 18px; }
.gn-panel-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.gn-panel-grid { gap: 18px 14px; padding: 8px 16px 18px; }
.gn-thumb-pg { border-radius: 6px; }
.gn-thumb.on .gn-thumb-pg { box-shadow: 0 0 0 2px var(--gn-glass-strong), 0 0 0 4.5px var(--gn-acc), 0 6px 14px -8px rgba(0,0,0,.6); }
.gn-thumb-row { justify-content: center; position: relative; padding: 0; min-height: 26px; }
.gn-thumb-row > span { padding: 2px 9px; border-radius: 10px; }
.gn-thumb.on .gn-thumb-row > span { background: var(--gn-acc); color: #fff; }
.gn-thumb-row .gn-ib { position: absolute; right: -4px; top: -2px; opacity: .7; }
.gn-thumb-add { border-radius: 8px; }
.gn-panel-act { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
/* Seitenvorschau reicht bis unter die Leiste oben und gleitet herein/hinaus (Kurve wie bei iOS-Seitenleisten) */
.gn-panel { top: calc(var(--gn-bar-h) + var(--gn-st) + 8px); animation: gn-panel-in .44s cubic-bezier(.32,.72,0,1) both; will-change: transform; }
.gn-panel.gn-panel-out { animation: gn-panel-out .23s cubic-bezier(.4,0,1,1) both; pointer-events: none; }
@keyframes gn-panel-in { from { transform: translateX(calc(-100% - 24px)); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes gn-panel-out { from { transform: none; opacity: 1; } to { transform: translateX(calc(-100% - 24px)); opacity: .5; } }
/* Vorschaubilder kommen beim Öffnen leicht versetzt nach */
.gn-panel.gn-panel-enter .gn-thumb { animation: gn-thumb-in .42s cubic-bezier(.32,.72,0,1) both; }
.gn-panel.gn-panel-enter .gn-thumb:nth-child(2) { animation-delay: .04s; }
.gn-panel.gn-panel-enter .gn-thumb:nth-child(3) { animation-delay: .08s; }
.gn-panel.gn-panel-enter .gn-thumb:nth-child(4) { animation-delay: .11s; }
.gn-panel.gn-panel-enter .gn-thumb:nth-child(5) { animation-delay: .14s; }
.gn-panel.gn-panel-enter .gn-thumb:nth-child(n+6) { animation-delay: .17s; }
@keyframes gn-thumb-in { from { opacity: 0; transform: translateX(-14px); } }
@media (min-width: 700px) {
  /* Stift-Zeile weicht der offenen Seitenvorschau nach rechts aus (Mitte der freien Fläche) */
  .gn-strip { transition: left .44s cubic-bezier(.32,.72,0,1), max-width .44s cubic-bezier(.32,.72,0,1); }
  .gn.gn-panel-on .gn-strip { left: calc(50% + 160px); max-width: calc(100% - 344px); }
  .gn-pageno { transition: opacity .25s ease, transform .25s ease, left .44s cubic-bezier(.32,.72,0,1); }
}
@media (max-width: 699px) {
  .gn-panel { height: auto; }
  @keyframes gn-panel-in { from { transform: translateY(calc(100% + 24px)); opacity: .6; } to { transform: none; opacity: 1; } }
  @keyframes gn-panel-out { from { transform: none; opacity: 1; } to { transform: translateY(calc(100% + 24px)); opacity: .6; } }
  @keyframes gn-thumb-in { from { opacity: 0; transform: translateY(12px); } }
}
@media (prefers-reduced-motion: reduce) {
  .gn-panel, .gn-panel.gn-panel-enter .gn-thumb { animation: gn-fade .15s ease both; }
  .gn-strip, .gn-pageno, .gn-zoom { transition: none; }
}
@keyframes gn-fade { from { opacity: 0; } }
/* Handy: Werkzeuge unten und Stift-Zeile als Glas */
@media (max-width: 699px) {
  .gn-tools { background: var(--gn-glass); -webkit-backdrop-filter: var(--gn-blur); backdrop-filter: var(--gn-blur); box-shadow: 0 -0.5px 0 var(--gn-glass-line); }
  .gn-strip { background: var(--gn-glass); -webkit-backdrop-filter: var(--gn-blur); backdrop-filter: var(--gn-blur); box-shadow: 0 -0.5px 0 var(--gn-glass-line); }
  .gn-tool.on { box-shadow: none; background: var(--gn-grp); }
  .gn-bar-l, .gn-bar-r { gap: 6px; }
  .gn-grp .gn-ib { width: 36px; height: 36px; flex-basis: 36px; }
  .gn-grp-act { background: transparent; padding: 0; }
  .gn-title-t { font-size: 15px; }
}
/* Leistungsmodus, „Transparenz reduzieren“: feste Flächen, keine Unschärfe */
html.gg-perf .gn :is(.gn-bar, .gn-strip, .gn-tools, .gn-zoom, .gn-pageno, .gn-panel) { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.gg-perf .gn { --gn-glass: #232326; --gn-glass-strong: #2b2b2e; }
@media (prefers-reduced-transparency: reduce) {
  .gn :is(.gn-bar, .gn-strip, .gn-tools, .gn-zoom, .gn-pageno, .gn-panel) { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .gn { --gn-glass: #232326; --gn-glass-strong: #2b2b2e; }
}
@media (prefers-contrast: more) {
  .gn { --gn-glass-line: rgba(255,255,255,0.32); --gn-grp: rgba(255,255,255,0.12); }
}
/* Mittlere Breiten (iPad hochkant): Werkzeuge etwas schmaler, Titel kürzer bzw. nur im Menü „…“ (Umbenennen) */
.gn-title-alt { display: none !important; }
@media (min-width: 900px) and (max-width: 1099px) {
  .gn-tool { width: 35px; }
  .gn-title { max-width: 120px; }
}
@media (min-width: 700px) and (max-width: 899px) {
  .gn-tool { width: 33px; }
  .gn-bar .gn-title { display: none; }
  .gn-title-alt { display: flex !important; }
}
/* Größere Leiste am PC und Tablet (Apple: Tippflächen mindestens 44 pt): Leiste 60 hoch, Knöpfe 44 hoch, Symbole 23.
 * In der Breite wird nur dort gespart, wo der Platz knapp ist (Werkzeuge in der Mitte, siehe Breiten unten). */
@media (min-width: 700px) {
  .gn { --gn-bar-h: 60px; --gn-r: 16px; }
  .gn-grp { padding: 3px; }
  .gn-grp .gn-ib { width: 44px; height: 44px; flex-basis: 44px; border-radius: 13px; }
  .gn-grp .gn-ib .gn-i { width: 23px; height: 23px; }
  .gn-tools { height: 50px; top: calc(var(--gn-st) + (var(--gn-bar-h) - 50px) / 2); }
  .gn-tool { width: 44px; height: 44px; border-radius: 13px; }
  .gn-tool .gn-i { width: 23px; height: 23px; }
  .gn-tool-dot { width: 8px; height: 8px; right: 6px; bottom: 6px; }
  .gn-title { height: 48px; }
  .gn-title-t { font-size: 17px; }
  /* Stift-Zeile darunter: etwas höher, Farben und Stärken größer */
  .gn-strip { height: 56px; border-radius: 20px; }
  .gn-penb { width: 33px; }
  .gn-colors .gn-swb { width: 27px; height: 27px; flex-basis: 27px; }
  .gn-size { width: 36px; height: 36px; border-radius: 10px; }
}
/* Heftname: höchstens so breit, dass er die Werkzeuge in der Mitte nicht berührt (halbe Breite − halbe Werkzeuge − linke Knöpfe) */
@media (min-width: 1100px) and (max-width: 1299px) { .gn-tool { width: 40px; } .gn-title { max-width: min(260px, calc(50vw - 391px)); } }
@media (min-width: 900px) and (max-width: 1099px) { .gn-tool { width: 37px; } .gn-grp .gn-ib { width: 40px; flex-basis: 40px; } .gn-title { max-width: calc(50vw - 362px); } }
@media (min-width: 700px) and (max-width: 899px) { .gn-tool { width: 34px; } .gn-grp .gn-ib { width: 38px; flex-basis: 38px; } }
@media (min-width: 1300px) { .gn-title { max-width: min(260px, calc(50vw - 413px)); } }

/* Bild zuschneiden (notes.js cropUi): ganzer Bildschirm über dem Heft, Rahmen mit Griffen */
.gn-crop {
  position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; background: rgba(10,10,12,0.94);
  color: #fff; opacity: 0; transition: opacity .18s; touch-action: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.gn-crop.on { opacity: 1; }
html.gg-perf .gn-crop { transition: none; background: #0a0a0c; }
.gn-crop-bar, .gn-crop-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; flex: none; }
.gn-crop-bar b { font-size: 17px; }
.gn-crop-foot { justify-content: center; }
.gn-crop .gn-btn:not(.gn-btn-primary) { background: rgba(255,255,255,0.12); color: #fff; }
.gn-crop-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gn-crop-img { position: relative; flex: none; }
.gn-crop-img img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; pointer-events: none; }
.gn-crop-box {
  position: absolute; box-shadow: 0 0 0 9999px rgba(0,0,0,0.58); outline: 2px solid #fff; cursor: move; touch-action: none;
}
.gn-crop-grid { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent 33.1%, rgba(255,255,255,.45) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.45) 66.7%, transparent 66.9%),
              linear-gradient(0deg, transparent 33.1%, rgba(255,255,255,.45) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.45) 66.7%, transparent 66.9%); }
.gn-crop-h { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; touch-action: none; z-index: 1; }
.gn-crop-h::after { content: ''; position: absolute; left: 8px; top: 8px; width: 12px; height: 12px; border-radius: 3px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.gn-crop-h[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; } .gn-crop-h[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.gn-crop-h[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; } .gn-crop-h[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.gn-crop-h[data-h="n"] { left: 50%; top: 0; cursor: ns-resize; } .gn-crop-h[data-h="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.gn-crop-h[data-h="e"] { left: 100%; top: 50%; cursor: ew-resize; } .gn-crop-h[data-h="w"] { left: 0; top: 50%; cursor: ew-resize; }
@media (pointer: coarse) { .gn-crop-h { width: 40px; height: 40px; margin: -20px 0 0 -20px; } .gn-crop-h::after { left: 13px; top: 13px; width: 14px; height: 14px; } }
/* heller Modus: außerhalb des Rahmens deutlich aufhellen, Rahmen und Griffe dunkel (sonst sieht man den Ausschnitt kaum) */
html[data-theme="light"] .gn .gn-crop-box { box-shadow: 0 0 0 9999px rgba(250,250,251,0.78); outline: 2px solid var(--gn-acc); }
html[data-theme="light"] .gn .gn-crop-h::after { background: var(--gn-acc); box-shadow: 0 0 0 2px #fff; }

/* Gleitende Taste (notes.js pillSync): Werkzeug-Leiste und Umschalter. Die Taste liegt hinter den Knöpfen und gleitet
   mit leichtem Nachfedern zum gewählten Knopf; der gewählte Knopf selbst bekommt keine eigene Fläche mehr. */
.gn-seg { position: relative; }   /* .gn-tools ist schon absolut positioniert */
.gn-pill {
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; display: block;
  transition: transform .42s cubic-bezier(.32, 1.26, .54, 1), width .42s cubic-bezier(.32, 1.26, .54, 1), height .3s ease, opacity .2s ease;
  will-change: transform;
}
.gn-has-pill > button { position: relative; z-index: 1; }
.gn-has-pill > button.on { background: transparent !important; box-shadow: none !important; }
.gn-tool { transition: background .12s ease, color .25s ease, opacity .2s ease; }
#gn-tools > .gn-pill { border-radius: 11px; background: var(--gn-glass-strong); box-shadow: 0 1px 3px rgba(0,0,0,.35), var(--gn-glass-hi); }
.gn-seg > .gn-pill { border-radius: 7px; background: var(--gn-pop); box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 0 0 0.5px var(--gn-line2); }
.gn-seg > button { transition: color .2s ease; }
@media (max-width: 699px) { #gn-tools > .gn-pill { box-shadow: none; background: var(--gn-grp); } }
@media (prefers-reduced-motion: reduce) { .gn-pill { transition: none; } }
html.gg-perf .gn-pill { transition: none; }

/* Heft lädt (notes.js skeleton): Platzhalter-Seiten an der Stelle der echten Seiten, mit Lichtschimmer.
   Leisten sind schon da, aber noch ohne Wirkung (nur „<“ geht, bricht ab). Danach blenden sie weich aus. */
.gn-skel {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  transition: opacity .38s ease;
}
.gn-skel.gn-skel-out { opacity: 0; }
.gn-skel-pg {
  position: relative; flex: none; width: var(--skw, 600px); height: var(--skh, 850px); border-radius: 2px; overflow: hidden;
  background-color: #2a2a2d; box-shadow: 0 0 0 .5px rgba(255,255,255,.06), 0 18px 36px -18px rgba(0,0,0,.6);
  animation: gnSkelIn .45s cubic-bezier(.22, 1, .36, 1) both;
}
.gn-skel-pg + .gn-skel-pg { animation-delay: .06s; }
/* graue Zeilen als Andeutung von Inhalt */
.gn-skel-pg i { position: absolute; left: 9%; height: 1.5%; border-radius: 99px; background: rgba(255,255,255,.06); }
.gn-skel-pg i:nth-child(1) { top: 9%; width: 46%; height: 2.2%; }
.gn-skel-pg i:nth-child(2) { top: 16%; width: 78%; }
.gn-skel-pg i:nth-child(3) { top: 21%; width: 70%; }
.gn-skel-pg i:nth-child(4) { top: 26%; width: 82%; }
.gn-skel-pg i:nth-child(5) { top: 31%; width: 56%; }
.gn-skel-pg i:nth-child(6) { top: 40%; width: 74%; }
.gn-skel-pg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.07) 50%, transparent 70%); background-size: 250% 100%;
  animation: gnSkelShine 1.5s ease-in-out infinite;
}
html[data-theme="light"] .gn-skel-pg::after { background-image: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.75) 50%, transparent 70%); }
@keyframes gnSkelShine { from { background-position: 125% 0; } to { background-position: -125% 0; } }
@keyframes gnSkelIn { from { opacity: 0; transform: translateY(8px); } }
.gn.gn-loading .gn-tools, .gn.gn-loading .gn-strip, .gn.gn-loading .gn-bar-r, .gn.gn-loading #gn-pagesbtn, .gn.gn-loading #gn-robtn,
.gn.gn-loading .gn-zoom, .gn.gn-loading .gn-pageno { pointer-events: none; opacity: .55; transition: opacity .3s ease; }
@media (prefers-reduced-motion: reduce) { .gn-skel-pg, .gn-skel-pg::after { animation: none; } }
html.gg-perf .gn-skel-pg::after { animation: none; }


/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════
   Heft-Editor im selben Stil wie die Schreiben-Seite (Marflux): Knöpfe ohne Leuchten und mit dem Drücken aus
   js/press-glass.js, kleine Fenster wachsen wie die Ausklapp-Menüs aus dem Knopf (js/dropdown-glass.js),
   Umschalter mit ziehbarer Glas-Blase (js/glass-slider.js), Auswahl wie im Hintergrund-Fenster (ios.css).
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* kleine Fenster: Verwandlung kommt aus dem JS, keine eigenen CSS-Übergänge dazwischen */
.gn-pop.gl-dd-js { transition: none !important; }
/* Knöpfe in Fenstern: volle Pillen ohne Leuchten, Drücken macht kurz dunkler (Größerwerden: js/press-glass.js) */
.gn-sheet .gn-btn-primary, .gn .gn-sheet .gn-btn-primary { box-shadow: none; }
.gn-btn { border-radius: 100px; font-weight: 650; transition: filter .2s ease, opacity .2s ease; }
.gn-btn:active:not(:disabled) { transform: none; filter: brightness(0.82); transition: filter 0s; }
/* Fenster-Kopf und runder Schließen-Knopf wie bei „Einstellungen“ */
.gn-sheet-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.gn-sheet-head [data-x] {
  width: 36px; height: 36px; flex: 0 0 36px; display: inline-grid; place-items: center; padding: 0; border: 0; cursor: pointer;
  background: var(--ios-circle, #3a3a3c); color: var(--ios-circle-ink, rgba(255,255,255,.88)); box-shadow: var(--ios-circle-shadow, 0 1px 2px rgba(0,0,0,.25));
  transition: background .15s ease;
}
.gn-sheet-head [data-x]:hover { background: var(--ios-group-press, #3a3a3c); }
.gn-sheet-head [data-x]:active { transform: none; filter: brightness(0.82); }
.gn-sheet-head [data-x] .gn-i { width: 18px; height: 18px; opacity: 1; }
.gn-input:focus { box-shadow: 0 0 0 2px var(--gn-acc); }
/* Umschalter: Pillen wie „Papier / Eigene“, die gleitende Taste hebt sich beim Ziehen als Glas */
.gn-seg { border-radius: 100px; padding: 3px; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.gn-seg > button { border-radius: 100px; -webkit-user-drag: none; }
.gn-seg > .gn-pill { border-radius: 100px !important; }
/* Umschalter mit zwei Reihen (Stiftarten, Textmarker-Arten): Rundung wie bisher, keine Pille */
.gn-seg:is(.gn-seg-wrap, .gn-styles-pop), .gn-seg:is(.gn-seg-wrap, .gn-styles-pop) > button, .gn-seg:is(.gn-seg-wrap, .gn-styles-pop) > .gn-pill { border-radius: 14px !important; }
#gn-tools { touch-action: manipulation; }   /* Leisten scrollen am Handy seitwärts: nicht sperren */
#gn-tools > .gn-pill { transition: transform .5s cubic-bezier(.34,1.35,.64,1), width .42s cubic-bezier(.32, 1.26, .54, 1), height .3s ease, opacity .2s ease; }
.gn-seg > .gn-pill:not(.gl-js) { transition: transform .5s cubic-bezier(.34,1.35,.64,1), width .42s cubic-bezier(.32, 1.26, .54, 1), height .3s ease, opacity .2s ease; }
/* Papier wählen: gewähltes Blatt mit Ring (mit Abstand) und Häkchen, das hineinfedert, wie im Hintergrund-Fenster */
.gn-ps-img { border-radius: 10px; transition: transform .3s cubic-bezier(.3,1.5,.5,1), box-shadow .2s ease; }
.gn-ps-tile:active .gn-ps-img { transform: scale(.95); }
.gn-ps-tile.on .gn-ps-img { box-shadow: 0 0 0 2.5px var(--gn-pop), 0 0 0 5px var(--gn-acc), 0 8px 18px -8px rgba(0,0,0,.4); overflow: visible; }
.gn-ps-tile .gn-ps-img > img { border-radius: inherit; }
.gn-ps-tick { box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0,0,0,.3); transition: opacity .15s ease, transform .35s cubic-bezier(.3,1.7,.45,1); }
/* Papierfarbe: runde Farbtupfer mit Ring wie bei „Papierfarbe“ im Hintergrund-Fenster */
.gn-ps-tone { gap: 18px; max-height: 90px; padding: 6px 6px 2px; }   /* Platz für Ring (5 px) und Namen, sonst abgeschnitten */
.gn-ps-tone.gn-tones-hide { max-height: 0; padding-top: 0; padding-bottom: 0; }
.gn-ps-tone button { flex-direction: column; align-items: center; gap: 6px; height: auto; padding: 0; border-radius: 0; background: none !important; box-shadow: none !important; font-weight: 500; }
.gn-ps-tone button.on { color: var(--gn-ink); font-weight: 600; }
.gn-ps-tone i { flex: 0 0 auto; width: 34px; height: 34px; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,.2), 0 3px 8px -4px rgba(0,0,0,.4); transition: box-shadow .2s ease, transform .3s cubic-bezier(.3,1.5,.5,1); }
.gn-ps-tone button:active i { transform: scale(.9); }
.gn-ps-tone button.on i { box-shadow: inset 0 0 0 0.5px rgba(0,0,0,.2), 0 0 0 2.5px var(--gn-pop), 0 0 0 5px var(--gn-acc); }
.gn-ps-tone i.gn-tone-dark { box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 3px 8px -4px rgba(0,0,0,.4); }   /* sonst unsichtbar auf dunklem Grund */
/* Farbtupfer: Ring federt, Antippen drückt ein */
.gn-swb { transition: box-shadow .2s ease, transform .3s cubic-bezier(.3,1.5,.5,1); }
.gn-swb:active { transform: scale(.88); }
@media (prefers-reduced-motion: reduce) { .gn-ps-tick, .gn-swb, .gn-ps-tone i, .gn-ps-img { transition: none; } }
/* Handy: Fenster als Blatt von unten mit Griff, wie auf der Schreiben-Seite (Bewegung: liquid.css .gg-pop-sheet) */
@media (max-width: 560px) {
  .gn-sheet-ov { align-items: flex-end; padding: 0; }
  .gn-sheet {
    position: relative; width: 100% !important; max-width: none; max-height: 92vh; max-height: 92dvh;
    border-radius: 28px 28px 0 0; padding-top: 22px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .gn-sheet::before {
    content: ''; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--ios-label3, rgba(var(--a-ebebf5,235,235,245),.3));
  }
}
/* Formen, Textmarker-Arten und Stärken in der Zeile darunter: dieselbe gleitende Taste mit Glas-Blase wie die Werkzeug-Leiste */
.gn-sec:is(.gn-shapes-row, .gn-styles, .gn-sizes) { position: relative; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.gn-sec:is(.gn-shapes-row, .gn-styles, .gn-sizes) > .gn-pill:not(.gl-lifted) { background: var(--gn-press); box-shadow: inset 0 0 0 1.5px var(--gn-line2); }
.gn-sec:is(.gn-shapes-row, .gn-styles, .gn-sizes) > .gn-pill:not(.gl-js) { transition: transform .5s cubic-bezier(.34,1.35,.64,1), width .42s cubic-bezier(.32, 1.26, .54, 1), height .3s ease, opacity .2s ease; }
/* Gewählter Eintrag in den Umschaltern (z. B. Radierer: Teilweise / Ganzer Strich): Taste etwas dunkler, hebt sich deutlicher ab */
html:not([data-theme="light"]) .gn-seg > .gn-pill:not(.gl-lifted) { background: #18181a; box-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 0 0.5px rgba(255,255,255,0.12); }

/* Abdeckband: Muster zur Wahl (kleine Vorschau je Muster, notes.js tapeDeco) */
.gn-tstyles { display: flex; gap: 4px; align-items: center; }
.gn-tsty { width: 40px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.gn-tsty canvas { width: 34px; height: 14px; display: block; pointer-events: none; }
.gn-tsty:hover { background: var(--gn-hover); }
.gn-tsty.on { background: var(--gn-press); box-shadow: inset 0 0 0 1.5px var(--gn-line2); }
@media (pointer: coarse) { .gn-tsty { width: 44px; height: 36px; border-radius: 10px; } }

/* ── Werkzeug-Symbole in Farbe (Stift, Textmarker, Abdeckband: notes.js penIcon/markIcon/tapeIcon) ─────────── */
.gn-i-c .gn-ink { stroke: none; }
.gn-i-c .gn-swash { fill: none; stroke-linecap: round; }
.gn-i-c .gn-halo { fill: none; stroke: transparent; stroke-linecap: round; }
.gn-i-c .gn-hl { fill: none; stroke-width: 3.4; stroke-linecap: round; opacity: .88; }
.gn-i-c .gn-tape { stroke: currentColor; stroke-width: 1.2; fill-opacity: .9; }
/* sehr dunkle Farbe im dunklen Aussehen / sehr helle im hellen: feiner Rand, damit sie zu sehen ist */
.gn-i-c .gn-ink.dk { stroke: rgba(255,255,255,.5); stroke-width: .8; }
.gn-i-c .gn-halo.dk { stroke: rgba(255,255,255,.26); }
html[data-theme="light"] .gn-i-c .gn-ink.dk { stroke: none; }
html[data-theme="light"] .gn-i-c .gn-halo.dk { stroke: transparent; }
html[data-theme="light"] .gn-i-c .gn-ink.lt { stroke: rgba(0,0,0,.35); stroke-width: .8; }
html[data-theme="light"] .gn-i-c .gn-halo.lt { stroke: rgba(0,0,0,.28); }
/* nicht gewählt: Farbe etwas zurückhaltender */
.gn-tool:not(.on) .gn-i-c .gn-ink, .gn-tool:not(.on) .gn-i-c .gn-swash { opacity: .9; }
/* Antippen: Symbol gibt kurz nach (wie ein echter Knopf) */
.gn-tool .gn-i { transition: transform .14s cubic-bezier(.3,.7,.4,1); }
.gn-tool:active .gn-i { transform: scale(.86); }
html.gg-perf .gn-tool .gn-i { transition: none; }


/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════
   Tabs oben im Heft (js/notes/tabs.js): offene Hefte wie im Browser. Die Zeile liegt über der Leiste, die Leiste
   und alles darunter rücken um --gn-tabs-h nach unten (--gn-st).
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════ */
.gn.gn-tabbed { --gn-tabs-h: 38px; }
.gn-tabs {
  position: absolute; z-index: 7; left: 0; right: 0; top: env(safe-area-inset-top, 0px); height: var(--gn-tabs-h);
  padding: 6px max(10px, env(safe-area-inset-right, 0px)) 0 max(10px, env(safe-area-inset-left, 0px));
}
.gn-tabs[hidden] { display: none; }
.gn-tabs-row {
  display: flex; align-items: center; gap: 4px; height: 32px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  overscroll-behavior-x: contain; touch-action: pan-x; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.gn-tabs-row::-webkit-scrollbar { display: none; }
.gn-tab {
  position: relative; flex: 0 1 200px; min-width: 104px; height: 30px; display: flex; align-items: center; gap: 2px; padding: 0 4px 0 12px;
  border-radius: 10px; color: var(--gn-ink2); font-size: 13px; font-weight: 600; letter-spacing: -0.005em; cursor: pointer;
  /* jeder Tab ist eine eigene Fläche mit feinem Rand (sonst stehen die Namen nur lose nebeneinander), der offene deutlich heller */
  background: rgba(255,255,255,0.045); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
  transition: background .12s ease, color .12s ease; -webkit-tap-highlight-color: transparent;
}
.gn-tab:hover { background: rgba(255,255,255,0.09); color: var(--gn-ink); }
.gn-tab.on { background: rgba(255,255,255,0.2); color: var(--gn-ink); font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22), 0 1px 3px rgba(0,0,0,0.3); cursor: default; }
.gn-tab:focus-visible, .gn-tab-add:focus-visible { outline: 2px solid var(--gn-acc); outline-offset: -2px; }
.gn-tab-t { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 30px; pointer-events: none; }
.gn-tab-x, .gn-tab-add {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent;
  color: inherit; cursor: pointer; transition: background .12s ease, opacity .12s ease;
}
.gn-tab-x { width: 24px; height: 24px; border-radius: 50%; opacity: .55; }
.gn-tab-x svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.gn-tab-x:hover { background: var(--gn-press); opacity: 1; }
.gn-tab-add { width: 30px; height: 30px; margin-left: 2px; border-radius: 10px; color: var(--gn-ink2); }
.gn-tab-add svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; pointer-events: none; }
.gn-tab-add:hover { background: var(--gn-hover); color: var(--gn-ink); }
.gn-tab-add:active { background: var(--gn-press); }
.gn-tab:not(.on):active { background: rgba(255,255,255,0.13); }
/* Maus: das X der anderen Tabs erst beim Darüberfahren (ruhiger), beim offenen Tab immer */
@media (hover: hover) and (pointer: fine) {
  .gn-tab:not(.on):not(:hover):not(:focus-within) .gn-tab-x { opacity: 0; }
}
/* Ziehen: der Tab folgt dem Zeiger, die anderen rücken weich zur Seite */
.gn-tabs-dragging .gn-tab { transition: transform .18s cubic-bezier(.3,.7,.3,1), background .12s ease; }
.gn-tabs-dragging .gn-tab.gn-tab-drag { transition: none; z-index: 2; background: var(--gn-pop); color: var(--gn-ink); box-shadow: var(--gn-shadow), inset 0 0 0 0.5px var(--gn-line2); cursor: grabbing; }
.gn-tabs-dragging, .gn-tabs-dragging .gn-tab { cursor: grabbing; }
html.gg-perf .gn-tabs-dragging .gn-tab, html.gg-perf .gn-tab, html.gg-perf .gn-tab-x { transition: none; }
@media (prefers-reduced-motion: reduce) { .gn-tabs-dragging .gn-tab, .gn-tab, .gn-tab-x { transition: none; } }
/* Handy: etwas flacher, schmalere Tabs, X nur am offenen Tab (sonst trifft man es beim Wechseln) */
@media (max-width: 699px) {
  .gn.gn-tabbed { --gn-tabs-h: 36px; }
  .gn-tabs { padding-top: 5px; padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
  .gn-tab { flex-basis: 150px; min-width: 92px; padding-left: 11px; }
  .gn-tab:not(.on) { padding-right: 11px; }
  .gn-tab.on { flex: 0 0 auto; max-width: 62vw; }   /* der offene Tab zeigt seinen Namen ganz, die anderen geben nach */
  .gn-tab:not(.on) .gn-tab-x { display: none; }
}

/* Bild auf die Seite ziehen (notes.js, drop): feiner Rahmen in Akzentfarbe, solange ein Bild darüber schwebt */
.gn.gn-drop .gn-view { box-shadow: inset 0 0 0 3px var(--gn-acc); }

/* Bild drehen (notes.js startRotate): runder Griff über der Mitte, mit Strich zum Rahmen; beim Drehen der Winkel */
.gn-rot-h {
  display: none; position: absolute; left: 50%; top: -48px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%;
  background: #fff; border: 2px solid var(--gn-acc); box-shadow: 0 1px 4px rgba(0,0,0,.35); pointer-events: auto;
  cursor: grab; touch-action: none; align-items: center; justify-content: center; color: var(--gn-acc);
}
.gn-rot-h::before { content: ''; position: absolute; inset: -12px; }                /* größere Trefferfläche für den Finger */
.gn-rot-h::after { content: ''; position: absolute; left: 50%; top: 100%; width: 2px; height: 16px; margin-left: -1px; background: var(--gn-acc); opacity: .7; }
.gn-rot-h svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.gn-selbox.gn-sel-rot .gn-rot-h { display: flex; }
.gn.gn-has-anchors .gn-rot-h, .gn-selbox.gn-locked .gn-rot-h { display: none !important; }
.gn-rot-deg {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 3px 8px; border-radius: 9px;
  background: var(--gn-chip-bg); color: var(--gn-chip-ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  white-space: nowrap; box-shadow: var(--gn-shadow); pointer-events: none;
}
.gn.gn-rotating .gn-rot-deg { display: block; }
.gn.gn-rotating .gn-rot-h { cursor: grabbing; }
.gn.gn-rotating .gn-handle { visibility: hidden; }                                  /* beim Drehen nur Rahmen und Griff */
.gn-selbox.gn-rot-below .gn-rot-h { top: auto; bottom: -48px; }
.gn-selbox.gn-rot-below .gn-rot-h::after { top: auto; bottom: 100%; }
.gn-selbox.gn-rot-below .gn-rot-deg { bottom: auto; top: calc(100% + 8px); }
.gn-selbox.gn-rot-in .gn-rot-h { top: 14px; }
.gn-selbox.gn-rot-in .gn-rot-h::after { display: none; }
