@font-face {
  font-family: "Andika";
  src: url("../assets/fonts/Andika/Andika-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Pridi";
  src: url("../assets/fonts/Pridi/Pridi-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("../assets/fonts/Outfit/static/Outfit-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Yanone Kaffeesatz";
  src: url("../assets/fonts/Yanone_Kaffeesatz/static/YanoneKaffeesatz-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atma";
  src: url("../assets/fonts/Atma/Atma-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Grenze Gotisch";
  src: url("../assets/fonts/Grenze_Gotisch/static/GrenzeGotisch-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  src: url("../assets/fonts/Roboto_Mono/static/RobotoMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bitcount Single";
  src: url("../assets/fonts/Bitcount_Single/static/BitcountSingle-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================
   Schreibwerkstatt – Prototyp v07 Tabs
   HTML / CSS / JavaScript, offline nutzbar
   ========================================================== */

@font-face {
  font-family: 'Andika';
  src: local('Andika'), local('Andika New Basic');
}

* { box-sizing: border-box; }
:root {
  --ink: #243447;
  --soft-ink: #53667a;
  --paper: #fffefa;
  --file: #dceffd;
  --format: #def4e5;
  --edit: #eef1f6;
  --list: #eadff8;
  --insert: #fff3b8;
  --cyber: #d8f3f0;
  --shadow: 0 18px 46px rgba(36, 52, 71, 0.14);
  --radius: 22px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Andika, 'Segoe UI', sans-serif;
  color: var(--ink);
  background-color: #f9fdfb;
  background-image: url('../assets/bilder/bg-aquarell-wisch.png');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ==========================================================
   Startbildschirm aus v03 bleibt nutzbar
   ========================================================== */
.start-body {
  display: grid;
  place-items: center;
  overflow: hidden;
}
.login-stage {
  width: min(1376px, 100vw);
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: #fff;
}
.stage-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage-figure { position: absolute; z-index: 3; pointer-events: none; filter: drop-shadow(0 12px 16px rgba(36,52,71,.18)); }
.stage-figure.pixeli { left: 3.2%; bottom: 2.5%; width: clamp(128px, 15.3vw, 221px); }
.stage-figure.walter { right: 3.2%; bottom: 1%; width: clamp(195px, 22.5vw, 325px); }
.monitor-panel {
  position: absolute; z-index: 2; left: 22%; top: 19%; width: 56%; min-height: 50%;
  padding: clamp(16px, 2vw, 32px); border-radius: 24px; display: flex; flex-direction: column;
  justify-content: center; text-align: center; background: rgba(255,255,255,0.60); backdrop-filter: blur(2px);
}
.eyebrow { margin: 0 0 8px; color: #2b7a78; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; font-size: .82rem; }
h1 { margin: 0 0 12px; font-size: clamp(1.7rem, 3.2vw, 3.2rem); line-height: 1.05; }
.lead { margin: 8px auto; max-width: 42em; font-size: clamp(1rem, 1.35vw, 1.25rem); line-height: 1.45; }
.name-label { margin-top: 14px; font-weight: 900; font-size: 1.1rem; }
.name-row { margin: 8px auto 0; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.name-row input { width: min(360px, 62vw); padding: 13px 16px; border-radius: 999px; border: 3px solid rgba(43,122,120,.25); background: white; color: var(--ink); outline: none; }
.name-row input:focus { border-color: #2b7a78; }
.primary-btn { border: 0; border-radius: 999px; padding: 13px 22px; background: #2b7a78; color: white; font-weight: 900; box-shadow: 0 8px 20px rgba(43,122,120,.22); }
.primary-btn:hover { transform: translateY(-1px); }
.primary-btn.wide { align-self: center; margin-top: 12px; }
.small-note { font-size: .85rem; color: var(--soft-ink); margin: 10px 0 0; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.mode-card { border: 3px solid rgba(36,52,71,.08); background: rgba(255,255,255,.86); border-radius: 22px; padding: 16px 12px; color: var(--ink); display: flex; flex-direction: column; gap: 5px; align-items: center; min-height: 145px; box-shadow: 0 8px 16px rgba(36,52,71,.08); }
.mode-card:hover { transform: translateY(-2px); border-color: rgba(43,122,120,.35); }
.mode-icon { font-size: 2rem; }
.mode-card strong { font-size: 1rem; }
.mode-card small { color: var(--soft-ink); line-height: 1.25; }

/* ==========================================================
   Editor-Kopfzeile
   ========================================================== */
.editor-body { overflow: hidden; }
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 22px;
  background: rgba(255,255,255,.68);
  border-bottom: 1px solid rgba(36,52,71,.08);
  backdrop-filter: blur(5px);
}
.brand-block { display: flex; align-items: baseline; gap: 14px; }
.brand-block .eyebrow { margin: 0; }
.topbar h1 { font-size: 1.55rem; margin: 0; }
.session-info { display: flex; gap: 12px; align-items: center; font-weight: 900; }
.ghost-link { color: #2b7a78; text-decoration: none; background: rgba(255,255,255,.9); padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(36,52,71,.08); }

/* ==========================================================
   Ribbon mit farbigen Tabs
   ========================================================== */
.ribbon {
  background: rgba(255,255,255,.50);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(36,52,71,.08);
  box-shadow: 0 8px 24px rgba(36,52,71,.06);
}
.ribbon-tabs {
  min-height: 56px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 18px 0;
}
.program-tabs, .cyber-tabs { display: flex; align-items: flex-end; gap: 8px; }
.tab-btn, .cyber-btn {
  border: 1px solid rgba(36,52,71,.10);
  border-bottom: 0;
  color: var(--ink);
  border-radius: 18px 18px 0 0;
  padding: 11px 16px 12px;
  font-weight: 900;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 -2px 10px rgba(36,52,71,.05) inset;
  opacity: .82;
  position: relative;
}
.tab-btn.active, .cyber-btn.active {
  opacity: 1;
  transform: translateY(1px);
  box-shadow: 0 -1px 0 rgba(255,255,255,.8) inset, 0 8px 20px rgba(36,52,71,.08);
}
.tab-btn.locked {
  filter: grayscale(.85);
  opacity: .38;
}
.tab-file { background: color-mix(in srgb, var(--file), white 12%); }
.tab-format { background: color-mix(in srgb, var(--format), white 8%); }
.tab-edit { background: color-mix(in srgb, var(--edit), white 5%); }
.tab-list { background: color-mix(in srgb, var(--list), white 8%); }
.tab-insert { background: color-mix(in srgb, var(--insert), white 6%); }
.cyber-btn { background: color-mix(in srgb, var(--cyber), white 10%); border-radius: 18px 18px 0 0; }
.walter-btn img { width: 34px; height: 34px; object-fit: contain; margin: -6px 0 -8px; filter: drop-shadow(0 4px 6px rgba(36,52,71,.18)); }

.tab-btn::after, .cyber-btn::after, .tool-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(115deg, rgba(255,255,255,.36), rgba(255,255,255,0) 42%),
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.32), transparent 38%),
    radial-gradient(circle at 84% 78%, rgba(255,255,255,.18), transparent 44%);
  opacity: .55;
}
.tool-panel { position: relative; overflow: hidden; }
.tool-panel > * { position: relative; z-index: 1; }


.ribbon-tools {
  min-height: 68px;
  padding: 10px 18px 12px;
  border-top: 1px solid rgba(255,255,255,.75);
}
.tool-panel {
  display: none;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  min-height: 46px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(36,52,71,.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.46);
}
.tool-panel.active { display: flex; }
.panel-file { background: color-mix(in srgb, var(--file), white 14%); }
.panel-format { background: color-mix(in srgb, var(--format), white 12%); }
.panel-edit { background: color-mix(in srgb, var(--edit), white 8%); }
.panel-list { background: color-mix(in srgb, var(--list), white 12%); }
.panel-insert { background: color-mix(in srgb, var(--insert), white 12%); }
.tool-panel button, .tool-panel label {
  border: 0;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  border-radius: 13px;
  min-height: 38px;
  padding: 7px 10px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: inset 0 0 0 1px rgba(36,52,71,.07), 0 3px 9px rgba(36,52,71,.04);
}
.tool-panel button:hover, .tool-panel label:hover { transform: translateY(-1px); }
.tool-panel select, .tool-panel input[type=color] {
  border: 1px solid rgba(36,52,71,.12);
  border-radius: 9px;
  background: white;
  height: 30px;
}
.tool-panel input[type=color] { width: 42px; padding: 2px; }
.needs-level-2.locked-tool,
.needs-level-5.locked-tool {
  filter: grayscale(.8);
  opacity: .45;
  pointer-events: none;
}

.menu-wrap { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 255px;
  z-index: 20;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(36,52,71,.10);
  box-shadow: var(--shadow);
}
.dropdown-menu a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  padding: 9px 10px;
  border-radius: 11px;
}
.dropdown-menu a:hover { background: var(--cyber); }
.dropdown-section {
  margin: 6px 4px 2px;
  padding: 8px 6px 3px;
  color: var(--soft-ink);
  font-size: .84rem;
  font-weight: 900;
  border-top: 1px solid rgba(36,52,71,.10);
}
.dropdown-menu .dropdown-subitem {
  padding-left: 18px;
}
.dropdown-menu .dropdown-subitem span,
.dropdown-menu .dropdown-subitem small {
  display: block;
}
.dropdown-menu .dropdown-subitem small {
  margin-top: 2px;
  color: var(--soft-ink);
  font-weight: 800;
}

.dropdown-group {
  margin: 3px 6px 0;
  padding: 7px 10px 4px;
  color: var(--ink);
  font-weight: 900;
  font-size: .96rem;
}
.dropdown-menu .case-link {
  margin: 2px 6px 4px;
  padding: 8px 12px 8px 26px;
  line-height: 1.25;
  border-radius: 10px;
}
.dropdown-menu .case-link span {
  white-space: normal;
}
.hidden-by-level {
  display: none !important;
}

/* ==========================================================
   Dokumentbereich
   ========================================================== */
.workspace {
  height: calc(100vh - 64px - 126px - 36px);
  min-height: 430px;
  overflow: hidden;
  padding: 18px 24px 16px;
}
.paper-wrap {
  height: 100%;
  overflow: auto;
  display: grid;
  place-items: start center;
  min-width: 0;
  padding-bottom: 70px;
}
.paper {
  width: min(1100px, 98%);
  min-height: 1123px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,252,.98));
  box-shadow: 0 8px 28px rgba(18, 55, 68, 0.08);
  border-radius: 8px;
  padding: 72px 80px;
  outline: none;
  font-size: 18px;
  line-height: 1.55;
  border: 1px solid rgba(36,52,71,.08);
}
.paper:empty::before {
  content: '';
}
.paper h1 { font-size: 32px; margin: 0 0 18px; }
.paper img.inserted-img { max-width: 60%; display: block; margin: 16px auto; }

/* ==========================================================
   Walter-Dialog, Status, Toast
   ========================================================== */
.walter-dialog {
  width: min(760px, 92vw);
  border: 0;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 0;
  background: rgba(255,255,255,.97);
}
.walter-dialog::backdrop { background: rgba(36,52,71,.25); backdrop-filter: blur(3px); }
.walter-dialog-inner {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  padding: 22px;
  position: relative;
}
.walter-dialog-inner > img { width: 160px; align-self: start; filter: drop-shadow(0 10px 12px rgba(36,52,71,.16)); }
.dialog-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--cyber);
  font-size: 1.4rem;
  font-weight: 900;
}
.walter-dialog h2 { margin: 0 0 12px; }
.tip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tip-grid button {
  border: 0;
  background: var(--cyber);
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 900;
}
.tip-text {
  background: #f7fbfb;
  border: 1px solid rgba(36,52,71,.08);
  border-radius: 16px;
  padding: 13px 15px;
  line-height: 1.5;
}
.statusbar {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  background: rgba(255,255,255,.68);
  border-top: 1px solid rgba(36,52,71,.08);
  color: var(--soft-ink);
  font-size: .9rem;
  font-weight: 800;
}
.statusbar button {
  border: 0;
  border-radius: 999px;
  background: #2b7a78;
  color: white;
  padding: 6px 12px;
  font-weight: 900;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 54px;
  background: #2b7a78;
  color: white;
  padding: 14px 20px;
  border-radius: 18px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 900px) {
  .monitor-panel { left: 18%; width: 64%; top: 18%; }
  .stage-figure.pixeli { width: 165px; left: 0; }
  .stage-figure.walter { width: 170px; right: 0; }
  .mode-grid { grid-template-columns: 1fr; }
  .editor-body { overflow: auto; }
  .topbar { height: auto; flex-wrap: wrap; }
  .ribbon-tabs { align-items: stretch; flex-direction: column; }
  .program-tabs, .cyber-tabs { flex-wrap: wrap; }
  .workspace { height: auto; min-height: 60vh; overflow: visible; }
  .paper-wrap { overflow: visible; }
  .paper { padding: 44px 30px; min-height: 900px; }
  .walter-dialog-inner { grid-template-columns: 1fr; }
  .walter-dialog-inner > img { width: 120px; }
}


/* ============================================================
   V10 Feinschliff: keine dauerhafte Stufen-Schaltfläche unten
   ============================================================ */
.stage-footer,
.progress-footer,
.level-footer,
.bottom-stage,
.stage-actions,
#nextStage,
#nextStageBtn,
#unlockNext,
.next-stage,
.next-stage-btn,
.unlock-next {
  display: none !important;
}

/* Stufen-Test kompakt oben in der Kopfzeile */
.stage-select-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(18, 112, 115, 0.18);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-weight: 700;
  color: #126f72;
}

.stage-select-top select {
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  outline: none;
  cursor: pointer;
}

/* Das Dokument bleibt Mittelpunkt, ohne harten Papier-Kontrast */
.paper {
  background: #fafafa !important;
}


/* ============================================================
   V11: Untere Status-/Stufenleiste vollständig entfernen
   ============================================================ */
footer,
.app-footer,
.status-bar,
.stage-bar,
.stage-footer,
.progress-footer,
.level-footer,
.bottom-bar,
.bottom-stage,
.stage-actions,
.app-status,
#statusBar,
#stageBar,
#progressBar,
#nextStage,
#nextStageBtn,
#unlockNext,
.next-stage,
.next-stage-btn,
.unlock-next {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
}

/* Kein Platz für unsichtbare Leisten am unteren Rand reservieren */
body,
.app,
.workspace,
.editor-shell,
.main,
main {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Hintergrund soll als fixe Werkstattwand wirken, nicht mitscrollen */
body {
  background-size: cover !important;
  background-position: center center !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
}

/* Schreibbereich ohne Footer-Zwang */
.document-stage,
.editor-area,
.paper-wrap,
.paper-stage {
  padding-bottom: 2rem !important;
}

/* Papier bleibt weicher */
.paper {
  background: #fafafa !important;
  box-shadow: 0 8px 28px rgba(18, 55, 68, 0.08) !important;
  border: 1px solid rgba(20, 70, 84, 0.07) !important;
}


/* ============================================================
   V13: Begrüßungskasten IM Monitor tiefer und lesbarer
   ============================================================ */

/* Nur der erste Anmeldekasten auf der Monitor-Grafik.
   Nicht der gesamte Browser, nicht die Startseite, nicht der Hintergrund. */
#loginPanel.monitor-panel {
  top: 28% !important;
  left: 22% !important;
  width: 56% !important;
  min-height: 43% !important;
  padding: 28px 34px 26px !important;
  justify-content: center !important;
}

/* Überschrift bleibt groß, aber der Kasten soll nicht überladen wirken. */
#loginPanel h1 {
  font-size: clamp(3.1rem, 4.2vw, 4rem) !important;
  line-height: 1.08 !important;
  margin: 0 0 20px !important;
  letter-spacing: 0 !important;
}

/* Wichtig: mehr Zeilenabstand, damit fette Wörter nicht verschwimmen. */
#loginPanel .lead {
  font-size: clamp(1.25rem, 1.55vw, 1.5rem) !important;
  line-height: 1.7 !important;
  max-width: 760px !important;
  margin: 0 auto 20px !important;
  font-weight: 500 !important;
}

/* Oberzeile klar, aber nicht dominant */
#loginPanel .eyebrow {
  font-size: clamp(0.9rem, 1vw, 1.05rem) !important;
  line-height: 1.2 !important;
  margin: 0 0 10px !important;
}

/* Frage gut lesbar */
#loginPanel .name-label {
  font-size: clamp(1.25rem, 1.45vw, 1.45rem) !important;
  line-height: 1.35 !important;
  margin-top: 4px !important;
  margin-bottom: 10px !important;
  font-weight: 900 !important;
}

/* Eingabefeld etwas größer, aber nicht riesig */
#loginPanel .name-row {
  gap: 14px !important;
  margin-top: 6px !important;
}

#loginPanel .name-row input {
  min-height: 58px !important;
  font-size: 1.25rem !important;
  padding: 0 22px !important;
}

#loginPanel .primary-btn {
  min-height: 58px !important;
  font-size: 1.18rem !important;
  padding: 0 28px !important;
}

/* Hinweis unten besser lesbar, aber weiter als Hinweis erkennbar */
#loginPanel .small-note {
  font-size: clamp(0.98rem, 1.05vw, 1.12rem) !important;
  line-height: 1.45 !important;
  margin-top: 16px !important;
}

/* Bei kleineren Monitorhöhen nur etwas weniger tief, damit nichts kollidiert. */
@media (max-height: 760px) {
  #loginPanel.monitor-panel {
    top: 25% !important;
    min-height: 45% !important;
  }

  #loginPanel h1 {
    font-size: clamp(2.8rem, 4vw, 3.6rem) !important;
    margin-bottom: 16px !important;
  }

  #loginPanel .lead {
    font-size: clamp(1.15rem, 1.45vw, 1.38rem) !important;
    line-height: 1.6 !important;
    margin-bottom: 16px !important;
  }
}


/* V14: Begrüßungskasten wieder etwas nach oben */
#loginPanel.monitor-panel{
    top:22% !important;
}


/* V21: Start-/Einstufungskasten im Monitor */
#modePanel.monitor-panel {
  top: 22% !important;
  left: 22% !important;
  width: 56% !important;
}

/* V21: lokale Schrift */
body, button, input, select, textarea { font-family: "Andika", Arial, sans-serif; }
.paper, #editor, [contenteditable="true"] { font-family: "Andika", Arial, sans-serif; }

/* V21: Farbauswahl als echtes Details-Menü */
.tool-panel,
.ribbon,
.ribbon-panel,
.tool-row,
.tool-strip {
  overflow: visible !important;
}

.color-tool {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  overflow: visible !important;
}

.color-summary {
  list-style: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: .45rem !important;
  cursor: pointer !important;
  user-select: none !important;
}

.color-summary::-webkit-details-marker {
  display: none !important;
}

.color-preview {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--current-color);
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 0 0 1px rgba(36,52,71,.24);
  display: inline-block;
}

.color-popover {
  position: absolute !important;
  left: 0 !important;
  top: calc(100% + 10px) !important;
  z-index: 99999 !important;
  width: 330px !important;
  padding: 16px !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.98) !important;
  border: 1px solid rgba(36,52,71,.14) !important;
  box-shadow: 0 18px 42px rgba(36,52,71,.20) !important;
}

.color-title { margin: 0 0 12px; font-weight: 900; color: var(--ink, #243447); }

.color-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 46px) !important;
  gap: 11px !important;
}

.color-swatch {
  width: 46px !important;
  height: 46px !important;
  border-radius: 13px !important;
  border: 2px solid rgba(36,52,71,.20) !important;
  background: var(--swatch) !important;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.40), 0 2px 6px rgba(0,0,0,.07) !important;
  cursor: pointer !important;
}

.color-swatch[aria-label="Weiß"] {
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.07) !important;
}

.color-swatch:hover,
.color-swatch:focus-visible,
.color-swatch.is-selected {
  outline: 3px solid #2b7a78 !important;
  outline-offset: 2px !important;
}

.color-expert {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid rgba(36,52,71,.12);
}

.color-expert summary {
  cursor: pointer;
  font-weight: 900;
  color: #2b7a78;
}

.color-field,
.native-picker-label {
  display: grid;
  gap: 5px;
  margin-top: 11px;
  font-weight: 900;
  color: var(--ink, #243447);
}

.color-field input,
.rgb-fields input {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(36,52,71,.22);
  padding: 0 10px;
  font: inherit;
  background: white;
}

.rgb-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 11px;
}

.rgb-fields label {
  display: grid;
  gap: 5px;
  font-weight: 900;
}

.native-picker-label input[type="color"] {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(36,52,71,.22);
  border-radius: 10px;
  padding: 3px;
  background: white;
}

.statusbar { display: none !important; }


/* ============================================================
   V22 – Monitor-Dialoge zentrieren
   ============================================================ */

/* Willkommen + Stufenauswahl exakt mittig im Monitor */
#loginPanel.monitor-panel,
#modePanel.monitor-panel{
    left:50% !important;
    top:50% !important;
    transform:translate(-50%, -50%) !important;
    width:58% !important;
    min-height:auto !important;
}

/* ============================================================
   V22 – Farbauswahl Feinschliff
   ============================================================ */

.color-summary,
.color-button{
    background:#ffffff !important;
    border:1px solid rgba(0,0,0,.12) !important;
    border-radius:10px !important;
}

/* Farbfelder behalten, aber Tooltip-Namen reichen */
.color-popover{
    width:270px !important;
}

/* RGB kompakter */
.rgb-fields{
    grid-template-columns:auto auto auto !important;
    justify-content:start !important;
    gap:8px !important;
}

.rgb-fields input{
    width:58px !important;
    min-width:58px !important;
    padding:0 4px !important;
    text-align:center !important;
}

/* Expertenbereich kompakter */
.color-field input{
    max-width:110px !important;
}


/* V23 Monitor-Dialoge wirklich zentriert */
.monitor-screen,
.monitor-area,
.monitor-wrapper{
    display:flex !important;
    justify-content:center !important;
    align-items:center !important;
}

#loginPanel.monitor-panel,
#modePanel.monitor-panel{
    position:absolute !important;
    left:50% !important;
    top:50% !important;
    transform:translate(-50%,-50%) !important;
    width:56% !important;
}

/* Farbfelder kleiner */
.color-grid{
    grid-template-columns:repeat(5,34px) !important;
    gap:8px !important;
}
.color-swatch{
    width:34px !important;
    height:34px !important;
}


/* V24 Farbbutton vereinheitlichen */
.color-summary{
  background:#fff !important;
  border:1px solid rgba(36,52,71,.18) !important;
  min-height:38px !important;
  height:38px !important;
  padding:6px 12px !important;
  border-radius:10px !important;
  display:inline-flex !important;
  align-items:center !important;
  gap:8px !important;
  font:inherit !important;
}
.color-summary span[aria-hidden="true"]{
  display:none !important;
}
.color-summary .color-preview{
  width:14px !important;
  height:14px !important;
  min-width:14px !important;
  border-radius:4px !important;
}


/* ============================================================
   V25 – Farbbutton final an Toolbar angleichen
   ============================================================ */

/* Der Farbe-Button soll wie die anderen Toolbar-Buttons wirken:
   gleiche Höhe, gleiche Polsterung, keine Sonderoptik. */
.color-tool {
    display: inline-flex !important;
    align-items: center !important;
}

.color-summary,
#colorMenuButton {
    box-sizing: border-box !important;
    min-height: 40px !important;
    height: 40px !important;
    min-width: 96px !important;
    padding: 7px 14px !important;
    border-radius: 11px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    font-family: "Andika", Arial, sans-serif !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    background: rgba(255,255,255,.92) !important;
    border: 1px solid rgba(36,52,71,.10) !important;
    box-shadow: 0 2px 6px rgba(36,52,71,.07) !important;
    color: var(--ink, #243447) !important;
}

/* Das alte Paletten-Emoji bleibt entfernt. */
.color-summary span[aria-hidden="true"],
#colorMenuButton span[aria-hidden="true"] {
    display: none !important;
}

/* Der Text soll normal breit wirken und nicht gequetscht werden. */
.color-summary span:not(.color-preview),
#colorMenuButton span:not(.color-preview) {
    display: inline-block !important;
    min-width: 42px !important;
    text-align: left !important;
}

/* Die Farbvorschau bleibt klein, aber sauber sichtbar. */
.color-preview {
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    border-radius: 4px !important;
    margin-left: 2px !important;
    background: var(--current-color) !important;
    border: 2px solid rgba(255,255,255,.95) !important;
    box-shadow: 0 0 0 1px rgba(36,52,71,.28) !important;
}

/* Hover/Focus passend zu den übrigen Buttons. */
.color-summary:hover,
#colorMenuButton:hover,
.color-summary:focus-visible,
#colorMenuButton:focus-visible {
    background: #ffffff !important;
    outline: 3px solid rgba(43,122,120,.18) !important;
    outline-offset: 2px !important;
}


/* ============================================================
   V26 – Farbbutton sauber an Toolbar angleichen
   ============================================================ */

/* Details-Element selbst soll nur Hülle sein. */
.color-tool {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    overflow: visible !important;
}

/* Summary verhält sich optisch wie die anderen Toolbar-Buttons. */
.color-summary,
#colorMenuButton {
    box-sizing: border-box !important;
    list-style: none !important;
    border: 0 !important;
    background: rgba(255,255,255,.86) !important;
    color: var(--ink, #243447) !important;
    border-radius: 13px !important;
    min-height: 38px !important;
    height: 38px !important;
    min-width: 0 !important;
    width: auto !important;
    padding: 7px 10px !important;
    font-family: "Andika", Arial, sans-serif !important;
    font-size: 1rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    user-select: none !important;
    box-shadow: inset 0 0 0 1px rgba(36,52,71,.07), 0 3px 9px rgba(36,52,71,.04) !important;
    outline: none !important;
}

/* Browser-Marker des details/summary ausblenden. */
.color-summary::-webkit-details-marker {
    display: none !important;
}

.color-summary::marker {
    content: "" !important;
}

/* Kein Sonder-Hover/Focus mit dickem Rahmen. */
.color-summary:hover,
#colorMenuButton:hover {
    transform: translateY(-1px) !important;
    background: rgba(255,255,255,.86) !important;
    outline: none !important;
}

.color-summary:focus,
.color-summary:focus-visible,
#colorMenuButton:focus,
#colorMenuButton:focus-visible {
    outline: none !important;
}

/* Text im Button nicht künstlich verbreitern oder quetschen. */
.color-summary span:not(.color-preview),
#colorMenuButton span:not(.color-preview) {
    min-width: 0 !important;
    width: auto !important;
    display: inline !important;
    text-align: left !important;
}

/* Farbvorschau klein, ruhig und sauber. */
.color-preview {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    border-radius: 4px !important;
    margin-left: 2px !important;
    background: var(--current-color) !important;
    border: 2px solid rgba(255,255,255,.95) !important;
    box-shadow: 0 0 0 1px rgba(36,52,71,.28) !important;
    display: inline-block !important;
}

/* V30: Speziallisten als echte Listen mit wiederholendem Symbol */
#editor ul.custom-marker-list {
  list-style: none;
  padding-left: 1.8em;
}

#editor ul.custom-marker-list > li {
  position: relative;
  margin: 0.18em 0;
}

#editor ul.custom-marker-list > li::before {
  position: absolute;
  left: -1.55em;
  width: 1.2em;
  text-align: center;
}

#editor ul.custom-marker-list.marker-check > li::before { content: "☑"; }
#editor ul.custom-marker-list.marker-hint > li::before { content: "🔍"; }
#editor ul.custom-marker-list.marker-pin > li::before { content: "📌"; }


/* ==========================================================
   Schriftarten-Auswahl: Namen in der jeweiligen Schrift anzeigen
   ========================================================== */
#fontFamily {
  font-family: "Andika", Arial, sans-serif;
}

#fontFamily option[value="Andika"] {
  font-family: "Andika", Arial, sans-serif;
}

#fontFamily option[value="Pridi"] {
  font-family: "Pridi", serif;
}

#fontFamily option[value="Outfit"] {
  font-family: "Outfit", Arial, sans-serif;
}

#fontFamily option[value="Yanone Kaffeesatz"] {
  font-family: "Yanone Kaffeesatz", Arial, sans-serif;
}

#fontFamily option[value="Atma"] {
  font-family: "Atma", cursive;
}

#fontFamily option[value="Grenze Gotisch"] {
  font-family: "Grenze Gotisch", serif;
}

#fontFamily option[value="Roboto Mono"] {
  font-family: "Roboto Mono", monospace;
}

#fontFamily option[value="Bitcount Single"] {
  font-family: "Bitcount Single", monospace;
}



/* V32 – Rückgängig/Wiederholen */
.tool-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

/* ============================================================
   V32f: Aktive Werkzeugschalter sichtbar machen
   ============================================================ */
.tool-panel button.tool-active {
  background: #d8eef8 !important;
  color: #123747 !important;
  box-shadow:
    inset 0 0 0 2px rgba(43, 122, 120, 0.42),
    inset 0 3px 8px rgba(36, 52, 71, 0.10),
    0 2px 6px rgba(36, 52, 71, 0.06) !important;
  transform: translateY(1px);
}

.tool-panel button.tool-active:hover {
  transform: translateY(1px);
}

/* ============================================================
   V32o: Drucklayout – nur das Dokument drucken
   ============================================================ */
@media print {
  @page {
    size: A4 portrait;
    margin: 14mm;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    min-height: 0 !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  .topbar,
  .ribbon,
  .ribbon-tabs,
  .ribbon-tools,
  .cyber-tabs,
  .tool-panel,
  .start-overlay,
  .modal,
  .toast,
  .ghost-link,
  #tueftelMenu,
  #walterBtn,
  #tueftelBtn,
  .walter-btn {
    display: none !important;
  }

  .workspace,
  .paper-wrap {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-width: none !important;
    background: #ffffff !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .paper,
  #editor {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-width: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  #editor img,
  .inserted-img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
