/* Telegram-inspired palette for the preview and its embedded pages. */
:root {
    color-scheme: light;
    --page: #f3f6f8; --surface: #ffffff; --rail: var(--surface); --text: #192733;
    --muted: #536676; --line: #dce4eb; --hover: #eef4f8;
    --selected: #e4f3fd; --selection-text: #145b83;
    --accent: #237cae; --action: #176fa1; --accent-text: #146b9b;
    --soft: #f0f4f7; --input-border: #ccd7df; --hint: #536676; --brand: #288ac2;
    --chat-bg: #e4ebe0; --bubble-in: #ffffff; --bubble-out: #effdde;
    --chat-dot: #53674d10;
    --bubble-out-text: #000000; --bubble-shadow: #748ea229;
    --popup-shadow: 0 8px 24px #172b3b24;
    --code: #f3f5f7;
    --syntax-comment: #64748b; --syntax-keyword: #7c3aad; --syntax-string: #216b3e;
    --syntax-function: #155e9b; --syntax-number: #985018; --syntax-property: #a62d50;
}
:root[data-theme="dark"], :root[data-calm-theme="dark"] {
    color-scheme: dark;
    --page: #111b26; --surface: #172431; --rail: var(--surface); --text: #edf5fb;
    --muted: #aabccc; --line: #334352; --hover: #223444;
    --selected: #23425e; --selection-text: #eaf6ff;
    --accent: #397bb3; --action: #2f6ea5; --accent-text: #8ecbff;
    --soft: #242f3d; --input-border: #313c49; --hint: #91a3b5; --brand: #5288c1;
    --chat-bg: #0e1621; --bubble-in: #182533; --bubble-out: #2b5278;
    --chat-dot: #a2b9d112;
    --bubble-out-text: #e4ecf2; --bubble-shadow: #04080e56;
    --popup-shadow: 0 8px 24px #05091166;
    --code: #101b27;
    --syntax-comment: #9bafbf; --syntax-keyword: #c7a4ee; --syntax-string: #a4d6a0;
    --syntax-function: #8bc7ef; --syntax-number: #e4b080; --syntax-property: #f0a0b6;
}

/* The embedded tools also load the shared site stylesheet. Map its colours here. */
:root:root {
    --lg-base: var(--page); --lg-ink: var(--text); --lg-muted: var(--muted);
    --lg-solid: var(--surface); --lg-panel: var(--surface); --lg-card: var(--surface);
    --lg-control: var(--soft); --lg-edge: var(--line); --lg-line: var(--line);
    --lg-accent: var(--accent); --lg-primary: var(--action); --lg-highlight: transparent;
    --lg-background: var(--page); --lg-reflection: none; --lg-depth: none;
    --send-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 19V5m-6 6 6-6 6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html body :is(.navigation .nav-item, .navigation .utility-item, .account-row,
              .model-button, .library-button, .suggestion, .auth-card,
              .image-dialog, .account-dialog, #result-dialog) {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
html body :is(.photo-wrapper > .card, .suno-wrapper > .card, .library-card,
              .price-info, .calm-balance, .library-primary),
html body.calm-tool :is(.photo-wrapper > .card, .suno-wrapper > .card, #generate-btn) {
    box-shadow: none !important;
}
html body.calm-tool #generate-btn, html body :is(.library-primary, .auth-telegram) {
    background: var(--action) !important;
}
html body :is(.model-menu, .chat-menu) {
    box-shadow: var(--popup-shadow) !important;
}
html body.gpt-chat .messages-area, html body .support-history, html body .conversation {
    background: radial-gradient(circle, var(--chat-dot) .8px, transparent 1px) 0 0 / 24px 24px,
                var(--chat-bg) !important;
}
.send-icon, .gpt-chat #send-button::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: var(--send-arrow) center / contain no-repeat;
    mask: var(--send-arrow) center / contain no-repeat;
}
@media (forced-colors: active) {
    html body :is(.model-menu, .chat-menu) { box-shadow: none !important; }
    .send-icon, .gpt-chat #send-button::after { forced-color-adjust: none; background: ButtonText; }
}
