:root {
    color-scheme: dark;

    --bg: #06101f;
    --panel: #0a172a;
    --panel-2: #0d1d33;
    --border: #263a59;

    --text: #f4f7fb;
    --muted: #9cafc8;

    --gold: #f4d36f;
    --blue: #2d9cff;
    --violet: #5852ff;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --shadow: 0 18px 50px rgb(0 0 0 / 0.28);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100%;
    overflow-x: hidden;

    background:
        radial-gradient(
            circle at top,
            #112443 0,
            var(--bg) 36rem
        );

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

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

button,
a,
label[for] {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding:
        max(16px, env(safe-area-inset-top))
        16px
        max(28px, env(safe-area-inset-bottom));
}

.topbar {
    position: relative;
    z-index: 30;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    min-height: 74px;
    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: rgb(8 19 35 / 0.94);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
}

.brand-logo-wrap {
    display: grid;
    place-items: center;

    width: 52px;
    height: 52px;
    flex: 0 0 52px;

    overflow: hidden;

    border: 1px solid #3e526e;
    border-radius: 16px;

    background: #02060d;
}

.brand-logo {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: contain;
    object-position: center;
}

.brand-copy {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.brand-copy strong {
    color: var(--gold);
    font-size: 1.15rem;
}

.brand-copy span {
    color: var(--muted);
    font-size: 0.82rem;
}

.account-button {
    display: flex;
    align-items: center;
    gap: 8px;

    min-height: 44px;
    padding: 0 14px;

    border: 1px solid #415675;
    border-radius: 14px;

    background: #10223b;
    color: var(--text);
}

.account-button-icon {
    font-size: 1.1rem;
}

.account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;

    width: min(280px, calc(100vw - 32px));

    padding: 8px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: #081426;
    box-shadow: var(--shadow);
}

.account-menu[hidden] {
    display: none;
}

.account-menu button,
.account-menu a {
    display: flex;
    width: 100%;

    padding: 12px 14px;

    border: 0;
    border-radius: 10px;

    background: transparent;
    color: var(--text);

    text-align: left;
}

.account-menu button:hover,
.account-menu a:hover {
    background: #142945;
}

.main-content {
    display: grid;
    gap: 16px;

    padding: 18px 0;
}

.hero-card,
.control-card,
.language-card,
.chat-card,
.subscription-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: rgb(9 21 38 / 0.88);
    box-shadow: var(--shadow);
}

.hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 24px;
}

.hero-copy h1 {
    margin: 8px 0 4px;
    font-size: clamp(2rem, 6vw, 4.2rem);
    line-height: 1;
}

.hero-copy p {
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    color: var(--gold);

    font-size: 0.72rem;
    font-weight: 800;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 9px 12px;

    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--muted);
}

.status-dot {
    width: 9px;
    height: 9px;

    border-radius: 999px;
    background: #46d99a;
}

.control-card {
    display: grid;
    gap: 14px;

    padding: 18px;
}

.control-group {
    display: grid;
    gap: 8px;
}

.control-group label,
.language-card label {
    color: var(--muted);
    font-size: 0.82rem;
}

select,
textarea {
    width: 100%;

    border: 1px solid #324865;
    border-radius: var(--radius-sm);

    background: #061222;
    color: var(--text);
}

select {
    min-height: 46px;
    padding: 0 12px;
}

.control-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.read-toggle {
    display: flex;
    align-items: center;
    gap: 8px;

    min-height: 44px;
    padding: 0 12px;

    border: 1px solid #324865;
    border-radius: 12px;

    background: #0a1729;
}

.control-actions .secondary {
    border: 1px solid #324865;
    background: #10223a;
}

.quick-actions {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;
}

.quick-actions button {
    min-height: 52px;
}

.language-card {
    display: grid;
    gap: 8px;

    padding: 18px;
}

.chat-card {
    overflow: clip;
}

.conversation {
    display: flex;
    flex-direction: column;
    gap: 14px;

    min-height: 300px;
    padding: 18px;
}

.message {
    display: flex;
    gap: 12px;

    max-width: 850px;
}

.message-avatar {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;
    flex: 0 0 44px;

    overflow: hidden;

    border-radius: 50%;
    background: #02060d;
}

.message-avatar img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.message-body {
    min-width: 0;

    padding: 14px 16px;

    border-radius: 16px;

    background: #10253f;
}

.message-body p {
    margin: 6px 0 0;

    color: #b9c7d9;
    line-height: 1.55;

    overflow-wrap: anywhere;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.user-message .message-body {
    background: #203567;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    padding: 0 18px 12px;
}

.attachment-list[hidden] {
    display: none;
}

.attachment-chip {
    padding: 8px 10px;

    border: 1px solid #324865;
    border-radius: 10px;

    background: #0b1a2e;

    color: var(--muted);
    font-size: 0.8rem;
}

textarea {
    min-height: 46px;
    max-height: 180px;

    resize: none;

    padding: 12px 14px;

    line-height: 1.35;
}

.subscription-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 20px;
}

.subscription-card h2 {
    margin: 6px 0;
}

.subscription-card p {
    margin: 0;
    color: var(--muted);
}

.footer {
    display: flex;
    flex-direction: column;
    gap: 18px;

    padding: 24px 8px 8px;

    color: var(--muted);
}

.footer-brand {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.footer-brand strong {
    color: var(--text);
}

.footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;

    background: rgb(0 0 0 / 0.68);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal {
    position: fixed;

    left: 50%;
    top: 50%;

    z-index: 100;

    width: min(620px, calc(100vw - 24px));
    max-height: min(760px, calc(100dvh - 24px));

    transform: translate(-50%, -50%);

    overflow: auto;
    overscroll-behavior: contain;

    border: 1px solid #314867;
    border-radius: 22px;

    background: #071321;
    box-shadow: 0 30px 80px rgb(0 0 0 / 0.5);
}

.modal[hidden] {
    display: none;
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 18px;

    border-bottom: 1px solid var(--border);

    background: #071321;
}

.modal-header h2 {
    margin: 5px 0 0;
}

.modal-content {
    padding: 18px;
}

.icon-button {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    border: 1px solid #324865;
    border-radius: 12px;

    background: #10233b;
    color: var(--text);

    font-size: 1.5rem;
}

.plan-grid {
    display: grid;
    gap: 12px;
}

.plan-card {
    padding: 16px;

    border: 1px solid #314867;
    border-radius: 16px;

    background: #0c1b30;
}

.plan-card h3 {
    margin: 0 0 8px;
    color: var(--gold);
}

.plan-card p {
    margin: 0 0 14px;
    color: var(--muted);
}

.plan-card button {
    width: 100%;
    min-height: 46px;

    border: 0;
    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            var(--blue),
            var(--violet)
        );

    color: white;
    font-weight: 800;
}

@media (min-width: 720px) {

    .app-shell {
        padding-inline: 24px;
    }

    .control-card {
        grid-template-columns:
            minmax(0, 1fr)
            auto;

        align-items: end;
    }

    .quick-actions {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .conversation {
        min-height: 420px;
    }

}

@media (min-width: 1050px) {

    .quick-actions {
        grid-template-columns:
            repeat(6, minmax(0, 1fr));
    }

}

@media (max-width: 640px) {

    .app-shell {
        padding-inline: 10px;
    }

    .topbar {
        min-height: 66px;
        padding: 9px 10px;
    }

    .brand-logo-wrap {
        width: 46px;
        height: 46px;
        flex-basis: 46px;

        border-radius: 14px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
    }

    .brand-copy {
        display: block;
    }

    .brand-copy strong {
        display: block;
        line-height: 1.1;
    }

    .brand-copy span {
        display: none;
    }

    .account-button {
        padding: 0 11px;
    }

    .account-button-label {
        display: none;
    }

    .hero-card {
        align-items: flex-start;
        padding: 18px;
    }

    .status-pill {
        font-size: 0.75rem;
    }

    .quick-actions {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .subscription-card {
        align-items: stretch;
        flex-direction: column;
    }

    .subscription-card button {
        width: 100%;
    }

    .modal {
        top: auto;
        bottom: 0;
        left: 0;

        width: 100%;
        max-height: calc(
            100dvh
            - env(safe-area-inset-top)
            - 10px
        );

        transform: none;

        border-radius: 22px 22px 0 0;
    }

}

/* ==========================================================
   ÍTSIKA CANONICAL 14D-R1
   AUTH + SETTINGS + CONVERSATION MEMORY
   ========================================================== */

.workspace {
    display: grid;
    gap: 16px;
}

.memory-panel {
    min-width: 0;
    padding: 16px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: rgb(9 21 38 / 0.88);
    box-shadow: var(--shadow);
}

.memory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
    margin-bottom: 14px;
}

.memory-header h2 {
    margin: 4px 0 0;
    font-size: 1rem;
}

.memory-header button {
    min-height: 40px;
    padding: 0 12px;

    border: 0;
    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            var(--blue),
            var(--violet)
        );

    color: white;
    font-weight: 750;
}

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

.conversation-list button {
    display: block;

    width: 100%;
    min-height: 50px;

    padding: 10px 12px;

    border: 1px solid #2f4563;
    border-radius: 12px;

    background: #0b1b30;
    color: var(--text);

    text-align: left;
}

.conversation-list button:hover {
    background: #132944;
}

.conversation-list button.active {
    border-color: #557cff;
    background: #172b50;
}

.conversation-title {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-weight: 700;
}

.conversation-meta {
    display: block;

    margin-top: 4px;

    color: var(--muted);
    font-size: 0.75rem;
}

.muted {
    color: var(--muted);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 8px;
    margin-bottom: 16px;
}

.auth-tab {
    min-height: 44px;

    border: 1px solid #324865;
    border-radius: 11px;

    background: #0c1b30;
    color: var(--text);
}

.auth-tab.active {
    border-color: transparent;

    background:
        linear-gradient(
            135deg,
            var(--blue),
            var(--violet)
        );
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form[hidden] {
    display: none;
}

.auth-form label,
.settings-list label {
    display: grid;
    gap: 7px;

    color: var(--muted);
    font-size: 0.85rem;
}

.auth-form input {
    width: 100%;
    min-height: 46px;

    padding: 0 12px;

    border: 1px solid #324865;
    border-radius: 12px;

    background: #061222;
    color: var(--text);
}

.auth-form button {
    min-height: 46px;

    border: 0;
    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            var(--blue),
            var(--violet)
        );

    color: white;
    font-weight: 800;
}

.form-status {
    min-height: 22px;
    margin: 14px 0 0;

    color: var(--muted);
}

.settings-list {
    display: grid;
    gap: 16px;
}

.settings-toggle {
    grid-template-columns: auto 1fr !important;
    align-items: center;
}

@media (min-width: 1050px) {

    .workspace {
        grid-template-columns:
            260px
            minmax(0, 1fr);

        align-items: start;
    }

    .memory-panel {
        position: sticky;
        top: 16px;
    }

}

@media (max-width: 1049px) {

    .memory-panel {
        order: 2;
    }

}

/* ==========================================================
   ÍTSIKA 14E-R2 — PREMIUM RECOVERY OVERRIDES
   One active application stylesheet.
   ========================================================== */

body {
    background:
        radial-gradient(
            circle at 50% -20%,
            #132849 0,
            #071222 36rem,
            #040b15 100%
        );
}

.app-shell {
    width: min(1360px, 100%);
}

/* ---------------------------
   Header
   --------------------------- */

.topbar {
    min-height: 70px;
    padding: 10px 14px;

    background: rgb(6 16 30 / 0.96);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.brand {
    gap: 10px;
}

.brand-logo-wrap {
    display: grid;
    place-items: center;

    width: 46px;
    height: 46px;
    flex: 0 0 46px;

    padding: 4px;

    border-radius: 13px;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            #07101d,
            #02060c
        );
}

.brand-logo {
    display: block;

    width: 36px !important;
    height: 36px !important;

    max-width: 36px !important;
    max-height: 36px !important;

    object-fit: contain !important;
    object-position: center center !important;

    margin: auto !important;

    transform: none !important;
}

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

.brand-copy span {
    font-size: 0.76rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-badge {
    min-height: 30px;

    display: inline-flex;
    align-items: center;

    padding: 0 10px;

    border: 1px solid #3c5578;
    border-radius: 999px;

    background: #0c1d34;

    color: #d9e6f8;

    font-size: 0.75rem;
    font-weight: 750;
}

.plan-badge[hidden] {
    display: none;
}

.account-button {
    min-height: 40px;

    padding: 0 12px;

    background: #0b1a2c;
}

/* ---------------------------
   Main workspace
   --------------------------- */

.workspace {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        280px;

    gap: 16px;

    align-items: start;

    padding-top: 16px;
}

.main-content {
    grid-column: 1;
    grid-row: 1;

    padding: 0;

    min-width: 0;
}

.memory-panel {
    grid-column: 2;
    grid-row: 1;

    position: sticky;
    top: 16px;

    min-width: 0;

    background: rgb(7 18 33 / 0.94);
}

/* ---------------------------
   Chat surface
   --------------------------- */

.chat-card {
    min-height: min(720px, calc(100vh - 150px));

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            rgb(8 21 39 / 0.96),
            rgb(5 14 27 / 0.98)
        );
}

.conversation {
    flex: 1;

    min-height: 430px;

    padding: 20px;
}

.message {
    max-width: 760px;
}

.message-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
}

.message-avatar img {
    width: 30px !important;
    height: 30px !important;

    object-fit: contain !important;
    object-position: center !important;

    margin: auto;
}

.message-body {
    padding: 12px 14px;

    border: 1px solid #1b3555;

    background: #0d213a;
}

/* ---------------------------
   Account / subscription
   --------------------------- */

.account-menu {
    z-index: 200;
}

.modal {
    z-index: 400;

    width: min(540px, calc(100vw - 24px));

    background:
        linear-gradient(
            180deg,
            #09192c,
            #06111f
        );
}

.modal-backdrop {
    z-index: 350;
}

/* ---------------------------
   Footer
   --------------------------- */

.footer {
    padding-top: 20px;

    font-size: 0.82rem;
}

/* ---------------------------
   Mobile
   --------------------------- */

@media (max-width: 1049px) {

    .workspace {
        display: flex;
        flex-direction: column;
    }

    .main-content {
        width: 100%;
        order: 1;
    }

    .memory-panel {
        position: static;

        width: 100%;
        order: 2;
    }

    .chat-card {
        min-height: calc(100dvh - 120px);
    }

}

@media (max-width: 640px) {

    .app-shell {
        padding-inline: 8px;
    }

    .topbar {
        min-height: 62px;

        padding: 8px 9px;

        border-radius: 18px;
    }

    .brand-logo-wrap {
        width: 42px;
        height: 42px;
        flex-basis: 42px;

        padding: 4px;
    }

    .brand-logo {
        width: 32px !important;
        height: 32px !important;

        max-width: 32px !important;
        max-height: 32px !important;
    }

    .plan-badge {
        padding-inline: 8px;

        font-size: 0.68rem;
    }

    .account-button {
        width: 42px;
        min-width: 42px;

        padding: 0;

        justify-content: center;
    }

    .conversation {
        min-height: 56dvh;

        padding: 14px;
    }

    .memory-panel {
        margin-bottom: 8px;
    }

}

/* ==========================================================
   ÍTSIKA 14E-R4-R2
   FINAL PREMIUM LAYOUT CONTRACT
   ========================================================== */

/* Desktop: app first, memory on right. */

.workspace {
    display: grid !important;

    grid-template-columns:
        minmax(0, 1fr)
        248px !important;

    gap: 14px !important;

    align-items: start !important;
}

.main-content {
    grid-column: 1 !important;
    grid-row: 1 !important;

    min-width: 0 !important;
}

.memory-panel {
    grid-column: 2 !important;
    grid-row: 1 !important;

    position: sticky !important;
    top: 16px !important;

    padding: 14px !important;

    border-radius: 18px !important;
}

/* Keep logo compact inside its host. */

.brand-logo-wrap {
    display: grid !important;
    place-items: center !important;

    width: 44px !important;
    height: 44px !important;

    flex: 0 0 44px !important;

    padding: 5px !important;
}

.brand-logo {
    display: block !important;

    width: 32px !important;
    height: 32px !important;

    max-width: 32px !important;
    max-height: 32px !important;

    object-fit: contain !important;
    object-position: center center !important;

    margin: auto !important;

    transform: none !important;
}

/* Chat should feel like the product, not a dashboard of controls. */

.chat-card {
    min-height:
        min(
            700px,
            calc(100vh - 150px)
        ) !important;

    display: flex !important;
    flex-direction: column !important;
}

.conversation {
    flex: 1 !important;

    min-height: 450px !important;
}

/*
 * Defensive CSS against retired media-mode UI.
 * The JS removes it from the DOM as well.
 */

[class*="media-mode"],
[class*="create-mode"],
[class*="media-duration"],
[data-media-mode],
[data-create-mode],
[data-itsika-chat-media-mode],
.itsika-chat-media-mode,
.itsika-media-mode-switcher,
.itsika-create-mode-controls,
.itsika-chat-media-create-controls {
    display: none !important;
}

/* Mobile becomes one natural scrolling column. */

@media (max-width: 1049px) {

    .workspace {
        display: flex !important;
        flex-direction: column !important;
    }

    .main-content {
        order: 1 !important;

        width: 100% !important;
    }

    .memory-panel {
        position: static !important;

        order: 2 !important;

        width: 100% !important;
    }

}

@media (max-width: 640px) {

    .brand-logo-wrap {
        width: 40px !important;
        height: 40px !important;

        flex-basis: 40px !important;
    }

    .brand-logo {
        width: 28px !important;
        height: 28px !important;

        max-width: 28px !important;
        max-height: 28px !important;
    }

}

/* ==========================================================
   ÍTSIKA 14F-A4-R3
   CANONICAL RESPONSIVE COMPOSER
   ========================================================== */

#composer-form {
    display: grid;

    grid-template-columns:
        42px
        minmax(0, 1fr)
        76px;

    grid-template-rows:
        44px;

    column-gap: 8px;

    align-items: stretch;

    width: 100%;

    margin: 0;
    padding: 10px;

    box-sizing: border-box;
}

#composer-form > .attach-button {
    grid-column: 1;
    grid-row: 1;

    display: grid;
    place-items: center;

    width: 42px;
    height: 44px;

    min-width: 42px;
    min-height: 44px;

    margin: 0;
    padding: 0;

    border-radius: 12px;

    cursor: pointer;

    box-sizing: border-box;
}

#composer-form > #attachment-input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    overflow: hidden;

    pointer-events: none;
}

#composer-form > #prompt-input {
    grid-column: 2;
    grid-row: 1;

    display: block;

    width: 100%;
    height: 44px;

    min-width: 0;
    min-height: 44px;
    max-height: 132px;

    margin: 0;
    padding: 11px 13px;

    resize: none;

    box-sizing: border-box;
}

#composer-form > #ask-button {
    grid-column: 3;
    grid-row: 1;

    display: block;

    width: 76px;
    height: 44px;

    min-width: 76px;
    min-height: 44px;

    margin: 0;
    padding: 0 12px;

    border-radius: 12px;

    box-sizing: border-box;
}

/* Desktop workspace */

.workspace {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        248px;

    gap: 14px;

    align-items: start;
}

.main-content {
    grid-column: 1;
    grid-row: 1;

    min-width: 0;
}

.memory-panel {
    grid-column: 2;
    grid-row: 1;

    position: sticky;
    top: 16px;
}

/* Restrained branding */

.brand-logo-wrap {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    padding: 5px;

    overflow: hidden;
}

.brand-logo {
    display: block;

    width: 32px;
    height: 32px;

    max-width: 32px;
    max-height: 32px;

    margin: auto;

    object-fit: contain;
    object-position: center center;

    transform: none;
}

@media (max-width: 1049px) {

    .workspace {
        display: flex;
        flex-direction: column;
    }

    .main-content {
        order: 1;
        width: 100%;
    }

    .memory-panel {
        position: static;

        order: 2;

        width: 100%;
    }

}

@media (max-width: 640px) {

    #composer-form {
        grid-template-columns:
            40px
            minmax(0, 1fr)
            64px;

        grid-template-rows:
            42px;

        column-gap: 6px;

        padding: 8px;
    }

    #composer-form > .attach-button {
        width: 40px;
        height: 42px;

        min-width: 40px;
        min-height: 42px;
    }

    #composer-form > #prompt-input {
        height: 42px;
        min-height: 42px;

        padding: 10px 11px;
    }

    #composer-form > #ask-button {
        width: 64px;
        height: 42px;

        min-width: 64px;
        min-height: 42px;

        padding: 0 8px;
    }

    .brand-logo-wrap {
        width: 40px;
        height: 40px;

        flex-basis: 40px;
    }

    .brand-logo {
        width: 28px;
        height: 28px;

        max-width: 28px;
        max-height: 28px;
    }

}

/* ==========================================================
   ÍTSIKA 14G-A6-R1
   PREMIUM LOGO + ACCOUNT SURFACE
   ========================================================== */

.brand-logo-wrap {
    display: grid !important;
    place-items: center !important;

    width: 62px !important;
    height: 62px !important;

    min-width: 62px !important;
    min-height: 62px !important;

    flex: 0 0 62px !important;

    padding: 0 !important;

    overflow: hidden !important;

    border-radius: 15px !important;

    box-sizing: border-box !important;
}

.brand-logo {
    display: block !important;

    width: 60px !important;
    height: 60px !important;

    max-width: 60px !important;
    max-height: 60px !important;

    object-fit: contain !important;
    object-position: center !important;

    transform: scale(1.38) !important;

    transform-origin: center !important;
}

.message-avatar {
    display: grid !important;
    place-items: center !important;

    width: 58px !important;
    height: 58px !important;

    min-width: 58px !important;
    min-height: 58px !important;

    flex: 0 0 58px !important;

    padding: 0 !important;

    overflow: hidden !important;

    border-radius: 50% !important;

    box-sizing: border-box !important;
}

.message-avatar img {
    display: block !important;

    width: 56px !important;
    height: 56px !important;

    max-width: 56px !important;
    max-height: 56px !important;

    object-fit: contain !important;
    object-position: center !important;

    transform: scale(1.38) !important;

    transform-origin: center !important;
}

.account-usage-strip {
    display: grid;

    grid-template-columns:
        minmax(210px, 0.75fr)
        minmax(0, 2fr);

    align-items: stretch;

    gap: 12px;

    width: 100%;

    margin: 0 0 14px 0;

    padding: 12px;

    box-sizing: border-box;

    border:
        1px solid
        rgba(127, 162, 208, 0.28);

    border-radius: 17px;

    background:
        linear-gradient(
            135deg,
            rgba(13, 31, 54, 0.98),
            rgba(7, 19, 35, 0.98)
        );

    box-shadow:
        inset 0 1px 0
            rgba(255,255,255,0.035),
        0 16px 44px
            rgba(0,0,0,0.16);
}

.usage-strip-title {
    display: flex;

    flex-direction: column;

    justify-content: center;

    gap: 5px;

    min-width: 0;

    padding: 9px 12px;
}

.usage-strip-title span {
    color: #f2d879;

    font-size: 0.68rem;

    font-weight: 800;

    letter-spacing: 0.15em;
}

.usage-strip-title strong {
    color: #f4f7fb;

    font-size: 0.96rem;

    line-height: 1.3;

    overflow-wrap: anywhere;
}

.usage-strip-metrics {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 9px;

    min-width: 0;
}

.usage-metric {
    display: flex;

    flex-direction: column;

    justify-content: center;

    gap: 5px;

    min-width: 0;

    padding: 10px 13px;

    border:
        1px solid
        rgba(126, 162, 208, 0.19);

    border-radius: 13px;

    background:
        rgba(15, 35, 61, 0.8);
}

.usage-metric span {
    color: #92a9c5;

    font-size: 0.72rem;

    font-weight: 700;

    letter-spacing: 0.07em;

    text-transform: uppercase;
}

.usage-metric strong {
    color: #f5df89;

    font-size: 1rem;

    line-height: 1.25;

    overflow-wrap: anywhere;
}

@media (max-width: 700px) {

    .brand-logo-wrap {
        width: 58px !important;
        height: 58px !important;

        min-width: 58px !important;
        min-height: 58px !important;

        flex-basis: 58px !important;
    }

    .brand-logo {
        width: 56px !important;
        height: 56px !important;

        max-width: 56px !important;
        max-height: 56px !important;
    }

    .message-avatar {
        width: 54px !important;
        height: 54px !important;

        min-width: 54px !important;
        min-height: 54px !important;

        flex-basis: 54px !important;
    }

    .message-avatar img {
        width: 52px !important;
        height: 52px !important;

        max-width: 52px !important;
        max-height: 52px !important;
    }

    .account-usage-strip {
        grid-template-columns: 1fr;

        padding: 9px;

        gap: 8px;
    }

    .usage-strip-metrics {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}

@media (max-width: 430px) {

    .usage-strip-metrics {
        grid-template-columns: 1fr;
    }

}

/* ITSIKA_14G_A12_R2_CSS_START */

.itsika-a12-account-actions {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;

    margin-top: 18px;
}

.itsika-a12-account-actions button {
    min-height: 46px;

    padding: 0 16px;

    border:
        1px solid
        rgba(118, 160, 224, 0.32);

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #208cff,
            #6558ff
        );

    color: #ffffff;

    cursor: pointer;

    font: inherit;
    font-weight: 800;
}

.itsika-a12-account-actions button + button {
    background:
        rgba(15, 31, 55, 0.96);
}

.modal[hidden],
.modal-backdrop[hidden] {
    display: none !important;
}

.modal:not([hidden]) {
    display: block;
}

.modal-backdrop:not([hidden]) {
    display: block;
}

button,
[role="button"],
.account-menu button,
.modal button {
    pointer-events: auto;
}

@media (max-width: 640px) {
    .itsika-a12-account-actions {
        grid-template-columns: 1fr;
    }
}

/* ITSIKA_14G_A12_R2_CSS_END */

/* ITSIKA_14G_A15_APP_CSS_START */

/*
    One browser interaction contract.
    Modal visibility is controlled by [hidden].
*/

html.itsika-modal-open,
body.itsika-modal-open {
    overflow: hidden !important;
}

#modal-backdrop[hidden],
#subscription-modal[hidden],
#auth-modal[hidden],
#settings-modal[hidden],
#account-modal[hidden] {
    display: none !important;
}

#modal-backdrop:not([hidden]) {
    display: block !important;

    position: fixed !important;
    inset: 0 !important;

    z-index: 9000 !important;

    background:
        rgba(
            0,
            4,
            12,
            0.76
        ) !important;

    backdrop-filter:
        blur(5px) !important;
}

#subscription-modal:not([hidden]),
#auth-modal:not([hidden]),
#settings-modal:not([hidden]),
#account-modal:not([hidden]) {
    display: block !important;

    position: fixed !important;

    top: 50% !important;
    left: 50% !important;

    transform:
        translate(
            -50%,
            -50%
        ) !important;

    z-index: 9010 !important;

    width:
        min(
            calc(100vw - 32px),
            520px
        ) !important;

    max-height:
        calc(
            100vh - 42px
        ) !important;

    overflow:
        auto !important;

    opacity: 1 !important;

    visibility:
        visible !important;

    pointer-events:
        auto !important;
}

#subscription-modal button,
#auth-modal button,
#settings-modal button,
#account-modal button,
#account-menu button,
#account-menu-button {
    pointer-events:
        auto !important;

    cursor:
        pointer !important;
}

.itsika-a15-account-actions {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 10px;

    margin-top: 20px;
}

.itsika-a15-account-actions button {
    min-height: 46px;

    padding:
        0 16px;

    border:
        1px solid
        rgba(
            108,
            155,
            226,
            0.34
        );

    border-radius: 12px;

    font: inherit;
    font-weight: 800;

    cursor: pointer;
}

.itsika-a15-primary {
    color: white;

    background:
        linear-gradient(
            135deg,
            #238fff,
            #6657ff
        );
}

.itsika-a15-secondary {
    color:
        #e7eef9;

    background:
        rgba(
            16,
            34,
            60,
            0.98
        );
}

.itsika-a15-auth-status {
    min-height: 20px;

    margin-top: 12px;

    color:
        #aebed4;

    font-size:
        0.9rem;
}

.itsika-a15-auth-status.error {
    color:
        #ff9d9d;
}

.itsika-a15-plan-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 10px;

    margin-top: 14px;
}

.itsika-a15-plan-item {
    padding: 14px;

    border:
        1px solid
        rgba(
            109,
            149,
            210,
            0.23
        );

    border-radius: 12px;

    background:
        rgba(
            12,
            29,
            52,
            0.86
        );
}

.itsika-a15-plan-item small {
    display: block;

    margin-bottom: 5px;

    color:
        #91a5c2;

    text-transform:
        uppercase;

    letter-spacing:
        0.08em;
}

.itsika-a15-plan-item strong {
    display: block;

    color:
        #fff2ab;

    font-size:
        1.05rem;
}

@media (max-width: 560px) {

    .itsika-a15-account-actions,
    .itsika-a15-plan-grid {
        grid-template-columns:
            1fr;
    }

}

/* ITSIKA_14G_A15_APP_CSS_END */

/* ==========================================================
   ITSIKA_H12_MEMORY_PANEL_CONTAINMENT

   Fix only the existing Memory / Conversations geometry.
   Existing card design/content/functionality is unchanged.
   ========================================================== */

@media (min-width: 1050px) {

    .memory-panel {
        box-sizing: border-box;

        display: flex;
        flex-direction: column;

        min-width: 0;
        max-width: 100%;

        max-height: calc(100dvh - 32px);

        overflow: hidden;
    }

    .memory-panel .conversation-list {
        box-sizing: border-box;

        width: 100%;
        min-width: 0;
        max-width: 100%;

        min-height: 0;

        overflow-x: hidden;
        overflow-y: auto;

        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    .memory-panel .conversation-list > button {
        box-sizing: border-box;

        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

}

/*
 * ==========================================================
 * ITSIKA_PHASE1_BLOCK3_CANONICAL_CHAT_AVATAR
 *
 * Final chat-avatar presentation authority.
 *
 * Every assistant message uses the same canonical logo asset
 * from the HTML/JS. This final rule intentionally overrides
 * historical avatar sizing rules without altering the rest
 * of the application layout.
 * ==========================================================
 */

.message-avatar {
    display: grid !important;
    place-items: center !important;

    width: 48px !important;
    height: 48px !important;

    min-width: 48px !important;
    min-height: 48px !important;

    flex: 0 0 48px !important;

    padding: 0 !important;
    margin: 0 !important;

    overflow: hidden !important;

    border-radius: 50% !important;
    box-sizing: border-box !important;

    background: #02060d;
}

.message-avatar img {
    display: block !important;

    width: 46px !important;
    height: 46px !important;

    min-width: 46px !important;
    min-height: 46px !important;

    max-width: 46px !important;
    max-height: 46px !important;

    margin: auto !important;

    object-fit: contain !important;
    object-position: center !important;

    transform: none !important;
}

@media (max-width: 760px) {
    .message-avatar {
        width: 44px !important;
        height: 44px !important;

        min-width: 44px !important;
        min-height: 44px !important;

        flex-basis: 44px !important;
    }

    .message-avatar img {
        width: 42px !important;
        height: 42px !important;

        min-width: 42px !important;
        min-height: 42px !important;

        max-width: 42px !important;
        max-height: 42px !important;
    }
}
