:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-soft: #f0f2f4;
    --text: #17191c;
    --muted: #6e747c;
    --line: #e4e7eb;
    --accent: #3157d5;
    --accent-soft: #e8edff;
    --danger: #b42318;
    --radius: 24px;
    --shadow:
        0 18px 50px rgba(20, 25, 40, .08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.topbar {
    height: 72px;
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 220px minmax(300px, 680px) 1fr;
    align-items: center;
    gap: 24px;
    padding: 0 28px;
    background: rgba(247,248,250,.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-orb {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: var(--text);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.brand strong {
    letter-spacing: -.04em;
}

.brand small {
    color: var(--muted);
    margin-left: 3px;
}

.search-trigger {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 16px;
    background: var(--surface-soft);
    color: var(--muted);
    text-align: left;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-trigger kbd {
    margin-left: auto;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 8px;
    padding: 3px 7px;
}

.workspace {
    justify-self: end;
    font-size: 13px;
    font-weight: 700;
}

.rail {
    position: fixed;
    top: 72px;
    bottom: 0;
    left: 0;
    z-index: 10;
    width: 88px;
    padding: 18px 12px;
    border-right: 1px solid var(--line);
    background: var(--bg);
}

.rail-item {
    height: 64px;
    margin-bottom: 8px;
    border-radius: 18px;
    color: var(--muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.rail-item span {
    font-size: 21px;
}

.rail-item small {
    font-size: 11px;
}

.rail-item:hover,
.rail-item.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.shell {
    max-width: 1500px;
    margin: 0 auto;
    padding:
        116px
        36px
        70px
        124px;
}

.welcome {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 36px;
}

.eyebrow {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    margin-bottom: 9px;
}

h1 {
    margin: 0;
    font-size: clamp(42px, 5vw, 72px);
    line-height: .98;
    letter-spacing: -.065em;
}

h1 span,
.local-section h2 span {
    color: var(--muted);
    font-weight: 500;
}

h2 {
    margin: 0;
    letter-spacing: -.04em;
}

.primary-action,
.submit-button {
    border: 0;
    background: var(--text);
    color: white;
    border-radius: 16px;
    min-height: 48px;
    padding: 0 20px;
    font-weight: 750;
}

.attention-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr))
        minmax(260px, 1.4fr);
    gap: 14px;
    margin-bottom: 22px;
}

.attention-card {
    min-height: 150px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.metric {
    font-size: 42px;
    font-weight: 750;
    letter-spacing: -.06em;
    margin-bottom: auto;
}

.attention-card small {
    color: var(--muted);
    margin-top: 4px;
}

.attention-card.intelligence {
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(49,87,213,.17),
            transparent 38%
        ),
        var(--surface);
}

.intelligence p {
    margin: auto 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    margin-bottom: 13px;
    box-shadow:
        0 0 0 7px var(--accent-soft);
}

.workspace-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(350px, .85fr);
    gap: 18px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    overflow: hidden;
}

.panel-head {
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.counter {
    color: var(--muted);
    font-size: 12px;
}

.stream-item {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    gap: 15px;
    align-items: start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

.stream-item:last-child {
    border-bottom: 0;
}

.signal-marker {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-top: 8px;
}

.stream-meta {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.stream-main strong {
    line-height: 1.35;
}

.stream-main p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 7px 0 0;
}

.story-button {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 12px;
    padding: 8px 11px;
    white-space: nowrap;
}

.story-button:hover {
    background: var(--text);
    color: white;
}

.story-row {
    min-height: 84px;
    padding: 17px 22px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
}

.story-row > div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.state {
    width: max-content;
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.priority {
    color: var(--muted);
    font-size: 11px;
}

.empty {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
    gap: 5px;
    padding: 25px;
}

.empty strong {
    color: var(--text);
}

.local-section {
    margin-top: 22px;
    min-height: 390px;
    border-radius: 30px;
    padding: 38px;
    background: var(--text);
    color: white;
    display: grid;
    grid-template-columns:
        minmax(0, .8fr)
        minmax(420px, 1.2fr);
    align-items: center;
    gap: 50px;
}

.local-section h2 {
    font-size: clamp(38px, 4vw, 64px);
    line-height: 1;
}

.local-section p {
    max-width: 510px;
    color: #aeb2b8;
    line-height: 1.65;
}

.local-map {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.map-node {
    min-width: 170px;
    text-align: center;
    padding: 16px 22px;
    border-radius: 18px;
    background: #272a2e;
    border: 1px solid #3a3e44;
}

.map-node.state {
    background: var(--accent);
    border-color: var(--accent);
}

.map-line {
    height: 34px;
    width: 1px;
    background: #555a62;
}

.community-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    width: 100%;
}

.community-row span {
    text-align: center;
    border: 1px solid #3a3e44;
    background: #202226;
    padding: 13px 8px;
    border-radius: 14px;
    font-size: 12px;
}

.modal,
.command {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(14,16,18,.48);
    backdrop-filter: blur(12px);
}

.modal[hidden],
.command[hidden] {
    display: none;
}

.modal {
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-card {
    width: min(620px, 96vw);
    background: var(--surface);
    border-radius: 28px;
    padding: 26px;
    box-shadow: var(--shadow);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-soft);
    font-size: 22px;
}

form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    font-size: 12px;
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    outline: 0;
    padding: 13px 14px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow:
        0 0 0 3px var(--accent-soft);
}

textarea {
    min-height: 170px;
    resize: vertical;
}

.command {
    display: flex;
    justify-content: center;
    padding-top: 12vh;
}

.command-box {
    width: min(760px, 92vw);
    height: max-content;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.command-box > input {
    border: 0;
    border-radius: 0;
    height: 68px;
    background: white;
    font-size: 17px;
    padding: 0 22px;
}

.command-help {
    border-top: 1px solid var(--line);
    padding: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
}

.command-help button {
    border: 1px solid var(--line);
    background: var(--surface-soft);
    border-radius: 10px;
    padding: 7px 10px;
}

@media (max-width: 1050px) {
    .attention-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .local-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .topbar {
        grid-template-columns: auto 1fr;
        height: 64px;
        padding: 0 14px;
    }

    .workspace {
        display: none;
    }

    .brand strong,
    .brand small {
        display: none;
    }

    .rail {
        top: auto;
        right: 0;
        bottom: 0;
        width: auto;
        height: 70px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        padding: 6px;
        border-top: 1px solid var(--line);
        border-right: 0;
    }

    .rail-item {
        height: 56px;
        margin: 0;
    }

    .shell {
        padding:
            96px
            14px
            100px;
    }

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

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

    .attention-card {
        min-height: 135px;
    }

    .stream-item {
        grid-template-columns: 8px 1fr;
    }

    .story-button {
        grid-column: 2;
        width: max-content;
    }

    .local-section {
        padding: 27px 20px;
    }

    .community-row {
        grid-template-columns: 1fr 1fr;
    }
}
