:root {
    --bg: #10131d;
    --sidebar: #141722;
    --panel: #191d2a;
    --panel-light: #202536;
    --border: #2b3042;
    --text: #f3f4fa;
    --muted: #969db2;
    --purple: #a78bfa;
    --purple-bright: #8b6cf6;
    --green: #75e0b0;
    --blue: #7db9ff;
    --orange: #ffbd83;
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 3px;
}

a {
    color: var(--purple);
}

.hidden {
    display: none !important;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 27px 17px 15px;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 7px;
    color: var(--text);
    text-decoration: none;
    font-family: "Space Grotesk", sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.7px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #a78bfa, #7050e8);
    font-size: 19px;
    position: relative;
}

.brand-mark span {
    position: absolute;
    top: -6px;
    right: -5px;
    font-size: 11px;
    color: var(--green);
}

.brand-ai {
    color: var(--purple);
}

.workspace-label {
    color: #737b92;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.7px;
    margin: 43px 10px 13px;
}

.navigation {
    display: grid;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #a7adc0;
    text-align: left;
    transition: .2s ease;
}

.nav-item>span {
    width: 21px;
    text-align: center;
    font-size: 19px;
}

.nav-item:hover {
    background: #1e2231;
    color: white;
}

.nav-item.active {
    background: #28243c;
    border-color: #39314f;
    color: #d7caff;
}

.sidebar-spacer {
    flex: 1;
    min-height: 30px;
}

.local-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 10px;
    background: #1b202d;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.local-icon {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #23352f;
    color: var(--green);
    font-size: 18px;
}

.local-card strong,
.profile-copy strong {
    display: block;
    font-size: 11px;
}

.local-card p,
.profile-copy span {
    margin: 2px 0 0;
    display: block;
    font-size: 10px;
    color: var(--muted);
}

.status-dot,
.tiny-dot {
    height: 7px;
    width: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #f0b36b;
    margin-left: auto;
}

.status-dot.connected,
.tiny-dot {
    background: var(--green);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 4px 3px;
    margin-top: 15px;
    border-top: 1px solid var(--border);
}

.avatar {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 11px;
    background: linear-gradient(135deg, #555e83, #31374d);
    font-weight: 700;
    font-size: 11px;
}

.profile-copy {
    flex: 1;
}

.muted {
    color: var(--muted);
}

.main-area {
    margin-left: 250px;
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 70px;
    border-bottom: 1px solid var(--border);
    padding: 0 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(16, 19, 29, .92);
}

.breadcrumb {
    color: var(--muted);
    font-size: 12px;
}

.breadcrumb span {
    padding: 0 10px;
    color: #51586d;
}

.breadcrumb strong {
    color: #e8eaf4;
    font-weight: 500;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 17px;
}

.privacy-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #aeb8c8;
}

.privacy-pill .tiny-dot {
    margin: 0;
}

.mobile-menu {
    display: none;
    color: white;
    background: transparent;
    border: 0;
    font-size: 20px;
}

.content {
    max-width: 1350px;
    padding: 43px 44px 32px;
    margin: 0 auto;
}

.welcome-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 31px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b5a1ff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
}

.sparkle {
    font-size: 17px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.8px;
}

h1 {
    font-size: clamp(34px, 3.7vw, 49px);
    line-height: 1.14;
    margin-bottom: 15px;
    font-weight: 600;
}

.gradient-text {
    background: linear-gradient(95deg, #b8a4ff 0%, #8b91ff 48%, #77d9ca 100%);
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
}

.hero-subtitle,
.section-heading p,
.workspace-header>p {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 0;
}

.hero-badge {
    border: 1px solid #39334d;
    border-radius: 100px;
    padding: 8px 13px;
    color: #bfb3e9;
    font-size: 10px;
    white-space: nowrap;
    margin-top: 15px;
    background: #1c1b2b;
}

.hero-badge span {
    color: var(--purple);
    margin-right: 6px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 39px;
}

.stat-card {
    border: 1px solid var(--border);
    background: linear-gradient(140deg, #1b1f2d, #171a26);
    border-radius: var(--radius);
    padding: 19px 19px 16px;
    min-width: 0;
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #b1b7c9;
    font-size: 12px;
    gap: 8px;
}

.stat-icon {
    width: 33px;
    height: 33px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 16px;
}

.purple,
.icon-purple {
    color: var(--purple);
    background: #30274b;
}

.green,
.icon-green {
    color: var(--green);
    background: #203d37;
}

.orange,
.icon-orange {
    color: var(--orange);
    background: #403024;
}

.icon-blue {
    color: var(--blue);
    background: #24364e;
}

.stat-number {
    margin-top: 11px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 31px;
    font-weight: 600;
    letter-spacing: -1.4px;
}

.stat-number.small-stat {
    font-size: 25px;
    letter-spacing: -.8px;
}

.stat-card p {
    color: var(--muted);
    font-size: 11px;
    margin: 1px 0 0;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 17px;
}

.section-heading h2 {
    font-size: 20px;
    margin-bottom: 3px;
}

.section-heading p {
    font-size: 12px;
}

.section-count {
    color: #8e96ab;
    font-size: 10px;
    letter-spacing: 1px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
    padding: 21px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    transition: border-color .2s, transform .2s, background .2s;
}

.tool-card:hover {
    border-color: #65538c;
    background: #1e2231;
    transform: translateY(-2px);
}

.tool-icon {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border-radius: 12px;
    font-size: 22px;
    margin-bottom: 17px;
}

.tool-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.3px;
    color: #9b91b9;
    margin-bottom: 5px;
}

.tool-card strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 17px;
    font-weight: 600;
}

.tool-card p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
    margin: 8px 0 16px;
    max-width: 350px;
}

.tool-link {
    margin-top: auto;
    color: #c5b5ff;
    font-size: 11px;
    font-weight: 600;
}

.tool-link span {
    padding-left: 5px;
}

.bottom-banner {
    display: flex;
    align-items: center;
    gap: 17px;
    margin-top: 25px;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid #38334d;
    background:
        radial-gradient(ellipse at 0% 50%, rgba(124, 91, 217, .15), transparent 50%),
        #1b1b2b;
}

.banner-symbol {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid #4b416b;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: #b9a4ff;
    font-size: 23px;
}

.banner-copy {
    flex: 1;
    min-width: 0;
}

.banner-copy strong {
    font-size: 13px;
}

.banner-copy p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.button {
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: .2s;
    border: 1px solid transparent;
}

.button-primary {
    color: white;
    background: linear-gradient(110deg, #8865ed, #7153d7);
    box-shadow: 0 4px 15px rgba(112, 83, 215, .12);
}

.button-primary:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.button-outline {
    color: #d4d8e7;
    background: #1c202d;
    border-color: #34394b;
}

.button-outline:hover {
    border-color: #7865b0;
    background: #242438;
}

.button-light {
    color: #171526;
    background: #e5dcff;
    white-space: nowrap;
}

.button-light:hover {
    background: white;
}

.button-small {
    padding: 7px 11px;
    font-size: 11px;
}

.disclaimer {
    color: #70778c;
    font-size: 10px;
    text-align: center;
    margin: 23px 0 0;
}

/* Writing workspace */

.workspace-header {
    margin-bottom: 25px;
}

.back-link {
    background: none;
    border: 0;
    color: #b7a4ff;
    padding: 0;
    margin-bottom: 27px;
    font-size: 12px;
}

.workspace-header .eyebrow {
    margin-bottom: 9px;
}

.workspace-header h1 {
    font-size: 37px;
    margin-bottom: 8px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    min-width: 0;
}

.panel-heading,
.output-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.panel-kicker {
    font-size: 9px;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: #aa96ef;
}

.panel h2 {
    font-size: 19px;
    margin: 4px 0 0;
}

.panel-icon {
    color: #b6a1ff;
    font-size: 24px;
}

label {
    display: block;
    color: #e1e4ee;
    font-size: 11px;
    font-weight: 600;
    margin: 17px 0 7px;
}

.optional {
    font-size: 8px;
    letter-spacing: .8px;
    color: #8189a0;
    margin-left: 6px;
}

input,
textarea,
select {
    display: block;
    width: 100%;
    background: #121621;
    color: #edf0f9;
    border: 1px solid #30364a;
    border-radius: 9px;
    padding: 11px 12px;
    font-size: 12px;
    outline: none;
    transition: border-color .2s;
}

input::placeholder,
textarea::placeholder {
    color: #697187;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #8871d0;
}

textarea {
    resize: vertical;
    min-height: 125px;
    line-height: 1.8;
}

select {
    cursor: pointer;
}

.field-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    font-size: 9px;
    color: #858da3;
}

.two-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.generate-button {
    width: 100%;
    margin-top: 24px;
    padding: 13px;
    min-height: 45px;
}

.button-arrow {
    margin-left: auto;
}

.form-note {
    color: #7e879e;
    font-size: 10px;
    line-height: 1.7;
    margin: 12px 0 0;
}

.form-error {
    color: #ffaaa8;
    background: #3c222b;
    border: 1px solid #68404a;
    padding: 10px;
    border-radius: 8px;
    margin-top: 14px;
    font-size: 11px;
}

.output-panel {
    display: flex;
    flex-direction: column;
}

.result-status {
    border-radius: 6px;
    border: 1px solid #3c4051;
    background: #232737;
    padding: 5px 7px;
    color: #9da6bc;
    font-size: 8px;
    letter-spacing: .8px;
    white-space: nowrap;
}

.result-status.ready {
    color: var(--green);
    background: #1b302c;
    border-color: #33574a;
}

.empty-output,
.loading-output {
    flex: 1;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 12px;
}

.empty-art {
    width: 95px;
    height: 95px;
    display: grid;
    place-items: center;
    position: relative;
    margin-bottom: 23px;
    border: 1px solid #39334f;
    border-radius: 26px;
    background: radial-gradient(circle, #30284b, #211e31);
    color: #c1adff;
    font-size: 39px;
}

.empty-art i,
.empty-art b {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    top: 15px;
    right: 16px;
}

.empty-art b {
    background: #9a86fa;
    top: auto;
    right: auto;
    bottom: 15px;
    left: 17px;
    width: 5px;
    height: 5px;
}

.empty-output h3,
.loading-output h3 {
    font-size: 17px;
    margin-bottom: 9px;
}

.empty-output>p,
.loading-output>p {
    max-width: 285px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.empty-tips {
    color: #b1b8cb;
    font-size: 10px;
    margin-top: 11px;
}

.empty-tips span {
    color: var(--green);
    margin-right: 7px;
}

.loader {
    width: 36px;
    height: 36px;
    border: 3px solid #37314e;
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin-bottom: 23px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-output {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    color: #8f97ad;
    font-size: 9px;
    letter-spacing: .7px;
}

.result-type {
    color: #c4b4ff;
    font-weight: 700;
}

.result-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #e2e5ef;
    font-size: 12px;
    line-height: 1.9;
    padding: 18px 0;
    flex: 1;
    min-height: 230px;
    max-height: 600px;
    overflow-y: auto;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.result-footnote {
    color: #8089a0;
    font-size: 10px;
    line-height: 1.7;
    margin: 13px 0 0;
}

/* Settings */

.settings-panel {
    max-width: 750px;
}

.settings-intro {
    display: flex;
    gap: 15px;
    align-items: center;
}

.settings-intro .tool-icon {
    flex-shrink: 0;
    margin: 0;
}

.settings-intro h2 {
    font-size: 20px;
    margin: 0 0 5px;
}

.settings-intro p,
.settings-help {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.settings-callout {
    background: #202438;
    border: 1px solid #3c3b5a;
    border-radius: 10px;
    padding: 14px;
    margin-top: 24px;
}

.settings-callout strong {
    color: #d4c6ff;
    font-size: 12px;
}

.settings-callout p {
    color: #aab1c6;
    font-size: 11px;
    line-height: 1.8;
    margin: 5px 0 0;
}

.settings-help {
    margin-top: 8px;
    line-height: 1.8;
}

.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 19px;
}

.connection-message {
    margin-top: 15px;
    padding: 11px;
    background: #222638;
    border: 1px solid #363c51;
    border-radius: 9px;
    color: #b5bdd1;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.connection-message.success {
    color: var(--green);
    border-color: #365c4c;
    background: #1d302b;
}

.connection-message.error {
    color: #ffb1a7;
    border-color: #694047;
    background: #39232c;
}

.divider-line {
    border-top: 1px solid var(--border);
    margin: 25px 0;
}

.settings-panel h3 {
    font-size: 17px;
}

.setup-steps {
    padding-left: 21px;
    color: #aeb5c8;
    font-size: 12px;
    line-height: 2;
}

.setup-steps li {
    padding-left: 4px;
    margin-bottom: 6px;
}

.setup-steps code {
    color: #c9baff;
    background: #28243a;
    border-radius: 5px;
    padding: 3px 5px;
}

/* Toast */

.toast {
    position: fixed;
    z-index: 30;
    bottom: 22px;
    left: 50%;
    transform: translate(-50%, 15px);
    padding: 11px 17px;
    border-radius: 10px;
    border: 1px solid #47415f;
    background: #28243b;
    color: #eee9ff;
    box-shadow: 0 10px 35px #0005;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: .2s;
    max-width: calc(100vw - 30px);
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Responsive layout */

@media (min-width: 1500px) {
    .content {
        padding-top: 55px;
    }
}

@media (max-width: 1100px) {
    .sidebar {
        width: 220px;
        min-width: 220px;
    }

    .main-area {
        margin-left: 220px;
    }

    .content {
        padding: 32px 25px;
    }

    .topbar {
        padding: 0 25px;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .empty-output,
    .loading-output {
        min-height: 260px;
    }
}

@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 15px 0 50px #0007;
    }

    .main-area {
        margin-left: 0;
    }

    .topbar {
        height: 62px;
        padding: 0 17px;
        gap: 12px;
    }

    .mobile-menu {
        display: block;
    }

    .breadcrumb {
        flex: 1;
    }

    .topbar-right {
        gap: 10px;
    }

    .privacy-pill {
        display: none;
    }

    .content {
        padding: 29px 17px;
    }

    .welcome-row {
        flex-direction: column;
        gap: 4px;
    }

    .hero-badge {
        margin-top: 7px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 30px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-number {
        font-size: 26px;
        margin-top: 7px;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }

    .bottom-banner {
        flex-wrap: wrap;
    }

    .banner-copy {
        flex-basis: calc(100% - 65px);
    }

    .button-light {
        width: 100%;
    }

    .workspace-header h1 {
        font-size: 31px;
    }

    .panel {
        padding: 17px;
    }

    .section-heading h2 {
        font-size: 18px;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 32px;
    }

    .desktop-break {
        display: none;
    }

    .two-fields {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .breadcrumb {
        font-size: 10px;
    }

    .button-small {
        padding: 7px 8px;
    }

    .result-actions .button {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}