@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

@font-face {
    font-family: "FK Grotesk";
    src:
        url("assets/fonts/FKGrotesk-Regular.woff2") format("woff2"),
        url("assets/fonts/FKGrotesk-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "FK Grotesk";
    src:
        url("assets/fonts/FKGrotesk-Medium.woff2") format("woff2"),
        url("assets/fonts/FKGrotesk-Medium.woff") format("woff");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "FK Grotesk";
    src:
        url("assets/fonts/FKGrotesk-Semibold.woff2") format("woff2"),
        url("assets/fonts/FKGrotesk-Semibold.woff") format("woff");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #0f1115;
    --bg-soft: #141821;
    --panel: #1a202a;
    --panel-soft: #1c222d;
    --line: #2d343f;
    --line-soft: #252c36;
    --text: #e7ebf1;
    --text-soft: #a7b0bd;
    --text-dim: #7e899a;
    --accent: #70c7c3;
    --danger: #d7aeb0;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 9px;
    --shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
    --font-ui: "Inter", "Avenir Next", "Segoe UI", sans-serif;
    --font-brand: "FK Grotesk", "FKGrotesk", "FK Grotesk Neue", "Inter", "Avenir Next", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-ui);
    color: var(--text);
    background:
        radial-gradient(1000px 520px at 50% -280px, rgba(126, 140, 162, 0.18) 0%, transparent 64%),
        linear-gradient(180deg, #0e1014 0%, #0f1217 48%, #0e1014 100%);
    line-height: 1.5;
    opacity: 0;
    transition: opacity 200ms ease;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
    font-family: var(--font-ui);
}

body.page-ready {
    opacity: 1;
}

h1,
h2,
h3,
p {
    margin: 0;
}

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

.site-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-shell > main {
    flex: 1;
}

.glass {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.top-nav {
    height: 46px;
    border-radius: 11px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    border-color: #272d36;
    background: #161b23;
    box-shadow: none;
}

.brand {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.015em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-links a {
    height: 28px;
    border-radius: 7px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    color: #aab3c1;
    font-size: 0.82rem;
    transition: background-color 150ms ease, color 150ms ease;
}

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

.nav-links.compact a {
    height: 30px;
    font-size: 0.78rem;
    padding: 0 8px;
}

.header-signup {
    height: 28px;
    padding: 0 10px;
    font-size: 0.82rem;
    border-radius: 8px;
    border-color: #3a414d;
    background: #202630;
    color: #dce2ec;
}

.header-signup:hover {
    background: #262d38;
    border-color: #4a5260;
}

.button,
button,
input[type="submit"] {
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--text);
    border-radius: 10px;
    height: 40px;
    padding: 0 14px;
    font-size: 0.88rem;
    font-family: var(--font-ui);
    font-weight: 600;
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    border-color: #3f4856;
    background: #202733;
}

.button.subtle {
    background: transparent;
}

.button.small {
    height: 32px;
    padding: 0 10px;
    font-size: 0.75rem;
}

.button.disabled,
button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    height: 46px;
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    background: #131822;
    color: var(--text);
    padding: 0 12px;
    font-size: 0.92rem;
    font-family: var(--font-ui);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder {
    color: #7f8897;
}

input:focus {
    border-color: #485364;
    box-shadow: 0 0 0 3px rgba(72, 83, 100, 0.26);
}

/* Landing */

.landing-shell {
    max-width: 1060px;
}

.landing-main {
    min-height: 0;
    flex: 1;
    display: grid;
    align-content: center;
}

.section {
    margin-bottom: 28px;
}

.hero {
    text-align: center;
    padding: 34px 12px 8px;
}

.hero h1 {
    width: min(760px, 100%);
    margin: 0 auto;
    font-size: clamp(2rem, 5.2vw, 3.35rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    font-weight: 600;
}

.hero-brand-title {
    font-family: var(--font-brand);
    font-weight: 520;
    letter-spacing: -0.025em;
}

.lead {
    width: min(720px, 100%);
    margin: 16px auto 0;
    color: var(--text-soft);
    font-size: 1rem;
}

.lead.compact {
    width: 100%;
    margin-top: 8px;
    font-size: 0.93rem;
}

.hero-form {
    width: min(782px, 100%);
    margin: 28px auto 0;
    border-radius: 18px;
    border: 1px solid #353b44;
    background: #1b1b1f;
    box-shadow: none;
    padding: 0;
    display: grid;
    gap: 0;
    text-align: left;
    overflow: visible;
}

.hero-input-layer {
    position: relative;
    min-height: 92px;
    background: transparent;
}

.hero-form textarea {
    width: 100%;
    height: 100%;
    border: none !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    min-height: 92px;
    padding: 14px 18px 10px;
    font-size: 1rem;
    line-height: 1.34;
    color: var(--text);
    resize: none;
    position: relative;
    z-index: 1;
    outline: none;
    border-radius: 0;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    caret-color: #d8dde6;
    color-scheme: dark;
}

.hero-form textarea:focus {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.hero-form textarea::placeholder {
    color: #787d86;
}

.hero-form textarea::-webkit-resizer {
    display: none;
}

.hero-form textarea::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.hero-controls-row {
    border-top: 1px solid #30343d;
    min-height: 58px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    overflow: visible;
}

.hero-plus {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #454a55;
    background: transparent;
    color: #a7adba;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
    font-weight: 400;
}

.hero-plus:hover {
    transform: none;
    border-color: #5b6270;
    background: #242932;
    color: #dce1ea;
}

.hero-controls-right {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    position: relative;
}

.hero-model-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    isolation: isolate;
    z-index: 90;
}

.hero-control {
    display: inline-flex;
    align-items: center;
    color: #a5acb9;
    font-size: 0.93rem;
    line-height: 1;
    white-space: nowrap;
}

.hero-control-model {
    all: unset;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #373f4b;
    background: #2a2d34;
    font-weight: 500;
    color: #d7ddeb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    font-size: 0.93rem;
    line-height: 1;
}

.hero-control-model:hover {
    transform: none;
    background: #2a2e38;
    color: #e4eaf4;
}

.hero-control-model::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid #8e95a3;
    border-bottom: 1.5px solid #8e95a3;
    transform: rotate(45deg) translateY(-1px);
    margin-left: 8px;
}

.hero-model-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 238px;
    border-radius: 14px;
    border: 1px solid #3a424f;
    background: #171b22;
    box-shadow: 0 24px 46px rgba(0, 0, 0, 0.62);
    padding: 8px 10px 9px;
    display: none;
    opacity: 0;
    transform: translateY(4px);
    z-index: 200;
    pointer-events: none;
}

.hero-model-menu.open {
    display: grid;
    opacity: 1;
    transform: translateY(0);
    gap: 3px;
    pointer-events: auto;
}

.hero-model-upgrade {
    min-height: 36px;
    border-radius: 8px;
    border: 1px solid #2f6973;
    background: rgba(26, 84, 95, 0.25);
    color: #dce4ef;
    padding: 0 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 5px;
    box-sizing: border-box;
}

.hero-model-upgrade + .hero-model-item {
    border-top: 1px solid #2a303b;
    margin-top: 2px;
    padding-top: 6px;
    min-height: 40px;
    height: 40px;
}

.hero-model-upgrade::after {
    content: "\2192";
    color: #5ec6d2;
    font-size: 1rem;
    line-height: 1;
}

.hero-model-item {
    width: 100%;
    height: 36px;
    min-height: 36px;
    border-radius: 8px;
    color: #a6aebb;
    padding: 0 0 0 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.86rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    user-select: none;
}

.hero-model-item:hover {
    transform: none;
    background: #272d37;
    color: #e3e8f1;
}

.hero-model-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.hero-model-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8d95a4;
    font-size: 0.8rem;
    line-height: 1;
    flex: 0 0 14px;
}

.hero-chip {
    height: 17px;
    padding: 0 5px;
    border-radius: 5px;
    background: rgba(42, 88, 102, 0.42);
    color: #72d2dd;
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    line-height: 1;
}

.hero-lock {
    width: 11px;
    height: 11px;
    display: inline-block;
    position: relative;
    flex: 0 0 11px;
    margin-left: 8px;
    opacity: 0.9;
}

.hero-lock::before {
    content: "";
    position: absolute;
    left: 1.3px;
    top: -4px;
    width: 8px;
    height: 5px;
    border: 1.2px solid #929bad;
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    box-sizing: border-box;
}

.hero-lock::after {
    content: "";
    position: absolute;
    left: 0;
    top: 1px;
    width: 11px;
    height: 8px;
    border-radius: 2px;
    background: #929bad;
}

.hero-control-computer::before {
    content: "";
    width: 12px;
    height: 8px;
    border: 1.2px solid #8d95a4;
    border-radius: 2px;
    margin-right: 6px;
    box-sizing: border-box;
}

.hero-control-mic {
    width: 9px;
    height: 12px;
    border: 1.4px solid #8d95a4;
    border-radius: 6px;
    position: relative;
}

.hero-control-mic::before {
    content: "";
    width: 9px;
    height: 5px;
    border-bottom: 1.2px solid #8d95a4;
    position: absolute;
    left: -1.4px;
    top: 10px;
    border-radius: 0 0 5px 5px;
}

.hero-control-mic::after {
    content: "";
    width: 1.3px;
    height: 4px;
    background: #8d95a4;
    position: absolute;
    left: 2.8px;
    top: 14.5px;
}

.hero-voice-submit {
    width: 36px;
    min-width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 0;
    padding: 0;
    background: #eceef2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.hero-voice-submit span {
    width: 2px;
    border-radius: 2px;
    background: #0f1218;
}

.hero-voice-submit span:nth-child(1) {
    height: 8px;
}

.hero-voice-submit span:nth-child(2) {
    height: 12px;
}

.hero-voice-submit span:nth-child(3) {
    height: 12px;
}

.hero-voice-submit span:nth-child(4) {
    height: 8px;
}

.hero-voice-submit:hover {
    transform: none;
    background: #ffffff;
}

.hero-go-submit {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    border-radius: 999px !important;
    border: 0 !important;
    padding: 0 !important;
    background: #eceef2 !important;
    color: #0f1218 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
}

.hero-go-submit:hover {
    transform: none;
    background: #ffffff !important;
}

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

.strip span {
    min-height: 38px;
    border: 1px solid #343d4a;
    border-radius: 999px;
    background: #171c24;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 8px;
    font-size: 0.79rem;
    color: #b3bcc8;
}

.mini-explain {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.micro-card {
    border-radius: 12px;
    border: 1px solid #323b47;
    background: #171d26;
    padding: 14px;
    box-shadow: none;
}

.micro-card h2 {
    font-size: 0.96rem;
    letter-spacing: -0.01em;
    margin-bottom: 7px;
}

.micro-card p {
    font-size: 0.86rem;
    color: var(--text-soft);
}

.site-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--text-dim);
    font-size: 0.82rem;
}

.footer-lines {
    letter-spacing: 0.01em;
    word-spacing: 0.18em;
    color: #98a2b2;
}

.footer-links {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.footer-links a {
    color: #a6b2c4;
    transition: color 150ms ease;
}

.footer-links a:hover {
    color: #dce2ec;
}

/* Legal */

.legal-main {
    width: min(860px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 12px;
    padding-bottom: 10px;
}

.legal-main h1 {
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    letter-spacing: -0.03em;
}

.legal-card {
    border-radius: 14px;
    border: 1px solid #333b47;
    background: #171d26;
    box-shadow: none;
    padding: 16px;
    display: grid;
    gap: 8px;
}

.legal-card h2 {
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.legal-card p {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.legal-card code {
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.84em;
    color: #d5dde9;
    background: #121721;
    border: 1px solid #313a48;
    border-radius: 6px;
    padding: 1px 6px;
}

.cookie-settings-form {
    gap: 12px;
}

.cookie-settings-form h3 {
    margin: 0;
    font-size: 0.94rem;
    letter-spacing: -0.01em;
    color: #dbe2ed;
}

.cookie-pref-row {
    border: 1px solid #313949;
    border-radius: 11px;
    background: #141a23;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cookie-pref-row.locked {
    opacity: 0.82;
}

.cookie-pref-copy {
    display: grid;
    gap: 4px;
}

.cookie-pref-copy p {
    margin: 0;
}

.cookie-switch {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 24px;
}

.cookie-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 1px solid #384152;
    background: #212835;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.cookie-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #a9b2bf;
    transition: transform 0.18s ease, background-color 0.18s ease;
}

.cookie-switch input:checked + .cookie-slider {
    background: #1e4b58;
    border-color: #2b6c7d;
}

.cookie-switch input:checked + .cookie-slider::before {
    transform: translateX(20px);
    background: #d8edf3;
}

.cookie-switch input:disabled + .cookie-slider {
    background: #243240;
    border-color: #405064;
}

.cookie-switch input:disabled + .cookie-slider::before {
    background: #dce2eb;
}

.cookie-pref-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cookie-settings-status {
    min-height: 18px;
    color: #c8d0dd;
    font-size: 0.84rem;
}

.cookie-settings-status.error {
    color: #dfb5b7;
}

.cookie-banner {
    position: fixed;
    right: 16px;
    bottom: 14px;
    width: min(340px, calc(100vw - 24px));
    border-radius: 12px;
    border: 1px solid #323949;
    background: #151922;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.52);
    padding: 13px;
    z-index: 420;
    display: grid;
    gap: 8px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.cookie-banner-hide {
    opacity: 0;
    transform: translateY(8px);
}

.cookie-banner h3 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.cookie-banner p {
    margin: 0;
    color: #a7b0bd;
    font-size: 0.84rem;
    line-height: 1.45;
}

.cookie-banner p a {
    color: #c8e9ea;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cookie-banner-actions .button {
    height: 34px;
    font-size: 0.78rem;
    padding: 0 10px;
}

/* Chat */

body.page-chat {
    overflow: hidden;
    background: #101114;
}

.chat-shell {
    height: 100vh;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
}

.chat-sidebar {
    background: #181a1f;
    border-right: 1px solid #2a2d34;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    min-height: 0;
}

.sidebar-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 2px 6px;
}

.sidebar-head-row h2 {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a93a1;
}

.history-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding-right: 2px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.sidebar-credit {
    margin-top: auto;
    min-height: 30px;
    border-top: 1px solid #2b2f37;
    padding: 8px 2px 2px;
    color: #8b93a0;
    font-size: 0.7rem;
    line-height: 1.35;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

.sidebar-credit:hover {
    color: #cfd6e1;
}

.history-item {
    width: 100%;
    height: 42px;
    flex: 0 0 42px;
    min-height: 42px;
    max-height: 42px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #b8c0cc;
    padding: 0 7px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.history-item:focus-visible {
    outline: none;
    border-color: #4a6f78;
    box-shadow: 0 0 0 2px rgba(74, 111, 120, 0.3);
}

.history-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.history-item .title {
    display: block;
    flex: 1;
    min-width: 0;
    font-size: 0.78rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item .meta {
    display: none;
    color: #818b99;
    font-size: 0.68rem;
}

.history-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin-left: auto;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #7e8794;
    font-size: 0.76rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.72;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.history-delete:hover {
    background: #303640;
    color: #e9edf3;
    opacity: 1;
}

.history-delete:focus-visible {
    outline: none;
    background: #303640;
    color: #e9edf3;
    opacity: 1;
}

.history-item:hover .history-delete,
.history-item.active .history-delete {
    opacity: 1;
}

.history-item:hover,
.history-item.active {
    background: #242830;
    border-color: #3b414b;
    color: #edf0f5;
}

.history-item.history-item-promoted {
    animation: history-promote 260ms ease;
}

.history-item-ghost {
    pointer-events: none;
    opacity: 0.78;
}

/* Cross-browser rendering balance for sidebar thread boxes */
@supports (-moz-appearance: none) {
    .history-item {
        border-color: rgba(72, 79, 92, 0.28);
    }

    .history-item:hover,
    .history-item.active {
        background: #252a33;
        border-color: #434b58;
    }

    .history-item:focus-visible {
        box-shadow: 0 0 0 2px rgba(77, 116, 130, 0.34);
    }
}

@supports (-webkit-hyphens: none) and (not (-moz-appearance: none)) {
    .history-item {
        border-color: rgba(72, 79, 92, 0.24);
    }

    .history-item:hover,
    .history-item.active {
        background: #242830;
        border-color: #3d4451;
    }
}

.chat-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    min-height: 0;
    background: #101114;
}

.chat-topbar {
    height: 46px;
    border-bottom: 1px solid #282c34;
    margin-bottom: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    padding: 0 12px;
    background: #111318;
}

.chat-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-pill {
    height: 22px;
    padding: 0 9px;
    border: 1px solid #3f464f;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    color: #aeb6c2;
}

.chat-thread-wrap {
    min-height: 0;
    overflow: hidden;
}

.chat-thread {
    height: 100%;
    overflow-y: auto;
    padding: 14px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    width: min(760px, calc(100% - 24px));
    margin: auto;
    border: 1px solid #323842;
    border-radius: 12px;
    background: #1a1f27;
    box-shadow: none;
    padding: 20px;
    text-align: center;
    color: #adb6c3;
    font-size: 0.92rem;
    display: grid;
    gap: 5px;
}

.message-row {
    width: min(860px, calc(100% - 24px));
    margin: 0 auto;
    display: flex;
}

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

.message-row.assistant {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 80%;
    border: 1px solid #363c45;
    border-radius: 14px;
    background: #1d222a;
    color: var(--text);
    padding: 11px 13px;
    white-space: pre-wrap;
    word-break: break-word;
    animation: bubble-in 180ms ease;
}

.message-row.user .message-bubble {
    background: #242a33;
    border-color: #434a55;
}

.message-footer {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-meta {
    font-size: 0.68rem;
    color: #8a93a1;
}

.message-bubble > .message-meta {
    margin-top: 6px;
    display: block;
}

.message-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.message-action {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #3b4350;
    background: #202732;
    color: #aeb8c7;
    font-size: 0.68rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.message-copy {
    width: 22px;
    min-width: 22px;
    padding: 0;
}

.message-copy svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.message-row.user:hover .message-action,
.message-row.user:focus-within .message-action,
.message-row.assistant:hover .message-action,
.message-row.assistant:focus-within .message-action,
.message-bubble:hover .message-action,
.message-bubble:focus-within .message-action {
    opacity: 1;
    pointer-events: auto;
}

.message-action:hover,
.message-action:focus-visible {
    background: #2b3442;
    color: #eef2f8;
    border-color: #4b5666;
    outline: none;
}

.message-action.success {
    color: #dfffe8;
    border-color: #4e8062;
    background: #274132;
}

.message-feedback {
    color: #ffffff !important;
}

.message-feedback svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    overflow: visible;
    opacity: 1;
    visibility: visible;
}

.message-feedback-up svg,
.message-feedback-down svg {
    transform: translateY(0.2px);
}

.message-feedback.active {
    color: #ffffff;
    background: #334256;
    border-color: #5f738e;
}

@media (hover: none), (pointer: coarse) {
    .message-row.assistant .message-action,
    .message-row.user .message-action {
        opacity: 1;
        pointer-events: auto;
    }
}

.typing-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c8ced8;
    opacity: 0.26;
    animation: typing 1.2s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.14s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.28s;
}

.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-120%);
    background: linear-gradient(90deg, transparent, rgba(238, 243, 250, 0.12), transparent);
    animation: shimmer 1.4s linear infinite;
}

.countdown {
    margin-top: 8px;
    display: inline-flex;
    height: 23px;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid #4a5568;
    color: #a7b0bf;
    font-size: 0.71rem;
}

.chat-input-wrap {
    border-top: 1px solid #282c34;
    background: #111318;
    padding: 10px 14px;
}

.chat-input-inner {
    width: min(782px, 100%);
    margin: 0 auto;
}

.chat-hero-form {
    width: min(782px, 100%);
    margin: 0 auto;
    border-radius: 18px;
    border: 1px solid #353b44;
    background: #1b1b1f;
    box-shadow: none;
    padding: 0;
    display: grid;
    gap: 0;
    text-align: left;
    overflow: visible;
}

.chat-hero-form textarea {
    min-height: 92px;
    padding: 14px 18px 10px;
}

.chat-hero-form .hero-controls-row {
    padding: 10px 14px;
}

.chat-hero-form .hero-model-menu {
    z-index: 240;
}

.chat-footer {
    margin-top: 0;
    padding: 9px 14px;
    border-top: 1px solid #282c34;
    background: #111318;
    font-size: 0.8rem;
}

/* Pricing */

body.page-pricing .site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pricing-main {
    flex: 1;
    padding-bottom: 8px;
}

body.page-pricing .site-footer {
    margin-top: auto;
}

.pricing-main h1 {
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    letter-spacing: -0.03em;
}

body.page-pricing .lead {
    width: 100%;
    max-width: none;
    margin: 12px 0 0;
    color: #ffffff;
    text-align: justify;
    text-justify: inter-word;
    text-align-last: left;
}

.pricing-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pricing-card {
    border-radius: 14px;
    border: 1px solid #333b47;
    background: #171d26;
    box-shadow: none;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pricing-card.featured {
    border-color: #42505f;
}

.pricing-card.elite {
    border-color: #474f5d;
}

.pricing-card.unavailable {
    opacity: 0.62;
}

.tier-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.badge {
    border-radius: 999px;
    border: 1px solid #3a4250;
    padding: 3px 8px;
    font-size: 0.72rem;
    color: #b3bac6;
}

.badge.muted {
    color: #8c96a5;
}

.price {
    font-size: 1.95rem;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.price span {
    font-size: 0.9rem;
    color: var(--text-soft);
}

.pricing-card ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.pricing-card .note {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.pricing-card .button {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-apply-free .apply-free-grid,
.page-apply-pro .apply-free-grid,
.page-apply-affluent .apply-free-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-apply-free .apply-free-result,
.page-apply-pro .apply-free-result,
.page-apply-affluent .apply-free-result {
    grid-column: span 2;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    gap: 16px;
    padding: 20px;
}

.apply-free-logo {
    width: min(440px, 100%);
    height: auto;
    object-fit: contain;
}

.apply-free-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.28;
    letter-spacing: -0.01em;
}

.apply-free-description {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.5;
    width: min(760px, 100%);
}

/* Modal */

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.66);
    padding: 20px;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    width: min(520px, 100%);
    border-radius: 14px;
    border: 1px solid #373f4c;
    background: #1a202a;
    padding: 18px;
    display: grid;
    gap: 10px;
    box-shadow: none;
}

.modal h3 {
    font-size: 1.12rem;
}

.modal p {
    color: var(--text-soft);
}

/* Login */

.login-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-main {
    flex: 1;
    display: grid;
    place-items: center;
    padding-bottom: 24px;
}

.login-card {
    width: min(460px, 100%);
    border-radius: 14px;
    border: 1px solid #343b47;
    background: #171d26;
    box-shadow: none;
    padding: 22px;
    display: grid;
    gap: 11px;
}

.login-card h1 {
    font-size: 1.9rem;
    letter-spacing: -0.03em;
}

.login-card label {
    font-size: 0.82rem;
    color: var(--text-soft);
}

.tiny-link {
    font-size: 0.81rem;
    color: var(--text-dim);
}

.tiny-link a {
    color: #a6b5cb;
}

.login-message {
    min-height: 18px;
    color: var(--danger);
    font-size: 0.84rem;
}

.login-notice {
    min-height: 18px;
    color: #8fbe9f;
    font-size: 0.84rem;
}

/* Leave Comment */

.comment-main {
    width: min(860px, 100%);
    margin: 0 auto;
    padding-bottom: 10px;
}

.comment-card {
    border-radius: 14px;
    border: 1px solid #333b47;
    background: #171d26;
    box-shadow: none;
    padding: 20px;
    display: grid;
    gap: 12px;
}

.comment-card h1 {
    font-size: clamp(1.8rem, 3.8vw, 2.4rem);
    letter-spacing: -0.03em;
}

.comment-form {
    display: grid;
    gap: 9px;
}

.comment-form label {
    font-size: 0.82rem;
    color: var(--text-soft);
}

.comment-form textarea {
    width: 100%;
    min-height: calc(12 * 1.35em + 24px);
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    background: #131822;
    color: var(--text);
    padding: 10px 12px;
    font-size: 0.92rem;
    font-family: var(--font-ui);
    line-height: 1.35;
    outline: none;
    resize: vertical;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.comment-form textarea::placeholder {
    color: #7f8897;
}

.comment-form textarea:focus {
    border-color: #485364;
    box-shadow: 0 0 0 3px rgba(72, 83, 100, 0.26);
}

.comment-feedback {
    border-radius: 10px;
    border: 1px solid #374154;
    background: #171e29;
    padding: 10px 12px;
    display: grid;
    gap: 4px;
    font-size: 0.86rem;
}

.comment-feedback p {
    margin: 0;
}

.comment-feedback-error {
    border-color: #5b3a44;
    background: #251920;
    color: #f0ccd5;
}

.comment-feedback-success {
    border-color: #3f5e4b;
    background: #18241d;
    color: #d2f0dd;
}

/* Logs */

.logs-main {
    display: grid;
    gap: 12px;
    padding-bottom: 8px;
}

.logs-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.logs-head h1 {
    font-size: clamp(1.6rem, 3.8vw, 2.35rem);
    letter-spacing: -0.03em;
}

.logs-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.logs-search input[type="text"] {
    width: min(300px, 76vw);
    height: 38px;
}

.logs-table-wrap {
    border-radius: 14px;
    border: 1px solid #343b47;
    background: #171d26;
    overflow: auto;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.logs-table th,
.logs-table td {
    text-align: left;
    vertical-align: top;
    padding: 10px 12px;
    border-bottom: 1px solid #2b3340;
    font-size: 0.82rem;
}

.logs-table th {
    color: #cfd7e2;
    background: #1b212c;
    position: sticky;
    top: 0;
    z-index: 2;
}

.logs-table td {
    color: #aeb7c4;
}

.logs-table tr:hover td {
    background: #1b212c;
}

.logs-table code {
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.78rem;
    color: #d5dde9;
    background: #121721;
    border: 1px solid #313a48;
    border-radius: 6px;
    padding: 1px 6px;
}

.log-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #3d4554;
    background: #232a36;
    color: #d2d9e3;
    padding: 1px 8px;
    font-size: 0.72rem;
    line-height: 1.4;
}

.log-badge.muted {
    color: #aab3c0;
    border-color: #39414f;
    background: #212732;
}

.logs-raw-row td {
    background: #151b24;
}

.logs-raw-row details {
    color: #b7c0ce;
}

.logs-raw-row summary {
    cursor: pointer;
    user-select: none;
}

.logs-raw-row pre {
    margin: 8px 0 0;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #323b4a;
    background: #10151d;
    color: #c8d0dc;
    font-size: 0.74rem;
    line-height: 1.5;
    overflow: auto;
}

/* Motion */

@keyframes typing {
    0%,
    80%,
    100% {
        opacity: 0.2;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

@keyframes shimmer {
    to {
        transform: translateX(120%);
    }
}

@keyframes bubble-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes history-promote {
    from {
        transform: translateY(-5px);
        background: #2a2f3a;
        border-color: #556273;
    }
    to {
        transform: translateY(0);
        background: transparent;
        border-color: transparent;
    }
}

/* Responsive */

@media (max-width: 1024px) {
    .strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-explain {
        grid-template-columns: 1fr;
    }

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

    .page-apply-free .apply-free-grid,
    .page-apply-pro .apply-free-grid,
    .page-apply-affluent .apply-free-grid {
        grid-template-columns: 1fr;
    }

    .page-apply-free .apply-free-result,
    .page-apply-pro .apply-free-result,
    .page-apply-affluent .apply-free-result {
        grid-column: auto;
    }

    .chat-shell {
        grid-template-columns: 210px minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    .site-shell {
        padding: 14px;
    }

    .top-nav {
        height: auto;
        padding: 10px;
        flex-wrap: wrap;
    }

    .landing-main {
        min-height: auto;
    }

    .hero {
        padding-top: 22px;
    }

    .hero-input-layer {
        min-height: 92px;
    }

    .hero-form textarea {
        min-height: 92px;
        font-size: 1rem;
        padding: 14px 14px 10px;
    }

    .hero-controls-row {
        padding: 9px 10px;
    }

    .hero-controls-right {
        gap: 12px;
    }

    .hero-control {
        font-size: 0.85rem;
    }

    .hero-model-menu {
        left: -18px;
        width: min(246px, calc(100vw - 36px));
    }

    .hero-voice-submit {
        width: 32px;
        min-width: 32px;
        height: 32px;
    }

    .hero-go-submit {
        width: 32px;
        min-width: 32px;
        height: 32px;
        font-size: 0.7rem;
    }

    .hero-plus {
        width: 30px;
        min-width: 30px;
        height: 30px;
    }

    .footer-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px;
    }

    body.page-chat {
        overflow: auto;
    }

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

    .chat-sidebar {
        order: 3;
        border-right: 0;
        border-top: 1px solid #2a2d34;
    }

    .history-list {
        max-height: 170px;
    }

    .chat-topbar {
        height: auto;
        flex-wrap: wrap;
        padding: 10px 12px;
    }

    .chat-hero-form textarea {
        min-height: 92px;
        font-size: 1rem;
        padding: 14px 14px 10px;
    }

    .chat-hero-form .hero-controls-row {
        padding: 9px 10px;
    }

    .chat-hero-form .hero-controls-right {
        gap: 12px;
    }

    .chat-hero-form .hero-control {
        font-size: 0.85rem;
    }

    .chat-hero-form .hero-model-menu {
        width: min(246px, calc(100vw - 36px));
    }

    .message-bubble {
        max-width: 92%;
    }

    .cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
    }

    .logs-table {
        min-width: 760px;
    }
}
