html, body.ttul-app-page {
    margin: 0 !important;
    min-height: 100%;
    background: #f3f5f7;
    color: #17202a;
    font-family: Roboto, Arial, sans-serif;
}

body.ttul-app-page * {
    box-sizing: border-box;
}

body.ttul-app-page #wpadminbar {
    display: none !important;
}

.ttul-frontend-shell {
    min-height: 100vh;
    background: transparent;
}

.ttul-app-header {
    height: 72px;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 24px;
    padding: 0 28px;
    background: #fff;
    border-bottom: 1px solid #e2e7ec;
    position: sticky;
    top: 0;
    z-index: 9999;
}

.ttul-app-brand {
    display: none;
    align-items: center;
    gap: 11px;
}

.ttul-app-logo,
.ttul-login-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #b41e1e;
    color: #fff;
    font-weight: 800;
    letter-spacing: -.03em;
}

.ttul-app-brand strong,
.ttul-app-brand small {
    display: block;
}

.ttul-app-brand strong {
    font-size: 17px;
    line-height: 1.1;
}

.ttul-app-brand small {
    color: #68737d;
    margin-top: 3px;
    font-size: 11px;
}

.ttul-app-nav {
    justify-self: center;
    display: flex;
    gap: 5px;
    padding: 4px;
    border-radius: 10px;
    background: #f0f2f4;
}

.ttul-app-tab {
    appearance: none;
    border: 0;
    background: transparent;
    border-radius: 7px;
    padding: 9px 18px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #59636e;
    cursor: pointer;
}

.ttul-app-tab.is-active {
    background: #fff;
    color: #17202a;
    box-shadow: 0 1px 3px rgba(16,24,40,.08);
}

.ttul-app-user {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.ttul-app-user span {
    font-weight: 700;
}

.ttul-app-user a {
    color: #68737d;
    text-decoration: none;
}

.ttul-app-content {
    max-width: 1540px;
    margin: 0 auto;
    padding: 0;
}

.ttul-frontend-shell .wrap,
.ttul-frontend-shell .ttul-wrap {
    margin: 0 !important;
}

.ttul-frontend-shell .ttul-topbar {
    min-height: 48px;
    margin: 0 0 16px;
    justify-content: flex-end;
    align-items: center;
}

.ttul-frontend-shell .ttul-topbar > div:first-child {
    display: none;
}

.ttul-frontend-shell .ttul-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ttul-frontend-shell .button,
.ttul-frontend-shell button.button,
.ttul-login-card input[type="submit"] {
    appearance: none;
    min-height: 36px;
    padding: 7px 13px;
    border: 1px solid #cbd2d9;
    border-radius: 7px;
    background: #fff;
    color: #25313c;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
}

.ttul-frontend-shell .button:hover,
.ttul-frontend-shell button.button:hover {
    border-color: #9da7b1;
    background: #f8f9fa;
}

.ttul-frontend-shell .button-primary,
.ttul-login-card input[type="submit"] {
    border-color: #b41e1e;
    background: #b41e1e;
    color: #fff;
}

.ttul-frontend-shell .button-primary:hover,
.ttul-login-card input[type="submit"]:hover {
    border-color: #971919;
    background: #971919;
}

.ttul-frontend-shell .button-link-delete {
    color: #b32d2e;
    border-color: transparent;
    background: transparent;
}

.ttul-frontend-shell .ttul-grid {
    grid-template-columns: 350px minmax(620px, 1fr);
    gap: 28px;
}

.ttul-frontend-shell .ttul-panel {
    top: 96px;
    max-height: calc(100vh - 118px);
    overflow: auto;
    padding-right: 4px;
}

.ttul-frontend-shell .ttul-card {
    border: 1px solid #e0e5ea;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(31,45,61,.04);
}

.ttul-frontend-shell .ttul-card input[type="text"],
.ttul-frontend-shell .ttul-card input[type="number"],
.ttul-frontend-shell .ttul-card select,
.ttul-frontend-shell .ttul-records-table input[type="text"] {
    min-height: 36px;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    padding: 6px 9px;
    background: #fff;
    color: #202a33;
    font: inherit;
}

.ttul-frontend-shell .ttul-canvas {
    width: min(100%, 760px);
    border-color: #d8dde2;
    box-shadow: 0 18px 50px rgba(30,41,59,.16);
}

.ttul-frontend-shell .ttul-records-section {
    margin: 0;
    border: 1px solid #e0e5ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(31,45,61,.05);
}

.ttul-frontend-shell .ttul-records-table {
    font-family: Roboto, Arial, sans-serif;
}

.ttul-login-card {
    width: min(420px, calc(100% - 32px));
    margin: 10vh auto 0;
    padding: 30px;
    background: #fff;
    border: 1px solid #e0e5ea;
    border-radius: 16px;
    box-shadow: 0 16px 50px rgba(30,41,59,.12);
}

.ttul-login-card h1 {
    margin: 16px 0 5px;
    font-size: 28px;
}

.ttul-login-card p {
    color: #67717b;
}

.ttul-login-card label {
    display: block;
    margin: 14px 0 5px;
    font-size: 12px;
    font-weight: 700;
}

.ttul-login-card input[type="text"],
.ttul-login-card input[type="password"] {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd2d9;
    border-radius: 7px;
    padding: 8px 10px;
    font: inherit;
}

.ttul-login-card .login-remember label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 400;
}


/* v0.5.3: kompaktere Bedienung und Builder-Feinschliff */
.ttul-frontend-shell .ttul-module[data-module="title"] {
    z-index: 4;
}

.ttul-frontend-shell .ttul-photo-module {
    z-index: 1;
}

.ttul-photo-module.ttul-photo-fade .ttul-photo-preview-image {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
}

.ttul-photo-module.ttul-has-image,
.ttul-photo-module.ttul-has-image .ttul-photo-inner {
    background: transparent !important;
}

.ttul-photo-module.ttul-has-image .ttul-photo-placeholder {
    background: transparent !important;
}

.ttul-frontend-shell .ttul-icon-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ttul-frontend-shell .ttul-icon-button .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 18px;
}

.ttul-frontend-shell input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    height: 20px;
    background: linear-gradient(to right, #c8ced5, #c8ced5) center / 100% 4px no-repeat;
    border: 0;
    padding: 0;
    outline: none;
}

.ttul-frontend-shell input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 0;
    background: #2271b1;
    cursor: pointer;
}

.ttul-frontend-shell input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: #c8ced5;
}

.ttul-frontend-shell input[type="range"]::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 0;
    background: #2271b1;
    cursor: pointer;
}

@media (max-width: 1180px) {
    .ttul-app-header {
        grid-template-columns: 1fr;
    }

    .ttul-app-nav {
        order: 3;
        grid-column: 1 / -1;
        justify-self: center;
        margin-top: -12px;
    }

    .ttul-app-header {
        height: 104px;
    }

    .ttul-frontend-shell .ttul-panel {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 760px) {
    .ttul-app-header {
        padding: 10px 6px;
        height: auto;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ttul-app-user span {
        display: none;
    }

    .ttul-app-nav {
        width: 100%;
        grid-column: 1 / -1;
        margin: 0;
    }

    .ttul-app-tab {
        flex: 1;
    }

    .ttul-app-content {
        padding: 0;
    }

    .ttul-frontend-shell .ttul-topbar {
        justify-content: stretch;
    }

    .ttul-frontend-shell .ttul-actions {
        width: 100%;
    }

    .ttul-frontend-shell .ttul-actions .button {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* v0.5.1: App wirklich unabhängig vom Theme darstellen */
body.ttul-app-page {
    padding-top: 0 !important;
}

body.ttul-app-page #wpadminbar,
body.ttul-app-page .et_pb_section,
body.ttul-app-page header#main-header,
body.ttul-app-page footer#main-footer {
    display: none !important;
}

.ttul-frontend-shell .ttul-module {
    z-index: 2;
}

.ttul-frontend-shell .ttul-module.is-selected {
    z-index: 50;
}

/* v0.5.2: kompakte mobile App-Fläche */
@media (max-width: 760px) {
    .ttul-frontend-shell .ttul-card {
        border-radius: 8px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .ttul-frontend-shell .ttul-workspace {
        margin-left: -1px;
        margin-right: -1px;
    }

    .ttul-frontend-shell .ttul-records-section {
        border-radius: 8px;
    }
}

/* Reihenfolge der Layer: Foto unten, Texte darüber, Titel ganz oben. */
.ttul-frontend-shell .ttul-module.ttul-photo-module { z-index: 1; }
.ttul-frontend-shell .ttul-module[data-module="title"] { z-index: 4; }
.ttul-frontend-shell .ttul-module.is-selected { z-index: 50; }

@media (min-width: 761px) and (max-width: 1180px) {
    .ttul-app-header { height: 72px; }
    .ttul-app-nav { margin-top: 0; }
}


.ttul-frontend-shell .ttul-record-photo {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 84px;
    flex-wrap: nowrap;
}

.ttul-frontend-shell .ttul-record-photo-thumb {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    object-fit: cover;
    display: inline-block;
    flex: 0 0 34px;
    background: #eef2f5;
    overflow: hidden;
}

.ttul-frontend-shell .ttul-record-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.ttul-frontend-shell .ttul-records-table th:nth-child(6),
.ttul-frontend-shell .ttul-records-table td:nth-child(6) {
    min-width: 92px;
}

.ttul-frontend-shell .ttul-records-table th:nth-child(7),
.ttul-frontend-shell .ttul-records-table td:nth-child(7) {
    min-width: 86px;
    white-space: nowrap;
}

/* v0.6.0 Multi-User / Demo */
.ttul-entry-shell,
.ttul-dashboard {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
    font-family: Roboto, Arial, sans-serif;
}

.ttul-entry-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0,1.15fr) minmax(340px,.85fr);
    gap: 24px;
    align-items: center;
}

.ttul-entry-card,
.ttul-layout-card,
.ttul-empty-card {
    background: #fff;
    border: 1px solid #e0e5ea;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(31,45,61,.07);
}

.ttul-entry-card { padding: 34px; }
.ttul-entry-intro { padding: 46px; }
.ttul-entry-kicker { color: #b41e1e; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.ttul-entry-card h1 { margin: 8px 0 14px; font-size: clamp(32px,4vw,54px); line-height: 1.02; }
.ttul-entry-card h2 { margin: 0 0 18px; font-size: 26px; }
.ttul-entry-card p { font-size: 17px; line-height: 1.55; color: #59636e; max-width: 620px; }
.ttul-entry-card small { display: block; margin-top: 12px; color: #7a858f; }
.ttul-entry-card label { display:block; margin: 12px 0 5px; font-weight: 700; font-size: 13px; }
.ttul-entry-card input[type="text"],
.ttul-entry-card input[type="password"],
.ttul-dashboard-actions input[type="text"] { width:100%; min-height:44px; border:1px solid #cbd2d9; border-radius:8px; padding:8px 11px; font:inherit; background:#fff; }
.ttul-entry-check { display:flex !important; align-items:center; gap:8px; font-weight:500 !important; }
.ttul-entry-primary { display:inline-flex; align-items:center; justify-content:center; min-height:42px; padding:9px 16px; border:0; border-radius:8px; background:#b41e1e; color:#fff !important; text-decoration:none; font-weight:800; cursor:pointer; }
.ttul-entry-link { display:inline-block; margin-top:14px; color:#59636e; text-decoration:none; }
.ttul-login-error { padding:10px 12px; border-radius:8px; background:#fff2f2; color:#9b1c1c; margin-bottom:12px; }

.ttul-dashboard-head { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; margin-bottom:24px; }
.ttul-dashboard-head h1 { margin:6px 0 5px; font-size:38px; }
.ttul-dashboard-head p { margin:0; color:#66717c; }
.ttul-dashboard-user { display:flex; gap:12px; align-items:center; padding-top:8px; }
.ttul-dashboard-user a { color:#68737d; text-decoration:none; }
.ttul-dashboard-actions { display:grid; grid-template-columns:minmax(220px,420px) auto; gap:10px; justify-content:start; margin-bottom:20px; }
.ttul-layout-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.ttul-layout-card { padding:20px; min-height:150px; display:flex; flex-direction:column; justify-content:space-between; gap:18px; }
.ttul-layout-card h2 { margin:0 0 6px; font-size:20px; }
.ttul-layout-card small { color:#7a858f; }
.ttul-layout-card-actions { display:flex; align-items:center; gap:8px; }
.ttul-empty-card { padding:28px; color:#68737d; }

.ttul-demo-banner { min-height:40px; display:flex; align-items:center; justify-content:center; gap:10px; padding:7px 16px; background:#fff6d8; color:#584a18; font-family:Roboto,Arial,sans-serif; font-size:13px; border-bottom:1px solid #ecd989; }
.ttul-demo-banner a { color:#584a18; font-weight:800; }
.ttul-app-header { grid-template-columns: 1fr auto 1fr; }
.ttul-back-dashboard { justify-self:start; display:inline-flex; align-items:center; gap:5px; color:#59636e; text-decoration:none; font-weight:700; font-size:13px; }
.ttul-current-layout-name { justify-self:end; font-size:13px; font-weight:800; color:#303b45; max-width:260px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

@media (max-width: 900px) {
    .ttul-entry-shell { grid-template-columns:1fr; align-items:start; padding-top:20px; }
    .ttul-entry-intro { padding:28px; }
    .ttul-layout-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 620px) {
    .ttul-entry-shell,
    .ttul-dashboard { width:calc(100% - 12px); padding:10px 0 24px; }
    .ttul-entry-card { padding:20px 16px; border-radius:10px; }
    .ttul-dashboard-head { display:block; }
    .ttul-dashboard-user { margin-top:10px; }
    .ttul-dashboard-actions { grid-template-columns:1fr; }
    .ttul-layout-cards { grid-template-columns:1fr; }
    .ttul-app-header { grid-template-columns:auto 1fr; height:auto; min-height:62px; padding:8px 8px; gap:8px; }
    .ttul-app-nav { justify-self:end; }
    .ttul-current-layout-name { grid-column:1/-1; justify-self:start; padding-left:2px; }
    .ttul-demo-banner { justify-content:flex-start; flex-wrap:wrap; }
}

.ttul-dashboard .ttul-icon-button {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border: 1px solid #cbd2d9;
    border-radius: 8px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.ttul-dashboard .ttul-icon-button .dashicons { width:18px; height:18px; font-size:18px; line-height:18px; }

/* v0.6.1: Designer mit Einstellungen links und rechts */
.ttul-app-content {
    max-width: 1760px;
}

.ttul-frontend-shell .ttul-builder-grid {
    display: grid;
    grid-template-columns: minmax(260px, 310px) minmax(520px, 1fr) minmax(260px, 310px);
    gap: 20px;
    align-items: start;
}

.ttul-frontend-shell .ttul-builder-grid .ttul-panel {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 106px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 3px;
}

.ttul-frontend-shell .ttul-builder-center {
    min-width: 0;
}

.ttul-frontend-shell .ttul-builder-center .ttul-canvas {
    width: min(100%, 760px);
}

.ttul-frontend-shell .ttul-background-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ttul-frontend-shell .ttul-bg-preset {
    appearance: none;
    width: 100%;
    border: 2px solid #dde2e7;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    overflow: hidden;
    text-align: left;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.ttul-frontend-shell .ttul-bg-preset:hover {
    border-color: #9ca6b0;
    transform: translateY(-1px);
}

.ttul-frontend-shell .ttul-bg-preset.is-active {
    border-color: #b41e1e;
    box-shadow: 0 0 0 1px #b41e1e;
}

.ttul-frontend-shell .ttul-bg-preset img {
    display: block;
    width: 100%;
    aspect-ratio: 210 / 297;
    object-fit: cover;
    border-radius: 5px;
    background: #fff;
}

.ttul-frontend-shell .ttul-bg-preset span {
    display: block;
    padding: 5px 3px 2px;
    font-size: 10px;
    line-height: 1.25;
    color: #59636e;
}

.ttul-frontend-shell .ttul-bg-preset-none {
    min-height: 115px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,#fff 0%,#fff 48%,#eef1f4 49%,#eef1f4 51%,#fff 52%,#fff 100%);
}

.ttul-frontend-shell .ttul-bg-preset-none span {
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 1280px) {
    .ttul-frontend-shell .ttul-builder-grid {
        grid-template-columns: 260px minmax(460px, 1fr) 260px;
        gap: 14px;
    }
}

@media (max-width: 1080px) {
    .ttul-frontend-shell .ttul-builder-grid {
        grid-template-columns: 1fr;
    }
    .ttul-frontend-shell .ttul-builder-grid .ttul-panel {
        position: static;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
    .ttul-frontend-shell .ttul-panel-left { order: 1; }
    .ttul-frontend-shell .ttul-builder-center { order: 2; }
    .ttul-frontend-shell .ttul-panel-right { order: 3; }
    .ttul-frontend-shell .ttul-background-presets {
        grid-template-columns: repeat(5, minmax(100px, 1fr));
        overflow-x: auto;
    }
}

@media (max-width: 760px) {
    .ttul-frontend-shell .ttul-builder-grid {
        gap: 10px;
    }
    .ttul-frontend-shell .ttul-background-presets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }
}

/* v0.6.3: kompakter Builder, einklappbare Panels und getrennte Ansichten */
.ttul-app-header {
    grid-template-columns: auto 1fr auto;
    gap: 16px;
}

.ttul-header-tools {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ttul-header-save,
.ttul-print-button {
    appearance: none;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    background: #b41e1e;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.ttul-header-save:hover,
.ttul-print-button:hover {
    background: #961818;
    color: #fff;
}

.ttul-frontend-shell .ttul-builder-grid {
    grid-template-columns: minmax(260px, 310px) minmax(420px, 1fr) minmax(260px, 310px);
}

.ttul-frontend-shell .ttul-builder-grid .ttul-panel {
    position: sticky;
    top: 88px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.ttul-frontend-shell .ttul-card > h2.ttul-card-toggle {
    position: relative;
    cursor: pointer;
    padding-right: 26px;
    user-select: none;
}

.ttul-frontend-shell .ttul-card > h2.ttul-card-toggle::after {
    content: "⌃";
    position: absolute;
    right: 1px;
    top: 50%;
    transform: translateY(-50%);
    color: #68737d;
    font-size: 16px;
    line-height: 1;
}

.ttul-frontend-shell .ttul-card.is-collapsed > h2.ttul-card-toggle::after {
    content: "⌄";
}

.ttul-frontend-shell .ttul-card.is-collapsed > :not(h2) {
    display: none !important;
}

.ttul-frontend-shell .ttul-records-section,
.ttul-frontend-shell .ttul-print-tab-section {
    margin: 0;
    border: 1px solid #e0e5ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(31,45,61,.05);
}

.ttul-frontend-shell .ttul-records-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #e8ecef;
}

.ttul-frontend-shell .ttul-records-head p {
    margin: 0;
    color: #68737d;
}

.ttul-frontend-shell #ttul-records-table-wrap {
    padding: 14px 16px 18px;
}

.ttul-print-tab-section {
    padding: 0;
    overflow: hidden;
}

.ttul-print-tab-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 12px 14px;
    border-bottom: 1px solid #e8ecef;
    background: #fff;
}

.ttul-print-preview-frame-wrap {
    background: #eef1f4;
    padding: 14px;
}

#ttul-print-preview-frame {
    display: block;
    width: 100%;
    min-height: 1120px;
    border: 0;
    background: #eef1f4;
}

@media (max-width: 1080px) {
    .ttul-frontend-shell .ttul-builder-grid {
        grid-template-columns: 1fr;
    }
    .ttul-frontend-shell .ttul-builder-grid .ttul-panel {
        position: static;
    }
    .ttul-header-tools {
        justify-self: end;
    }
}

@media (max-width: 760px) {
    .ttul-app-header {
        grid-template-columns: 1fr;
        height: auto;
        padding: 8px;
        gap: 8px;
    }
    .ttul-header-tools {
        justify-self: stretch;
        flex-wrap: wrap;
    }
    .ttul-app-nav {
        justify-self: stretch;
        flex: 1 1 100%;
        overflow-x: auto;
    }
    .ttul-app-tab {
        flex: 1 0 auto;
        padding: 9px 12px;
    }
    .ttul-header-save {
        width: 100%;
    }
    .ttul-current-layout-name {
        display: none;
    }
    .ttul-frontend-shell .ttul-records-head {
        align-items: stretch;
        flex-direction: column;
    }
    .ttul-frontend-shell .ttul-records-head .ttul-actions {
        flex-wrap: wrap;
    }
    .ttul-print-preview-frame-wrap {
        padding: 4px;
    }
    #ttul-print-preview-frame {
        min-height: 900px;
    }
}

/* v0.6.4: Header-Abstand, bündige Klapppfeile und vereinfachte Hauptaktion */
.ttul-app-content {
    padding-top: 20px;
}

.ttul-frontend-shell .ttul-card > h2.ttul-card-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    align-items: start;
    column-gap: 8px;
    padding-right: 0;
    line-height: 1.2;
}

.ttul-frontend-shell .ttul-card > h2.ttul-card-toggle::after {
    position: static;
    transform: none;
    justify-self: end;
    align-self: start;
    margin-top: 2px;
    width: 18px;
    text-align: center;
    line-height: 1.2;
}

.ttul-frontend-shell .ttul-records-head .ttul-actions {
    margin-left: auto;
}

.ttul-frontend-shell .ttul-print-tab-section {
    margin-top: 0;
}

/* Hauptaktion sitzt ausschließlich im App-Header. */
.ttul-header-save {
    min-width: 132px;
    text-align: center;
}

@media (max-width: 760px) {
    .ttul-app-content {
        padding-top: 12px;
    }
}

/* v0.7.0: Veranstaltungen als eigene Ebene */
.ttul-dashboard-section {
    margin-top: 28px;
}

.ttul-dashboard-section + .ttul-dashboard-section {
    margin-top: 42px;
    padding-top: 28px;
    border-top: 1px solid #e4e8ec;
}

.ttul-dashboard-section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 14px;
}

.ttul-dashboard-section-head h2 {
    margin: 0 0 4px;
    font-size: 24px;
}

.ttul-dashboard-section-head p {
    margin: 0;
    color: #68737d;
}

.ttul-layout-card h3,
.ttul-event-card h3 {
    margin: 0 0 5px;
    font-size: 17px;
}

.ttul-event-create-grid {
    display: grid;
    grid-template-columns: 1.35fr 160px 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.ttul-event-create-grid input,
.ttul-event-create-grid select,
.ttul-event-settings-grid input,
.ttul-event-settings-grid select {
    min-height: 42px;
    border: 1px solid #cbd2d9;
    border-radius: 7px;
    padding: 8px 10px;
    background: #fff;
    font: inherit;
}

.ttul-event-cards {
    display: grid;
    gap: 10px;
}

.ttul-event-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid #e0e5ea;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(31,45,61,.04);
}

.ttul-event-card p {
    margin: 0 0 4px;
    color: #34404b;
}

.ttul-event-card small {
    color: #68737d;
}

.ttul-event-content {
    max-width: 1180px;
}

.ttul-event-settings-section,
.ttul-event-content .ttul-records-section,
.ttul-event-content .ttul-print-tab-section {
    margin: 0;
}

.ttul-event-settings-card {
    background: #fff;
    border: 1px solid #e0e5ea;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 18px rgba(31,45,61,.05);
}

.ttul-event-settings-card h2 {
    margin: 0 0 16px;
    color: #b41e1e;
    font-size: 22px;
}

.ttul-event-settings-grid {
    display: grid;
    grid-template-columns: 1.5fr 180px 1fr 1fr;
    gap: 14px;
}

.ttul-event-settings-grid label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.ttul-event-settings-grid label span {
    font-size: 12px;
}

.ttul-event-settings-card .description {
    margin: 14px 0 0;
    color: #68737d;
}

.ttul-event-app .ttul-records-table {
    min-width: 760px;
}

@media (max-width: 1100px) {
    .ttul-event-create-grid {
        grid-template-columns: 1fr 1fr;
    }
    .ttul-event-create-grid .ttul-entry-primary {
        grid-column: span 2;
    }
    .ttul-event-settings-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .ttul-dashboard-section + .ttul-dashboard-section {
        margin-top: 28px;
        padding-top: 20px;
    }
    .ttul-event-create-grid,
    .ttul-event-settings-grid {
        grid-template-columns: 1fr;
    }
    .ttul-event-create-grid .ttul-entry-primary {
        grid-column: auto;
    }
    .ttul-event-card {
        align-items: stretch;
        flex-direction: column;
    }
}

/* v0.8.0 – Freigaben */
.ttul-shares-section {
    padding: 20px;
}

.ttul-share-card {
    max-width: 980px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e0e5ea;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 18px rgba(31,45,61,.05);
}

.ttul-share-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.ttul-share-head p {
    margin: 0;
    color: #68737d;
}

.ttul-share-create {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 180px auto;
    gap: 10px;
    margin: 18px 0 20px;
}

.ttul-share-create input,
.ttul-share-create select,
.ttul-share-row select {
    min-height: 40px;
    border: 1px solid #cbd2d9;
    border-radius: 7px;
    padding: 7px 10px;
    background: #fff;
    font: inherit;
}

.ttul-share-list {
    display: grid;
    gap: 8px;
}

.ttul-share-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 38px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e4e8ec;
    border-radius: 8px;
    background: #fafbfc;
}

.ttul-share-row strong,
.ttul-share-row small {
    display: block;
}

.ttul-share-row small {
    margin-top: 3px;
    color: #73808c;
}

.ttul-shared-events-dashboard .ttul-event-card small {
    font-weight: 600;
}

@media (max-width: 760px) {
    .ttul-shares-section { padding: 10px; }
    .ttul-share-card { padding: 14px; }
    .ttul-share-create,
    .ttul-share-row {
        grid-template-columns: 1fr;
    }
    .ttul-share-row .ttul-icon-button { justify-self: end; }
}

/* v0.9.0 – QR-Upload & Fotografenmodus */
.ttul-photographer-section { padding: 0 20px 30px; }
.ttul-photographer-admin-card {
    background: #fff;
    border: 1px solid #e0e5ea;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 18px rgba(31,45,61,.05);
}
.ttul-photo-mode-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}
.ttul-photo-mode-intro h2 { margin: 0 0 6px; }
.ttul-photo-mode-intro p { margin: 0; color: #68737d; }
.ttul-event-qr-block {
    display: grid;
    grid-template-columns: 200px minmax(0,1fr);
    gap: 22px;
    align-items: center;
    padding: 18px;
    border: 1px solid #e3e7eb;
    border-radius: 10px;
    background: #fafbfc;
}
.ttul-event-qr-block img { width: 200px; max-width: 100%; height: auto; display: block; background: #fff; }
.ttul-event-qr-block strong { display: block; margin-bottom: 8px; }
.ttul-event-qr-block input { width: 100%; margin-bottom: 8px; }
.ttul-record-qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(210px,1fr));
    gap: 14px;
    margin-top: 18px;
}
.ttul-record-qr-card {
    border: 1px solid #e0e5ea;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    background: #fff;
}
.ttul-record-qr-card h3 { margin: 8px 0 4px; font-size: 15px; }
.ttul-record-qr-card p { min-height: 34px; margin: 0 0 10px; color: #68737d; font-size: 12px; }
.ttul-record-qr-card img { width: 170px; max-width: 100%; height: auto; display: block; margin: 0 auto 10px; }
.ttul-record-qr-status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.ttul-record-qr-status.has-photo { background: #e8f5e9; color: #237a32; }
.ttul-record-qr-status.missing-photo { background: #fff4e5; color: #985f00; }

.ttul-public-photo-shell {
    min-height: 100vh;
    background: #f3f5f7;
    font-family: Roboto, Arial, sans-serif;
    color: #17202a;
    padding-bottom: 30px;
}
.ttul-public-photo-header {
    background: #fff;
    border-bottom: 1px solid #e0e5ea;
    padding: 22px max(16px, env(safe-area-inset-left));
}
.ttul-public-photo-header span { color: #68737d; font-size: 12px; font-weight: 700; }
.ttul-public-photo-header h1 { margin: 6px 0 4px; font-size: clamp(22px,5vw,34px); }
.ttul-public-photo-header p { margin: 0; color: #68737d; }
.ttul-public-photo-list {
    width: min(760px,100%);
    margin: 0 auto;
    padding: 16px;
    display: grid;
    gap: 12px;
}
.ttul-public-photo-card {
    background: #fff;
    border: 1px solid #e0e5ea;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 3px 14px rgba(31,45,61,.04);
}
.ttul-public-photo-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ttul-public-photo-meta h2 { margin: 0 0 4px; font-size: 18px; }
.ttul-public-photo-meta p { margin: 0; color: #68737d; font-size: 13px; }
.ttul-public-photo-status { white-space: nowrap; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 700; }
.ttul-public-photo-status.has-photo { background: #e8f5e9; color: #237a32; }
.ttul-public-photo-status.missing-photo { background: #fff4e5; color: #985f00; }
.ttul-public-photo-thumb {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 10px;
    margin: 14px 0;
    display: block;
}
.ttul-public-photo-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    border-radius: 9px;
    background: #2271b1;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    padding: 10px 14px;
}
.ttul-public-photo-button input { display: none; }
.ttul-public-photo-progress { min-height: 18px; margin-top: 8px; font-size: 12px; color: #68737d; text-align: center; }

@media (max-width: 620px) {
    .ttul-photographer-section { padding-left: 8px; padding-right: 8px; }
    .ttul-photographer-admin-card { padding: 12px; }
    .ttul-photo-mode-intro { display: block; }
    .ttul-photo-mode-intro .ttul-entry-primary { display: inline-block; margin-top: 12px; }
    .ttul-event-qr-block { grid-template-columns: 1fr; text-align: center; }
    .ttul-event-qr-block img { margin: 0 auto; }
    .ttul-public-photo-list { padding: 8px; }
    .ttul-public-photo-card { border-radius: 9px; padding: 12px; }
    .ttul-public-photo-meta { display: block; }
    .ttul-public-photo-status { display: inline-block; margin-top: 8px; }
}
.ttul-local-qr { display:block; background:#fff; line-height:0; }
.ttul-local-qr svg { display:block; width:100%; height:auto; }
.ttul-event-qr-block > .ttul-local-qr { width:200px; max-width:100%; }
.ttul-record-qr-card .ttul-local-qr { width:170px; max-width:100%; margin:0 auto 10px; }
@media (max-width:620px){ .ttul-event-qr-block > .ttul-local-qr { margin:0 auto; } }


/* v0.9.1 – Header-Feinschliff & Event-Felder */
.ttul-event-app .ttul-app-header {
    grid-template-columns: auto 1fr;
}
.ttul-event-app .ttul-header-tools {
    justify-self: end;
}
#ttul-event-name,
#ttul-event-location {
    padding-left: 14px !important;
}

/* v0.9.2 – vereinfachtes Onboarding / Registrierung */
.ttul-entry-shell-single {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: min(100%, 760px);
    padding: 36px 16px;
}

.ttul-auth-card {
    width: min(100%, 460px);
    padding: 34px;
}

.ttul-auth-card h2 {
    margin-top: 6px;
}

.ttul-auth-card input[type="email"] {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd2d9;
    border-radius: 8px;
    padding: 8px 11px;
    font: inherit;
    background: #fff;
}

.ttul-existing-account-note,
.ttul-auth-lead {
    margin: 0 0 16px;
    padding: 11px 12px;
    border-radius: 8px;
    background: #f6f7f8;
    color: #59636e;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

.ttul-login-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.ttul-entry-link-inline {
    margin-top: 0 !important;
}

.ttul-auth-divider {
    height: 1px;
    background: #e3e7ea;
    margin: 24px 0;
}

.ttul-auth-option {
    display: grid;
    gap: 10px;
}

.ttul-auth-option strong {
    font-size: 15px;
}

.ttul-auth-option small {
    margin: -3px 0 0;
}

.ttul-entry-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid #cbd2d9;
    border-radius: 8px;
    background: #fff;
    color: #26313b !important;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.ttul-entry-secondary:hover {
    border-color: #aeb7bf;
    background: #f8f9fa;
}

.ttul-entry-full {
    width: 100%;
}

.ttul-auth-card form .ttul-entry-full {
    margin-top: 16px;
}

.ttul-auth-switch {
    margin-top: 18px;
    text-align: center;
    color: #66717c;
    font-size: 14px;
}

@media (max-width: 620px) {
    .ttul-entry-shell-single {
        width: 100%;
        padding: 8px;
        align-items: flex-start;
    }
    .ttul-auth-card {
        width: 100%;
        padding: 22px 16px;
    }
    .ttul-login-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}
