/* =========================================================
   Basis-Layout: html / body / .root / .viewport / .scene
   Gemeinsam für Editor (index.html) und Viewer (viewer.html).
   ========================================================= */

html,
body {
    position: relative;
    height: 100%;
    margin: 0;
    padding: 0;
}

.root {
    position: relative;
}

.viewport {
    width: 100%;
    height: 100%;
    overflow: auto;
}

.scene {
    position: relative;
    width: 1920px;
    height: 1136px;
    /* background-image wird via SceneStore und applySceneBackground() gesetzt */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform-origin: 0 0;
}


/* =========================================================
   Globaler figure-Reset
   Browser-UA-Stylesheet setzt margin-block/inline auf figure-Elemente.
   Alle Komponenten-figure-Elemente beginnen mit margin: 0 / padding: 0.
   ========================================================= */

.scene figure {
    margin: 0;
    padding: 0;
}

/* =========================================================
   Content wrapper
   height: 100% damit Komponenten-Typen, die ihrerseits height: 100%
   nutzen (z.B. ai-assistant), auf die konfigurierte Komponentenhöhe
   referenzieren können.
   ========================================================= */

.component-content {
    height: 100%;
}

/* =========================================================
   Component types
   ========================================================= */

.component-image {
    width: 100%;
    height: auto;
    display: block;
}

.component-image-caption {
    margin-top: 0.25em;
    font-size: 0.9em;
    color: #555;
    text-align: center;
}

/* =========================================================
   Video component
   ========================================================= */

/* Outer figure fills the component box completely */
.component-video {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden;
    /* important for warp/scale */
    box-sizing: border-box;
}

/* Media elements must fill the figure */
.component-video iframe,
.component-video video {
    position: absolute;
    inset: 0;
    /* top:0 right:0 bottom:0 left:0 */
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

/* Prevent inline baseline quirks */
.component-video iframe,
.component-video video {
    vertical-align: top;
}

/* Caption (hidden by default, shown in popup later) */
.component-video-caption {
    display: none;
    margin-top: 0.5em;
    font-size: 0.9em;
    color: #555;
}

/* =========================================================
   Embedded Webpage component
   ========================================================= */

.component-iframe {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.component-iframe iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.component-iframe-caption {
    display: none;
    /* reserved for popup mode */
}

/* =========================================================
   Link component
   ========================================================= */

/* Icon Link */
.component-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 4rem;
    /* scalable */
    cursor: pointer;
    user-select: none;
}

/* =========================================================
   Confirmation dialog
   ========================================================= */

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.confirm-overlay.hidden {
    display: none;
}

.confirm-dialog {
    background: #fff;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    font-family: system-ui, sans-serif;
}

.confirm-text {
    margin-bottom: 1.25rem;
    font-size: 1rem;
    line-height: 1.4;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.confirm-actions button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    cursor: pointer;
}

/* =========================================================
   Audio component
   ========================================================= */

.component-audio {
    position: relative;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    /* vertically center audio controls */
    justify-content: center;
    /* horizontally center */

    flex-direction: column;
}

.component-audio audio {
    width: 100%;
    /* allow resizing */
    max-width: 100%;
    display: block;
}

.component-audio-caption {
    /* display: none; */
    /* ~~reserved for popup / expanded mode~~ */
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9em;
    color: #555;
    text-align: center;
}


/* =========================================================
   Form component
   ========================================================= */

.component-form {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
    background-color: white;
    border-radius: 1rem;
    border: 2px solid grey;
    padding: 1.0rem;
}

.component-form fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.component-form legend {
    font-weight: bold;
    margin-bottom: 0.75rem;
}

.form-field {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
}

.form-field label {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.35rem 0.45rem;
    box-sizing: border-box;
}

.form-field--checkbox {
    flex-direction: row;
    align-items: center;
}

.form-field--checkbox input {
    width: auto;
}

.form-field--checkbox label {
    margin: 0;
    font-size: 0.9rem;
}

.form-actions {
    margin-top: 1rem;
}

.form-actions button {
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
}

/* =========================================================
   Form component – additions
   ========================================================= */

/* Required field indicator */
.form-required {
    color: #c00;
    margin-left: 0.1em;
}

/* Help text below a field */
.form-field-help {
    font-size: 0.8rem;
    color: #777;
    margin-top: 0.2rem;
}

/* Server response area (below submit button) */
.form-response {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.form-response.form-response--success {
    color: #2a7a2a;
}

.form-response.form-response--error {
    color: #c00;
}

/* Field-level error message */
.form-field-error-msg {
    font-size: 0.8rem;
    color: #c00;
    margin-top: 0.2rem;
}

/* Field marked invalid after server response */
.form-field--error input,
.form-field--error select,
.form-field--error textarea {
    border-color: #c00;
    outline-color: #c00;
}

/* Loading state: button disabled */
.form-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* JSON parse error in editor */
.component-form-error {
    color: #c00;
    font-size: 0.9rem;
    padding: 0.5rem;
    border: 1px solid #c00;
    border-radius: 4px;
}

/* component expand handle */
.component-expand-handle_top-upper-corner_not-used {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #222;
    color: white;
    font-size: 14px;
    cursor: pointer;
    z-index: 9999;
}

.component-expand-handle {
    position: absolute;
    transform: translate(-50%, -50%);
    /* true centering */
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #222;
    color: white;
    font-size: 18px;
    /* large enough for both ⤢ and × */
    cursor: pointer;
    z-index: 9999;
}

/* ---------------------------------
   Teaser overlay
   Shown in collapsed viewer state when expandable + teaser content set.
   Position: absolute, covers the component-content area.
   Customisable from Stand-CSS via .component-teaser.
--------------------------------- */

.component-teaser {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
    overflow: hidden;
    cursor: pointer;
    z-index: 10;
    background-color: #ffffff;
    border-radius: 1rem;
}

.component-teaser-image {
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.component-teaser-text {
    padding: 0.4em 0.6em;
    text-align: center;
    overflow: hidden;
}

/* ---------------------------------
   Backdrop overlay
   Inserted into document.body when a component expands with showBackdrop=true.
   z-index 9998: below handle (9999) and expanded component (10000).
--------------------------------- */

/* Expanded component gets a clean card look regardless of component type */
.scene.viewer .component.expanded {
    background-color: white;
    border-radius: 1rem;
    border: 2px solid grey;
}

.component-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9998;
    cursor: pointer;
}

/* ---------------------------------
   Video Aspect Ratio System
--------------------------------- */

.component-video {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.component-video.ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.component-video.ratio-4-3 {
    aspect-ratio: 4 / 3;
}

.component-video.ratio-1-1 {
    aspect-ratio: 1 / 1;
}

.component-video iframe,
.component-video video {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

/* =========================================================
   Contact component
   ========================================================= */

.component-contact {
    container-type: inline-size;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
}

.contact-card {
    font-size: 2.8cqi;
    font-family: system-ui, -apple-system, sans-serif;

    --header-bg: #1b2a4a;
    --header-color: rgba(255, 255, 255, 0.92);
    --accent: var(--header-bg);

    width: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0.5em;
    overflow: hidden;
    box-shadow: 0 0.22em 1.2em rgba(0, 0, 0, 0.13);
}

.contact-header {
    background: var(--header-bg);
    padding: 0.7em 1em;
    flex-shrink: 0;
}

.contact-company-name {
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--header-color);
    line-height: 1.3;
}

.contact-company-url {
    font-size: 0.62em;
    color: var(--header-color);
    opacity: 0.55;
    margin-top: 0.12em;
}

.contact-body {
    flex: 1;
    display: grid;
    grid-template-columns: 6.5em 1fr;
    gap: 0 1em;
    padding: 1em;
    min-height: 0;
    overflow: hidden;
}

.contact-left {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65em;
}

.contact-photo-wrap {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    border: 0.14em solid var(--accent);
    flex-shrink: 0;
}

.contact-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.contact-qr {
    width: 100%;
    aspect-ratio: 1;
    flex-shrink: 0;
}

.contact-qr svg,
.contact-qr img {
    width: 100%;
    height: 100%;
    display: block;
}

.contact-qr-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    border: 0.06em solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    color: #aaa;
}

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

.contact-name {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-role {
    font-size: 0.75em;
    color: #888;
    margin-top: 0.12em;
}

.contact-fields {
    margin-top: 0.6em;
    border-top: 0.07em solid #eee;
    padding-top: 0.5em;
    display: flex;
    flex-direction: column;
    gap: 0.28em;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.contact-field {
    display: flex;
    align-items: baseline;
    gap: 0.4em;
    font-size: 0.8em;
    color: #333;
    line-height: 1.3;
    min-width: 0;
}

.cf-icon {
    width: 1.1em;
    text-align: center;
    flex-shrink: 0;
    font-style: normal;
    color: var(--accent);
    opacity: 0.55;
}

.contact-field a {
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-field a:hover {
    text-decoration: underline;
}

.contact-field-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-vcard-btn {
    margin-top: auto;
    padding-top: 0.6em;
    padding-bottom: 0;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.72em;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    opacity: 0.7;
    align-self: flex-start;
}

.contact-vcard-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

/* =========================================================
   AI Assistant component
   ========================================================= */

.component-ai-assistant {
    container-type: inline-size;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 1.0cqi;
    background: #f0f2f5;
    border-radius: 0.5em;
    overflow: hidden;

    --ai-header-bg: #1b2a4a;
    --ai-header-color: rgba(255, 255, 255, 0.92);
}

/* ── Header ─────────────────────────────────────────────── */

.ai-header {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.5em 0.8em;
    background: var(--ai-header-bg);
    color: var(--ai-header-color);
    flex-shrink: 0;
}

.ai-avatar {
    width: 2em;
    height: 2em;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ai-name {
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Messages area ──────────────────────────────────────── */

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.7em;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    min-height: 0;
}

/* ── Bubbles ─────────────────────────────────────────────── */

.ai-bubble {
    max-width: 80%;
    padding: 0.45em 0.75em;
    border-radius: 0.8em;
    font-size: 0.82em;
    line-height: 1.45;
    word-break: break-word;
}

.ai-bubble--assistant {
    align-self: flex-start;
    background: #fff;
    border-bottom-left-radius: 0.15em;
    box-shadow: 0 0.1em 0.4em rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

.ai-bubble--user {
    align-self: flex-end;
    background: var(--ai-header-bg);
    color: var(--ai-header-color);
    border-bottom-right-radius: 0.15em;
}

/* Blinking cursor while streaming */
.ai-bubble--streaming::after {
    content: "▌";
    opacity: 0.6;
    animation: ai-blink 0.8s step-end infinite;
}

@keyframes ai-blink {
    50% {
        opacity: 0;
    }
}

/* Constrain images inside assistant bubbles */
.ai-bubble--assistant img {
    max-width: 100%;
    max-height: 10em;
    display: block;
    border-radius: 0.3em;
    margin-top: 0.3em;
}

/* Error text inside a bubble */
.ai-bubble .ai-error {
    color: #c00;
}

/* ── Input row ───────────────────────────────────────────── */

.ai-input-row {
    display: flex;
    align-items: flex-end;
    gap: 0.4em;
    padding: 0.5em 0.7em;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.ai-input {
    flex: 1;
    resize: none;
    border: 1px solid #ccc;
    border-radius: 1em;
    padding: 0.4em 0.75em;
    font-family: inherit;
    font-size: 0.82em;
    line-height: 1.4;
    max-height: 6em;
    overflow-y: auto;
    box-sizing: border-box;
    outline: none;
}

.ai-input:focus {
    border-color: var(--ai-header-bg);
}

.ai-input:disabled {
    background: #f5f5f5;
    color: #999;
}

.ai-send-btn {
    flex-shrink: 0;
    padding: 0.4em 0.9em;
    background: var(--ai-header-bg);
    color: var(--ai-header-color);
    border: none;
    border-radius: 1em;
    font-family: inherit;
    font-size: 0.82em;
    cursor: pointer;
    white-space: nowrap;
}

.ai-send-btn:hover:not(:disabled) {
    opacity: 0.85;
}

.ai-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------------------------------
   Links
--------------------------------- */

figure.icon-link a {
    text-decoration: none;
}


/* ==========================================================
   Stand-Info-Header (oberhalb der Komponentenliste)
   ========================================================== */

.cb-stand-header {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0;
}

.cb-stand-heading {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.cb-stand-description {
    font-size: 0.95rem;
    line-height: 1.6;
}

.cb-stand-description p:last-child {
    margin-bottom: 0;
}

.cb-stand-contact {
    font-size: 0.9rem;
    line-height: 1.8;
}

.cb-contact-company {
    font-weight: 600;
}

.cb-contact-phone {
    margin-top: 0.5rem;
}

/* ==========================================================
   Komponentenliste unterhalb der Szene
   ========================================================== */

.cb-component-list-wrapper {
    padding: 2rem 1rem;
}

.cb-list-group {
    margin-bottom: 2.5rem;
}

.cb-list-group-heading {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.cb-list-item {
    padding: 0.75rem;
}

.cb-list-item-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Video und Audio: immer volle Breite, responsive */
.cb-component-list-wrapper .component-video,
.cb-component-list-wrapper figure.component-audio {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.cb-component-list-wrapper .component-video.ratio-16-9 {
    aspect-ratio: 16 / 9;
    position: relative;
}

.cb-component-list-wrapper .component-video.ratio-4-3 {
    aspect-ratio: 4 / 3;
    position: relative;
}

.cb-component-list-wrapper .component-video.ratio-1-1 {
    aspect-ratio: 1 / 1;
    position: relative;
}

.cb-component-list-wrapper .component-video-player,
.cb-component-list-wrapper .component-video-iframe {
    width: 100%;
    height: 100%;
    display: block;
}

/* Audio: volle Breite */
.cb-component-list-wrapper .component-audio audio {
    width: 100%;
}

/* Contact-Karte: natürliche Breite erlauben */
.cb-component-list-wrapper .component-contact {
    margin: 0;
    width: 100%;
}

/* AI-Assistant in der Komponentenliste */
.cb-component-list-wrapper .component-ai-assistant {
    min-height: 300px;
}
.cb-component-list-wrapper .ai-messages {
    max-height: 600px;
}


/* =========================================================
   Conferences — dynamische Konferenzliste
   ========================================================= */

.component-conferences {
    container-type: inline-size;
    height: 100%;
    overflow-y: auto;
}

.conference-heading {
    margin: 0 0 0.75em;
    font-size: 1em;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.6em 1em;
    background: #f4f4f4;
}

/* Kein Standard-Listen-Styling */
.conference-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

/* Normalansicht — Karten-Layout */
.conference-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.9em 1em;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.35em;
}

.conference-meta {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

.conference-type-label {
    font-size: 0.8em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.conference-live-badge {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    font-size: 0.75em;
    font-weight: 600;
    padding: 0.15em 0.5em;
    border-radius: 3px;
    letter-spacing: 0.03em;
}

.conference-reg-icon {
    color: #555;
    line-height: 1;
}

.conference-reg-icon svg {
    vertical-align: middle;
}

.conference-title {
    font-weight: 600;
    font-size: 1em;
}

.conference-desc {
    margin: 0;
    color: #444;
    font-size: 0.9em;
}

.conference-time {
    font-size: 0.85em;
    color: #555;
}

.conference-btn {
    display: inline-block;
    margin-top: 0.25em;
    padding: 0.35em 0.9em;
    border: 1px solid currentColor;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85em;
    color: inherit;
    align-self: flex-start;
    transition: background 0.15s, color 0.15s;
}

.conference-btn:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Kompaktansicht — eine Zeile pro Eintrag, bei Platzmangel bricht die Zeit um */
.conference-item--compact {
    flex-direction: row;
    align-items: center;
    gap: 0.4em 0.6em;
    padding: 0.5em 0.75em;
    flex-wrap: wrap;
}

.conference-type-icon {
    flex-shrink: 0;
    line-height: 1;
    color: #555;
}

.conference-type-icon svg {
    vertical-align: middle;
}

.conference-compact-link,
.conference-compact-title {
    flex: 1 1 100px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.conference-compact-link {
    color: inherit;
    text-decoration: none;
}

.conference-compact-link:hover {
    text-decoration: underline;
}

.conference-item--compact .conference-time {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Leer- und Fehlerzustand */
.conference-empty,
.conference-error {
    margin: 0;
    color: #666;
    font-style: italic;
}


/* =========================================================
   Hall Overview (Hallenübersicht) — dynamische Hallenliste
   ========================================================= */

.component-fairhalls {
    container-type: inline-size;
    height: 100%;
    overflow-y: auto;
}

.fairhalls-heading {
    margin: 0 0 0.75em;
    font-size: 1em;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.6em 1em;
    background: #f4f4f4;
}

/* Kachel-/Grid-Ansicht — Spaltenzahl responsiv über Container-Query */
.fairhalls-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75em;
}

@container (min-width: 360px) {
    .fairhalls-grid { grid-template-columns: repeat(2, 1fr); }
}

@container (min-width: 640px) {
    .fairhalls-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Listenansicht — eine Zeile pro Halle */
.fairhalls-list {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

/* Einzelne Halle (Kachel oder Zeile) */
.fairhall-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s, border-color 0.15s;
}

a.fairhall-item:hover {
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Geschlossene Hallen — nicht anklickbar, gedämpft */
.fairhall-item--closed {
    opacity: 0.6;
    cursor: default;
}

.fairhall-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: #eee;
}

.fairhall-body {
    padding: 0.6em 0.8em;
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}

.fairhall-name {
    font-weight: 600;
    font-size: 1em;
}

.fairhall-count {
    font-size: 0.85em;
    color: #555;
}

.fairhall-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em;
    margin-top: 0.15em;
}

.fairhall-badge {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 600;
    padding: 0.15em 0.5em;
    border-radius: 3px;
    letter-spacing: 0.03em;
}

.fairhall-badge--closed {
    background: #c0392b;
    color: #fff;
}

.fairhall-badge--login {
    background: #e0e0e0;
    color: #333;
}

/* Listenansicht — Bild links, Inhalt rechts */
.fairhalls-list .fairhall-item {
    flex-direction: row;
    align-items: stretch;
}

.fairhalls-list .fairhall-image {
    width: 120px;
    flex-shrink: 0;
    aspect-ratio: auto;
}

.fairhalls-list .fairhall-body {
    justify-content: center;
}

/* Leer- und Fehlerzustand */
.fairhalls-empty,
.fairhalls-error {
    margin: 0;
    color: #666;
    font-style: italic;
}


/* ─────────────────────────────────────────────────────────────────────────────
   Documents Component
   ───────────────────────────────────────────────────────────────────────────── */

.component-documents {
    container-type: inline-size;
    height: 100%;
    overflow-y: auto;
}

.document-heading {
    margin: 0 0 0.75em;
    font-size: 1em;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.6em 1em;
    background: #f4f4f4;
}

.document-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

/* Normalansicht — Karten-Layout */
.document-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.9em 1em;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.35em;
}

.document-title {
    font-weight: 600;
    font-size: 1em;
}

.document-meta {
    font-weight: 400;
    color: #666;
    font-size: 0.9em;
}

.document-desc {
    margin: 0;
    color: #444;
    font-size: 0.9em;
}

.document-btn {
    display: inline-block;
    margin-top: 0.25em;
    padding: 0.35em 0.9em;
    border: 1px solid currentColor;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85em;
    color: inherit;
    align-self: flex-start;
    transition: background 0.15s, color 0.15s;
}

.document-btn:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Kompaktansicht — eine Zeile pro Eintrag */
.document-item--compact {
    flex-direction: row;
    align-items: center;
    gap: 0.4em 0.6em;
    padding: 0.5em 0.75em;
    flex-wrap: wrap;
}

.document-compact-title {
    flex: 1 1 100px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.document-compact-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
    padding: 0.2em;
    border-radius: 3px;
    transition: background 0.15s;
}

.document-compact-btn:hover {
    background: rgba(0,0,0,0.08);
}

/* Leer-Zustand */
.document-empty {
    margin: 0;
    color: #666;
    font-style: italic;
}

/* Link-Komponente: Link füllt die ganze Komponente, Inhalt zentriert (Beta-Feedback les-local) */
.component-link-wrapper.icon-link {
    width: 100%;
    height: 100%;
    margin: 0;
}
.component-link-wrapper.icon-link .component-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    text-decoration: none;
}

/* „Ganze Fläche löst Expand aus": Cursor signalisiert Klickbarkeit (nur im Viewer) */
.scene.viewer .cb-area-expand {
    cursor: zoom-in;
}