/* Kundenportal */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1d2733;
  --muted: #637081;
  --line: #dde3ea;
  --accent: #1f5fa8;
  --accent-dark: #174a84;
  --danger: #b42318;
  --ok: #1a7f37;
  --warn: #b26a00;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.45; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
code { background: #eef1f4; padding: 0 .3em; border-radius: 4px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: #16263a; color: #fff; padding: .7rem 1.5rem; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; }
.brand a { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: .6rem; }
.brand img { width: 30px; height: 30px; display: block; }
.login-logo { display: block; width: 72px; height: 72px; margin: 0 0 1rem; }
.who { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.who .muted { color: #b8c4d2; }
.mainnav { background: #fff; border-bottom: 1px solid var(--line); padding: 0 1.5rem; display: flex; gap: .25rem; flex-wrap: wrap; }
.mainnav a { padding: .75rem .8rem; text-decoration: none; color: var(--text); border-bottom: 3px solid transparent; }
.mainnav a:hover { color: var(--accent); }
.mainnav a.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.subnav { background: #eef3f9; border-bottom: 1px solid var(--line); padding: 0 1.5rem; display: flex; gap: .25rem; flex-wrap: wrap; font-size: .92rem; }
.subnav a { padding: .5rem .7rem; text-decoration: none; color: var(--text); }
.subnav a.active { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
main { max-width: 1250px; margin: 0 auto; padding: 1.5rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.card.narrow, .narrow { max-width: 460px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + form { margin-top: 1.25rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem 1.25rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.prewrap { white-space: pre-wrap; }

.form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; margin-bottom: .9rem; }
.form .grid2 label, .form .grid3 label { margin-bottom: 0; }
.form .grid2 { margin-bottom: 1rem; }
input, select, textarea { font: inherit; padding: .5rem .6rem; border: 1px solid #c4cdd7; border-radius: 6px; background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31, 95, 168, .3); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; }
input.tiny { width: 5rem; }
input.code { font-size: 1.5rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
label.check, .form label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; margin-bottom: .4rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 600; padding: 0 .4rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .1rem 1.5rem; margin-bottom: .6rem; }
.check-row { display: flex; flex-direction: column; }
.check-row .item-note { display: none; margin: -.2rem 0 .5rem 1.6rem; padding: .3rem .5rem; font-size: .85rem; }
.check-row:has(input:checked) .item-note { display: block; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.inline-form input, .inline-form select { flex: 1 1 180px; width: auto; }
.inline-form input[type=color] { flex: 0 0 3rem; }
.inline-form input.tiny { flex: 0 0 9rem; }
.inline { display: inline; }

.btn { display: inline-block; padding: .5rem 1rem; border: 1px solid #c4cdd7; border-radius: 6px; background: #fff;
  color: var(--text); font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); color: #fff; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.small { padding: .25rem .6rem; font-size: .85rem; }
.linklike { background: none; border: 0; color: #fff; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.buttons { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.alert { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.alert.error { background: #fdecea; border-color: #f4b4ad; color: #7a1a12; }
.alert.success { background: #e9f6ec; border-color: #a7d8b3; color: #164f25; }
.alert.info { background: #eaf2fb; border-color: #b4cdea; color: #183f6b; }
.alert p { margin: .3rem 0; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.table.compact th, .table.compact td { padding: .35rem .45rem; }
.table tr.inactive td { opacity: .55; }
.table .num { text-align: right; }
.table .actions a { margin-right: .7rem; white-space: nowrap; }
td.soon { color: var(--warn); font-weight: 600; }
progress { width: 90px; height: 8px; vertical-align: middle; accent-color: var(--ok); }

.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #e7ebf0; color: #334; white-space: nowrap; }
.st-eingereicht { background: #e3edfa; color: #184a86; }
.st-in_bearbeitung { background: #fff1d6; color: #7a4b00; }
.st-rueckfrage { background: #fde4e1; color: #8a1f13; }
.st-eingerichtet { background: #e6f0ff; color: #2b3f9e; }
.st-freigegeben { background: #dff3e4; color: #145c28; }
.st-storniert { background: #eceff2; color: #5d6670; }
.type-onboarding { background: #e3edfa; color: #184a86; }
.type-offboarding { background: #fde4e1; color: #8a1f13; }
.type-stilllegung { background: #fff1d6; color: #7a4b00; }
.type-reaktivierung { background: #dff3e4; color: #145c28; }
.new-buttons { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.type-tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .8rem; border-bottom: 1px solid var(--line); }
.type-tabs a { padding: .45rem .8rem; text-decoration: none; color: var(--text); border-bottom: 3px solid transparent; }
.type-tabs a.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.card.related { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; padding: .8rem 1.25rem; }
.inline-form label.grow { flex: 1 1 360px; margin: 0; }
[hidden] { display: none !important; }
.ok-text { color: var(--ok); }
.err-text { color: var(--danger); }
.card.danger-zone { border-color: #f4b4ad; }
.card.danger-zone form + form { margin-top: 1rem; }
.staff-box { background: #f3f8ff; border-color: #b4cdea; }
.staff-box p { margin: .3rem 0; }
.complete-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.complete-form label.check { margin: 0; }
.tag { display: inline-block; font-size: .72rem; padding: .05rem .45rem; border-radius: 4px; background: #eef1f4; color: var(--muted); margin-left: .3rem; vertical-align: middle; }
.tag.warn { background: #fff1d6; color: #7a4b00; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.tile { display: flex; flex-direction: column; padding: .7rem .9rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.tile strong { font-size: 1.4rem; }
.tile span { font-size: .85rem; }
.tile.active { outline: 2px solid var(--accent); }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar label { display: flex; align-items: center; gap: .4rem; }
.toolbar select, .toolbar input[type=search] { width: auto; min-width: 200px; }
.push-right { margin-left: auto; }
.company-switch label { font-weight: 600; }

.facts { display: grid; grid-template-columns: 160px 1fr; gap: .35rem .8rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.checklist { list-style: none; padding: 0; margin: 0 0 .6rem; }
.checklist li { padding: .25rem 0; border-bottom: 1px dashed var(--line); }
.checklist li.done label { text-decoration: line-through; color: var(--muted); }
.checklist label { display: inline-flex; gap: .5rem; align-items: center; }

.timeline { list-style: none; padding: 0; margin: 0 0 1rem; }
.timeline li { border-left: 3px solid var(--line); padding: .4rem 0 .6rem .9rem; margin-left: .3rem; }
.timeline li.kind-comment { border-left-color: var(--accent); }
.timeline li.kind-status { border-left-color: var(--warn); }
.timeline li.internal { background: #fffaf0; }
.timeline .meta { font-size: .8rem; color: var(--muted); margin-bottom: .2rem; }

.template-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.25rem; align-items: start; }
.pick { list-style: none; margin: 0 0 1rem; padding: 0; }
.pick li { padding: .3rem .5rem; border-radius: 6px; }
.pick li.active { background: #e3edfa; font-weight: 600; }
.pick a { text-decoration: none; }

.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .8rem; }
.qr { margin: .8rem 0; }
.qr img { border: 1px solid var(--line); border-radius: 6px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .08em; background: #f3f5f8; padding: .5rem .7rem; border-radius: 6px; display: inline-block; user-select: all; }
.links { display: flex; flex-wrap: wrap; gap: 1.2rem; }

@media (max-width: 800px) {
  main { padding: 1rem; }
  .template-layout { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
}

/* App-Startseite */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; margin-bottom: 1.5rem; }
.app-tile { display: flex; flex-direction: column; gap: .45rem; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1.2rem; text-decoration: none; color: var(--text); transition: box-shadow .15s, transform .15s; min-height: 190px; }
.app-tile:hover { box-shadow: 0 6px 18px rgba(22, 38, 58, .12); transform: translateY(-2px); }
.app-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; }
.app-name { font-weight: 700; font-size: 1.1rem; }
.app-desc { color: var(--muted); font-size: .9rem; flex: 1; }
.app-foot { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.matrix-wrap { overflow-x: auto; margin-bottom: 1rem; }
.matrix th, .matrix td.center, .center { text-align: center; }
.matrix th:first-child { text-align: left; }
.matrix tbody tr:hover { background: #f7f9fb; }
.matrix input[type=checkbox] { width: 18px; height: 18px; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; font: inherit; }
input[type=color] { width: 3rem; height: 2.3rem; padding: .15rem; }

/* Druckansicht */
body.print { background: #fff; padding: 1.5cm; max-width: 21cm; margin: 0 auto; }
body.print h2 { margin-top: 1.2rem; }
.print-list li { list-style: none; padding: .3rem 0; }
.print-list .box { font-size: 1.2rem; margin-right: .4rem; }
.sign { margin-top: 2.5rem; }
@media print {
  .topbar, .mainnav, .toolbar, .buttons, form .btn { display: none !important; }
  body.print { padding: 0; }
}

/* ===== App „Formulare“ ===== */
.forms-layout { display: grid; grid-template-columns: 270px 1fr; gap: 1.25rem; align-items: start; }
.folder-nav .tree, .folder-nav .tree ul { list-style: none; margin: 0; padding: 0; }
.folder-nav .tree ul { padding-left: 1rem; }
.folder-nav .tree li > a { display: inline-block; padding: .25rem .4rem; border-radius: 6px; text-decoration: none; color: var(--text); }
.folder-nav .tree li.active > a { background: #e3edfa; color: var(--accent); font-weight: 600; }
.compact-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.compact-form label { margin-bottom: .5rem; font-size: .9rem; }
.breadcrumb { margin: 0 0 .8rem; color: var(--muted); }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.folder-tile { display: flex; flex-direction: column; gap: .15rem; padding: .8rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 600; }
.folder-tile:hover { border-color: var(--accent); }
.folder-tile > span:first-child { font-size: 1.4rem; }
.folder-tools summary { cursor: pointer; font-weight: 600; }
.folder-tools .inline-form { align-items: center; }
details.more { display: inline-block; position: relative; }
details.more summary { list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; box-shadow: 0 6px 18px rgba(22,38,58,.15); min-width: 260px; display: grid; gap: .5rem; }
.more-menu .inline-form { margin: 0; }
.pick-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: .4rem .6rem; }
.pick-list label.check { margin: 0; padding: .2rem 0; border-bottom: 1px dashed var(--line); }
.filter-input { margin-bottom: .4rem; }
.pager { display: flex; gap: .6rem; flex-wrap: wrap; }
.logo-preview { display: block; max-width: 260px; max-height: 120px; margin-bottom: 1rem; border: 1px dashed var(--line); padding: .5rem; background: #fff; }
.api-doc { margin-top: 1rem; }
.api-doc summary { cursor: pointer; font-weight: 600; }
.code-block { background: #16263a; color: #e8eef5; padding: .8rem 1rem; border-radius: 6px; overflow-x: auto; font-size: .85rem; }
.danger-inline { margin-top: 1rem; }
.sticky-buttons { position: sticky; bottom: 0; background: var(--bg); padding: .7rem 0; z-index: 4; border-top: 1px solid var(--line); }
label.mt, .mt { margin-top: 1rem; }
span.ph { display: inline-block; background: #e6f4f1; color: #0b5e53; border: 1px solid #a8d8cf; border-radius: 4px; padding: 0 .3em; font-size: .9em; line-height: 1.35; white-space: nowrap; cursor: default; user-select: all; }

/* Inhalt von Formularen (Editor und Druck gleich) */
.doc-content { font-family: Arial, Helvetica, "Liberation Sans", sans-serif; font-size: 11pt; line-height: 1.4; color: #111; }
.doc-content p { margin: 0 0 .6em; }
.doc-content h1 { font-size: 18pt; margin: 0 0 .5em; }
.doc-content h2 { font-size: 14pt; margin: .2em 0 .5em; }
.doc-content h3 { font-size: 12pt; margin: .2em 0 .4em; color: inherit; text-transform: none; letter-spacing: 0; }
.doc-content h4 { font-size: 11pt; margin: .2em 0 .4em; }
.doc-content ul, .doc-content ol { margin: 0 0 .6em; padding-left: 1.4em; }
.doc-content hr { border: 0; border-top: 1px solid #888; margin: .6em 0; }
.doc-content a { color: inherit; }
.doc-content table { width: 100%; border-collapse: collapse; margin: 0 0 .6em; }
.doc-content table td, .doc-content table th { padding: .25em .4em; vertical-align: top; text-align: left; }
.doc-content table.tbl-grid td, .doc-content table.tbl-grid th { border: 1px solid #555; }
.doc-content table.tbl-grid th { background: #eee; }
.doc-content table.tbl-plain td, .doc-content table.tbl-plain th { padding-left: 0; }
.doc-content td.w-50 { width: 55%; }
.doc-content .v-bottom { vertical-align: bottom; }
.doc-content .al-center { text-align: center; }
.doc-content .al-right { text-align: right; }
.doc-content .al-justify { text-align: justify; }
.doc-content .fs-small { font-size: 8.5pt; }
.doc-content .fs-large { font-size: 13pt; }
.doc-content .fs-xlarge { font-size: 17pt; }
.doc-content .c-muted { color: #666; }
.doc-content .c-accent { color: #1f5fa8; }
.doc-content img { max-width: 100%; }
.doc-content img.img-s { max-height: 20mm; }
.doc-content img.img-m { max-height: 40mm; }
.doc-content img.img-l { max-height: 80mm; }
.doc-content img.doc-logo { max-height: 22mm; max-width: 70mm; }
.doc-content p.sig { border-top: 1px solid #333; padding-top: .2em; margin-top: 10mm; font-size: 9pt; width: 85%; }
.doc-content table.sig td { width: 50%; }
.doc-content .box { font-size: 1.15em; }
.doc-content .page-break { border-top: 2px dashed #a8d8cf; margin: 1em 0; height: 0; }
.region .page-break::after { content: "Seitenumbruch"; display: block; text-align: center; font-size: 8pt; color: #0b5e53; }

@media (max-width: 900px) {
  .forms-layout { grid-template-columns: 1fr; }
}
.company-switch { margin-bottom: 1rem; }
.company-switch select { width: auto; min-width: 240px; margin-left: .4rem; }
.layout-head { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: end; }
.layout-head label { margin-bottom: 0; }
.form .grid2 > .card label:not(.check) { margin-bottom: .9rem; }

/* ===== Formular-Editor im Stil von Word ===== */
body.word-app, body.fill-app { margin: 0; background: #e8eaed; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.word-form { display: none; }
.word-title { display: flex; align-items: center; gap: .7rem; background: #16263a; color: #fff; padding: .35rem 1rem; flex: 0 0 auto; }
.word-title .ic { width: 18px; height: 18px; }
.wt-back { color: #fff; display: flex; padding: .25rem; border-radius: 4px; }
.wt-back:hover { background: rgba(255,255,255,.12); }
.wt-app { font-size: 1.2rem; }
.wt-name { background: transparent; border: 1px solid transparent; color: #fff; font-size: 1rem; font-weight: 600; width: auto; min-width: 260px; max-width: 520px; padding: .3rem .5rem; }
.wt-name:hover, .wt-name:focus { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.06); outline: none; }
.wt-doc { font-weight: 600; }
.wt-state { color: #ffd479; font-size: .85rem; }
.wt-actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; position: relative; }
.wt-btn { display: inline-flex; align-items: center; gap: .35rem; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 5px; padding: .35rem .75rem; font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.wt-btn:hover { background: rgba(255,255,255,.2); }
.wt-btn.primary { background: #2b7de9; border-color: #2b7de9; }
.wt-btn.primary:hover { background: #1f68c9; }
.wt-date { display: inline-flex; align-items: center; gap: .3rem; }
.wt-date input { width: auto; padding: .25rem .4rem; background: rgba(255,255,255,.95); border: 0; }
.toast { position: fixed; top: 52px; right: 1rem; z-index: 50; padding: .6rem 1rem; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.18); animation: toast-out 6s forwards; max-width: 520px; }
.toast.success { background: #e9f6ec; color: #164f25; border: 1px solid #a7d8b3; }
.toast.error { background: #fdecea; color: #7a1a12; border: 1px solid #f4b4ad; }
.toast.info { background: #eaf2fb; color: #183f6b; border: 1px solid #b4cdea; }
@keyframes toast-out { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

.word { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.rb-tabs { display: flex; gap: .1rem; background: #f3f3f3; padding: .2rem .8rem 0; border-bottom: 1px solid #d6d6d6; flex: 0 0 auto; }
.rb-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: .45rem .9rem .35rem; font: inherit; font-size: .9rem; cursor: pointer; color: #333; }
.rb-tab:hover { background: #e6e6e6; }
.rb-tab.active { border-bottom-color: #2b7de9; color: #1f5fa8; font-weight: 600; }
.rb-tab-ctx { color: #0f7b6c; }
.rb-tab-ctx.active { border-bottom-color: #0f7b6c; color: #0f7b6c; }
.rb-tab-ctx.pulse { background: #e6f4f1; }
.ribbon { background: #fbfbfb; border-bottom: 1px solid #d6d6d6; flex: 0 0 auto; min-height: 98px; }
.rb-panel { display: none; padding: .35rem .6rem 0; gap: .3rem 0; align-items: stretch; flex-wrap: wrap; }
.rb-panel.active { display: flex; }
.rb-group { display: flex; flex-direction: column; padding: 0 .55rem; border-right: 1px solid #e0e0e0; flex: 0 0 auto; }
.rb-items { display: flex; gap: .15rem; align-items: flex-start; flex: 1; min-height: 66px; }
.rb-label { text-align: center; font-size: .72rem; color: #666; padding: .15rem 0 .3rem; white-space: nowrap; }
.rb-font { flex-direction: column; gap: .25rem; }
.rb-row { display: flex; gap: .15rem; align-items: center; }
.rb { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; border: 1px solid transparent; background: none; border-radius: 4px; cursor: pointer; color: #222; font: inherit; font-size: .78rem; padding: .25rem .4rem; min-width: 30px; }
.rb:hover { background: #e8eef7; border-color: #c9d8ee; }
.rb.on { background: #cfe0f5; border-color: #9fbfe6; }
.rb .ic { width: 20px; height: 20px; }
.rb-big { min-width: 54px; height: 64px; }
.rb-big .ic { width: 26px; height: 26px; }
.rb-big span { white-space: nowrap; }
.rb-sm { flex-direction: row; height: 28px; padding: 0 .35rem; font-size: .9rem; }
.rb-sm .ic { width: 17px; height: 17px; }
.rb-sm sup, .rb-sm sub { font-size: .65em; }
.rb-line { flex-direction: row; gap: .35rem; height: 26px; justify-content: flex-start; width: 100%; }
.rb-line .ic { width: 17px; height: 17px; }
.rb-drop { padding: 0; min-width: 14px; height: 28px; }
.rb-drop .ic { width: 12px; height: 12px; }
.rb-split { position: relative; display: inline-flex; align-items: flex-start; }
.rb-stack { display: flex; flex-direction: column; gap: .2rem; padding-left: .3rem; }
.rb-stack select { width: 150px; font-size: .82rem; padding: .2rem; }
.ribbon select, .ribbon input { width: auto; font-size: .85rem; padding: .2rem .35rem; border-radius: 3px; border-color: #c8c8c8; height: 28px; }
.ribbon [data-font], .ribbon [data-page-font] { width: 150px; }
.ribbon [data-size] { width: 54px; }
.ribbon .rb-num { width: 54px; }
.ribbon .rb-wide { width: 220px; }
.ribbon [data-layout-select] { width: 190px; }
.rb-lbl { font-size: .78rem; color: #555; min-width: 2.6rem; }
.glyph-a { font-weight: 700; font-size: 1rem; line-height: 1; }
.glyph-hl { font-size: .85rem; line-height: 1; padding: 0 2px; border: 1px solid #bbb; border-radius: 2px; }
.color-bar { display: block; width: 18px; height: 4px; margin-top: 1px; }
.rb-sm:has(.color-bar) { flex-direction: column; gap: 0; }
.rb-styles { gap: .3rem; }
.st-card { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; width: 82px; height: 62px; background: #fff; border: 1px solid #dcdcdc; border-radius: 3px; padding: .25rem .4rem; cursor: pointer; font: inherit; overflow: hidden; }
.st-card:hover { border-color: #2b7de9; background: #f4f8fe; }
.st-card small { font-size: .7rem; color: #555; white-space: nowrap; }
.st-normal { font-family: Arial, sans-serif; font-size: 11pt; }
.st-title { font-family: Arial, sans-serif; font-size: 16pt; }
.st-h1 { font-weight: 700; font-size: 13pt; color: #1f3864; }
.st-h2 { font-weight: 700; font-size: 11pt; color: #2f5496; }
.st-h3 { font-weight: 700; font-size: 10pt; color: #404040; }
.st-quote { font-style: italic; color: #555; }
.st-small { font-size: 8pt; color: #666; }
.rb-hint p { font-size: .78rem; color: #555; max-width: 260px; margin: .2rem 0; }

/* Ausklappmenüs */
.pop { display: none; position: absolute; top: calc(100% + 2px); left: 0; z-index: 30; background: #fff; border: 1px solid #c8c8c8; border-radius: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: .35rem; }
.pop.open { display: block; }
.pop.menu { min-width: 240px; max-height: 60vh; overflow-y: auto; }
.pop.menu > button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .4rem .6rem; font: inherit; font-size: .88rem; cursor: pointer; border-radius: 3px; }
.pop.menu > button:hover { background: #e8eef7; }
.pop.menu small { color: #666; }
.pop.menu hr { border: 0; border-top: 1px solid #e3e3e3; margin: .3rem 0; }
.ph-menu > button code { float: right; color: #0b5e53; background: #e6f4f1; font-size: .75rem; margin-left: 1rem; }
.sw-grid { display: grid; grid-template-columns: repeat(10, 18px); gap: 3px; }
#pop-back .sw-grid, #pop-shade .sw-grid { grid-template-columns: repeat(6, 22px); }
.sw { width: 18px; height: 18px; border: 1px solid #bbb; border-radius: 2px; cursor: pointer; padding: 0; }
#pop-back .sw, #pop-shade .sw { width: 22px; height: 22px; }
.sw:hover { outline: 2px solid #2b7de9; }
.sw-none { background: linear-gradient(135deg, #fff 45%, #d00 46%, #d00 54%, #fff 55%); }
.sw-more { display: flex; align-items: center; gap: .4rem; font-size: .8rem; margin-top: .45rem; white-space: nowrap; }
.sw-more input { width: 30px; height: 22px; padding: 0; border: 0; }
.table-picker { padding: .5rem; }
.tp-grid { display: grid; grid-template-columns: repeat(10, 16px); gap: 2px; }
.tp-grid button { width: 16px; height: 16px; border: 1px solid #c4c4c4; background: #fff; padding: 0; cursor: pointer; }
.tp-grid button.on { background: #cfe0f5; border-color: #2b7de9; }
.tp-label { font-size: .8rem; text-align: center; margin-top: .35rem; }
.pop.symbols.open { display: grid; grid-template-columns: repeat(10, 28px); gap: 2px; }
.symbols button { width: 28px; height: 28px; border: 1px solid transparent; background: none; cursor: pointer; font-size: 1rem; border-radius: 3px; }
.symbols button:hover { background: #e8eef7; border-color: #c9d8ee; }
.margin-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .6rem; padding: .2rem .4rem; }
.margin-inputs label { display: flex; justify-content: space-between; align-items: center; gap: .4rem; font-size: .82rem; }
.margin-inputs input { width: 70px; padding: .2rem; }

/* Formelleiste */
.formula-bar { display: flex; align-items: center; gap: .4rem; background: #fff; border-bottom: 1px solid #d6d6d6; padding: .25rem .8rem; flex: 0 0 auto; }
.fb-name { min-width: 64px; text-align: center; border: 1px solid #cfcfcf; border-radius: 3px; padding: .15rem .4rem; font-size: .85rem; font-family: ui-monospace, Consolas, monospace; color: #333; }
.fb-fx { color: #777; display: flex; }
.fb-fx .ic { width: 18px; height: 18px; }
.formula-bar input { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; padding: .25rem .5rem; height: 28px; }
.formula-bar input:disabled { background: #f6f6f6; }

/* Arbeitsfläche mit Seite */
.canvas { flex: 1 1 auto; overflow: auto; padding: 0 1rem 2rem; position: relative; }
.ruler { width: 210mm; height: 18px; margin: .6rem auto 0; position: relative; background: #fff; border: 1px solid #cfcfcf; border-bottom: 0; font-size: 9px; color: #666; overflow: hidden; }
.rl-margin { position: absolute; top: 0; bottom: 0; background: #d9d9d9; }
.rl-tick { position: absolute; bottom: 0; width: 0; height: 4px; border-left: 1px solid #999; }
.rl-tick.major { height: 18px; border-left: 0; }
.rl-tick.major::before { content: ""; position: absolute; bottom: 0; height: 6px; border-left: 1px solid #888; }
.rl-tick { text-indent: -4px; line-height: 11px; }
.rl-indent { position: absolute; top: 0; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid #2b7de9; margin-left: -5px; }
.page { position: relative; width: 210mm; min-height: 297mm; margin: 0 auto 1rem; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.2);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(297mm - 2px), #9aa7b4 calc(297mm - 2px), #9aa7b4 297mm, transparent 297mm); display: flex; flex-direction: column; }
.page .region { outline: none; }
.region-body { flex: 1 0 auto; min-height: 60mm; }
.region-header { margin-bottom: 6mm; }
.region-footer { margin-top: 6mm; }
.region.locked { opacity: .55; cursor: default; }
.region.locked:hover { opacity: .75; box-shadow: 0 0 0 1px #9fbfe6; }
.region.hf-empty { min-height: 0; opacity: 1; }
.hf-tag { font-size: .7rem; color: #7a8796; border-bottom: 1px dashed #b9c4d0; margin: 0 0 2mm; padding-bottom: 1px; user-select: none; cursor: pointer; }
.hf-tag-footer { order: 0; }
.page.hf-editing .region-body { opacity: .4; }
.page.hf-editing .region.hf-active { opacity: 1; box-shadow: 0 0 0 2px #2b7de9; }
.hf-pick { display: inline-flex; gap: .35rem; align-items: center; }
.hf-pick select { font: inherit; padding: .15rem .3rem; }
.hf-note { color: #6b5a1e; }
.hf-bar { position: sticky; top: 0; z-index: 5; width: 210mm; max-width: 100%; margin: .6rem auto 0; background: #fff8e1; border: 1px solid #f0d58a; border-radius: 4px; padding: .45rem .7rem; font-size: .88rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.page.col-resize, .page.col-resize td, body.dragging-col, body.dragging-col * { cursor: col-resize !important; }
.page.selecting-cells ::selection { background: transparent; }
.region td.cell-sel, .region th.cell-sel { background-color: rgba(43,125,233,.18) !important; }
.region td[data-formula] { background-color: #f3f7fc; cursor: cell; }
.region td[data-input], .region th[data-input] { background-color: #fffbe6; }
.region .calc-error, .fill-canvas .calc-error { color: #b42318; font-weight: 600; }
.region table td, .region table th { min-width: 2em; }
.region table.tbl-plain td, .region table.tbl-plain th { outline: 1px dashed #d3dbe4; outline-offset: -1px; }
.region span.ph-f, .region span.ph.ph-f { background: #fff3c4; color: #7a5a00; border-color: #f0d58a; }
.cell-heads { position: absolute; inset: 0; pointer-events: none; }
.cell-heads span { position: absolute; font: 600 10px/16px system-ui, sans-serif; color: #666; background: #f0f0f0; border: 1px solid #d0d0d0; text-align: center; box-sizing: border-box; }
.cell-heads .ch-col { height: 16px; }
.cell-heads .ch-row { width: 20px; display: flex; align-items: center; justify-content: center; }
.cell-heads span.on { background: #cfe0f5; color: #1f5fa8; border-color: #9fbfe6; }

.statusbar { display: flex; align-items: center; gap: 1.5rem; background: #f3f3f3; border-top: 1px solid #d6d6d6; padding: .15rem 1rem; font-size: .8rem; color: #444; flex: 0 0 auto; }
.st-zoom { margin-left: auto; display: flex; align-items: center; gap: .3rem; }
.st-zoom input[type=range] { width: 120px; padding: 0; border: 0; height: auto; }

/* ===== Ausfüllen im Dokument ===== */
.fill-canvas { flex: 1 1 auto; overflow: auto; padding: 1rem; }
.fill-note { width: 210mm; max-width: 100%; margin: 0 auto 1rem; background: #fff8e1; border: 1px solid #f0d58a; border-radius: 4px; padding: .6rem .8rem; }
.customers-pop { position: fixed; top: 46px; right: 1rem; left: auto; width: 440px; max-width: calc(100vw - 2rem); padding: .8rem; }
.customers-pop .cust-search { display: flex; gap: .4rem; margin-bottom: .5rem; }
.customers-pop .pick-list { max-height: 50vh; }
.customers-pop .buttons { margin-top: .6rem; justify-content: space-between; }
.sheet { background: #fff; width: 210mm; min-height: 297mm; margin: 0 auto 1.2rem; box-shadow: 0 2px 12px rgba(22,38,58,.2); display: flex; flex-direction: column; box-sizing: border-box; }
.doc-header { margin-bottom: 6mm; }
.doc-body { flex: 1 0 auto; }
.doc-footer { margin-top: 6mm; }
.fill { display: inline-block; min-width: 4em; min-height: 1.3em; background: #fff8d6; border-bottom: 1px solid #d9b84a; padding: 0 .15em; outline: none; vertical-align: baseline; white-space: pre-wrap; }
.fill:empty::before { content: attr(data-label); color: #a08a3c; font-style: italic; font-size: .9em; }
.fill:focus { background: #fff0a8; box-shadow: 0 0 0 2px #f0d58a; }
.fill.fill-multi { display: block; min-height: 3.5em; width: 100%; }
.fill.fill-num { min-width: 3em; text-align: right; }
.fill.filled { background: transparent; border-bottom-color: transparent; }
.fill.filled:hover, .fill.filled:focus { background: #fff8d6; border-bottom-color: #d9b84a; }
.fill-check { font: inherit; font-size: 1.15em; line-height: 1; background: #fff8d6; border: 0; padding: 0 .1em; cursor: pointer; }
.fill-select, .fill-date { width: auto; font: inherit; padding: 0 .2em; background: #fff8d6; border: 0; border-bottom: 1px solid #d9b84a; border-radius: 0; height: auto; }
.fill-print { display: none; }
td.fill-cell { background: #fffbe6; outline: none; cursor: text; }
td.fill-cell:focus { box-shadow: inset 0 0 0 2px #f0d58a; background: #fff0a8; }
.grow-btn { font: 600 .8rem system-ui, sans-serif; background: #e6f4f1; color: #0b5e53; border: 1px dashed #a8d8cf; border-radius: 4px; padding: .2rem .7rem; cursor: pointer; margin: -0.3em 0 .6em; }
.page-break-inline { display: block; }
@media print {
  @page { size: A4; margin: 0; }
  body.fill-app { background: #fff; height: auto; overflow: visible; display: block; }
  .fill-app .word-title, .fill-note, .pop, .grow-btn, .toast { display: none !important; }
  .fill-canvas { padding: 0; overflow: visible; }
  .sheet { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .sheet:last-of-type { break-after: auto; page-break-after: auto; }
  .fill, .fill:focus { background: none; box-shadow: none; border-bottom: 0; }
  .fill:empty { border-bottom: 1px solid #555; min-width: 6em; }
  .fill:empty::before { content: ""; }
  .fill.fill-multi:empty { border-bottom: 0; background: repeating-linear-gradient(transparent 0, transparent 1.35em, #888 1.35em, #888 calc(1.35em + 1px)); min-height: 4.2em; }
  .fill-check { background: none; }
  .fill-select, .fill-date { display: none; }
  .fill-print { display: inline; }
  td.fill-cell { background: none !important; box-shadow: none !important; }
  .doc-body .page-break, .page-break-inline { break-after: page; page-break-after: always; border: 0; margin: 0; }
}
/* Editor eingebettet (Briefkopf & Fußzeile) */
.template-layout > section { min-width: 0; }
.word[data-mode=layout] { border: 1px solid var(--line); border-radius: var(--radius); background: #e8eaed; }
.word[data-mode=layout] .formula-bar { display: none; }
.word[data-mode=layout] .canvas { max-height: 70vh; padding-bottom: 1rem; }
.word[data-mode=layout] .page { min-height: 80mm; background-image: none; }
.paper-wrap .word { margin: 0; }
.pop.ph-menu { min-width: 340px; }

/* Datensicherung */
.table .actions .linklike { color: #b3261e; text-decoration: none; }
.table .actions .linklike:hover { text-decoration: underline; }
textarea.code { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .78rem; margin: .4rem 0 .6rem; }

/* Selbstregistrierung */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.zipcity { grid-template-columns: 7rem 1fr; gap: 1rem; margin-bottom: 0 !important; }
.card.review { border-color: #f0c27b; background: #fffaf0; }
details summary { cursor: pointer; }

/* Updates */
.nowrap { white-space: nowrap; }
.table.updates td .prewrap { max-width: 60ch; }
details.update-tools { display: inline-block; vertical-align: top; }
details.update-tools[open] { display: block; margin-top: .5rem; min-width: 260px; }
details.update-tools .form { margin: .5rem 0; padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius); }

/* Mitarbeiterliste */
.toolbar .grow { flex: 1 1 auto; }
.table.employees td.actions .btn { margin: 0 .2rem .2rem 0; }
fieldset[disabled] { opacity: .85; }

/* App „Linksammlung“ (Intranet-Startseite im Stil von SharePoint) */
.links-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem 1.5rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.link-tabs { display: flex; gap: .2rem; flex-wrap: wrap; align-items: flex-end; }
.link-tabs > a, .link-tab-add { display: inline-block; padding: .6rem 1rem; text-decoration: none; color: var(--text); border-bottom: 3px solid transparent; font-weight: 500; cursor: pointer; }
.link-tabs > a:hover { color: var(--accent); background: #eef3f9; border-radius: 6px 6px 0 0; }
.link-tabs > a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.link-tab-add { color: var(--muted); }
.link-tabs .more-menu { left: 0; right: auto; }
.links-tools { display: flex; gap: .6rem; align-items: center; padding-bottom: .5rem; }
.link-search input { width: 240px; border-radius: 20px; padding-left: .9rem; }
.link-edit-hint { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; background: #fff8e6; border-color: #f0d9a3; padding: .7rem 1rem; }
.link-edit-hint .more-menu { right: auto; left: 0; }
.link-empty { text-align: center; padding: 2rem 1rem; }
.link-section { margin: 0 0 2rem; }
.ls-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: .35rem; margin-bottom: .8rem; }
.ls-head h2 { margin: 0; font-size: 1.2rem; }
.ls-tools { display: flex; gap: .3rem; align-items: center; }
.ls-desc { margin: -.3rem 0 .8rem; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.field-label { display: block; font-weight: 500; margin-bottom: .3rem; }

.link-grid { display: grid; gap: 1rem; }
.link-grid.layout-tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.link-grid.layout-compact { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; }
.link-grid.layout-list { grid-template-columns: 1fr; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.link-grid.one { grid-template-columns: minmax(0, 280px); }
.lt-wrap { display: flex; flex-direction: column; min-width: 0; }
.link-tile { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: var(--text); transition: box-shadow .15s, transform .15s, border-color .15s; }
.link-tile:hover { box-shadow: 0 6px 18px rgba(22,38,58,.13); transform: translateY(-2px); border-color: #c4cdd7; }
.link-tile:focus-visible { outline: 3px solid rgba(31,95,168,.45); outline-offset: 2px; }
.lt-img { display: block; aspect-ratio: 16 / 9; background: #fff; overflow: hidden; border-bottom: 1px solid var(--line); }
.lt-img img { width: 100%; height: 100%; display: block; }
/* Fester Rahmen: Einpassen (mit Innenabstand, ganzes Bild) oder Ausfüllen */
.lt-img.fit-contain img { object-fit: contain; padding: 8%; box-sizing: border-box; }
.lt-img.fit-cover img { object-fit: cover; }
.lt-ph { border-bottom: 0; }
.lt-ph { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2.2rem; font-weight: 700; }
.lt-body { display: flex; flex-direction: column; gap: .25rem; padding: .7rem .85rem .8rem; flex: 1; }
.lt-title { font-weight: 600; line-height: 1.3; }
.link-tile:hover .lt-title { color: var(--accent); }
.lt-desc { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lt-host { margin-top: auto; padding-top: .2rem; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-tools { display: flex; gap: .25rem; flex-wrap: wrap; padding-top: .35rem; }
.lt-add { align-items: center; justify-content: center; gap: .3rem; min-height: 120px; border: 2px dashed #c4cdd7; background: transparent; color: var(--muted); font-weight: 600; }
.lt-add span { font-size: 1.6rem; }
.lt-add:hover { color: var(--accent); border-color: var(--accent); }

/* kompakte Kacheln: Bild/Symbol links, Text rechts */
.layout-compact .link-tile, .layout-list .link-tile { flex-direction: row; align-items: center; }
.layout-compact .lt-img, .layout-list .lt-img { flex: 0 0 64px; width: 64px; height: 64px; aspect-ratio: auto; margin: .6rem 0 .6rem .6rem; border-radius: 6px; border: 1px solid var(--line); }
.layout-compact .lt-img.fit-contain img, .layout-list .lt-img.fit-contain img { padding: 6%; }
.layout-compact .lt-ph, .layout-list .lt-ph { border: 0; }
.layout-compact .lt-ph { font-size: 1.4rem; }
.layout-compact .lt-desc { -webkit-line-clamp: 2; }
.layout-compact .lt-add { min-height: 84px; flex-direction: row; }
/* Liste: Zeilen ohne Kachelrahmen */
.layout-list .lt-wrap { border-bottom: 1px solid var(--line); }
.layout-list .lt-wrap:last-child { border-bottom: 0; }
.layout-list .lt-wrap:has(.lt-tools) { flex-direction: row; align-items: center; padding-right: .6rem; }
.layout-list .link-tile { border: 0; border-radius: 0; flex: 1; }
.layout-list .link-tile:hover { transform: none; box-shadow: none; background: #f5f8fc; }
.layout-list .lt-img { flex-basis: 36px; width: 36px; height: 36px; margin: .45rem 0 .45rem .7rem; }
.layout-list .lt-ph { font-size: 1rem; }
.layout-list .lt-body { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; padding: .5rem .8rem; }
.layout-list .lt-desc { -webkit-line-clamp: 1; flex: 1 1 200px; }
.layout-list .lt-host { margin: 0 0 0 auto; padding: 0; }
.layout-list .lt-add { min-height: 0; padding: .7rem; border: 0; flex-direction: row; }
.layout-list .lt-tools { padding: 0; flex-wrap: nowrap; }

/* Farben für Kacheln ohne Bild */
.lc-1 .lt-ph, .color-pick.lc-1 { background: #1f5fa8; }
.lc-2 .lt-ph, .color-pick.lc-2 { background: #0f7b6c; }
.lc-3 .lt-ph, .color-pick.lc-3 { background: #2f8a3e; }
.lc-4 .lt-ph, .color-pick.lc-4 { background: #c2410c; }
.lc-5 .lt-ph, .color-pick.lc-5 { background: #b42335; }
.lc-6 .lt-ph, .color-pick.lc-6 { background: #6b4fbb; }
.lc-7 .lt-ph, .color-pick.lc-7 { background: #5b6878; }
.lc-8 .lt-ph, .color-pick.lc-8 { background: #16263a; }
.color-picks { display: flex; gap: .4rem; flex-wrap: wrap; }
.form label.color-pick, .color-pick { width: 30px; height: 30px; border-radius: 50%; margin: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.color-pick input { appearance: none; -webkit-appearance: none; width: 30px; height: 30px; margin: 0; border: 0; border-radius: 50%; padding: 0; background: transparent; cursor: pointer; }
.color-pick input:checked { box-shadow: 0 0 0 3px #fff inset, 0 0 0 2px var(--text); }
.link-preview { display: block; max-width: 100%; max-height: 160px; border-radius: 6px; border: 1px solid var(--line); margin-bottom: .6rem; }
@media (max-width: 640px) {
  .link-search input { width: 100%; }
  .links-tools { width: 100%; }
}

/* Großes App-Symbol links oben auf den Seiten einer App */
.page-head { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.25rem; }
.page-head h1 { margin: 0; }
.app-icon.app-icon-lg { width: 64px; height: 64px; border-radius: 16px; font-size: 2.1rem; flex: 0 0 64px; box-shadow: 0 4px 12px rgba(22, 38, 58, .15); }
.page-app { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .1rem; }
@media print { .page-head .app-icon-lg { display: none; } }

/* Linksammlung: Bildvorschläge im Link-Dialog */
.url-row { display: flex; gap: .5rem; }
.url-row input { flex: 1; }
.img-suggest { margin-bottom: .9rem; }
.img-suggest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; }
.img-sug { display: flex; flex-direction: column; gap: .25rem; padding: .3rem; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; font: inherit; text-align: left; }
.img-sug:hover { border-color: #9fb6d3; }
.img-sug.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,95,168,.2); }
.img-sug-frame { display: block; aspect-ratio: 16 / 9; background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.img-sug-frame img { width: 100%; height: 100%; object-fit: contain; padding: 6%; box-sizing: border-box; display: block; }
.img-sug-cap { font-size: .75rem; color: var(--muted); }
.img-sug.selected .img-sug-cap { color: var(--accent); font-weight: 600; }
.img-sug.selected .img-sug-cap::before { content: "✓ "; }
.link-preview { background: #fff; object-fit: contain; aspect-ratio: 16 / 9; width: 280px; padding: 4%; box-sizing: border-box; }

/* Rechte der Verwaltungsadmins */
fieldset.rights { margin-top: 1rem; }
.rights-detail { margin: .4rem 0 .8rem 1.6rem; }
.rights-presets { margin: .3rem 0 .5rem; }
.rights-table td.center, .rights-table th.center { text-align: center; width: 7.5rem; }
.rights-table td { vertical-align: middle; }

/* Sprachumschalter (Seiten ohne Anmeldung) */
.lang-switch { display: flex; gap: .75rem; font-size: .9rem; }
.lang-switch a { color: #b8c4d2; }
.lang-switch a:hover { color: #fff; text-decoration: underline; }
.lang-switch strong { color: #fff; font-weight: 600; }

/* App „Tickets“ */
.tk-offen, .tk-wieder_eroeffnet { background: #e3edfa; color: #184a86; }
.tk-in_bearbeitung { background: #fff1d6; color: #7a4b00; }
.tk-rueckfrage { background: #fde4e1; color: #8a1f13; }
.tk-zurueckgestellt, .tk-beim_dienstleister { background: #efe9fb; color: #4b2f8f; }
.tk-geloest { background: #dff3e4; color: #145c28; }
.tk-geschlossen { background: #eceff2; color: #5d6670; }
.prio { font-size: .85rem; white-space: nowrap; }
.prio::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; background: #9aa5b1; }
.prio-einschraenkung::before { background: #d39e00; }
.prio-blockiert::before { background: #d13b2b; }
.prio-mehrere::before { background: #8a1f13; box-shadow: 0 0 0 2px #f4c7c0; }
.prio-blockiert, .prio-mehrere { font-weight: 600; }
.type-tabs .count { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .3rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .75rem; text-align: center; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.ticket-side .card { margin-bottom: 1rem; }
.ticket-side .facts { grid-template-columns: 110px 1fr; }
.ticket-actions form { margin: 0 0 .7rem; }
.ticket-actions .inline-form label { display: block; margin-bottom: .3rem; }
.ticket-actions select, .ticket-actions input[type=date] { width: 100%; }
.chat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.chat-msg { max-width: 85%; padding: .6rem .8rem; border-radius: 10px; background: #f3f5f8; border: 1px solid var(--line); }
.chat-msg.from-processor { align-self: flex-end; background: #eaf2fd; border-color: #cddff7; }
.chat-msg.note { align-self: flex-end; background: #fffaf0; border: 1px dashed #e0b84d; }
.chat-msg .meta { font-size: .8rem; color: var(--muted); margin-bottom: .25rem; }
.chat-event { align-self: center; font-size: .85rem; color: var(--muted); text-align: center; }
.attachments { list-style: none; margin: .4rem 0 0; padding: 0; font-size: .9rem; }
.queue-box { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; margin-bottom: .7rem; }
.queue-box summary { cursor: pointer; }
.queue-box .form { margin-top: .8rem; }
.queue-hints { margin: -.4rem 0 1rem; padding-left: 1.1rem; }
@media (max-width: 860px) {
  .ticket-layout { grid-template-columns: 1fr; }
  .chat-msg { max-width: 100%; }
}

/* Tickets: Zeitsteuerung */
.tag.danger { background: #fde2e1; color: #a1201b; }
.due { white-space: nowrap; font-size: .85rem; }
.due.today { color: #7a4b00; font-weight: 600; }
.due.over { color: #a1201b; font-weight: 600; }
.times-table input[type=number] { width: 6rem; }

/* Tickets: E-Mail-Eingang */
.inbox-item .meta { margin-bottom: .3rem; }
.inbox-body { background: #f7f8fa; border-radius: 6px; padding: .5rem .7rem; max-height: 14rem; overflow: auto; margin: .4rem 0 .6rem; }

/* Tickets: Austausch mit dem Dienstleister */
.chat-msg.provider { align-self: flex-end; background: #eef4fb; border: 1px dashed #7da3cf; }
.tag.info { background: #e3eefa; color: #1f4f86; }

/* Tickets: Auswertung */
.stats-filters label { display: flex; flex-direction: column; align-items: flex-start; font-size: .85rem; gap: .15rem; }
.stats-tiles .tile strong { font-size: 1.25rem; }
.stats-chart { width: 100%; height: auto; display: block; margin: .25rem 0 .5rem; }
.stats-chart .grid { stroke: #e8ecf1; stroke-width: 1; }
.stats-chart .base { stroke: #b8c2cd; stroke-width: 1; }
.stats-chart .axis { fill: var(--muted); font-size: 11px; }
.stats-chart .bar.new { fill: #2a78d6; }
.stats-chart .bar.solved { fill: #eb6834; }
.stats-chart .hit { fill: transparent; }
.stats-chart .bar-group:hover .hit { fill: rgba(31, 95, 168, .06); }
.legend { font-size: .9rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.legend .key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.legend .key.new { background: #2a78d6; }
.legend .key.solved { background: #eb6834; margin-left: .6rem; }
.grid2 + .grid2 { margin-top: 1.25rem; }
.stats-filters { align-items: flex-end; }
.stats-filters label { text-align: left; }

/* Inventar */
.badge.inv-lager { background: #e3eefa; color: #1f4f86; }
.badge.inv-einsatz { background: #e2f4e6; color: #1a6b31; }
.badge.inv-reparatur { background: #fff1d6; color: #7a4b00; }
.badge.inv-ausgemustert, .badge.inv-entsorgt { background: #eceff3; color: #59636f; }
.badge.ct-aktiv, .badge.ct-verlaengert { background: #e2f4e6; color: #1a6b31; }
.badge.ct-kuendigung_freigabe, .badge.ct-kuendigung_freigegeben { background: #fff1d6; color: #7a4b00; }
.badge.ct-gekuendigt { background: #fde8e8; color: #9b1c1c; }
.badge.ct-beendet { background: #eceff3; color: #59636f; }
.inline-inputs { display: flex; gap: .4rem; align-items: center; }
.inline-inputs select { flex: 1; }
.warn-text { color: var(--warn); font-weight: 600; }
.inv-log { list-style: none; padding: 0; margin: .5rem 0 0; }
.inv-log li { padding: .45rem 0; border-top: 1px solid var(--line); }
.file-list { padding-left: 1.1rem; }
.file-list .inline-form { display: inline-flex; margin: 0 0 0 .4rem; }
code.secret { font-size: 1rem; word-break: break-all; user-select: all; }
.pre { white-space: pre-wrap; }
.narrow-input { width: 5rem; }
.inv-grid { align-items: start; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.inv-grid .form .grid2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 900px) { .inv-grid { grid-template-columns: 1fr; } }
.badge.lic-aktiv { background: #e2f4e6; color: #1a6b31; }
.badge.lic-bald { background: #fff1d6; color: #7a4b00; }
.badge.lic-abgelaufen { background: #fde2e1; color: #a1201b; }
.badge.lic-gekuendigt { background: #e3eefa; color: #1f4f86; }
.badge.lic-beendet { background: #eceff3; color: #59636f; }
.inline-pair { display: flex; gap: .4rem; }
.inline-pair input { width: 6rem; flex: 0 0 6rem; }
.inline-form.inline-mini { display: inline-flex; margin: 0 0 0 .4rem; }

/* Inventar: Übergabeprotokoll und Etiketten */
.ho-doc { max-width: 820px; }
.ho-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .8rem; margin-bottom: 1rem; }
.ho-head .ho-logo { display: block; max-height: 56px; max-width: 220px; margin-bottom: .4rem; }
.ho-meta { text-align: right; color: var(--muted); }
.ho-terms { margin: 1.2rem 0; }
.ho-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.5rem; align-items: end; }
.ho-sign-box { display: flex; flex-direction: column; justify-content: flex-end; min-height: 90px; }
.ho-signature { max-height: 80px; max-width: 100%; object-fit: contain; align-self: flex-start; }
.ho-line { border-top: 1px solid #333; padding-top: .3rem; font-size: .85rem; }
.sign-pad { width: 100%; max-width: 600px; aspect-ratio: 3 / 1; border: 1px dashed #9aa6b2; border-radius: var(--radius); background: #fff; touch-action: none; cursor: crosshair; }
.labels-page { background: #fff; padding: 1rem; }
.labels-bar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.labels { display: grid; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm; gap: 0; }
.label { display: flex; gap: 2mm; align-items: center; padding: 2mm 3mm; border: 1px dashed #ccd3db; overflow: hidden; font-size: 8pt; line-height: 1.25; }
.label-qr svg { width: 26mm; height: 26mm; display: block; }
.label-text strong { font-size: 10pt; }
@media print {
  .no-print, .labels-bar { display: none !important; }
  .labels-page { padding: 0; }
  .label { border: 0; break-inside: avoid; }
  .ho-doc { border: 0; box-shadow: none; max-width: none; }
  .ho-doc a { color: inherit; text-decoration: none; }
}
.label .small { font-size: 7pt; }

/* Geräte & Lizenzen – Demnächst fällig, Kostenübersicht, Import */
.due-box { border-left: 4px solid #e0a100; }
.due-box h2 .count { display: inline-block; min-width: 1.5rem; padding: 0 .4rem; margin-left: .3rem; border-radius: 999px; background: #e0a100; color: #fff; font-size: .8rem; text-align: center; vertical-align: middle; }
.due-box ul { margin: 0; }
.table-scroll { overflow-x: auto; }
.table tr.sum td { border-top: 2px solid var(--line, #d9dee5); }

/* Geräte & Lizenzen – Anbindungen */
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; margin: .8rem 0 1rem; }
.int-card { display: flex; flex-direction: column; gap: .4rem; padding: .9rem 1rem; border: 1px solid var(--line, #d9dee5); border-radius: 8px; cursor: pointer; font-weight: normal; }
.int-card.on { border-color: var(--accent, #1f5fa8); background: #f3f7fc; }
.int-card .int-head { display: flex; align-items: center; gap: .5rem; }
.int-card .tag { align-self: flex-start; }
.preview-card { border-style: dashed; }
.table tr.group-row th { background: var(--bg, #f4f6f8); color: #1f5fa8; text-transform: none; font-size: .9rem; letter-spacing: 0; padding-top: .7rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.ct-bar { width: 45%; }
.ct-bar progress { width: 100%; height: .8rem; }
/* Verträge, Stufe 7: PDF auslesen, Vorjahresvergleich */
.alert.warn { background: #fff6e0; border-color: #f0d08a; color: #6b4600; }
.tag.success { background: #e9f6ec; color: #1d6b33; }
.ct-text { max-height: 24rem; overflow: auto; white-space: pre-wrap; font-size: .85rem; }
.ct-ocr { border-top: 1px solid var(--line, #d9dee5); padding-top: .6rem; margin-top: .6rem; }
.num.up { color: #a1201b; }
.num.down { color: #1d6b33; }

/* App „Dokumente & Anleitungen“ (Wiki) */
.wk-head { display: flex; gap: 1rem; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: .8rem; border-bottom: 1px solid var(--line); }
.wk-head .type-tabs { border-bottom: 0; margin-bottom: 0; }
.wk-search { display: flex; gap: .4rem; padding-bottom: .4rem; }
.wk-search input[type=search] { width: 260px; }
.wk-spaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.wk-space-tile { display: flex; flex-direction: column; gap: .35rem; background: #fff; border: 1px solid var(--line); border-top: 4px solid #15803d;
  border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--text); text-decoration: none; transition: box-shadow .15s, transform .15s; }
.wk-space-tile:hover { box-shadow: 0 6px 18px rgba(22, 38, 58, .12); transform: translateY(-2px); }
.wk-icon { display: inline-block; min-width: 1.3em; text-align: center; }
.wk-icon.big { font-size: 1.8rem; line-height: 1; align-self: flex-start; }
.wk-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.wk-side { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; padding: 1rem; }
.wk-space-title { display: block; font-weight: 700; text-decoration: none; color: var(--text); margin-bottom: .6rem; }
.wk-tree ul { list-style: none; margin: 0; padding: 0 0 0 .9rem; }
.wk-tree > ul { padding-left: 0; }
.wk-tree li { position: relative; padding-left: 1.1rem; margin: .1rem 0; }
.wk-tree li.closed > ul { display: none; }
.wk-tree a { display: block; padding: .15rem .35rem; border-radius: 4px; text-decoration: none; color: var(--text); font-size: .92rem; word-break: break-word; }
.wk-tree a:hover { background: #eef3f9; }
.wk-tree li.current > a { background: #e3eefa; color: var(--accent); font-weight: 600; }
.wk-twisty { position: absolute; left: 0; top: .25rem; width: 1rem; height: 1rem; padding: 0; border: 0; background: none; cursor: pointer; color: var(--muted); }
.wk-twisty::before { content: "▸"; display: block; font-size: .8rem; line-height: 1rem; transition: transform .15s; }
.wk-tree li.open > .wk-twisty::before { transform: rotate(90deg); }
.wk-side .btn { margin-top: .8rem; }
.wk-crumbs { font-size: .88rem; color: var(--muted); margin-bottom: .6rem; }
.wk-crumbs a { text-decoration: none; }
.wk-title-row { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.wk-title-row h1 { margin-bottom: .3rem; }
.wk-list { margin: 0; padding-left: 1.2rem; }
.wk-list li { margin: .25rem 0; }
.wk-children { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1rem; }
.wk-tools { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; padding: .7rem 1.25rem; }
.wk-hits { list-style: none; margin: 0; padding: 0; }
.wk-hits li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.wk-hits li:last-child { border-bottom: 0; }

/* Seiteninhalt (Anzeige und Editor) */
.wk-body { font-size: 1rem; line-height: 1.6; overflow-wrap: break-word; }
.wk-body h1, .wk-body h2 { font-size: 1.35rem; margin: 1.6rem 0 .6rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.wk-body h3 { font-size: 1.15rem; margin: 1.3rem 0 .5rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.wk-body h4 { font-size: 1rem; margin: 1.1rem 0 .4rem; }
.wk-body > :first-child { margin-top: 0; }
.wk-body img { max-width: 100%; height: auto; border-radius: 4px; }
.wk-body table { border-collapse: collapse; margin: .8rem 0; max-width: 100%; }
.wk-body th, .wk-body td { border: 1px solid #c9d2dc; padding: .35rem .6rem; text-align: left; vertical-align: top; }
.wk-body th { background: #f1f4f7; }
.wk-body blockquote { margin: .8rem 0; padding: .3rem 1rem; border-left: 4px solid var(--line); color: var(--muted); }
.wk-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.wk-info, .wk-note, .wk-warn, .wk-ok { border-left: 4px solid; border-radius: 6px; padding: .6rem .9rem; margin: .8rem 0; }
.wk-info { background: #eaf2fb; border-color: #3b7dd8; }
.wk-note { background: #f3f0fb; border-color: #7c5cc4; }
.wk-warn { background: #fff4e0; border-color: #d48a00; }
.wk-ok { background: #e9f6ec; border-color: #2f9e4f; }
.wk-info > :first-child, .wk-note > :first-child, .wk-warn > :first-child, .wk-ok > :first-child { margin-top: 0; }
.wk-info > :last-child, .wk-note > :last-child, .wk-warn > :last-child, .wk-ok > :last-child { margin-bottom: 0; }
.wk-st { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: .05rem .45rem; border-radius: 4px; vertical-align: middle; }
.wk-st-grey { background: #e6e9ed; color: #3c4653; }
.wk-st-blue { background: #dce9fb; color: #164a8a; }
.wk-st-green { background: #d9f2e0; color: #155c2b; }
.wk-st-yellow { background: #fff0c2; color: #6b4b00; }
.wk-st-red { background: #fde1dd; color: #8a1d12; }
nav.wk-toc { background: #f7f9fb; border: 1px solid var(--line); border-radius: 6px; padding: .6rem 1rem; margin: .8rem 0; display: inline-block; min-width: 240px; }
nav.wk-toc ul { list-style: none; margin: .3rem 0 0; padding: 0; }
nav.wk-toc li.lvl3 { padding-left: 1rem; }
nav.wk-toc li.lvl4 { padding-left: 2rem; }
.wk-editor div.wk-toc { background: #f7f9fb; border: 1px dashed #9aa7b5; border-radius: 6px; padding: .6rem 1rem; color: var(--muted); }

/* Editor */
.wk-edit-head { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.wk-edit-head .grow { flex: 1 1 320px; }
.wk-toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; background: #f4f6f8;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; padding: .35rem .45rem; margin-top: .8rem; }
.wk-toolbar button { min-width: 2rem; height: 2rem; padding: 0 .4rem; border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer; font-size: .95rem; }
.wk-toolbar button:hover { background: #fff; border-color: var(--line); }
.wk-toolbar button.on { background: #dce9fb; border-color: #a9c6ee; }
.wk-toolbar select { width: auto; height: 2rem; padding: 0 .3rem; font-size: .88rem; }
.wk-toolbar .wk-sep { width: 1px; height: 1.4rem; background: var(--line); margin: 0 .2rem; }
.wk-tablebtns { display: inline-flex; gap: .25rem; align-items: center; }
.wk-tablebtns[hidden] { display: none; }
.wk-editor { min-height: 420px; border: 1px solid var(--line); border-radius: 0 0 6px 6px; padding: 1rem 1.2rem; background: #fff; outline: none; }
.wk-editor:focus { border-color: #9dbbe2; box-shadow: 0 0 0 3px rgba(31, 95, 168, .12); }
.wk-editor table td, .wk-editor table th { min-width: 3rem; }
.wk-fallback { font-family: ui-monospace, monospace; font-size: .85rem; }

@media (max-width: 900px) {
  .wk-layout { grid-template-columns: 1fr; }
  .wk-side { position: static; max-height: none; }
  .wk-search input[type=search] { width: 100%; }
}
@media print {
  .wk-side, .wk-tools, .wk-head, .wk-crumbs, .wk-title-row .btn-row { display: none !important; }
  .wk-layout { display: block; }
}

/* Dokumente & Anleitungen, Stufe 2: Verlauf, Vergleich, Kommentare */
.wk-mt { margin-top: .5rem; }
.wk-meta { display: flex; gap: .6rem 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.wk-meta-links { display: flex; gap: .4rem 1rem; flex-wrap: wrap; align-items: center; font-size: .9rem; }
.wk-diff { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; border: 1px solid var(--line); border-radius: 6px; overflow: auto; }
.wk-diff-line { padding: .1rem .6rem .1rem 0; white-space: pre-wrap; word-break: break-word; }
.wk-diff-line.add { background: #e6f6ea; }
.wk-diff-line.del { background: #fdecea; text-decoration: line-through; text-decoration-color: rgba(122, 26, 18, .45); }
.wk-diff-op { display: inline-block; width: 1.8rem; text-align: center; color: var(--muted); user-select: none; }
.wk-diff-line.add .wk-diff-op { color: var(--ok); font-weight: 700; }
.wk-diff-line.del .wk-diff-op { color: var(--danger); font-weight: 700; }
.wk-diff-gap { padding: .1rem 1.8rem; color: var(--muted); background: #f7f9fb; }
.wk-ins { background: #e6f6ea; color: #164f25; text-decoration: none; padding: 0 .2rem; border-radius: 3px; }
.wk-del, .wk-del-text { background: #fdecea; color: #7a1a12; padding: 0 .2rem; border-radius: 3px; }
.wk-comment { border-top: 1px solid var(--line); padding: .7rem 0; }
.wk-comment:first-of-type { border-top: 0; }
.wk-comment-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.wk-comment-body { margin-top: .25rem; overflow-wrap: break-word; }
.wk-mention { color: var(--accent); }
.btn-link { background: none; border: 0; padding: 0; color: var(--danger); cursor: pointer; text-decoration: underline; font: inherit; }
.btn-link.small { font-size: .82rem; }
.wk-comment-form { position: relative; margin-top: .8rem; }
.wk-mention-list { position: absolute; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(22, 38, 58, .14); min-width: 220px; padding: .25rem; }
.wk-mention-opt { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .35rem .6rem; border-radius: 4px; cursor: pointer; font: inherit; }
.wk-mention-opt:hover, .wk-mention-opt.active { background: #e3eefa; }
@media print { .wk-comments, .wk-meta-links { display: none !important; } }

/* Dokumente & Anleitungen, Stufe 3: Freigabe, Prüfung, Dateien, Für alle Kunden */
.wk-status { display: flex; gap: .6rem 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: .55rem .8rem; margin-bottom: 1rem;
  border-radius: 6px; background: #f1f4f7; border: 1px solid var(--line); font-size: .92rem; }
.wk-status.draft { background: #fff6e0; border-color: #f0d08a; }
.wk-status.over { background: #fdecea; border-color: #f4b4ad; }
.wk-files table td { vertical-align: top; }
.wk-file-versions { margin-top: .3rem; }
.wk-file-versions ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.wk-file-new { display: inline-block; margin-right: .5rem; }
.wk-file-new > summary { list-style: none; cursor: pointer; }
.wk-file-new > summary::-webkit-details-marker { display: none; }
.wk-file-new[open] form { margin-top: .4rem; display: flex; flex-direction: column; gap: .3rem; min-width: 240px; }
.wk-file-add { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-top: .8rem; }
.wk-file-add p { flex-basis: 100%; margin: 0; }
.wk-copy { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.wk-copy p { flex-basis: 100%; margin: 0; }
.wk-hub { border-top: 4px solid #15803d; }
.wk-todo { margin-bottom: 1.25rem; }
.wk-todo .card { margin-bottom: 0; }

/* Dokumente & Anleitungen, Stufe 4: Passwort-Tresor */
.vault-bar { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: 1rem;
  padding: .55rem .9rem; border-radius: var(--radius); background: #e9f6ec; border: 1px solid #a7d8b3; }
.vault-status { font-size: .92rem; color: #164f25; }
.vault-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.vault-folders { padding: .6rem; }
.vault-folders a { display: block; padding: .45rem .6rem; border-radius: 6px; text-decoration: none; color: var(--text); }
.vault-folders a:hover { background: #eef3f9; }
.vault-folders a.active { background: #e3eefa; color: var(--accent); font-weight: 600; }
.vault-row { cursor: pointer; }
.vault-row:hover td, .vault-row:focus td { background: #f4f8fd; }
.vault-card { max-width: 860px; }
.vault-fields { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: .5rem 1rem; margin: 1rem 0; }
.vault-fields dt { color: var(--muted); font-size: .9rem; padding-top: .3rem; }
.vault-fields dd { margin: 0; display: flex; gap: .5rem; align-items: flex-start; flex-wrap: wrap; }
.vault-val { padding: .25rem .5rem; background: #f4f6f8; border-radius: 4px; min-width: 8rem; word-break: break-all; }
pre.vault-val { margin: 0; white-space: pre-wrap; font-family: inherit; flex: 1 1 100%; }
.vault-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.vault-input { display: flex; gap: .4rem; align-items: center; }
.vault-input input { flex: 1; }
.vault-kit { border: 2px dashed #9aa7b5; border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.vault-kit-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.15rem; letter-spacing: .04em; word-break: break-all;
  background: #f4f6f8; padding: .7rem .9rem; border-radius: 6px; }
@media (max-width: 900px) { .vault-layout { grid-template-columns: 1fr; } }
@media print {
  body.vault-print * { visibility: hidden; }
  body.vault-print .vault-kit, body.vault-print .vault-kit * { visibility: visible; }
  body.vault-print .vault-kit { position: absolute; left: 0; top: 0; width: 100%; border: 2px dashed #000; }
}

/* Tresor, Stufe 5: Generator, 2FA-Code, Fälligkeiten */
.vault-gen { border: 1px solid var(--line); border-radius: 6px; padding: .6rem .8rem; margin: -.3rem 0 .8rem; background: #f7f9fb; display: flex; flex-direction: column; gap: .5rem; }
.vault-gen-opts { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; }
.vault-gen input[type=range] { width: 180px; vertical-align: middle; }
.vault-totp { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .5rem .8rem; background: #eef6ff; border: 1px solid #c4dbf5; border-radius: 6px; margin-bottom: .8rem; }
.vault-code { font-size: 1.4rem; letter-spacing: .08em; }
.vault-due { border-left: 4px solid var(--warn); }

/* Dokumente & Anleitungen, Stufe 6: Verknüpfungen */
.wkl-add { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; }
.wkl-add select { max-width: 100%; }

/* Zentrale Einstellungen */
.who a.gear { color: #fff; text-decoration: none; }
.who a.gear.active { font-weight: 600; text-decoration: underline; }
.set-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.set-side { position: sticky; top: 1rem; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 8px; padding: .75rem; font-size: .92rem; }
.set-side .company-switch { margin-bottom: .75rem; }
.set-side .company-switch select { max-width: 100%; }
.set-side .set-group { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .6rem .4rem .2rem; }
.set-side ul { list-style: none; margin: 0; padding: 0; }
.set-side ul ul { margin: .15rem 0 .3rem .8rem; border-left: 2px solid var(--line); }
.set-side a { display: block; padding: .35rem .5rem; border-radius: 5px; text-decoration: none; color: var(--text); }
.set-side a:hover { background: rgba(0, 0, 0, .04); color: var(--accent); }
.set-side a.active { color: var(--accent); font-weight: 600; background: rgba(0, 0, 0, .04); }
.set-side .set-pick { display: none; }
@media (max-width: 800px) {
    .set-layout { grid-template-columns: 1fr; gap: .75rem; }
    .set-side { position: static; padding: .5rem .75rem; }
    .set-side .set-group, .set-side > ul { display: none; }
    .set-side .set-pick { display: block; }
}

/* Einsicht: Portal-Betreiber als erster Dienstleister */
.provider-operator { border-left: 4px solid var(--accent); }
.check.indent { margin-left: 1.6rem; }
