/* ===== Variables ===== */
:root {
    --color-bg: #0f0f12;
    --color-surface: #18181c;
    --color-border: #2a2a30;
    --color-text: #e4e4e7;
    --color-text-muted: #a1a1aa;
    --color-primary: #6366f1;
    --color-primary-hover: #818cf8;
    --color-accent: #22d3ee;
    --color-success: #34d399;
    --color-danger: #f87171;
    --font-sans: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.25);
}

/* ===== Base ===== */
html {
    font-size: 16px; /* verhindert iOS-Zoom bei Input-Focus */
    -webkit-text-size-adjust: 100%;
}
html, body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
}
@media (max-width: 1199px) {
    html, body { overflow-x: hidden; }
    .app-page { min-width: 0; width: 100%; }
    .app-main { width: 100%; box-sizing: border-box; }
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-top: 0;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }

/* ===== App shell ===== */
#app {
    min-height: 100dvh;
}

.app-page {
    display: flex;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.app-topbar {
    display: none;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
}
.app-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    gap: 0.75rem;
}
.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.15rem;
    background: rgba(0, 0, 0, 0.15);
}
.lang-switcher-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.2;
}
.lang-switcher-btn.active,
.lang-switcher-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-primary);
}
.app-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text);
}
.app-toggler {
    background: none;
    border: none;
    color: var(--color-text);
    padding: 0.75rem;
    margin: -0.25rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
}
.app-toggler span {
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.app-sidebar {
    width: 240px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 1rem 0;
    flex-shrink: 0;
    overflow-y: auto;
}
.app-sidebar.collapse {
    display: none;
}
@media (min-width: 1200px) {
    .app-sidebar.collapse {
        display: block;
    }
}
.app-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 100%;
}
.app-nav-link {
    padding: 0.6rem 1rem;
    color: var(--color-text-muted);
    border-radius: var(--radius);
    margin: 0 0.5rem;
    transition: background .15s, color .15s;
}
.app-nav-link:hover, .app-nav-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-primary);
}
.app-nav-icon {
    opacity: 0.8;
    margin-right: 0.5rem;
    font-size: 0.85em;
}
.app-nav-footer {
    margin-top: auto;
    padding: 1rem 1rem 0.75rem;
    border-top: 1px solid var(--color-border);
}

.app-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 1.5rem;
    scrollbar-gutter: stable;
}
/* Übersetzungen: kein Browser-Scroll – nur innerhalb der 80%-Box */
.app-main--translations {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.app-content--translations {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 80vw;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.app-content {
    width: 80vw;
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ===== Mobile / Tablet: Topbar + Overlay-Menü (Sidebar nimmt keinen Platz weg) ===== */
.app-sidebar-backdrop {
    display: none;
}
@media (max-width: 1199px) {
    .app-page {
        flex-direction: column;
    }
    .app-topbar {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        min-height: 52px;
        padding: 0.75rem 1rem;
        padding-top: max(0.75rem, env(safe-area-inset-top));
    }
    .app-topbar-inner { width: 100%; }
    .app-brand { font-size: 1.1rem; }
    .app-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 99;
        -webkit-tap-highlight-color: transparent;
    }
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 52px;
        top: calc(52px + env(safe-area-inset-top));
        bottom: 0;
        z-index: 100;
        box-shadow: var(--shadow);
        width: min(260px, 78vw);
        padding: 0.5rem 0;
        overflow-y: auto;
    }
    .app-sidebar.collapse { display: none; }
    .app-nav-link {
        padding: 0.85rem 1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        font-size: 1rem;
    }
    .app-nav-icon { font-size: 1.1em; }
    .app-main {
        padding: 1rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    .app-content {
        width: 80vw;
        max-width: 100%;
    }
    /* Tabellen: horizontales Scrollen nur wo keine Karten-Ansicht */
    .app-main .table-wrapper:not(.table-responsive-cards) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    .app-main .table-wrapper:not(.table-responsive-cards) .table {
        min-width: 520px;
    }
    .app-main .table th,
    .app-main .table td {
        padding: 0.65rem 0.5rem;
        font-size: 0.9375rem;
    }
    /* Touch-freundliche Buttons */
    .app-main .btn,
    .app-main .btn-sm {
        min-height: 44px;
        padding: 0.6rem 1rem;
        font-size: 1rem;
    }
    .app-main .btn-sm { min-height: 40px; padding: 0.5rem 0.85rem; }
    .app-main .translation-meta-actions .translation-action {
        display: inline-block !important;
        width: auto !important;
        min-height: auto !important;
        padding: 0.35rem 0.75rem !important;
        font-size: 0.875rem !important;
    }
    /* Formulare */
    .app-main .form-control {
        min-height: 48px;
        font-size: 16px; /* verhindert Zoom auf iOS */
        padding: 0.65rem 0.85rem;
    }
    .app-main .form-label { font-size: 0.9375rem; }
    /* Cards & Abstände */
    .app-main .card-body { padding: 1rem; }
    .app-main h1 { font-size: 1.5rem; }
    .app-main h2, .app-main h3 { font-size: 1.35rem; }
    .mb-3, .mt-4 { margin-bottom: 1rem; margin-top: 1rem; }
    /* Sprach-Umschalter größer */
    .lang-toggle .btn {
        min-height: 40px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .app-main { padding: 0.75rem; }
    .app-main .table-wrapper { margin: 0 -0.75rem; padding: 0 0.75rem; }
    .app-main .table-responsive-cards .table { min-width: 0; }
    .app-sidebar { width: min(260px, 82vw); }
}

/* Hochformat / schmale Viewports: Tabellen als Karten (lesbar ohne Quer-Scroll) */
@media (max-width: 767px) {
    .app-main .table-responsive-cards .table,
    .app-main .table-responsive-cards thead,
    .app-main .table-responsive-cards tbody,
    .app-main .table-responsive-cards tr,
    .app-main .table-responsive-cards th,
    .app-main .table-responsive-cards td {
        display: block;
    }
    .app-main .table-responsive-cards thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0,0,0,0);
        border: 0;
    }
    .app-main .table-responsive-cards tbody tr {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        margin-bottom: 0.75rem;
        padding: 0.75rem 1rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    }
    .app-main .table-responsive-cards tbody td {
        border: none;
        padding: 0.35rem 0;
        font-size: 0.9375rem;
        line-height: 1.45;
    }
    .app-main .table-responsive-cards tbody td::before {
        content: attr(data-label);
        display: inline-block;
        min-width: 6.5em;
        font-weight: 600;
        color: var(--color-text-muted);
        font-size: 0.8125rem;
        margin-right: 0.5rem;
    }
    .app-main .table-responsive-cards tbody td:last-child {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--color-border);
    }
    .app-main .table-responsive-cards tbody td:last-child::before {
        display: none;
    }
    .app-main .table-wrapper.table-responsive-cards {
        overflow-x: visible;
        margin: 0;
        padding: 0;
    }
    .app-main .table-responsive-cards .table {
        min-width: 0;
    }
}

/* Portrait: etwas mehr Lesbarkeit */
@media (max-width: 767px) and (orientation: portrait) {
    .app-main { padding: 0.85rem 1rem; }
    .app-main h1 { font-size: 1.35rem; }
    .app-main h2, .app-main h3 { font-size: 1.25rem; }
    .app-main .table-responsive-cards tbody td { font-size: 1rem; }
}

/* Lange URLs / Code auf kleinen Screens umbrechen */
.app-main code {
    word-break: break-all;
    overflow-wrap: break-word;
}

/* ===== Forms & buttons (app) ===== */
.btn-primary {
    background: var(--color-primary);
    border: none;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
}
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary, .btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
}
.btn-secondary:hover, .btn-outline-secondary:hover {
    background: var(--color-surface);
    border-color: var(--color-text-muted);
}
.form-control {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    width: 100%;
}
.form-control::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.form-label {
    color: var(--color-text);
    font-weight: 500;
    margin-bottom: 0.35rem;
    display: block;
}
.form-check-input {
    background-color: var(--color-surface);
    border-color: var(--color-border);
}
.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.alert-danger { background: rgba(248,113,113,0.15); color: var(--color-danger); border: 1px solid var(--color-danger); border-radius: var(--radius); padding: 0.75rem; }
.alert-success { background: rgba(52,211,153,0.15); color: var(--color-success); border-radius: var(--radius); padding: 0.75rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.6rem; text-align: left; border-bottom: 1px solid var(--color-border); }
.table th { color: var(--color-text-muted); font-weight: 500; }
.table-striped tbody tr:nth-child(odd) { background: rgba(255,255,255,0.02); }
/* Tabellen im Dark-Theme: kein weißer Hintergrund */
.app-main .table,
.app-main .table th,
.app-main .table td,
.app-main .table thead,
.app-main .table tbody,
.app-main .table tbody tr {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}
.app-main .table {
    background: var(--color-surface) !important;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.app-main .table thead th {
    background: rgba(0,0,0,0.2) !important;
    color: var(--color-text-muted) !important;
    font-weight: 500;
    border-bottom: 1px solid var(--color-border);
}
.app-main .table tbody td {
    border-bottom: 1px solid var(--color-border);
}
.app-main .table-striped tbody tr:nth-child(odd) {
    background: rgba(255,255,255,0.03) !important;
}
.app-main .table-striped tbody tr:nth-child(even) {
    background: transparent !important;
}
.app-main .table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.card-body { padding: 1.25rem; }
.card-title { color: var(--color-text) !important; }
.card-text { color: var(--color-text) !important; }
/* Billing & App-Inhalte: Lesbarkeit auf dunklem Hintergrund */
.app-main,
.app-content {
    color: var(--color-text);
}
.app-main h1,
.app-main h2,
.app-main h3,
.app-main h4,
.app-main h5,
.app-main h6 { color: var(--color-text) !important; }
.app-main .card,
.app-main .card-body,
.app-main .card-title,
.app-main .card-text,
.app-main p,
.app-main li { color: var(--color-text); }
.app-main .text-muted,
.app-main .small,
.app-main small { color: var(--color-text-muted) !important; }
.app-main .text-success { color: var(--color-success) !important; }
.app-main .text-warning { color: #fbbf24 !important; }
/* Dashboard: Buttons in Tabellen – gut lesbar, kein heller Hintergrund */
.app-main .btn-outline-secondary {
    background: transparent !important;
    border: 1px solid var(--color-text-muted) !important;
    color: var(--color-text) !important;
}
.app-main .btn-outline-secondary:hover {
    background: var(--color-surface) !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}
.app-main .table-meta-col {
    white-space: nowrap !important;
    width: 1%;
    min-width: 22rem;
    vertical-align: middle;
}
.app-main .translations-table-scroll .translations-table .table-meta-col {
    width: 23.625rem !important;
    min-width: 23.625rem !important;
    max-width: 23.625rem !important;
}
.app-main .translation-meta-table {
    width: auto;
    margin: 0;
    border-collapse: collapse;
    border: none;
    background: transparent !important;
}
.app-main .translation-meta-table td {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    vertical-align: middle;
    white-space: nowrap !important;
}
.app-main .translation-meta-actions {
    padding-left: 1rem !important;
}
.app-main .translation-meta-actions .translation-action {
    display: inline-block !important;
    vertical-align: middle;
    width: auto !important;
    max-width: none !important;
    float: none !important;
}
.app-main .translation-meta-actions .translation-action + .translation-action {
    margin-left: 0.625rem;
}

/* Übersetzungen: Scroll nur innerhalb der 80%-Content-Box */
.translations-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
.translations-page-toolbar {
    flex: 0 0 auto;
}
.translations-table-panel {
    flex: 1 1 auto;
    min-height: 12rem;
    min-width: 0;
    max-width: 100%;
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    overflow: hidden;
}
.translations-table-scroll {
    position: absolute;
    inset: 0;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}
.app-main .translations-table-scroll .translations-table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    background: transparent !important;
}
.app-main .translations-table-scroll .translations-col-view {
    width: 10%;
}
.app-main .translations-table-scroll .translations-col-object {
    width: 12%;
}
.app-main .translations-table-scroll .translations-col-text {
    width: auto;
}
.app-main .translations-table-scroll .translations-col-meta {
    width: 23.625rem;
}
.app-main .translations-table-scroll .translations-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #1e1e24 !important;
    box-shadow: 0 1px 0 var(--color-border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-main .translations-table-scroll .translations-table tbody td:not(.table-meta-col) {
    overflow: hidden;
    vertical-align: middle;
}
.app-main .translations-table-scroll .translations-table th.table-meta-col,
.app-main .translations-table-scroll .translations-table td.table-meta-col {
    position: sticky;
    right: 0;
    z-index: 1;
    width: 23.625rem !important;
    min-width: 23.625rem !important;
    max-width: 23.625rem !important;
    padding: 0.45rem 0.5rem !important;
    white-space: nowrap !important;
    vertical-align: middle;
    overflow: visible !important;
    background: #1a1a20 !important;
    box-shadow: -8px 0 12px rgba(0, 0, 0, 0.22);
}
.app-main .translations-table-scroll .translations-table thead th.table-meta-col {
    z-index: 3;
    background: #1e1e24 !important;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-main .translations-table-striped tbody tr:nth-child(odd) td.table-meta-col {
    background: #1e1e24 !important;
}
.app-main .translations-table-striped tbody tr:nth-child(even) td.table-meta-col {
    background: #1a1a20 !important;
}
.app-main .translations-table-scroll .translation-meta-cell {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
    overflow: visible;
}
.app-main .translations-table-scroll .translation-meta-actions {
    display: flex;
    flex: 0 0 4.35rem;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    padding-left: 0 !important;
    overflow: visible;
}
.app-main .translations-table-scroll .translation-meta-info {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.7rem;
    line-height: 1.2;
}
.app-main .translations-table-scroll .translation-action-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    min-height: 2rem !important;
    padding: 0 !important;
    flex-shrink: 0;
    font-size: 0 !important;
    line-height: 0 !important;
    color: var(--color-text-muted);
}
.app-main .translations-table-scroll .translation-action-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    line-height: 0;
}
.app-main .translations-table-scroll .translation-action-glyph svg {
    display: block;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}
.app-main .translations-table-scroll .translation-meta-actions .translation-action + .translation-action {
    margin-left: 0 !important;
}

@media (max-width: 1199px) {
    .app-main .translations-table-scroll .translation-action-icon {
        display: inline-flex !important;
        width: 2rem !important;
        height: 2rem !important;
        min-height: 2rem !important;
    }
}

.app-main .translations-table-scroll .translations-table td:not(.table-meta-col):not(:nth-child(1)):not(:nth-child(2)) {
    max-width: 0;
}
.app-main .translations-table-scroll .translations-table td:nth-child(1),
.app-main .translations-table-scroll .translations-table td:nth-child(2) {
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-main::-webkit-scrollbar,
.translations-table-scroll::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
.app-main::-webkit-scrollbar-track,
.translations-table-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}
.app-main::-webkit-scrollbar-thumb,
.translations-table-scroll::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 6px;
}
.app-main::-webkit-scrollbar-thumb:hover,
.translations-table-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

.translation-action {
    appearance: none;
    -webkit-appearance: none;
    display: inline-block;
    margin: 0;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: transparent;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.25;
    color: var(--color-text);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.translation-action-history {
    border-color: var(--color-text-muted);
    color: var(--color-text);
}
.translation-action-history:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(99, 102, 241, 0.08);
}
.translation-action-delete {
    border-color: var(--color-border);
    color: var(--color-text-muted);
}
.translation-action-delete:hover {
    border-color: rgba(248, 113, 113, 0.45);
    color: var(--color-danger);
    background: rgba(248, 113, 113, 0.1);
}

/* Übersetzungs-Textzelle mit Editor-Button */
.translation-text-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 11rem;
}
.app-main .translations-table .translation-text-cell {
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}
.app-main .translations-table .translation-text-preview {
    display: none;
}
.translation-text-preview {
    flex: 1 1 100%;
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 0.35rem 0.5rem;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.04);
    border: 1px dashed rgba(0, 0, 0, 0.12);
    max-height: 6rem;
    overflow: auto;
}
.translation-text-inline {
    flex: 1;
    min-width: 0;
    resize: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    field-sizing: content;
    min-height: 2rem;
    max-height: 2rem;
    line-height: 1.35;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}
.app-main .translations-table .translation-text-inline {
    width: 100%;
    max-width: 100%;
    field-sizing: fixed;
}
.translation-text-editor-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.translation-text-editor-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(99, 102, 241, 0.08);
}
.text-editor-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.55);
}
.text-editor-modal {
    width: 80vw;
    max-width: 80vw;
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}
.text-editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex: 0 0 auto;
}
.text-editor-title {
    margin: 0;
    font-size: 1.1rem;
}
.text-editor-close {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.text-editor-close:hover { color: var(--color-text); }
.text-editor-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex: 0 0 auto;
}
.text-editor-tab {
    appearance: none;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    border-radius: 8px;
    padding: 0.4rem 0.85rem;
    font-size: 0.875rem;
    cursor: pointer;
}
.text-editor-tab.active,
.text-editor-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(99, 102, 241, 0.08);
}
.text-editor-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.text-editor-area {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    resize: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow: auto;
}
.text-editor-hint {
    margin: 0.5rem 0 0;
    flex: 0 0 auto;
}
.text-editor-preview {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    overflow: auto;
    line-height: 1.6;
}
.text-editor-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex: 0 0 auto;
}

.text-muted { color: var(--color-text-muted); }
.small, small { font-size: 0.875rem; }
code { background: var(--color-surface); padding: 0.2em 0.4em; border-radius: 4px; font-family: var(--font-mono); font-size: 0.9em; color: var(--color-text); }

/* DNS-Hinweis (White-Label): lesbar im Dark-Theme */
.dns-hint {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.dns-hint strong { color: var(--color-text); }
.dns-hint ul { color: var(--color-text-muted); }
.dns-hint ul strong { color: var(--color-text); }
.dns-hint code {
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-accent);
    padding: 0.2em 0.45em;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* ===== Landing layout ===== */
.landing-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #0f0f12 0%, #1a1a24 50%, #0d0d12 100%);
}
.landing-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.landing-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.landing-header .brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-text);
    letter-spacing: -0.02em;
}
.landing-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.landing-nav a {
    color: var(--color-text-muted);
    font-weight: 500;
}
.landing-nav a:hover { color: var(--color-text); }
.landing-main .btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}
.landing-main .btn-outline-secondary:hover {
    background: var(--color-surface);
    border-color: var(--color-text-muted);
    color: var(--color-text);
}
.landing-main { flex: 1; }
.landing-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}
.landing-footer-inner { max-width: 1100px; margin: 0 auto; }
.landing-footer a { color: var(--color-text-muted); text-decoration: none; }
.landing-footer a:hover { color: var(--color-text); text-decoration: underline; }

/* ===== Hero ===== */
.hero {
    padding: 4rem 1.5rem 5rem;
    text-align: center;
}
.hero-content { max-width: 680px; margin: 0 auto; }
.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    line-height: 1.7;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}
.btn-hero-primary {
    display: inline-block;
    background: var(--color-primary);
    color: #fff !important;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    -webkit-text-fill-color: #fff;
}
.btn-hero-primary:hover { background: var(--color-primary-hover); }
.btn-hero-secondary {
    display: inline-block;
    background: transparent;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    -webkit-text-fill-color: var(--color-text);
}
.btn-hero-secondary:hover { border-color: var(--color-text-muted); background: rgba(255,255,255,0.05); }

/* ===== Features ===== */
.features {
    padding: 4rem 1.5rem;
    background: rgba(0,0,0,0.2);
}
.features-inner { max-width: 1100px; margin: 0 auto; }
.features h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 2.5rem;
    color: var(--color-text);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color .2s, transform .2s;
}
.feature-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}
.feature-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { color: var(--color-text-muted); font-size: 0.95rem; margin: 0; }

/* ===== CTA ===== */
.cta {
    padding: 4rem 1.5rem;
    text-align: center;
}
.cta-inner { max-width: 560px; margin: 0 auto; }
.cta h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.cta p { color: var(--color-text-muted); margin-bottom: 1.5rem; }

/* ===== Auth pages in app layout ===== */
.container { max-width: 520px; margin-left: auto; margin-right: auto; padding: 0 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.875rem; }
.btn-link { background: none; border: none; color: var(--color-primary); cursor: pointer; padding: 0; }
.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.form-check-input { width: 1.25rem; height: 1.25rem; accent-color: var(--color-primary); }
.list-unstyled { list-style: none; padding: 0; margin: 0; }

/* ===== Blazor / loading ===== */
h1:focus { outline: none; }
.content { padding-top: 1rem; }
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--color-success); }
.invalid { outline: 1px solid var(--color-danger); }
.validation-message { color: var(--color-danger); }
#blazor-error-ui {
    background: rgba(248,113,113,0.2);
    color: var(--color-danger);
    bottom: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    display: none;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.blazor-error-boundary { padding: 1rem; color: white; background: var(--color-danger); }
.loading-progress { display: block; width: 8rem; height: 8rem; margin: 20vh auto 1rem auto; }
.loading-progress circle { fill: none; stroke: var(--color-border); stroke-width: 0.6rem; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--color-primary); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; }
.loading-progress-text { text-align: center; font-weight: bold; margin-top: 1rem; }

/* ===== Brand logo ===== */
.brand-with-logo { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.brand-logo { border-radius: 8px; }

/* ===== Pricing ===== */
.pricing { padding: 4rem 1.5rem; }
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}
.pricing-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.pricing-card-highlight {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(99,102,241,0.3);
}
.pricing-price { font-size: 1.5rem; font-weight: 700; color: var(--color-accent); }
.pricing-features { list-style: none; padding: 0; margin: 0; color: var(--color-text-muted); font-size: 0.9rem; }
.pricing-features li { padding: 0.25rem 0; }
.pricing-features li::before { content: "✓ "; color: var(--color-success); }

/* ===== Integration code ===== */
.integration-code {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--color-text);
}
.nav-tabs .nav-link { color: var(--color-text-muted); background: transparent; border: 1px solid transparent; }
.nav-tabs .nav-link.active { color: var(--color-primary); border-color: var(--color-border); background: var(--color-surface); }

/* ===== Language picker ===== */
.language-picker { margin-top: 0.25rem; }
.language-picker-header { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.language-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: rgba(0,0,0,0.15);
}
.language-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--color-surface);
    transition: border-color .15s, background .15s;
}
.language-picker-item.selected { border-color: var(--color-primary); background: rgba(99,102,241,0.12); }
.language-picker-item.disabled { opacity: 0.45; cursor: not-allowed; }
.language-picker-item input { accent-color: var(--color-primary); }
.language-code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-accent);
    min-width: 1.6rem;
    text-transform: lowercase;
}
.language-name { font-size: 0.9rem; color: var(--color-text); }
