:root {
    color-scheme: dark;
    --bg: #090b0f;
    --bg-2: #111318;
    --surface: #15171d;
    --surface-2: #1b1e25;
    --surface-soft: rgba(255, 255, 255, 0.055);
    --line: rgba(255, 255, 255, 0.11);
    --line-strong: rgba(251, 146, 60, 0.34);
    --text: #fff7ed;
    --muted: #b5adb0;
    --muted-2: #7f858f;
    --accent: #fb923c;
    --accent-2: #ef4444;
    --accent-3: #f97316;
    --good: #34d399;
    --bad: #fb7185;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

html:not(.dark) {
    color-scheme: light;
    --bg: #fbfcff;
    --bg-2: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-soft: rgba(15, 23, 42, 0.04);
    --line: rgba(148, 163, 184, 0.22);
    --line-strong: rgba(249, 115, 22, 0.32);
    --text: #0f172a;
    --muted: #475569;
    --muted-2: #94a3b8;
    --accent: #f97316;
    --accent-2: #0ea5e9;
    --accent-3: #f97316;
    --good: #10b981;
    --bad: #f43f5e;
    --shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(251, 146, 60, 0.06) 1px, transparent 1px),
        linear-gradient(rgba(251, 146, 60, 0.045) 1px, transparent 1px),
        linear-gradient(140deg, var(--bg), var(--bg-2) 58%, #210f0f);
    background-size: 54px 54px, 54px 54px, auto;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: background-color 220ms ease, color 220ms ease;
}

html:not(.dark) body {
    background:
        linear-gradient(90deg, rgba(14, 165, 233, 0.04) 1px, transparent 1px),
        linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
        linear-gradient(135deg, #fbfcff 0%, #f0f9ff 50%, #fff7ed 100%);
    background-size: 54px 54px, 54px 54px, auto;
}

button,
textarea {
    font: inherit;
}

button {
    letter-spacing: 0;
}

.landing-body {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    overflow-x: hidden;
    background: #090b0f;
}

.landing-backdrop,
.landing-bg-grid,
.landing-bg-beam,
.landing-bg-diacritics {
    position: fixed;
    pointer-events: none;
}

.landing-backdrop {
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(13, 16, 22, 0.56) 0%, rgba(21, 23, 31, 0.34) 46%, rgba(13, 16, 22, 0.62) 100%),
        linear-gradient(140deg, #171c25 0%, #1e222c 46%, #4a2118 100%);
}

.landing-bg-grid {
    inset: -24%;
    background:
        linear-gradient(90deg, rgba(251, 146, 60, 0.14) 1px, transparent 1px),
        linear-gradient(rgba(251, 146, 60, 0.09) 1px, transparent 1px),
        repeating-linear-gradient(118deg, transparent 0 104px, rgba(255, 247, 237, 0.06) 105px 106px, transparent 107px 208px);
    background-size: 78px 78px, 78px 78px, 240px 240px;
    opacity: 0.68;
    transform: rotate(-7deg) scale(1.16);
    animation: landingGridDrift 18s linear infinite;
}

.landing-bg-beam {
    top: -18vh;
    width: 34vw;
    min-width: 430px;
    height: 138vh;
    opacity: 0.56;
    filter: blur(6px);
    transform: rotate(18deg);
    background: linear-gradient(90deg, transparent 0%, rgba(251, 146, 60, 0.2) 43%, rgba(239, 68, 68, 0.12) 54%, transparent 100%);
}

.landing-bg-beam-a {
    left: 3vw;
    animation: landingBeamA 19s ease-in-out infinite alternate;
}

.landing-bg-beam-b {
    right: -9vw;
    opacity: 0.42;
    animation: landingBeamB 24s ease-in-out infinite alternate;
}

.landing-bg-diacritics {
    color: rgba(251, 146, 60, 0.22);
    font-family: "Amiri", "Noto Naskh Arabic", serif;
    font-size: 118px;
    font-weight: 800;
    letter-spacing: 26px;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 0 34px rgba(239, 68, 68, 0.16);
    opacity: 0.22;
}

.landing-bg-diacritics::before {
    content: "\25CC\064E \25CC\0650 \25CC\064F \25CC\0651 \25CC\0652 \25CC\064B \25CC\064D \25CC\064C";
}

.landing-bg-diacritics-a {
    left: -5vw;
    top: 18vh;
    transform: rotate(-11deg);
    animation: landingMarksA 16s ease-in-out infinite alternate;
}

.landing-bg-diacritics-b {
    right: -10vw;
    bottom: 13vh;
    transform: rotate(-11deg);
    opacity: 0.14;
    animation: landingMarksB 20s ease-in-out infinite alternate;
}

.landing-page {
    position: relative;
    z-index: 1;
    width: min(1780px, calc(100% - 64px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 0 40px;
}

.landing-nav {
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
}

.landing-brand,
.landing-nav-links,
.landing-actions,
.landing-footer {
    display: flex;
    align-items: center;
}

.landing-brand {
    gap: 14px;
    color: var(--text);
    text-decoration: none;
}

.landing-brand img {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(249, 115, 22, 0.24));
}

.landing-brand span {
    display: grid;
    gap: 2px;
}

.landing-brand strong {
    font-size: 19px;
    line-height: 1;
}

.landing-brand small,
.landing-kicker {
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.landing-nav-links {
    gap: 14px;
}

.landing-nav-links a,
.landing-footer a {
    color: var(--muted);
    text-decoration: none;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.landing-nav-links a {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 750;
}

.landing-nav-links a:hover,
.landing-footer a:hover {
    color: var(--text);
}

.landing-nav-links .landing-nav-button,
.landing-primary,
.landing-secondary,
.landing-footer a {
    border: 1px solid var(--line);
    border-radius: 8px;
}

.landing-nav-links .landing-nav-button {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.landing-hero {
    min-height: 720px;
    display: grid;
    grid-template-columns: minmax(650px, 0.95fr) minmax(620px, 1.05fr);
    align-items: center;
    gap: 88px;
    padding: 42px 0 36px;
}

.landing-hero-copy {
    max-width: 820px;
}

.landing-kicker {
    margin: 0 0 16px;
    color: var(--accent);
}

.landing-hero h1 {
    max-width: 820px;
    margin: 0;
    font-size: 76px;
    line-height: 0.93;
    font-weight: 900;
}

.landing-hero-copy > p:not(.landing-kicker) {
    max-width: 700px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.7;
}

.landing-actions {
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.landing-primary,
.landing-secondary {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.landing-stats {
    width: min(680px, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(21, 23, 29, 0.58);
    overflow: hidden;
}

.landing-stats div {
    min-height: 86px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 18px;
    border-right: 1px solid var(--line);
}

.landing-stats div:last-child {
    border-right: 0;
}

.landing-stats strong {
    color: var(--text);
    font-size: 20px;
    line-height: 1;
}

.landing-stats span {
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.landing-primary {
    border-color: rgba(251, 146, 60, 0.55);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #190b08;
}

.landing-secondary {
    background: rgba(255, 255, 255, 0.055);
}

.landing-primary:hover,
.landing-secondary:hover,
.landing-nav-links .landing-nav-button:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
}

.landing-visual {
    position: relative;
    min-height: 600px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 34px;
    padding: 48px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02)),
        rgba(21, 23, 29, 0.68);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.landing-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../assets/sukoon-banner.png") center / cover no-repeat;
    opacity: 0.08;
    pointer-events: none;
}

.landing-logo-mark,
.landing-preview {
    position: relative;
}

.landing-logo-mark {
    width: 190px;
    height: 190px;
    object-fit: contain;
    filter: drop-shadow(0 26px 38px rgba(239, 68, 68, 0.24));
}

.landing-preview {
    width: 100%;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(9, 11, 15, 0.72);
}

.landing-preview span {
    display: block;
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 850;
}

.landing-preview p {
    margin: 0;
    color: var(--text);
    font-family: "Amiri", "Noto Naskh Arabic", serif;
    font-size: 31px;
    line-height: 2;
}

.landing-section {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 18px 0 64px;
}

.landing-section article {
    min-height: 154px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(21, 23, 29, 0.72);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.landing-section article:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background: rgba(27, 30, 37, 0.86);
}

.landing-section span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
}

.landing-section h2,
.landing-band h2 {
    margin: 14px 0 0;
    color: var(--text);
    font-size: 24px;
    line-height: 1.15;
}

.landing-section p,
.landing-band p {
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.landing-section a {
    color: var(--accent);
}

.landing-band {
    display: grid;
    grid-template-columns: 0.72fr 1.28fr;
    gap: 56px;
    align-items: start;
    padding: 50px 0 62px;
    border-top: 1px solid var(--line);
}

.landing-footer {
    justify-content: space-between;
    gap: 18px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    font-size: 14px;
    font-weight: 750;
}

.landing-footer a {
    padding: 10px 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
}

@keyframes landingGridDrift {
    from {
        background-position: 0 0, 0 0, 0 0;
    }
    to {
        background-position: 78px -78px, -78px 78px, 240px -240px;
    }
}

@keyframes landingBeamA {
    from {
        transform: translate3d(-6vw, 0, 0) rotate(18deg);
    }
    to {
        transform: translate3d(12vw, 5vh, 0) rotate(18deg);
    }
}

@keyframes landingBeamB {
    from {
        transform: translate3d(8vw, 4vh, 0) rotate(18deg);
    }
    to {
        transform: translate3d(-10vw, -4vh, 0) rotate(18deg);
    }
}

@keyframes landingMarksA {
    from {
        transform: translate3d(-4vw, 0, 0) rotate(-11deg);
    }
    to {
        transform: translate3d(7vw, 4vh, 0) rotate(-11deg);
    }
}

@keyframes landingMarksB {
    from {
        transform: translate3d(5vw, 0, 0) rotate(-11deg);
    }
    to {
        transform: translate3d(-7vw, -4vh, 0) rotate(-11deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .landing-bg-grid,
    .landing-bg-beam,
    .landing-bg-diacritics {
        animation: none;
    }
}

@media (max-width: 1180px) {
    .landing-page {
        width: min(100% - 48px, 1180px);
    }

    .landing-hero {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 42px;
        padding: 46px 0 34px;
    }

    .landing-visual {
        width: min(100%, 620px);
        justify-self: start;
    }

    .landing-section,
    .landing-band {
        grid-template-columns: 1fr;
    }
}

.app-shell {
    display: flex;
    height: 100vh;
    min-height: 680px;
    overflow: hidden;
}

.sidebar-wrapper {
    position: relative;
    flex: 0 0 300px;
    width: 300px;
    transition: width 260ms ease;
}

.sidebar {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(18px);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px 16px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(249, 115, 22, 0.2));
}

.brand-copy p {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 800;
}

.brand-copy span,
.eyebrow {
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.brand-copy span,
.eyebrow {
    letter-spacing: 0;
}

.sidebar-section,
.sidebar-actions,
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--line);
}

.examples-section {
    min-height: 0;
}

.runtime-card,
.home-panel,
.settings-dialog {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--surface-soft), rgba(255, 255, 255, 0.025));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.runtime-card {
    border-radius: 8px;
    padding: 13px;
}

.runtime-row,
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.runtime-details {
    margin: 8px 0 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.runtime-status {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.runtime-status.ready {
    color: #042f22;
    background: var(--good);
}

.runtime-status.offline {
    color: #fff1f2;
    background: rgba(239, 68, 68, 0.74);
}

.device-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.device-option,
.secondary-button,
.ghost-button,
.icon-button,
.send-button,
.primary-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface-soft);
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.device-option {
    height: 34px;
    font-size: 12px;
    font-weight: 800;
}

.device-option:hover:not(:disabled),
.device-option.active {
    border-color: var(--line-strong);
    background: rgba(251, 146, 60, 0.16);
    color: var(--text);
}

.device-option:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.demo-list {
    display: grid;
    gap: 7px;
    max-height: 245px;
    overflow-y: auto;
    padding-right: 3px;
    margin-top: 10px;
}

.demo-chip {
    width: 100%;
    display: block;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    text-align: left;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.demo-chip:hover {
    transform: translateY(-1px);
    background: var(--surface-soft);
    border-color: var(--line);
}

.demo-chip strong,
.demo-chip span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.demo-chip strong {
    font-size: 13px;
    font-weight: 800;
}

.demo-chip span {
    margin-top: 3px;
    color: var(--muted-2);
    font-size: 11px;
}

.secondary-button,
.ghost-button,
.primary-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 800;
}

.secondary-button {
    width: 100%;
}

.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: rgba(251, 146, 60, 0.13);
}

.secondary-button.translucent {
    width: auto;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.primary-button {
    border-color: rgba(251, 146, 60, 0.55);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff7ed;
    box-shadow: 0 14px 35px rgba(239, 68, 68, 0.28);
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 45px rgba(239, 68, 68, 0.35);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px;
}

.chat-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.chat-history-item:hover,
.chat-history-item.active {
    color: var(--text);
    background: var(--surface-soft);
    border-color: var(--line);
}

.delete-chat-btn {
    opacity: 0;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 6px;
    color: var(--muted-2);
    background: transparent;
}

.chat-history-item:hover .delete-chat-btn {
    opacity: 1;
}

.delete-chat-btn:hover {
    color: #fecdd3;
    background: rgba(239, 68, 68, 0.18);
}

.sidebar-toggle {
    position: absolute;
    z-index: 20;
    right: 0;
    top: 50%;
    width: 28px;
    height: 48px;
    transform: translate(100%, -50%);
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 8px 8px 0;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.main-surface {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.main-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(251, 146, 60, 0.12), transparent 30%),
        linear-gradient(245deg, rgba(239, 68, 68, 0.12), transparent 34%);
    opacity: 0.75;
}

.topbar {
    position: relative;
    z-index: 1;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 76%, transparent);
    backdrop-filter: blur(18px);
}

.model-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    font-size: 13px;
    font-weight: 800;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.12);
}

.icon {
    width: 18px;
    height: 18px;
}

.icon-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.messages-container {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
}

.messages-column {
    width: min(100%, 1040px);
    min-height: 100%;
    margin: 0 auto;
    padding: 30px 28px 24px;
    display: flex;
    flex-direction: column;
}

.home-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: messageIn 360ms ease-out;
}

.hero-band {
    position: relative;
    min-height: min(56vh, 560px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    background: #160c0a;
}

.hero-media {
    position: absolute;
    inset: 0;
    background-image: url("../assets/sukoon-banner.png");
    background-size: cover;
    background-position: center;
    opacity: 0.54;
    transform: scale(1.01);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(9, 11, 15, 0.96), rgba(9, 11, 15, 0.74) 46%, rgba(9, 11, 15, 0.28)),
        linear-gradient(0deg, rgba(9, 11, 15, 0.58), transparent 52%);
}

html:not(.dark) .hero-overlay {
    background:
        linear-gradient(90deg, rgba(39, 23, 19, 0.92), rgba(39, 23, 19, 0.72) 46%, rgba(39, 23, 19, 0.22)),
        linear-gradient(0deg, rgba(39, 23, 19, 0.32), transparent 52%);
}

.hero-content {
    position: relative;
    z-index: 1;
    width: min(710px, 92%);
    min-height: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(30px, 7vw, 72px);
}

.hero-logo {
    width: 86px;
    height: 86px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.42));
}

.hero-kicker {
    margin: 0 0 10px;
    color: #fed7aa;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
}

.hero-content h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 0.95;
    letter-spacing: 0;
    color: #fff7ed;
}

.hero-text {
    max-width: 600px;
    margin: 20px 0 0;
    color: #f7d8ca;
    font-size: 17px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    backdrop-filter: blur(14px);
}

.metric-strip div {
    padding: 18px;
    border-right: 1px solid var(--line);
}

.metric-strip div:last-child {
    border-right: 0;
}

.metric-strip strong,
.metric-strip span {
    display: block;
}

.metric-strip strong {
    color: var(--accent);
    font-size: 24px;
    line-height: 1.1;
}

.metric-strip span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 18px;
}

.home-panel {
    border-radius: 8px;
    padding: 22px;
}

.home-panel h2 {
    margin: 8px 0 8px;
    font-size: 22px;
    line-height: 1.15;
}

.home-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.arabic-preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(251, 146, 60, 0.13), rgba(239, 68, 68, 0.1)),
        var(--surface-soft);
}

.arabic-preview span {
    color: var(--accent);
    font-weight: 900;
}

.arabic-preview p {
    margin-top: 12px;
    color: var(--text);
    font-size: clamp(22px, 3vw, 36px);
    line-height: 1.95;
}

.composer-wrap {
    position: relative;
    z-index: 2;
    padding: 16px 28px 22px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 86%, transparent) 32%);
}

.composer {
    width: min(100%, 900px);
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(16px);
}

#message-input {
    flex: 1;
    min-height: 42px;
    max-height: 170px;
    resize: none;
    overflow: hidden;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font-size: 15px;
    line-height: 1.65;
    white-space: pre-wrap;
}

#message-input::placeholder {
    color: var(--muted-2);
}

.send-button {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff7ed;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: rgba(251, 146, 60, 0.48);
}

.send-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.25);
}

.send-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.input-hint {
    margin: 10px 0 0;
    color: var(--muted-2);
    text-align: center;
    font-size: 12px;
}

.message-wrap {
    width: min(100%, 760px);
    margin-bottom: 22px;
}

.message-wrap.user {
    align-self: flex-end;
}

.message-wrap.model {
    align-self: flex-start;
}

.message-label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 800;
}

.message-wrap.user .message-label {
    text-align: right;
}

.message-wrap.model .message-label {
    color: var(--accent);
}

.user-message,
.model-message {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border-radius: 8px;
    padding: 14px 15px;
    line-height: 1.85;
    font-size: 15px;
}

.user-message {
    color: #fff7ed;
    background: linear-gradient(135deg, #9f1239, #dc2626);
    box-shadow: 0 14px 35px rgba(127, 29, 29, 0.18);
}

html:not(.dark) .user-message {
    color: #ffffff;
    background: linear-gradient(135deg, #f97316, #0ea5e9);
    box-shadow: 0 14px 35px rgba(14, 165, 233, 0.18);
}

.model-message {
    color: var(--text);
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.model-message.streaming::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 3px;
    background: var(--accent);
    vertical-align: -0.12em;
    animation: cursorBlink 850ms infinite;
}

.settings-panel:not(.hidden) {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(8px);
}

.settings-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 420px);
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.settings-header,
.settings-body {
    padding: 18px;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.settings-header h2 {
    margin: 0;
    font-size: 15px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.setting-row span {
    color: var(--muted);
    font-size: 12px;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

.message-enter {
    animation: messageIn 280ms ease-out;
}

.loading-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.loading-dot:nth-child(1) { animation: bounce 1.2s infinite 0ms; }
.loading-dot:nth-child(2) { animation: bounce 1.2s infinite 160ms; }
.loading-dot:nth-child(3) { animation: bounce 1.2s infinite 320ms; }

html, body, * {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

::selection {
    color: #fff7ed;
    background: var(--accent-2);
}

@media (max-width: 980px) {
    .landing-hero {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 38px;
        padding: 46px 0 34px;
    }

    .landing-visual {
        width: min(100%, 540px);
        justify-self: start;
    }

    .landing-section,
    .landing-band {
        grid-template-columns: 1fr;
    }

    .app-shell {
        min-height: 100vh;
    }

    .sidebar-wrapper {
        position: absolute;
        z-index: 30;
        height: 100%;
        box-shadow: var(--shadow);
    }

    .main-surface {
        margin-left: 0;
    }

    .home-grid {
        grid-template-columns: 1fr;
    }

    .hero-band {
        min-height: 520px;
    }
}

@media (max-width: 720px) {
    .landing-page {
        width: min(100% - 32px, 1180px);
        padding-top: 16px;
    }

    .landing-nav {
        height: auto;
        align-items: flex-start;
        flex-direction: column;
    }

    .landing-nav-links {
        width: 100%;
        flex-wrap: wrap;
    }

    .landing-hero h1 {
        font-size: 42px;
        line-height: 1;
    }

    .landing-hero-copy > p:not(.landing-kicker) {
        font-size: 16px;
    }

    .landing-visual {
        min-height: 360px;
        padding: 24px;
    }

    .landing-logo-mark {
        width: 118px;
        height: 118px;
    }

    .landing-preview p {
        font-size: 22px;
    }

    .landing-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .sidebar-wrapper {
        width: min(86vw, 300px);
        flex-basis: min(86vw, 300px);
    }

    .topbar,
    .messages-column,
    .composer-wrap {
        padding-left: 18px;
        padding-right: 18px;
    }

    .hero-content {
        width: 100%;
        padding: 28px;
    }

    .hero-content h1 {
        font-size: 38px;
    }

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

    .metric-strip div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .metric-strip div:last-child {
        border-bottom: 0;
    }
}
