:root {
    color-scheme: dark;
    --bg: #20211f;
    --panel: #121312;
    --panel-soft: #2a2b28;
    --panel-raised: #343731;
    --line: #464943;
    --text: #f4f2ed;
    --muted: #b9bcb3;
    --soft: #8f9589;
    --accent: #36c679;
    --accent-strong: #19a75b;
    --warn: #f1a942;
    --danger: #ef6f6c;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background:
        radial-gradient(circle at 28% 12%, rgba(54, 198, 121, 0.10), transparent 32%),
        linear-gradient(135deg, #181917 0%, var(--bg) 50%, #26231f 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

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

.app-shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    height: 100vh;
    min-height: 620px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 18px;
    background: rgba(18, 19, 18, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.new-chat {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-weight: 700;
}

.new-chat:hover,
.history a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.brand-mark {
    width: 27px;
    height: 27px;
}

.history {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    margin-top: 20px;
    overflow-y: auto;
}

.history p {
    margin: 18px 10px 6px;
    color: var(--soft);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.history a {
    display: block;
    min-height: 36px;
    padding: 9px 10px;
    border-radius: 8px;
    color: #dcddd8;
    font-size: 14px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history a[aria-current="page"] {
    background: rgba(54, 198, 121, 0.14);
    color: #f8fff9;
}

.profile,
.message-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile {
    min-height: 56px;
    margin-top: 16px;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-weight: 650;
}

.profile-image {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    object-fit: cover;
}

.content {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
}

.home-stage {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(920px, calc(100% - 40px));
    margin: 0 auto;
    padding: 44px 0 150px;
}

.hero-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 22px;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
}

h1 {
    max-width: 820px;
    margin: 0 0 34px;
    color: var(--text);
    font-size: clamp(32px, 6vw, 54px);
    line-height: 1.04;
    text-align: center;
    letter-spacing: 0;
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.prompt-grid button {
    min-height: 74px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.prompt-grid button:hover,
.prompt-grid button:focus-visible {
    border-color: rgba(54, 198, 121, 0.75);
    background: rgba(54, 198, 121, 0.11);
    outline: none;
}

.chat-thread {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 18px;
    width: min(900px, calc(100% - 48px));
    margin: 0 auto;
    padding: 44px 0 154px;
    overflow-y: auto;
}

.message {
    width: min(760px, 100%);
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(42, 43, 40, 0.82);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
}

.user-message {
    align-self: flex-end;
    background: rgba(54, 198, 121, 0.11);
}

.assistant-message {
    align-self: flex-start;
}

.message-author {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
}

.message-body {
    color: var(--text);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.message-body p {
    margin: 0;
}

.unsafe-query img,
.unsafe-query video,
.unsafe-query iframe {
    max-width: 100%;
}

.composer-area {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 272px;
    padding: 16px 24px 18px;
    background: linear-gradient(to top, rgba(32, 33, 31, 0.98) 78%, rgba(32, 33, 31, 0));
}

.composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: min(880px, 100%);
    margin: 0 auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(52, 55, 49, 0.98);
    box-shadow: var(--shadow);
    cursor: text;
}


.composer input {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    outline: none;
}

.composer input::placeholder,
.report-panel input::placeholder {
    color: #90958c;
}

.composer button,
.report-submit {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 6px;
    background: var(--accent);
    color: #092215;
    cursor: pointer;
    font-weight: 850;
    white-space: nowrap;
}

.composer button:hover,
.report-submit:hover {
    background: #53dc91;
}

.disclaimer {
    margin: 9px 0 0;
    color: var(--soft);
    font-size: 12px;
    text-align: center;
}

.report-widget {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 20;
    width: max-content;
}

.report-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: #f4f2ed;
    color: #171917;
    cursor: pointer;
    font-weight: 850;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.32);
    white-space: nowrap;
}

.report-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warn);
    box-shadow: 0 0 0 4px rgba(241, 169, 66, 0.22);
}

.report-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: min(360px, calc(100vw - 32px));
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(18, 19, 18, 0.98);
    box-shadow: var(--shadow);
}

.report-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.report-close {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
}

.report-close:hover {
    background: rgba(255, 255, 255, 0.14);
}

.report-panel label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.report-panel input {
    width: 100%;
    min-height: 44px;
    margin-bottom: 10px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
    color: var(--text);
    outline: none;
}

.report-panel input:focus,
.composer:focus-within {
    border-color: rgba(54, 198, 121, 0.9);
    box-shadow: 0 0 0 3px rgba(54, 198, 121, 0.14), var(--shadow);
}

.report-submit {
    width: 100%;
}

.report-status {
    min-height: 18px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.report-status[data-state="ok"] {
    color: #71e6a5;
}

.report-status[data-state="error"] {
    color: var(--danger);
}

.report-status[data-state="pending"] {
    color: var(--warn);
}

@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    .app-shell {
        grid-template-columns: 1fr;
        min-height: 100vh;
        height: auto;
    }

    .sidebar {
        display: none;
    }

    .content {
        min-height: 100vh;
        height: auto;
    }

    .home-stage {
        width: min(100% - 28px, 720px);
        padding-top: 54px;
    }

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

    .chat-thread {
        width: min(100% - 28px, 720px);
        padding-top: 24px;
    }

    .composer-area {
        left: 0;
    }

}

@media (max-width: 560px) {
    h1 {
        font-size: 34px;
    }

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

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

    .composer button {
        width: 100%;
    }

    .report-widget {
        right: 14px;
        bottom: 14px;
    }
}
