:root {
    color-scheme: dark;
    --background: #090b10;
    --surface: rgba(21, 24, 33, 0.88);
    --surface-strong: #171a23;
    --line: rgba(255, 255, 255, 0.10);
    --text: #f5f6f8;
    --muted: #a6aab5;
    --accent: #8ee6c4;
    --accent-strong: #62d7aa;
    --danger: #ff8f94;
    --radius: 24px;
    --department-banner-height: clamp(80px, 16.667vw, 180px);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    overflow-x: hidden;
    background:
            radial-gradient(circle at top, rgba(53, 73, 87, 0.28), transparent 38rem),
            var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

[hidden] {
    display: none !important;
}

.background-orb {
    position: fixed;
    z-index: -1;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.14;
}

.orb-one {
    top: -8rem;
    left: -7rem;
    background: #57dfb0;
}

.orb-two {
    right: -8rem;
    bottom: -10rem;
    background: #708fff;
}

.department-banner {
    width: 100%;
    height: var(--department-banner-height);
    overflow: hidden;
    background: #002733;
}

.department-banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.app-shell {
    min-height: calc(100vh - var(--department-banner-height));
}

.token-view {
    display: grid;
    min-height: calc(100vh - var(--department-banner-height));
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0;
    grid-template-rows: auto 1fr;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(142, 230, 196, 0.45);
    border-radius: 12px;
    background: rgba(142, 230, 196, 0.10);
    color: var(--accent);
    font-size: 0.8rem;
    letter-spacing: 0;
}

.token-card {
    width: min(580px, 100%);
    margin: auto;
    padding: clamp(32px, 6vw, 62px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(27, 31, 41, 0.95), rgba(15, 18, 25, 0.92));
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(20px);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(2.5rem, 8vw, 4.7rem);
    font-weight: 690;
    letter-spacing: -0.065em;
    line-height: 0.96;
}

h1 span {
    color: var(--muted);
}

.intro {
    max-width: 44ch;
    margin: 28px 0 36px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

label {
    display: block;
    margin-bottom: 9px;
    color: #d9dbe1;
    font-size: 0.82rem;
    font-weight: 650;
}

.credential-field {
    margin-bottom: 18px;
}

.text-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: 0;
    padding: 15px 16px;
    background: rgba(0, 0, 0, 0.20);
    color: var(--text);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.text-input:focus {
    border-color: rgba(142, 230, 196, 0.65);
    box-shadow: 0 0 0 4px rgba(142, 230, 196, 0.08);
}

.secret-input {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.20);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.secret-input:focus-within {
    border-color: rgba(142, 230, 196, 0.65);
    box-shadow: 0 0 0 4px rgba(142, 230, 196, 0.08);
}

.secret-input input {
    min-width: 0;
    flex: 1;
    padding: 15px 16px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.secret-input input::placeholder,
.text-input::placeholder,
textarea::placeholder,
.model-picker input::placeholder {
    color: #6f7480;
}

.icon-button {
    border: 0;
    padding: 0 16px;
    background: transparent;
    color: var(--muted);
    font-size: 0.75rem;
}

.privacy-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 11px 2px 24px;
    color: #747a87;
    font-size: 0.74rem;
}

.privacy-note span {
    color: var(--accent);
    font-size: 0.45rem;
}

.primary-button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    border: 0;
    border-radius: 14px;
    padding: 15px 18px;
    background: var(--accent);
    color: #092018;
    font-weight: 750;
    transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover:not(:disabled) {
    background: var(--accent-strong);
    transform: translateY(-1px);
}

.form-error {
    margin: -10px 0 16px;
    color: var(--danger);
    font-size: 0.82rem;
    line-height: 1.45;
}

.chat-view {
    display: grid;
    min-height: 100vh;
    grid-template-rows: auto 1fr auto;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--line);
    padding: 15px clamp(20px, 4vw, 52px);
    background: rgba(9, 11, 16, 0.78);
    backdrop-filter: blur(20px);
}

.brand.compact {
    color: var(--text);
    letter-spacing: 0;
    text-transform: none;
}

.brand.compact > div {
    display: grid;
    gap: 3px;
}

.connection-state {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 500;
}

.connection-state i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.header-actions {
    display: flex;
    align-items: end;
    gap: 10px;
}

.model-picker {
    display: grid;
    width: min(300px, 32vw);
    margin: 0 8px 0 0;
    gap: 4px;
}

.model-picker span {
    color: var(--muted);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-picker input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: 0;
    padding: 9px 11px;
    background: var(--surface-strong);
    color: var(--text);
    font-size: 0.78rem;
}

.model-picker input:focus {
    border-color: rgba(142, 230, 196, 0.55);
}

.secondary-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 13px;
    background: transparent;
    color: var(--muted);
    font-size: 0.75rem;
}

.button-link {
    text-decoration: none;
}

.secondary-button:hover {
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--text);
}

.secondary-button.danger:hover {
    border-color: rgba(255, 143, 148, 0.35);
    color: var(--danger);
}

.messages {
    width: 100%;
    margin: 0;
    padding: 44px 0 160px;
}

.chat-workspace {
    display: grid;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    grid-template-columns: minmax(0, 850px) 280px;
    gap: 36px;
}

.usage-panel {
    position: sticky;
    top: 110px;
    align-self: start;
    margin-top: 44px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    background: var(--surface);
}

.usage-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.usage-heading .eyebrow {
    margin-bottom: 7px;
}

.usage-heading h2 {
    margin: 0;
    font-size: 1.05rem;
}

.usage-heading .icon-button {
    padding: 5px;
}

.team-usage-heading {
    margin: 20px 0 10px;
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.team-invocations {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 8px;
    list-style: none;
}

.team-invocations li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.78rem;
}

.team-invocations strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.statistics-status {
    margin: 14px 0 0;
    color: var(--danger);
    font-size: 0.75rem;
    line-height: 1.45;
}

.empty-state {
    display: grid;
    min-height: 50vh;
    place-items: center;
    align-content: center;
    text-align: center;
}

.tool-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 18px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: var(--accent);
    font-size: 1.7rem;
}

.empty-state h2 {
    margin: 0;
    font-size: clamp(1.55rem, 4vw, 2.35rem);
    letter-spacing: -0.045em;
}

.empty-state > p:not(.eyebrow) {
    max-width: 55ch;
    margin: 14px auto 24px;
    color: var(--muted);
    line-height: 1.6;
}

.prompt-suggestion {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 11px 17px;
    background: rgba(142, 230, 196, 0.06);
    color: #c8eee0;
}

.prompt-suggestion:hover {
    border-color: rgba(142, 230, 196, 0.38);
}

.message-row {
    display: grid;
    margin-bottom: 26px;
    grid-template-columns: 38px 1fr;
    gap: 14px;
}

.message-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
}

.message-row.assistant .message-avatar {
    border-color: rgba(142, 230, 196, 0.3);
    background: rgba(142, 230, 196, 0.08);
    color: var(--accent);
}

.generator-link {
    display: block;
    margin-top: 18px;
    color: var(--muted);
    text-align: center;
}

.generated-token {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.generated-token label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.generated-token textarea {
    width: 100%;
    resize: none;
    overflow-wrap: anywhere;
}

.generator-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.token-validity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    color: var(--muted);
}

.token-validity strong {
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.full-width {
    width: 100%;
    margin-top: 12px;
}

.message-body {
    padding-top: 5px;
}

.message-author {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
}

.message-content {
    display: grid;
    margin: 0;
    gap: 12px;
    color: #e7e8ec;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.message-row.user .message-content {
    white-space: pre-wrap;
}

.message-content p,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content ol,
.message-content ul,
.message-content pre {
    margin: 0;
}

.message-content h3,
.message-content h4,
.message-content h5 {
    color: var(--text);
    line-height: 1.3;
}

.message-content ol,
.message-content ul {
    display: grid;
    padding-left: 24px;
    gap: 6px;
}

.message-content :not(pre) > code {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.06);
    color: #c8eee0;
    font-size: 0.9em;
}

.code-block {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #11141b;
}

.code-language {
    display: block;
    border-bottom: 1px solid var(--line);
    padding: 7px 12px;
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.message-content pre {
    overflow-x: auto;
    padding: 16px;
    color: #e7e8ec;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
    line-height: 1.55;
    white-space: pre;
}

.message-content pre code {
    font: inherit;
}

.typing {
    display: flex;
    gap: 5px;
    padding-top: 9px;
}

.typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    animation: pulse 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
    animation-delay: 160ms;
}

.typing span:nth-child(3) {
    animation-delay: 320ms;
}

@keyframes pulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.75); }
    40% { opacity: 1; transform: scale(1); }
}

.composer-wrap {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 25px 20px 18px;
    background: linear-gradient(transparent, var(--background) 32%);
}

.composer {
    display: flex;
    width: min(850px, 100%);
    margin: 0 auto;
    align-items: end;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 11px 11px 11px 17px;
    background: rgba(24, 27, 36, 0.96);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.composer-wordmark {
    position: absolute;
    top: 25px;
    right: clamp(20px, 4vw, 52px);
    width: clamp(120px, 12vw, 160px);
    height: auto;
    opacity: 0.72;
    pointer-events: none;
}

.composer:focus-within {
    border-color: rgba(142, 230, 196, 0.43);
}

.composer textarea {
    max-height: 160px;
    min-height: 28px;
    flex: 1;
    resize: none;
    border: 0;
    outline: 0;
    padding: 4px 0;
    background: transparent;
    color: var(--text);
    line-height: 1.45;
}

.send-button {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 11px;
    background: var(--accent);
    color: #092018;
    font-size: 1.1rem;
    font-weight: 850;
}

.composer-hint {
    margin: 7px auto 0;
    color: #626773;
    font-size: 0.66rem;
    text-align: center;
}

.composer-error {
    width: min(850px, 100%);
    margin: 0 auto 8px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 143, 148, 0.22);
    border-radius: 10px;
    background: rgba(255, 143, 148, 0.07);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.docs-shell {
    width: min(980px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0 80px;
}

.docs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(64px, 10vw, 110px);
}

.docs-hero {
    max-width: 760px;
}

.docs-hero h1 {
    font-size: clamp(3rem, 9vw, 6.5rem);
}

.docs-nav {
    display: flex;
    margin: 30px 0 70px;
    flex-wrap: wrap;
    gap: 10px;
}

.docs-nav a {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 13px;
    color: var(--muted);
    font-size: 0.78rem;
    text-decoration: none;
}

.docs-nav a:hover,
.docs-section a {
    color: var(--accent);
}

.docs-section {
    margin-top: 28px;
    scroll-margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(26px, 5vw, 48px);
    background: rgba(21, 24, 33, 0.72);
}

.docs-section h2 {
    margin: 0 0 18px;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    letter-spacing: -0.04em;
}

.docs-section h3 {
    margin: 30px 0 10px;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.docs-section p {
    color: var(--muted);
    line-height: 1.65;
}

.docs-grid {
    display: grid;
    margin: 24px 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.docs-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.16);
}

.docs-card h3 {
    margin-top: 0;
    color: var(--text);
}

.docs-card p {
    margin-bottom: 0;
}

.endpoint-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.endpoint-heading h2 {
    margin: 0;
}

.method {
    display: inline-block;
    min-width: 52px;
    border-radius: 7px;
    padding: 5px 8px;
    color: #092018;
    font-size: 0.68rem;
    font-weight: 800;
    text-align: center;
}

.method.get {
    background: var(--accent);
}

.method.post {
    background: #8fb2ff;
}

.docs-section pre {
    overflow-x: auto;
    margin: 12px 0 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    background: #080a0e;
    color: #d9e3df;
    font-size: 0.82rem;
    line-height: 1.6;
}

.docs-section :not(pre) > code {
    border-radius: 5px;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.07);
    color: #dce3e0;
}

.callout {
    margin-top: 24px;
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    padding: 14px 17px;
    background: rgba(142, 230, 196, 0.07);
    color: var(--muted);
    line-height: 1.6;
}

.callout.warning {
    border-left-color: #ffd58f;
    background: rgba(255, 213, 143, 0.07);
}

.endpoint-list {
    display: grid;
    margin: 22px 0;
    gap: 10px;
}

.endpoint-list > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-table {
    display: grid;
    border-top: 1px solid var(--line);
}

.status-table > div {
    display: grid;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    grid-template-columns: 120px 1fr;
    gap: 16px;
    color: var(--muted);
}

@media (max-width: 760px) {
    .chat-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .model-picker {
        width: 100%;
        margin-right: 0;
    }

    .secondary-button {
        flex: 1;
    }

    .messages {
        padding-top: 28px;
    }

    .chat-workspace {
        width: min(100% - 40px, 850px);
        grid-template-columns: 1fr;
        gap: 0;
    }

    .usage-panel {
        position: static;
        order: -1;
        margin-top: 24px;
    }

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

    .status-table > div {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

@media (max-width: 1279px) {
    .composer-wordmark {
        display: none;
    }
}
