:root {
    --bg: #f3f6fb;
    --panel: #ffffff;
    --panel-strong: #f5edf9;
    --text: #0f172a;
    --muted: #64748b;
    --border: rgba(15, 23, 42, 0.08);
    --accent: #a24fd4;
    --accent-strong: #723195;
    --accent-soft: rgba(162, 79, 212, 0.16);
    --sidebar-start: #4a235f;
    --sidebar-mid: #2d153f;
    --sidebar-end: #170d24;
    --danger: #c92a2a;
    --success: #2b8a3e;
    --font-ui: 'Manrope', 'Segoe UI', Tahoma, sans-serif;
    --app-font-size: 16px;
    --sidebar-width: 280px;
    --sidebar-shadow: 0 30px 70px rgba(8, 16, 24, 0.3);
    --sidebar-active: #ffd44d;
    --sidebar-active-strong: #ffbe0b;
}

html[lang="ar"] {
    --font-ui: 'Cairo', Tahoma, sans-serif;
}

html {
    font-size: var(--app-font-size);
}

[data-theme="dark"] {
    --bg: #081018;
    --panel: #102132;
    --panel-strong: #24182f;
    --text: #edf2f7;
    --muted: #9fb3c8;
    --border: rgba(148, 163, 184, 0.18);
    --accent: #ddb2fb;
    --accent-strong: #f4e7ff;
    --accent-soft: rgba(221, 178, 251, 0.18);
    --sidebar-start: #2f163f;
    --sidebar-mid: #22112e;
    --sidebar-end: #130a1d;
    --sidebar-active: #ffd44d;
    --sidebar-active-strong: #ffcf40;
}

body {
    background:
        radial-gradient(circle at top left, rgba(162,79,212,0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(114,49,149,0.08), transparent 22%),
        var(--bg);
    color: var(--text-custom-light, var(--text));
    min-height: 100vh;
    font-family: var(--font-ui-custom, var(--font-ui));
    text-rendering: optimizeLegibility;
}

[data-theme="dark"] body {
    color: var(--text-custom-dark, var(--text));
}

body.module-launcher-open {
    overflow: hidden;
}

button,
input,
select,
textarea,
table {
    font: inherit;
}

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 0.22s ease;
}

.sidebar {
    background:
        radial-gradient(circle at top, rgba(255,255,255,0.08), transparent 26%),
        linear-gradient(180deg, var(--sidebar-start), var(--sidebar-mid) 56%, var(--sidebar-end));
    color: #fff;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    width: var(--sidebar-width);
    transition: transform 0.22s ease, opacity 0.22s ease, margin 0.22s ease;
    z-index: 1045;
}

.sidebar-brand {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.sidebar-brand > div {
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-brand img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    padding: 0.4rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
}

.sidebar-nav {
    display: grid;
    gap: 0.75rem;
}

.sidebar-link,
.sidebar-group-links a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: 0.2s ease;
    display: block;
}

.sidebar-group {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.sidebar-group[open],
.sidebar-group.is-active {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.sidebar-group-toggle {
    list-style: none;
    cursor: pointer;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: #fff;
    font-weight: 700;
    user-select: none;
}

.sidebar-group-toggle::-webkit-details-marker {
    display: none;
}

.sidebar-group-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-group.is-active > .sidebar-group-toggle,
.sidebar-group[open] > .sidebar-group-toggle {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(216, 164, 247, 0.12));
}

.sidebar-group.is-active > .sidebar-group-toggle {
    border-bottom: 1px solid rgba(255, 212, 77, 0.28);
    box-shadow: inset 4px 0 0 var(--sidebar-active);
    color: #fff2b8;
}

.sidebar-group-icon {
    width: 0.8rem;
    height: 0.8rem;
    border-inline-end: 2px solid rgba(255, 255, 255, 0.82);
    border-bottom: 2px solid rgba(255, 255, 255, 0.82);
    transform: rotate(45deg);
    transition: transform 0.2s ease, margin 0.2s ease;
    flex: 0 0 auto;
    margin-top: -0.2rem;
}

.sidebar-group[open] .sidebar-group-icon {
    transform: rotate(225deg);
    margin-top: 0.2rem;
}

.sidebar-group-links {
    display: grid;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem 0.7rem;
}

.sidebar-group-links a {
    font-size: 0.95rem;
    padding-inline-start: 1rem;
}

.sidebar-link,
.sidebar-group-links a {
    position: relative;
    padding-inline-start: 1.15rem;
}

.sidebar-link.active,
.sidebar-group-links a.active {
    background: linear-gradient(135deg, rgba(255, 230, 150, 0.3), rgba(255, 200, 50, 0.22));
    border-color: rgba(255, 212, 77, 0.5);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
    color: #fff7d0;
}

.sidebar-link.active::before,
.sidebar-group-links a.active::before {
    content: '';
    position: absolute;
    inset-block: 10px;
    inset-inline-start: 8px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--sidebar-active), var(--sidebar-active-strong));
    box-shadow: 0 0 0 4px rgba(255, 212, 77, 0.12);
}

.sidebar-link:hover,
.sidebar-group-links a:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(216, 164, 247, 0.18));
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    color: #fff;
}

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

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(114, 49, 149, 0.08);
    position: sticky;
    top: 0;
    z-index: 5;
}

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-strong);
    --bs-btn-hover-border-color: var(--accent-strong);
    --bs-btn-active-bg: var(--accent-strong);
    --bs-btn-active-border-color: var(--accent-strong);
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
}

.btn-outline-primary {
    --bs-btn-color: var(--accent-strong);
    --bs-btn-border-color: rgba(114, 49, 149, 0.28);
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--accent-strong);
    --bs-btn-active-border-color: var(--accent-strong);
    --bs-btn-active-color: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-dark:hover {
    border-color: rgba(114, 49, 149, 0.24);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(162, 79, 212, 0.4);
    box-shadow: 0 0 0 0.2rem rgba(162, 79, 212, 0.12);
}

.topbar-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.topbar h1 {
    font-size: 1.35rem;
    margin: 0;
}

.topbar-menu {
    flex: 0 0 auto;
}

.topbar-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.content-area {
    padding: 1.5rem;
    flex: 1 1 auto;
}

.module-launcher {
    position: fixed;
    inset: 0;
    z-index: 1090;
}

.module-launcher[hidden] {
    display: none !important;
}

.module-launcher-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 7, 27, 0.72);
    backdrop-filter: blur(10px);
}

.module-launcher-panel {
    position: relative;
    width: min(1120px, calc(100% - 2rem));
    max-height: calc(100vh - 3rem);
    margin: 1.5rem auto;
    background:
        radial-gradient(circle at top left, rgba(255, 212, 77, 0.12), transparent 22%),
        radial-gradient(circle at bottom right, rgba(162, 79, 212, 0.18), transparent 28%),
        linear-gradient(180deg, #2f163f, #21102f 58%, #140a1d);
    color: #f7efff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    box-shadow: 0 34px 84px rgba(10, 6, 16, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .module-launcher-panel {
    background:
        radial-gradient(circle at top left, rgba(255, 212, 77, 0.1), transparent 20%),
        radial-gradient(circle at bottom right, rgba(162, 79, 212, 0.14), transparent 28%),
        linear-gradient(180deg, #291338, #1b0d27 58%, #110816);
    border-color: rgba(255, 255, 255, 0.08);
}

.module-launcher-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.35rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.module-launcher-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
}

.module-launcher-header p {
    margin: 0;
    color: rgba(241, 230, 255, 0.72);
}

.module-launcher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    overflow: auto;
}

.module-launcher-card {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(8, 5, 14, 0.22);
    color: #f7efff;
}

[data-theme="dark"] .module-launcher-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.module-launcher-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
}

.module-launcher-card-badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 212, 77, 0.28), rgba(162, 79, 212, 0.36));
    color: #fff7d0;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.module-launcher-links {
    display: grid;
    gap: 0.5rem;
}

.module-launcher-links a {
    text-decoration: none;
    color: #f7efff;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: 0.18s ease;
}

[data-theme="dark"] .module-launcher-links a {
    background: rgba(255, 255, 255, 0.03);
    color: #f7efff;
}

.module-launcher-links a:hover,
.module-launcher-links a.active {
    transform: translateY(-1px);
    border-color: rgba(255, 212, 77, 0.5);
    background: linear-gradient(135deg, rgba(87, 38, 116, 0.88), rgba(53, 24, 74, 0.96));
    box-shadow: 0 12px 24px rgba(255, 190, 11, 0.16);
    color: #fff8db;
}

[data-theme="dark"] .module-launcher-links a:hover,
[data-theme="dark"] .module-launcher-links a.active {
    background: linear-gradient(135deg, rgba(94, 42, 126, 0.88), rgba(45, 19, 64, 0.96));
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.06);
    padding: 1.25rem;
}

.panel + .panel {
    margin-top: 1rem;
}

.card-metric {
    background: linear-gradient(135deg, var(--panel), var(--panel-strong));
    border-radius: 22px;
    padding: 1.2rem;
    border: 1px solid var(--border);
}

.card-metric h3 {
    font-size: 0.95rem;
    color: var(--muted);
}

.card-metric strong {
    font-size: 1.8rem;
}

.data-table thead th {
    background: var(--panel-strong);
    border-bottom: 0;
    white-space: nowrap;
}

.data-table td,
.data-table th {
    vertical-align: middle;
}

.auth-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem 1rem 1rem;
    background: linear-gradient(135deg, rgba(162,79,212,0.22), rgba(114,49,149,0.08)), var(--bg);
}

.auth-card {
    width: min(460px, calc(100% - 2rem));
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.5);
    padding: 2rem;
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(114,49,149,0.2);
}

.auth-body .app-footer {
    width: min(1100px, 100%);
    margin: 1.25rem 0 0;
}

[data-theme="dark"] .auth-card {
    background: rgba(16,33,50,0.92);
    border-color: rgba(148,163,184,0.22);
}

.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.product-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.product-search-results button {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0.85rem 1rem;
    text-align: start;
}

.product-search-results button:hover {
    background: var(--panel-strong);
}

.thermal-receipt {
    width: 80mm;
    margin: 0 auto;
    font-size: 12px;
}

.label-sheet {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.barcode-label {
    border: 1px dashed #adb5bd;
    padding: 0.6rem;
    text-align: center;
}

.company-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.company-brand-logo {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    padding: 0.55rem;
}

.company-brand-meta {
    display: grid;
    gap: 0.2rem;
}

.company-brand-meta strong {
    font-size: 1.05rem;
}

.company-brand-meta span {
    color: var(--muted);
    font-size: 0.92rem;
}

.company-brand-compact .company-brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 14px;
}

.app-footer,
.print-footer {
    margin: 0 1.5rem 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-footer-meta,
.print-footer-meta {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.92rem;
}

.pdf-actions .btn {
    white-space: nowrap;
}

.receipt-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.settings-brand-card {
    background: linear-gradient(135deg, var(--panel), var(--panel-strong));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem 1.15rem;
}

.settings-section-title {
    margin-bottom: 0.85rem;
    font-size: 1rem;
    font-weight: 800;
}

.settings-appearance-card {
    background: linear-gradient(135deg, var(--panel), var(--panel-strong));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem 1.15rem;
}

.appearance-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.appearance-preview-card {
    border-radius: 18px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.appearance-preview-card.light {
    background: #ffffff;
    color: #0f172a;
}

.appearance-preview-card.dark {
    background: #102132;
    color: #edf2f7;
    border-color: rgba(148, 163, 184, 0.18);
}

.appearance-preview-card h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
}

.appearance-preview-card p {
    margin: 0;
    line-height: 1.7;
}

.appearance-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(162,79,212,0.14);
    color: var(--accent-strong);
}

.inventory-summary-card {
    min-width: 180px;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--panel), var(--panel-strong));
}

.chat-page {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1rem;
    min-height: 70vh;
}

.chat-sidebar-panel,
.chat-thread-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-start-form {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.chat-conversation-list {
    display: grid;
    gap: 0.65rem;
    overflow-y: auto;
}

.chat-conversation-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    transition: 0.2s ease;
}

.chat-conversation-item:hover,
.chat-conversation-item.active {
    border-color: rgba(162, 79, 212, 0.32);
    background: linear-gradient(135deg, var(--panel), var(--panel-strong));
}

.chat-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(162,79,212,0.14), rgba(162,79,212,0.28));
    color: var(--accent-strong);
    font-weight: 800;
    flex: 0 0 auto;
}

.chat-conversation-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.chat-conversation-meta strong,
.chat-conversation-meta div,
.chat-conversation-meta small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conversation-meta small {
    color: var(--muted);
}

.chat-unread-badge {
    min-width: 28px;
    padding: 0.22rem 0.45rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    text-align: center;
    font-size: 0.8rem;
}

.chat-thread-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.chat-thread-header .chat-avatar {
    width: 54px;
    height: 54px;
}

.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 0.35rem 0.25rem;
    min-height: 340px;
    max-height: 60vh;
}

.chat-empty-state {
    display: grid;
    place-items: center;
    min-height: 340px;
    color: var(--muted);
    text-align: center;
}

.chat-message-row {
    display: flex;
}

.chat-message-row.mine {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: min(78%, 620px);
    border-radius: 18px;
    padding: 0.85rem 1rem;
    background: var(--accent-soft);
    border: 1px solid rgba(162,79,212,0.14);
}

.chat-message-row.mine .chat-bubble {
    background: linear-gradient(135deg, rgba(162,79,212,0.96), rgba(114,49,149,0.95));
    color: #fff;
}

.chat-bubble p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-bubble small {
    display: block;
    margin-top: 0.5rem;
    color: inherit;
    opacity: 0.72;
}

.chat-image-link {
    display: inline-block;
    margin-top: 0.65rem;
}

.chat-image {
    max-width: min(100%, 280px);
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.chat-composer {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.chat-composer textarea {
    min-height: 92px;
    resize: vertical;
}

.chat-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.chat-image-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
}

.chat-image-preview img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.sidebar-close {
    margin-inline-start: auto;
}

.sidebar-backdrop {
    display: none;
}

.app-shell.sidebar-collapsed .layout {
    grid-template-columns: 0 minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .sidebar {
    margin-inline-start: calc(-1 * var(--sidebar-width));
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 992px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        inset-inline-start: 0;
        height: 100vh;
        transform: translateX(calc(-100% - 16px));
        box-shadow: var(--sidebar-shadow);
    }

    html[dir="rtl"] .sidebar {
        inset-inline-start: auto;
        inset-inline-end: 0;
        transform: translateX(calc(100% + 16px));
    }

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

    .app-shell.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(8, 16, 24, 0.42);
        z-index: 1040;
    }

    .topbar {
        padding: 1rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-title-group,
    .topbar-actions {
        width: 100%;
    }

    .content-area {
        padding: 1rem;
    }

    .module-launcher-panel {
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
        margin: 0.5rem auto;
        border-radius: 22px;
    }

    .module-launcher-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .app-footer,
    .print-footer {
        margin: 0 1rem 1rem;
        padding: 0.95rem 1rem;
    }

    .chat-page {
        grid-template-columns: 1fr;
    }

    .appearance-preview-grid {
        grid-template-columns: 1fr;
    }

    .chat-messages {
        max-height: none;
        min-height: 280px;
    }

    .chat-bubble {
        max-width: 100%;
    }
}
