/* Minimal App-Shell (U0) — siehe UI/06-MINIMAL-SHELL.md */

:root {
  --tab-bar-height: 40px;
  --color-primary-muted: #f3f4e3;
  --color-error-bg: #ffebee;
  --color-warning-bg: #fff8e1;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --sidebar-width-expanded: 280px;
  --sidebar-width-collapsed: 56px;
  --header-height: 52px;
  --color-bg: #f4f5f7;
  --color-surface: #fff;
  --color-border: #dcdfe4;
  --color-text: #1a1a1a;
  --color-muted: #6b7280;
  --color-primary: #848d15;  /* winball-Grün = Astra-Farbe 0 auf erechnungs-validator.de */
  --color-primary-hover: #6c7411;
  --color-error: #c62828;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-header {
  flex: 0 0 var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.app-header__logo {
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.app-header__title {
  flex: 1;
  color: var(--color-muted);
  font-size: 13px;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header__btn {
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
}

.app-header__btn:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.app-header__btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  flex: 0 0 var(--sidebar-width-expanded);
  display: flex;
  flex-direction: column;
  background: #1e1e2e;
  color: #e4e4ef;
  transition: flex-basis 0.2s ease;
  overflow: hidden;
}

.sidebar.is-collapsed {
  flex-basis: var(--sidebar-width-collapsed);
}

.sidebar__toggle {
  flex: 0 0 40px;
  border: none;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  font-size: 18px;
}

.sidebar__toggle:hover {
  color: #fff;
}

.sidebar__inner {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
}

.sidebar.is-collapsed .sidebar__inner {
  display: none;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.main .result-view {
  flex: 1;
  min-height: 0;
}

.pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--color-surface);
}

/* Ergebnis: eine Fläche mit einer Reiterleiste (Dokument- und Prüfansichten), keine Teilung */
.result-view {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}

.app[data-mode="result"] .result-view,
.app[data-mode="expired"] .result-view {
  display: flex;
}

.pane--main {
  flex: 1;
  min-height: 0;
}

.pane__content[hidden] {
  display: none !important;
}

.tab-bar__group {
  display: flex;
  align-items: stretch;
}

.tab-bar__group:empty {
  display: none;
}

.pane__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

#doc-tab-panels,
#review-tab-panels {
  flex: 1;
  min-height: 0;
}

.pane__content--empty {
  background: var(--color-surface);
}

/* Upload / Dropzone (Parität validator-form.php) */
.upload-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 24px 16px;
  overflow: auto;
}

.app[data-mode="result"] .upload-view {
  display: none;
}

.dropzone {
  width: min(560px, 92%);
  min-height: 210px;
  margin: 0 auto;
  padding: 28px 24px 20px;
  text-align: center;
  border: 2px dashed #ccc;
  border-radius: 20px;
  background: rgba(247, 249, 251, 0.85);
  transition: border-color 0.15s ease, background 0.15s ease;
}

/* Einbettung: Auf schmalen iframes bricht der Text der Karte je nach Breite unterschiedlich um
   (Kartenhöhe 226–262 px). Mit fester Mindesthöhe meldet der Container zwischen 300 und 419 px
   Breite immer dieselbe Höhe (410 px), damit die Starthöhe der Einbettung passt und nichts springt. */
@media (max-width: 419px) {
  .app[data-embed="1"] .dropzone {
    min-height: 266px;
  }
}

.dropzone.is-highlight {
  border-color: var(--color-text);
  background: rgba(232, 245, 238, 0.9);
}

.dropzone.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.dropzone__form {
  margin: 0 0 10px;
}

.dropzone__lead {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text);
}

.dropzone__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dropzone__btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
}

.dropzone__btn:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.dropzone__formats {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

.dropzone__status {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--color-text);
}

.dropzone__status.is-error {
  color: var(--color-error);
}

.dropzone__progress {
  height: 22px;
  width: 100%;
  max-width: 420px;
  margin: 16px auto 0;
  border: 1px solid var(--color-primary);
  border-radius: 3px;
  overflow: hidden;
}

.dropzone__progress-bar {
  height: 100%;
  width: 0;
  background: var(--color-primary);
  opacity: 0.65;
  transition: width 0.2s ease;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    z-index: 20;
    transform: translateX(-100%);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }
}

/* ——— U1: Panel, Tabs, Ergebnis ——— */

.app-header__link {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 13px;
  margin-right: 8px;
}

.app-header__link:hover {
  color: var(--color-primary);
}

.app[data-mode="loading"] .dropzone {
  pointer-events: none;
  opacity: 0.85;
}

.app[data-mode="queue"] .upload-view,
.app[data-mode="result"] .upload-view,
.app[data-mode="expired"] .upload-view {
  display: none;
}

.app[data-mode="queue"] .queue-view {
  display: flex;
}

.queue-view {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.queue-panel {
  max-width: 420px;
  text-align: center;
  padding: 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.queue-panel__title {
  margin: 0 0 8px;
  font-size: 18px;
}

.queue-panel__text {
  margin: 0 0 12px;
  color: var(--color-muted);
}

.queue-panel__position {
  margin: 0;
  font-weight: 600;
  color: var(--color-primary);
}

.system-banner {
  flex: 0 0 auto;
  padding: 12px 16px;
  background: var(--color-error-bg);
  border-bottom: 1px solid #ffcdd2;
  color: var(--color-error);
  font-weight: 600;
}

.pane--u1-stub {
  flex: 0 0 auto;
  max-height: 48px;
}

.pane--u1-stub .split-handle {
  display: none;
}

.pane-stub {
  margin: 0;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--color-muted);
  text-align: center;
  background: #f8f9fa;
}

.panel-head {
  padding: 8px 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.panel-filename {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.chip--ok {
  background: rgba(45, 134, 89, 0.3);
  color: #a5d6a7;
}

.chip--error {
  background: rgba(198, 40, 40, 0.25);
  color: #ff8a80;
}

.chip--muted {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
}

.panel-box {
  margin: 8px 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.panel-box__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  list-style: none;
}

.panel-box__summary::-webkit-details-marker {
  display: none;
}

.panel-box__summary::before {
  content: "▸";
  font-size: 11px;
  color: #888;
}

.panel-box[open] .panel-box__summary::before {
  content: "▾";
}

.panel-box__body {
  padding: 0 12px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #ccc;
}

.panel-box__body p {
  margin: 0 0 8px;
}

.panel-box__body p:last-child {
  margin-bottom: 0;
}

.panel-handlung .panel-box__body {
  color: #e4e4ef;
}

.panel-source {
  margin: 0 0 6px;
  font-size: 12px;
  color: #a9abb8;
}

.panel-handlung .panel-source:last-child {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.panel-dl {
  margin: 0;
  display: grid;
  gap: 6px;
}

.panel-dl div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 12px;
}

.panel-dl dt {
  color: #888;
}

.panel-dl dd {
  margin: 0;
  word-break: break-word;
}

.panel-downloads a,
.panel-downloads button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  margin-bottom: 4px;
  border: none;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: #ddd;
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}

.panel-downloads a:hover:not(.is-disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.panel-downloads .is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.tab-bar {
  flex: 0 0 var(--tab-bar-height);
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 8px;
  background: #eef0f3;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.tab-bar__tab {
  border: none;
  background: transparent;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  color: var(--color-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-bar__tab:hover {
  color: var(--color-text);
}

.tab-bar__tab.is-active {
  color: var(--color-text);
  font-weight: 600;
  border-bottom-color: var(--color-primary);
  background: var(--color-surface);
}

.tab-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.tab-panel[hidden] {
  display: none !important;
}

.tab-panel__scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.pane-hint {
  margin: 0;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--color-muted);
  background: #f8f9fa;
  border-bottom: 1px solid var(--color-border);
}

.report-list {
  padding: 12px 16px;
}

.summary-view {
  padding: 12px 16px 20px;
}

.summary-block {
  margin-bottom: 18px;
}

.summary-block__title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.summary-recommendation {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.summary-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.summary-hint--legal {
  color: var(--color-text);
  font-weight: 500;
}

.report-item.is-highlight-pulse {
  animation: plus-highlight-pulse 2s ease-out;
}

@keyframes plus-highlight-pulse {
  0% { background: rgba(255, 196, 0, 0.35); }
  100% { background: transparent; }
}

.error-info {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  cursor: help;
}

.summary-overall.is-valid {
  color: var(--color-success, #1b6b34);
  font-weight: 700;
}

.summary-overall.is-invalid {
  color: var(--color-error);
  font-weight: 700;
}

.summary-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.summary-dl {
  margin: 0;
}

.summary-dl--inline > div {
  display: inline-block;
  margin-right: 14px;
  margin-bottom: 4px;
}

.summary-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-tile {
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.summary-tile--ok {
  border-color: #8fd4a6;
  background: #f3fbf6;
}

.summary-tile--fail {
  border-color: #e8a8a8;
  background: var(--color-error-bg);
}

.summary-tile--warn {
  border-color: #e6d08a;
  background: #fffbeb;
}

.summary-tile__label {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.summary-tile__status {
  display: block;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.summary-link {
  border: 0;
  background: none;
  color: var(--color-link, #0b57d0);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.summary-index {
  list-style: none;
  margin: 0;
  padding: 0;
}

.summary-index__item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 6px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
}

.summary-index__item.is-active {
  font-weight: 700;
}

.summary-index__src {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.report-item--passed {
  opacity: 0.75;
  cursor: default;
}

.report-item--warn {
  border-color: #e6d08a;
  background: #fffbeb;
}

.plus-summary {
  padding: 0 16px 8px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.report-item {
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.report-item:hover {
  border-color: #bbb;
}

.report-item.is-active {
  border-color: var(--color-error);
  background: var(--color-error-bg);
}

.report-item__head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}

.report-item__num {
  font-weight: 700;
  color: var(--color-error);
}

.report-item__rule {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-muted);
}

.report-item__source {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eee;
  color: var(--color-muted);
}

.report-item__msg {
  font-size: 13px;
  margin: 0 0 8px;
}

.report-item__hint {
  font-size: 12px;
  color: var(--color-text);
  margin: 0 0 6px;
  padding: 8px 10px;
  background: var(--color-primary-muted);
  border-radius: var(--radius);
}

.report-item__solution {
  font-size: 12px;
  color: var(--color-muted);
  margin: 0;
}

.report-empty {
  padding: 24px 16px;
  color: var(--color-muted);
}

.addition-list {
  padding: 12px 16px;
}

.addition-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--color-primary);
  background: #f8f9fa;
  font-size: 13px;
}

.basisdaten-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px;
}

.basisdaten-card {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.basisdaten-card dt {
  font-size: 11px;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.basisdaten-card dd {
  margin: 0;
  font-weight: 600;
}

.codemirror-wrap {
  flex: 1;
  min-height: 200px;
  height: 100%;
  border-top: 1px solid var(--color-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.codemirror-wrap .CodeMirror {
  flex: 1;
  height: auto !important;
  min-height: 200px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.report-frame-wrap,
.sightbill-frame-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  overflow: hidden;
}

.report-frame-wrap iframe,
.sightbill-frame-wrap iframe {
  flex: 1;
  width: 100%;
  min-height: 200px;
  border: none;
}

.app[data-mode="expired"] .panel-downloads a,
.app[data-mode="expired"] .panel-downloads button {
  opacity: 0.45;
  pointer-events: none;
}

.app[data-mode="loading"] .sidebar__inner,
.app[data-mode="upload"] .sidebar__inner,
.app[data-mode="queue"] .sidebar__inner {
  display: none;
}

.app[data-mode="result"] .sidebar__inner,
.app[data-mode="expired"] .sidebar__inner {
  display: block;
}

/* Vor dem Ergebnis (Upload/Warteschlange/Laden) ist die Seitenleiste leer: schmal eingeklappt zeigen
   statt als breite dunkle Fläche (Einbettung auf der Startseite, 2026-11-16) */
.app[data-mode="loading"] .sidebar,
.app[data-mode="upload"] .sidebar,
.app[data-mode="queue"] .sidebar {
  flex-basis: var(--sidebar-width-collapsed);
}

/* Eingeklappt bleibt die Seitenleiste leer (nur der Umschalter) – muss nach der Regel oben stehen */
.app .sidebar.is-collapsed .sidebar__inner {
  display: none;
}

/* ——— U2–U4: Sichtbeleg, Sync, Mobile, Embed ——— */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 8px 16px;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

.sync-status {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  padding: 10px 14px;
  background: #323232;
  color: #fff;
  font-size: 13px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.sync-status.is-visible {
  opacity: 0.95;
}

.panel-errors {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.error-index-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: #ddd;
  cursor: pointer;
  font: inherit;
}

.error-index-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.error-index-item.is-selected {
  border-color: #ff8a80;
  background: rgba(198, 40, 40, 0.2);
}

.error-index-item--warn {
  border-left: 3px solid #e6c34a;
}

.error-index-item--warn.is-selected {
  border-color: #e6c34a;
  background: rgba(230, 195, 74, 0.18);
}

.error-index-item--info {
  border-left: 3px solid #8aa4c8;
}

.error-index-item--info.is-selected {
  border-color: #8aa4c8;
  background: rgba(138, 164, 200, 0.18);
}

.error-index-item__line1 {
  font-size: 13px;
  margin-bottom: 2px;
  overflow-wrap: anywhere;
  /* Bis zu 3 Zeilen, dann «…»; der ausgewählte Eintrag zeigt den ganzen Text. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.error-index-item.is-selected .error-index-item__line1 {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: none;
  overflow: visible;
}

.error-index-item__line2 {
  font-size: 11px;
  color: #888;
  font-family: var(--font-mono);
}

.error-index-item__explain {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: #ffb4a9;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.error-index-item__explain:hover,
.error-index-item__explain:focus-visible {
  color: #fff;
}

.panel-download-open:hover:not(.is-disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.tab-bar--main {
  position: relative;
  flex: 0 0 auto;
  align-items: flex-start;
  overflow: visible;
}

/* alle Ansichten in einer Leiste: bei schmalem Fenster umbrechen statt quer scrollen */
.tab-bar__tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
}

/* Download bleibt immer oben rechts in der ersten Zeile */
.tab-bar--main .tab-bar__actions {
  flex: 0 0 auto;
  height: var(--tab-bar-height);
}

.tab-bar__download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
}

.tab-bar--main .tab-bar__tab {
  min-height: var(--tab-bar-height);
}

/* Gruppen nur für die Logik (Dokument/Prüfung) – optisch eine durchgehende Reihe */
.tab-bar--main .tab-bar__group {
  display: contents;
}

.tab-bar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  padding-right: 4px;
}

.tab-bar__icon-btn {
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 16px;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: var(--radius);
}

.tab-bar__icon-btn:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.05);
}

.tab-bar__empty {
  padding: 0 14px;
  font-size: 13px;
  color: var(--color-muted);
  align-self: center;
}


.attachments-layout {
  display: flex;
  min-height: 320px;
  flex: 1;
}

.attachments-list {
  flex: 0 0 200px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
}

.attachments-list__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.attachments-list__item:hover {
  background: #f0f0f0;
}

.attachments-list__item.is-active {
  background: var(--color-primary-muted);
  font-weight: 600;
}

.attachments-preview {
  flex: 1;
  min-width: 0;
  padding: 12px;
  overflow: auto;
}

.attachments-preview iframe,
.attachments-preview img {
  max-width: 100%;
  border: none;
}

.attachments-preview iframe {
  width: 100%;
  min-height: 420px;
}

.attachments-preview img {
  height: auto;
}

.attachments-preview__loading {
  color: var(--color-muted);
  margin: 0;
}

.attachments-preview__text {
  margin: 0;
  padding: 10px 12px;
  background: #f8f8f8;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 70vh;
  overflow: auto;
}

.attachments-preview__hint {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
}

.attachments-preview__meta {
  color: var(--color-muted);
  margin: 0 0 8px;
}

.app-header__drawer-btn {
  display: none;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--color-text);
}

.app.is-mobile .app-header__drawer-btn {
  display: inline-block;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(0, 0, 0, 0.35);
  z-index: 15;
}

.app-header--embed .app-header__link[href="/docs/"] {
  display: none;
}

.app[data-embed="1"] .app-footer {
  display: none;
}

.app-footer {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--color-muted);
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.tab-bar__tab:focus-visible,
.error-index-item:focus-visible,
.report-item:focus-visible,
.attachments-list__item:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ValiBot – Fehler-Assistent (assets/valibot.js), Optik wie im Plugin */
.valibot-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius);
  background: #1e1e1e;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.valibot-open:hover,
.valibot-open:focus-visible {
  background: #333;
}

.valibot-open:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.valibot {
  position: fixed;
  inset: 0;
  z-index: 3000;
}

.valibot[hidden] {
  display: none;
}

.valibot__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.valibot__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(640px, calc(100% - 32px));
  height: min(70vh, 520px);
  margin: max(16px, 8vh) auto 0;
  overflow: hidden;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.valibot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #2d2d2d;
  border-bottom: 1px solid #444;
  color: #ccc;
  font-family: var(--font-mono);
  font-size: 14px;
}

.valibot__close {
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
}

.valibot__close:hover {
  color: #fff;
}

.valibot__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.valibot__xterm {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px;
}

.valibot__prompt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px 12px;
  border-top: 1px solid #333;
  color: #d4d4d4;
  font-family: var(--font-mono);
  font-size: 13px;
}

.valibot__prompt-char {
  color: #4ec9b0;
  font-weight: bold;
}

.valibot__prompt input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #d4d4d4;
  font: inherit;
  outline: none;
}

.valibot__fallback {
  padding: 1em;
  color: #d4d4d4;
  font-family: var(--font-mono);
}

.tab-bar__icon-btn:disabled {
  opacity: 0.4;
  cursor: default;
  background: transparent;
}

/* Handy: Reiter quer wischen statt viele Zeilen; Download bleibt rechts sichtbar */
@media (max-width: 768px) {
  .tab-bar__tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tab-bar__tabs::-webkit-scrollbar {
    display: none;
  }
  .tab-bar__download {
    padding: 4px 8px;
  }
}

/* PDF mit eingebetteter UBL: Hinweis „Kein ZUGFeRD-PDF“ (Seitenleiste, Übersicht, Ergänzungen) */
.result-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.45;
}

.result-note--warn {
  border-left: 3px solid #e6c34a;
  background: rgba(230, 195, 74, 0.14);
}

.summary-addition--warn {
  padding: 8px 10px;
  border-left: 3px solid #e6c34a;
  border-radius: var(--radius);
  background: rgba(230, 195, 74, 0.12);
}
