/* Styleguide App. Farben und Schriften kommen als CSS-Variablen aus dem Kunden-Branding. */
:root {
  --line: color-mix(in srgb, var(--c-text) 14%, transparent);
  --line-strong: color-mix(in srgb, var(--c-text) 70%, transparent);
  --soft: color-mix(in srgb, var(--c-surface) 55%, var(--c-bg));
  --accent-tint: color-mix(in srgb, var(--c-accent) 14%, var(--c-bg));
  --ok: #1f7a4d;
  --ok-tint: #e5f4ec;
  --warn: #8a5a00;
  --warn-tint: #fff4dc;
  --bad: #b3261e;
  --bad-tint: #fdecea;
  --radius: 6px;
  --sidebar: 250px;
  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
}
h1, h2, h3, h4 { font-family: var(--f-heading); line-height: 1.2; margin: 0 0 .5em; color: var(--c-primary); }
h1 { font-size: var(--step-3); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: var(--step-2); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0 0 .9em; }
a { color: var(--c-primary); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; background: var(--soft); border: 1px solid var(--line); border-radius: 4px; padding: .05em .35em; }
img { max-width: 100%; height: auto; display: block; }
small { font-size: var(--step--1); }
.muted { color: var(--c-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--c-primary); color: var(--c-on-primary); padding: 8px 12px; border-radius: var(--radius); }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
[hidden] { display: none !important; }

/* App-Rahmen */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
  padding: 22px 14px 18px; border-right: 1px solid var(--line); background: var(--c-bg);
}
.sidebar__brand { padding: 0 10px 14px; border-bottom: 1px solid var(--line); }
.brandmark { display: block; text-decoration: none; color: var(--c-primary); font-size: var(--step-1); }
.brandmark img { max-height: 44px; width: auto; }
.sidebar__product { display: block; margin-top: 8px; font-size: var(--step--1); color: var(--c-muted); }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar__sep { margin: 18px 10px 6px; font-size: var(--step--1); color: var(--c-muted); }
.navlink {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius);
  text-decoration: none; color: var(--c-text); position: relative;
}
.navlink svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .75; }
.navlink:hover { background: var(--soft); }
.navlink.is-active { background: var(--c-surface); color: var(--c-primary); font-weight: 600; }
.navlink.is-active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c-accent); }
.navlink.is-active svg { opacity: 1; }
.sidebar__user { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.userchip { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--c-text); padding: 6px; border-radius: var(--radius); }
.userchip:hover, .userchip.is-active { background: var(--soft); }
.userchip strong { display: block; font-size: var(--step--1); }
.userchip small { display: block; color: var(--c-muted); font-size: .75rem; }
.sidebar__user form { padding-left: 52px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--c-primary); color: var(--c-on-primary); font-size: .8rem; font-weight: 700; }
.avatar--small { width: 30px; height: 30px; font-size: .72rem; }
.topbar { display: none; }
.main { padding: 36px clamp(20px, 4vw, 56px) 80px; max-width: 1240px; width: 100%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: var(--step--1); line-height: 1.2;
  padding: 10px 16px; border-radius: var(--radius); cursor: pointer; text-decoration: none;
  border: 1px solid var(--line-strong); background: var(--c-bg); color: var(--c-primary);
}
.btn:hover { background: var(--soft); text-decoration: none; }
.btn--primary { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.btn--primary:hover { background: color-mix(in srgb, var(--c-primary) 86%, #000); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn--danger:hover { background: #8f1e18; }
.btn--danger-text { color: var(--bad); }
.btn--small { padding: 7px 12px; font-size: .8125rem; }
.btn--block { width: 100%; }
.linkbtn { font: inherit; font-size: var(--step--1); background: none; border: 0; padding: 0; color: var(--c-primary); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.linkbtn--danger { color: var(--bad); }
.iconbtn { width: 40px; height: 40px; border: 0; background: none; border-radius: var(--radius); cursor: pointer; display: grid; place-items: center; color: var(--c-primary); }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* Seitenköpfe */
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 26px; }
.pagehead p { max-width: 70ch; }
.crumb { font-size: var(--step--1); color: var(--c-muted); margin-bottom: 6px; }
.crumb a { color: var(--c-muted); }
.lead { font-size: var(--step-1); color: var(--c-muted); }
.page--narrow { max-width: 620px; }

/* Hinweise */
.flashes { display: grid; gap: 8px; margin-bottom: 22px; }
.flash { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius); border: 1px solid; font-size: var(--step--1); }
.flash--success { background: var(--ok-tint); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: #124b2f; }
.flash--error { background: var(--bad-tint); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: #7a1a14; }
.flash--info { background: var(--soft); border-color: var(--line); }
.flash__x { background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: inherit; padding: 0 2px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px; }
.banner--obsolete { background: var(--warn-tint); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: #5b3b00; }
.note { font-size: var(--step--1); color: var(--c-muted); }

/* Filter */
.filters { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 30px; display: grid; gap: 10px; background: var(--c-bg); position: sticky; top: 0; z-index: 5; box-shadow: 0 8px 18px -16px var(--c-text); }
.filters__search { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.filters__search svg { width: 20px; height: 20px; fill: none; stroke: var(--c-muted); stroke-width: 1.8; stroke-linecap: round; flex: none; }
.filters__search input[type=search] { flex: 1; border: 0; border-radius: 0; outline: none !important; font: inherit; font-size: var(--step-1); padding: 4px 0; background: transparent; color: var(--c-text); min-width: 0; }
.filters__search input:focus { outline: none; }
.filters__search:focus-within { border-bottom-color: var(--c-primary); }
.filters__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.filters__label { width: 58px; font-size: var(--step--1); color: var(--c-muted); flex: none; }
.filters__count { margin-left: auto; font-size: var(--step--1); color: var(--c-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 0; min-width: 0; }
.filters__row .check { flex-basis: 100%; padding-left: 70px; }
.chip { font: inherit; font-size: .8125rem; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--c-bg); color: var(--c-text); cursor: pointer; line-height: 1.3; }
.chip:hover { background: var(--soft); }
.chip.is-on { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.chip--tag.is-on { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-on-accent); }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: var(--step--1); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--c-primary); }

/* Modulliste */
.modgroup { margin-bottom: 38px; }
.modgroup__title { display: flex; align-items: baseline; gap: 12px; font-size: var(--step-1); padding-bottom: 10px; border-bottom: 1.5px solid var(--line-strong); margin-bottom: 0; }
.modgroup__title small { color: var(--c-muted); font-weight: 400; }
.modgroup__prefix { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 4px; background: var(--c-primary); color: var(--c-on-primary); font-size: .95rem; }
.modgroup__desc { margin: 8px 0 0; font-size: var(--step--1); }
.modrows { list-style: none; margin: 0; padding: 0; }
.modrow { border-bottom: 1px solid var(--line); }
.modrow__link { display: grid; grid-template-columns: 84px 168px minmax(0, 1fr); gap: 22px; align-items: center; padding: 16px 8px; text-decoration: none; color: inherit; border-radius: var(--radius); }
.modrow__link:hover { background: var(--soft); }
.modrow__link:hover .modrow__name { text-decoration: underline; text-underline-offset: .18em; }
.modrow__code { font-family: var(--f-heading); font-size: 1.75rem; font-weight: 700; color: var(--c-primary); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.modrow__thumb { aspect-ratio: 16 / 10; border-radius: 4px; overflow: hidden; background: var(--c-surface); border: 1px solid var(--line); display: grid; place-items: center; }
.modrow__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.modrow__nothumb { font-size: .72rem; color: var(--c-muted); }
.modrow__body { display: grid; gap: 4px; }
.modrow__name { font-weight: 600; font-size: var(--step-1); color: var(--c-primary); }
.modrow__desc { font-size: var(--step--1); color: var(--c-muted); max-width: 72ch; }
.modrow__meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.badge { display: inline-block; font-size: .72rem; line-height: 1.3; padding: 3px 8px; border-radius: 999px; background: var(--c-surface); color: var(--c-text); text-decoration: none; }
.badge--world { background: var(--c-primary); color: var(--c-on-primary); }
.badge--global { background: transparent; border: 1px solid var(--line-strong); color: var(--c-text); }
.badge--draft { background: var(--warn-tint); color: var(--warn); }
.badge--hint { background: transparent; border: 1px dashed var(--line-strong); color: var(--c-muted); }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 40px 28px; text-align: center; }
.empty p { color: var(--c-muted); }

/* Schriftfeld: Kopf eines Moduls wie der Plankopf einer Zeichnung */
.titleblock {
  display: grid; grid-template-columns: 170px repeat(4, minmax(0, 1fr));
  border: 1.5px solid var(--line-strong); border-radius: 2px; margin-bottom: 18px;
}
.titleblock > div { padding: 10px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.titleblock span { display: block; font-size: .72rem; color: var(--c-muted); margin-bottom: 3px; }
.titleblock__code { grid-row: span 3; background: var(--c-primary); color: var(--c-on-primary); display: flex; flex-direction: column; justify-content: space-between; border-bottom: 0 !important; }
.titleblock__code span { color: inherit; opacity: .75; }
.titleblock__code strong { font-family: var(--f-heading); font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.titleblock__name { grid-column: span 4; border-right: 0 !important; }
.titleblock__name h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.titleblock__cell { font-weight: 500; }
.titleblock__cell:nth-child(6) { border-right: 0 !important; }
.titleblock__cell small { display: block; color: var(--c-muted); font-weight: 400; }
.titleblock__tags { grid-column: span 4; border-right: 0 !important; border-bottom: 0 !important; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.titleblock__tags span { width: 100%; }
.status { font-style: normal; }
.status--active { color: var(--ok); }
.status--draft { color: var(--warn); }
.status--obsolete { color: var(--bad); }
.actionbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.actionbar__spacer { flex: 1; }
.localnav { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--line); margin-bottom: 26px; font-size: var(--step--1); }
.localnav a { text-decoration: none; padding: 9px 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--c-text); }
.localnav a:hover { border-bottom-color: var(--c-accent); }
.localnav small { color: var(--c-muted); }

/* Inhaltsblöcke */
.sheet { margin-bottom: 42px; scroll-margin-top: 20px; }
.sheet--narrow { max-width: 640px; }
.sheet__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sheet__tools { display: flex; gap: 8px; }
.sheet__title { font-size: var(--step-1); padding-bottom: 8px; border-bottom: 1px solid var(--line); margin: 28px 0 16px; flex: 1; }
.sheet__head .sheet__title { border-bottom: 0; }
.sheet__head { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.sheet__head .sheet__title { margin-bottom: 0; }
.sheet > .sheet__title:first-child, .sheet > .sheet__head:first-child .sheet__title { margin-top: 0; }
.sheet__title--big { font-size: var(--step-2); }
.sheet__more { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.sheet__more summary { cursor: pointer; font-size: var(--step--1); color: var(--c-muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 20px; }
.grid2--tight, .grid4--tight { gap: 4px 14px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.field { margin-bottom: 18px; }
.field__label { font-size: var(--step--1); font-weight: 600; color: var(--c-muted); margin-bottom: 6px; }
.field__empty { color: var(--c-muted); font-style: italic; font-size: var(--step--1); margin: 0; }
.prose { max-width: 74ch; }
.prose--wide { max-width: 82ch; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 .9em; }
.prose li { margin-bottom: .25em; }
.prose h3, .prose h4 { margin-top: 1.2em; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 32px; margin: 0 0 18px; }
.specs dt { font-size: var(--step--1); color: var(--c-muted); font-weight: 600; }
.specs dd { margin: 2px 0 0; word-break: break-word; }
.anchor { font-weight: 600; }
.usedon, .files { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.usedon li, .files li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }

/* Token-Chips in Texten */
.tchip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px 1px 6px; border-radius: 4px; background: var(--accent-tint); border: 1px solid color-mix(in srgb, var(--c-accent) 45%, transparent); text-decoration: none; font-size: .88em; color: var(--c-primary); white-space: nowrap; }
.tchip i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); }
.tchip small { color: var(--c-muted); font-size: .9em; }
.tchip--missing { background: var(--bad-tint); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.tchip--archived { text-decoration: line-through; opacity: .7; }

/* Screenshots */
.shots { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.shots__col { display: grid; gap: 16px; }
.shots__col--wide:nth-child(3) { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.shot { margin: 0; }
.shot a { display: block; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--c-surface); }
.shot img { width: 100%; }
.shot figcaption { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: var(--step--1); margin-top: 6px; }
.shot figcaption span { flex: 1; min-width: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin: 16px 0; }

/* Verlauf */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl { position: relative; padding: 0 0 22px 28px; }
.tl::before { content: ""; position: absolute; left: 0; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--c-bg); border: 2px solid var(--c-muted); }
.tl--meeting::before, .tl--decision::before { background: var(--c-accent); border-color: var(--c-primary); }
.tl--obsolete::before, .tl--delete::before, .tl--archive::before { border-color: var(--bad); }
.tl--create::before { border-color: var(--ok); }
.tl__head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.tl__action { font-weight: 600; color: var(--c-primary); }
.tl__entity { font-size: var(--step--1); }
.tl__meta { font-size: var(--step--1); color: var(--c-muted); }
.tl__comment { margin: 4px 0; max-width: 78ch; }
.tl__drive { font-size: var(--step--1); }
.tl__changes { margin-top: 6px; }
.tl__changes summary { cursor: pointer; font-size: var(--step--1); color: var(--c-muted); }
.diff { border-collapse: collapse; margin-top: 8px; width: 100%; font-size: var(--step--1); }
.diff th, .diff td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.diff thead th { color: var(--c-muted); font-weight: 600; }
.diff tbody th { width: 22%; font-weight: 600; }
.diff__old { background: var(--bad-tint); width: 39%; }
.diff__new { background: var(--ok-tint); width: 39%; }
.diff i { color: var(--c-muted); }
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; align-items: center; }
.filterbar input[type=search] { flex: 1 1 260px; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 20px; font-size: var(--step--1); }

/* Kommentare */
.comments { display: grid; gap: 14px; max-width: 78ch; }
.comment { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.comment header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: var(--step--1); margin-bottom: 2px; }
.comment .prose { font-size: var(--step-0); }
.comment-form { display: grid; gap: 8px; justify-items: start; }
.comment-form textarea { width: 100%; }
form.inline { display: inline; }

/* Formulare */
.form { display: grid; gap: 4px; }
.form--wide { gap: 22px; }
.form label, .labelish { font-size: var(--step--1); font-weight: 600; margin-top: 8px; display: block; }
.fieldrow label { margin-top: 0; }
.fieldrow { display: grid; gap: 5px; align-content: start; margin-bottom: 12px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], input[type=date], input:not([type]), select, textarea {
  font: inherit; font-size: var(--step-0); color: var(--c-text); background: var(--c-bg);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 9px 11px; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--c-primary) 35%, transparent); outline-offset: 0; border-color: var(--c-primary); }
input[type=file] { font: inherit; font-size: var(--step--1); }
.hint { font-size: var(--step--1); color: var(--c-muted); margin: 0 0 4px; }
.req { font-weight: 400; color: var(--bad); font-size: .75rem; margin-left: 4px; }
.opt { font-weight: 400; color: var(--c-muted); font-size: .75rem; margin-left: 4px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 8px; margin: 0; min-width: 0; }
.panel legend { font-family: var(--f-heading); font-weight: 700; font-size: var(--step-1); color: var(--c-primary); padding: 0 6px; margin-left: -6px; }
.panel--reason { border-color: var(--c-primary); border-width: 1.5px; background: var(--soft); }
.reason { border: 0; padding: 0; margin: 8px 0 12px; display: grid; gap: 5px; min-width: 0; }
.reason legend { font-weight: 700; font-size: var(--step-0); color: var(--c-primary); padding: 0; margin-bottom: 6px; }
.reason label { margin-top: 4px; }
.reason--compact { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.reason--compact legend { float: left; width: 100%; margin-bottom: 4px; }
.formactions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; position: sticky; bottom: 0; background: var(--c-bg); padding: 14px 0; border-top: 1px solid var(--line); z-index: 4; }
.mdhint { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between; font-size: var(--step--1); color: var(--c-muted); background: var(--soft); border-radius: var(--radius); padding: 12px 16px; position: sticky; top: 0; z-index: 4; }
.mdhint p { margin: 0; max-width: 80ch; }
.tokenpick { display: grid !important; gap: 4px; margin: 0 !important; color: var(--c-text); }
.tokenpick select { min-width: 240px; }
.tagpick { display: flex; flex-wrap: wrap; gap: 6px; }
.tagpick__item { margin: 0 !important; font-weight: 400 !important; cursor: pointer; }
.tagpick__item input { position: absolute; opacity: 0; }
.tagpick__item span { display: inline-block; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: .8125rem; }
.tagpick__item input:checked + span { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-on-accent); }
.tagpick__item input:focus-visible + span { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.valuerow { display: flex; gap: 8px; align-items: center; }
.valuerow input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--c-bg); flex: none; cursor: pointer; }
.logofield { display: flex; gap: 14px; align-items: center; }
.logofield img { max-height: 40px; width: auto; max-width: 160px; border: 1px solid var(--line); padding: 4px; border-radius: 4px; }

/* Tokens */
.tokens { list-style: none; margin: 0; padding: 0; }
.token { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 20px; }
.token:target { background: var(--accent-tint); box-shadow: 0 0 0 12px var(--accent-tint); border-radius: 2px; }
.token__preview { display: flex; align-items: center; min-height: 64px; }
.swatch { width: 100%; height: 72px; border-radius: 4px; border: 1px solid var(--line); }
.typesample { font-size: 1.1rem; line-height: 1.3; color: var(--c-primary); overflow-wrap: anywhere; }
.sizebar { display: block; height: 14px; background: var(--c-accent); border-radius: 2px; min-width: 2px; }
.token__val { font-weight: 600; }
.token__name { margin: 0 0 2px; font-size: var(--step-1); }
.token__key { margin: 0 0 8px; font-size: var(--step--1); }
.token__specs { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 8px; font-size: var(--step--1); }
.token__specs dt { color: var(--c-muted); }
.token__specs dd { margin: 0; font-weight: 600; }
.token__usage { font-size: var(--step--1); color: var(--c-muted); }
.token__used { font-size: var(--step--1); margin: 0 0 6px; }
.token__history summary { cursor: pointer; font-size: var(--step--1); color: var(--c-muted); margin-bottom: 10px; }
.token__actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { color: var(--c-muted); font-weight: 600; border-bottom-color: var(--line-strong); }

/* Einstellungen */
.taxgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 40px; }
.taxrow { display: grid; grid-template-columns: minmax(0, 1fr) 64px auto auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.taxrow:has(.taxrow__prefix) { grid-template-columns: 56px minmax(0, 1fr) 64px auto auto; }
.taxrow input { padding: 6px 8px; font-size: var(--step--1); }
.taxrow .check { grid-column: 1 / -1; }
.taxrow__reason { grid-column: 1 / -2; }
.taxrow__count { text-align: right; min-width: 70px; }
.taxrow[data-taxrow]:not(.is-dirty) .taxrow__reason, .taxrow[data-taxrow]:not(.is-dirty) .taxrow__save { display: none; }
.taxrow--add { border-bottom: 0; background: var(--soft); padding: 10px; border-radius: var(--radius); margin-top: 8px; }
.userlist { display: grid; }
.userrow { display: grid; grid-template-columns: 36px minmax(0, 1fr) 210px auto auto; gap: 12px 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.userrow.is-inactive { opacity: .6; }
.userrow__names { display: flex; gap: 6px; margin-bottom: 3px; }
.userrow__names input { padding: 5px 8px; font-weight: 600; }
.userrow__actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* Dialoge */
.dialog { border: 0; border-radius: 10px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); color: var(--c-text); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45); }
.dialog--wide { width: min(760px, calc(100vw - 32px)); }
.dialog::backdrop { background: color-mix(in srgb, var(--c-primary) 55%, transparent); }
.dialog form { padding: 24px 26px 20px; }
.dialog h2 { font-size: var(--step-1); margin-bottom: 8px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(10, 12, 16, .9); }
.lightbox[open] { display: grid; grid-template-columns: 60px minmax(0, 1fr) 60px; align-items: center; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 10px; max-height: 100vh; padding: 30px 0; }
.lightbox img { max-height: calc(100vh - 110px); width: auto; max-width: 100%; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.lightbox figcaption { color: #fff; font-size: var(--step--1); }
.lightbox__close { position: fixed; top: 14px; right: 18px; font-size: 2rem; background: none; border: 0; color: #fff; cursor: pointer; }
.lightbox__nav { font-size: 2.6rem; background: none; border: 0; color: #fff; cursor: pointer; height: 100%; }

/* Login */
.plain { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--c-surface); }
.plain__box { width: min(420px, 100%); background: var(--c-bg); border-radius: 10px; padding: 34px 32px 26px; border-top: 4px solid var(--c-accent); box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .4); }
.plain__brand { margin-bottom: 26px; }
.plain__brand img { max-height: 48px; width: auto; }
.plain__brand strong { font-family: var(--f-heading); font-size: var(--step-2); color: var(--c-primary); }
.plain__title { font-size: var(--step-2); }
.plain .btn--block { margin-top: 18px; }
.plain__foot { margin: 18px 0 0; font-size: var(--step--1); text-align: center; }

/* Mobil */
@media (max-width: 1080px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .titleblock { grid-template-columns: 130px repeat(2, minmax(0, 1fr)); }
  .titleblock__name, .titleblock__tags { grid-column: span 2; }
  .titleblock__code { grid-row: span 4; }
  .titleblock__cell:nth-child(6) { border-right: 1px solid var(--line) !important; }
  .titleblock__cell:nth-child(4), .titleblock__cell:nth-child(6) { border-right: 0 !important; }
  .userrow { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .userrow > select, .userrow > .check { grid-column: 2; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; background: var(--c-bg); border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .topbar__title { font-weight: 700; color: var(--c-primary); }
  .main { padding-top: 22px; }
  .filters { position: static; }
  .grid2, .grid3, .taxgrid, .shots { grid-template-columns: minmax(0, 1fr); }
  .span2, .span3 { grid-column: auto; }
  .modrow__link { grid-template-columns: 60px minmax(0, 1fr); gap: 14px; }
  .modrow__thumb { display: none; }
  .modrow__code { font-size: 1.25rem; }
  .token { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .token__actions { flex-direction: row; align-items: center; }
  .pagehead { flex-direction: column; }
}
@media (max-width: 560px) {
  .grid4 { grid-template-columns: minmax(0, 1fr); }
  .titleblock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .titleblock__code { grid-row: auto; grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 12px; justify-content: flex-start; }
  .titleblock__name, .titleblock__tags { grid-column: 1 / -1; }
  .filters__label { width: 100%; }
  .diff tbody th { width: auto; }
  .diff, .diff tbody, .diff tr, .diff td, .diff th { display: block; width: 100% !important; }
  .diff thead { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .actionbar, .filters, .localnav, .comment-form, dialog, .btn, .linkbtn { display: none !important; }
  .app { display: block; }
}

/* Suchfeld im Filter ohne Rahmen (nach den globalen Eingabefeldern) */
.filters__search input[type=search] { border: 0; padding: 4px 0; background: transparent; }
@media (max-width: 560px) { .filters__row .check { padding-left: 0; } }
.tokenpick select { font-weight: 400; }
