/* Loaded last; desktop layout and document/export styles remain independent. */
.mobile-preview-switch,
.mobile-builder-note,
.mobile-builder-return,
.mobile-word-export-compact { display: none; }

.is-mobile-workspace { --mobile-accent: #087f77; }
.is-mobile-workspace body { min-width: 0; }
.is-mobile-workspace input,
.is-mobile-workspace textarea,
.is-mobile-workspace select { font-size: 16px; }
.is-mobile-workspace button { touch-action: manipulation; }
.is-mobile-workspace [data-workspace-view="drafts"],
.is-mobile-workspace [data-workspace-view="layouts"],
.is-mobile-workspace .workspace-register-page--templates .workspace-register-header-action,
.is-mobile-workspace .workspace-register-page--templates .workspace-resource-menu-host,
.is-mobile-workspace #previewEditButton,
.is-mobile-workspace .execution-reorder-controls { display: none; }

.is-mobile-workspace .workspace-shell { grid-template-rows: 64px 52px minmax(0, 1fr); }
.is-mobile-workspace .workspace-global-header { padding: 0 18px; grid-template-columns: 1fr auto; }
.is-mobile-workspace .workspace-header-spacer { display: none; }
.is-mobile-workspace .workspace-wordmark { grid-column: 1; justify-self: start; font-size: 27px; }
.is-mobile-workspace .workspace-account { grid-column: 2; }
.is-mobile-workspace .workspace-account-copy,
.is-mobile-workspace .lexcraft-persistence-control-workspace { display: none; }
.is-mobile-workspace .workspace-primary-nav { justify-content: stretch; padding: 0 12px; }
.is-mobile-workspace .workspace-nav-button { flex: 1; padding: 0 10px; height: 52px; font-size: 14px; }
.is-mobile-workspace .workspace-dashboard-page,
.is-mobile-workspace .workspace-register-page { padding: 26px 18px 36px; }
.is-mobile-workspace .workspace-dashboard-columns { grid-template-columns: 1fr; gap: 28px; }
.is-mobile-workspace .workspace-dashboard-heading { align-items: stretch; }
.is-mobile-workspace .workspace-dashboard-primary-action { justify-content: space-between; min-height: 48px; }
.is-mobile-workspace .workspace-register-header h1 { font-size: 30px; }
.is-mobile-workspace .workspace-register-page--templates .workspace-register-header { padding-left: 16px; }
.is-mobile-workspace .workspace-register-columns { display: none; }
.is-mobile-workspace .workspace-register-row--templates { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px 16px; }
.is-mobile-workspace .workspace-register-row--templates [data-label="Layout"],
.is-mobile-workspace .workspace-register-row--templates [data-label="Aktualisiert"] { display: none; }
.is-mobile-workspace .workspace-register-primary-cell strong { overflow-wrap: anywhere; }
.is-mobile-workspace .workspace-register-action { min-height: 44px; }
.is-mobile-workspace .workspace-template-use-panel { padding: 18px 16px; grid-template-columns: 1fr; }
.is-mobile-workspace .workspace-template-use-form { grid-template-columns: minmax(0, 1fr); }
.is-mobile-workspace .workspace-template-use-actions { flex-wrap: wrap; }
.is-mobile-workspace .workspace-template-use-field input { font-size: 16px; min-height: 48px; }

.is-mobile-workspace .execution-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
    background: #f5f7f8;
}
.is-mobile-workspace .execution-shell .execution-topbar {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: auto minmax(32px, 1fr) auto;
    gap: 6px 8px;
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
}
.is-mobile-workspace .execution-shell .editor-topbar-left { grid-row: 1; grid-column: 1; }
.is-mobile-workspace .execution-shell .editor-title-group {
    display: flex;
    position: static;
    transform: none;
    grid-row: 2;
    grid-column: 1 / -1;
    min-width: 0;
    max-width: none;
    align-items: flex-start;
    text-align: left;
    pointer-events: auto;
}
.is-mobile-workspace .execution-shell .editor-title {
    max-width: 100%;
    font-size: 18px;
    font-weight: 650;
    line-height: 1.4;
    letter-spacing: -.2px;
    text-transform: none;
    text-shadow: none;
}
.is-mobile-workspace .execution-shell .editor-mode-badge { display: none; }
.is-mobile-workspace .execution-shell .editor-actions { display: contents; }
.is-mobile-workspace .execution-shell .editor-actions > .topbar-primary { grid-row: 1; grid-column: 3; }
.is-mobile-workspace .execution-shell .topbar-button,
.is-mobile-workspace .execution-shell .topbar-primary { min-height: 44px; padding: 0 6px; font-size: 11px; text-transform: none; letter-spacing: normal; white-space: nowrap; }
/* Compact button surfaces with the original colors and full-size touch targets. */
.is-mobile-workspace .execution-shell .execution-topbar .topbar-button,
.is-mobile-workspace .execution-shell .execution-topbar .topbar-primary {
    position: relative;
    isolation: isolate;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #f4f7f8;
    font-weight: 760;
}
.is-mobile-workspace .execution-shell .execution-topbar .topbar-button::before,
.is-mobile-workspace .execution-shell .execution-topbar .topbar-primary::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 6px 0;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 6px;
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 1px 2px rgba(0, 0, 0, .1);
    pointer-events: none;
}
.is-mobile-workspace .execution-shell .execution-topbar .topbar-primary::before {
    border-color: rgba(93, 219, 209, .34);
    background: var(--execution-premium-accent);
}
.is-mobile-workspace .execution-shell .execution-topbar .topbar-button:hover::before {
    border-color: rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .17);
}
.is-mobile-workspace .execution-shell .execution-topbar .topbar-primary:hover::before {
    border-color: rgba(125, 235, 227, .48);
    background: var(--execution-premium-accent-dark);
}
.is-mobile-workspace .execution-shell .execution-topbar .client-interview-open {
    width: max-content;
    max-width: 100%;
    justify-self: center;
}
.is-mobile-workspace .execution-shell .execution-topbar .topbar-button:focus-visible,
.is-mobile-workspace .execution-shell .execution-topbar .topbar-primary:focus-visible {
    outline: 2px solid #8edbd4;
    outline-offset: 1px;
}
.is-mobile-workspace .execution-shell .lexcraft-persistence-control-editor {
    position: static;
    grid-row: 1;
    grid-column: 2;
    place-self: center;
    margin: 0;
}
.is-mobile-workspace .execution-shell .lexcraft-editor-storage-button { min-height: 36px; min-width: 32px; justify-content: center; padding: 0; background: transparent; border: 0; cursor: pointer; }
.is-mobile-workspace .execution-shell .lexcraft-editor-storage-button:focus-visible { outline: 2px solid #8edbd4; outline-offset: 2px; }
.is-mobile-workspace .execution-shell .lexcraft-persistence-control-editor { border: 0; padding: 0; }
.is-mobile-workspace .execution-shell .lexcraft-persistence-control-editor .lexcraft-save-status { display: inline-flex; gap: 0; font-size: 0; line-height: 0; letter-spacing: 0; }
.is-mobile-workspace .execution-shell .mobile-preview-switch {
    display: flex;
    gap: 4px;
    padding: 5px;
    margin: 12px 16px;
    border: 1px solid #dce5e8;
    border-radius: 12px;
    background: #e9eff1;
}
.is-mobile-workspace .mobile-preview-switch button {
    flex: 1;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #526875;
    font-size: 14px;
    font-weight: 700;
}
.is-mobile-workspace .mobile-preview-switch button[aria-pressed="true"] {
    background: #fff;
    color: var(--mobile-accent);
    box-shadow: 0 2px 5px #102a3c12;
}
.is-mobile-workspace .mobile-preview-switch button:focus-visible { outline: 2px solid var(--mobile-accent); outline-offset: 1px; }
.is-mobile-workspace .execution-shell .preview-layout { display: block; height: 100%; min-height: 0; overflow: hidden; }
.is-mobile-workspace .execution-shell .preview-interview-panel,
.is-mobile-workspace .execution-shell .preview-document-area { height: 100%; overflow: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.is-mobile-workspace .execution-shell[data-mobile-pane="interview"] .preview-document-area,
.is-mobile-workspace .execution-shell[data-mobile-pane="document"] .preview-interview-panel { display: none; }
.is-mobile-workspace .execution-shell .preview-interview-panel { padding: 0; border: 0; }
.is-mobile-workspace .execution-shell .preview-interview-panel > .preview-panel-heading { display: none; }
.is-mobile-workspace .execution-shell .preview-interview-list { padding: 0 16px max(32px, env(safe-area-inset-bottom)); }
.is-mobile-workspace .execution-shell .preview-section-header { min-height: 52px; }
.is-mobile-workspace .execution-shell .preview-question { padding: 16px 4px; }
.is-mobile-workspace .execution-shell .preview-question-title { font-size: 15px; line-height: 1.5; }
.is-mobile-workspace .execution-shell input:not([type="checkbox"]):not([type="radio"]),
.is-mobile-workspace .execution-shell textarea,
.is-mobile-workspace .execution-shell select { font-size: 16px; min-height: 48px; border-radius: 8px; }
.is-mobile-workspace .execution-shell .preview-choice-option { min-height: 48px; }
.is-mobile-workspace .execution-shell .preview-document-area { padding: 18px 12px max(24px, env(safe-area-inset-bottom)); }
.is-mobile-workspace .execution-shell .preview-document-frame { width: 100%; max-width: none; }
.is-mobile-workspace .execution-shell .preview-document-caption { margin: 0 8px 18px; }
.is-mobile-workspace .execution-shell .preview-paper { width: 100%; min-height: 100%; margin: 0; padding: 24px 20px; border-radius: 8px; overflow-x: auto; }
.is-mobile-workspace .execution-shell .preview-document { overflow-wrap: anywhere; }
.is-mobile-workspace .execution-shell .preview-free-text-trigger { pointer-events: none; }
.is-mobile-workspace .workspace-size-guard-panel > p:not(.mobile-builder-note),
.is-mobile-workspace .workspace-size-guard-requirement,
.is-mobile-workspace #workspaceFullscreenButton { display: none; }
.is-mobile-workspace .mobile-builder-note,
.is-mobile-workspace .mobile-builder-return { display: block; }

@media print {
    .mobile-preview-switch { display: none !important; }
}

@media (max-width: 380px) {
    .is-mobile-workspace .execution-shell .mobile-word-export-full { display: none; }
    .is-mobile-workspace .execution-shell .mobile-word-export-compact { display: inline; }
    .is-mobile-workspace .execution-shell .topbar-button,
    .is-mobile-workspace .execution-shell .topbar-primary { padding-inline: 4px; }
}
