:root {
    color-scheme: light;
    --hub-bg: #f4efe7;
    --hub-card: rgba(255, 255, 255, 0.88);
    --hub-card-strong: #ffffff;
    --hub-line: rgba(58, 46, 38, 0.12);
    --hub-ink: #1f1a16;
    --hub-muted: #6d6258;
    --hub-accent: #17624d;
    --hub-accent-soft: rgba(23, 98, 77, 0.11);
    --hub-warn: #b3621f;
    --hub-danger: #a23b3b;
    --hub-shadow: 0 22px 54px rgba(36, 24, 16, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    color: var(--hub-ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 38%),
        radial-gradient(circle at right 10%, rgba(225, 208, 187, 0.7), transparent 24%),
        linear-gradient(180deg, #f7f2eb 0%, var(--hub-bg) 56%, #ece2d7 100%);
}

button,
a,
input,
select {
    font: inherit;
}

button,
.hub-link {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.78rem 1.08rem;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button:hover,
.hub-link:hover {
    transform: translateY(-1px);
}

button {
    background: #1d1b19;
    color: #fff8f0;
    box-shadow: 0 10px 20px rgba(29, 27, 25, 0.16);
}

button.secondary {
    background: transparent;
    color: var(--hub-ink);
    border-color: var(--hub-line);
    box-shadow: none;
}

button.warn {
    background: var(--hub-warn);
}

button.danger {
    background: var(--hub-danger);
}

button.ghost {
    background: var(--hub-accent-soft);
    color: var(--hub-accent);
    box-shadow: none;
}

input,
select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--hub-line);
    background: rgba(255, 255, 255, 0.92);
    padding: 0.82rem 0.92rem;
    color: var(--hub-ink);
}

input:focus,
select:focus {
    outline: 2px solid rgba(23, 98, 77, 0.18);
    border-color: rgba(23, 98, 77, 0.45);
}

.hub-shell {
    max-width: 1500px;
    margin: 0 auto;
    padding: 2rem 1.2rem 3rem;
}

.hub-hero,
.hub-section {
    background: var(--hub-card);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--hub-shadow);
}

.hub-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem;
    border-radius: 30px;
    padding: 1.6rem 1.7rem;
    margin-bottom: 1rem;
}

.hub-kicker {
    margin: 0 0 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.74rem;
    color: var(--hub-muted);
}

.hub-copy {
    margin: 0;
    color: var(--hub-muted);
    max-width: 70ch;
    line-height: 1.55;
}

.hub-copy.small {
    max-width: 58ch;
}

.hub-hero h1,
.hub-section-head h2,
.follower-head h3 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.hub-hero h1 {
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1.02;
}

.hub-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.hub-link {
    text-decoration: none;
    background: transparent;
    border-color: var(--hub-line);
    color: var(--hub-ink);
}

.hub-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--hub-line);
}

.hub-toggle input {
    width: auto;
    margin: 0;
}

.hub-status {
    border-radius: 18px;
    padding: 0.95rem 1.1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--hub-shadow);
}

.hub-status.info {
    background: rgba(255, 255, 255, 0.9);
}

.hub-status.success {
    background: rgba(23, 98, 77, 0.12);
    color: var(--hub-accent);
}

.hub-status.error {
    background: rgba(162, 59, 59, 0.14);
    color: var(--hub-danger);
}

.hub-progress {
    display: grid;
    gap: 1rem;
    position: sticky;
    top: 0.85rem;
    z-index: 6;
    border-radius: 28px;
    padding: 1.3rem 1.35rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--hub-shadow);
}

.hub-progress-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.hub-progress-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.progress-lane {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 24px;
    border: 1px solid var(--hub-line);
    background: rgba(255, 255, 255, 0.82);
}

.progress-lane > strong {
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hub-muted);
}

.progress-stack {
    display: grid;
    gap: 0.7rem;
}

.progress-card {
    display: grid;
    gap: 0.35rem;
    padding: 0.88rem 0.95rem;
    border-radius: 18px;
    border: 1px solid rgba(58, 46, 38, 0.08);
    background: rgba(244, 239, 231, 0.72);
}

.progress-card.active {
    border-color: rgba(23, 98, 77, 0.2);
    box-shadow: inset 0 0 0 1px rgba(23, 98, 77, 0.08);
}

.progress-card.success {
    background: rgba(23, 98, 77, 0.09);
}

.progress-card.error {
    background: rgba(162, 59, 59, 0.1);
}

.progress-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
}

.progress-title::before {
    content: "";
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: rgba(31, 26, 22, 0.18);
    flex: 0 0 auto;
}

.progress-card.active .progress-title::before {
    background: var(--hub-accent);
    box-shadow: 0 0 0 0 rgba(23, 98, 77, 0.28);
    animation: hub-pulse 1.2s ease infinite;
}

.progress-card.success .progress-title::before {
    background: var(--hub-accent);
}

.progress-card.error .progress-title::before {
    background: var(--hub-danger);
}

.progress-detail,
.progress-meta {
    color: var(--hub-muted);
    font-size: 0.92rem;
}

.busy-card {
    border-color: rgba(23, 98, 77, 0.18);
    box-shadow: 0 18px 42px rgba(23, 98, 77, 0.08), inset 0 0 0 1px rgba(23, 98, 77, 0.08);
}

.inline-progress {
    display: grid;
    gap: 0.3rem;
    padding: 0.82rem 0.95rem;
    margin: 0.1rem 0 0.45rem;
    border-radius: 18px;
    border: 1px solid rgba(23, 98, 77, 0.16);
    background: rgba(23, 98, 77, 0.08);
}

.inline-progress .progress-title::before {
    background: var(--hub-accent);
    box-shadow: 0 0 0 0 rgba(23, 98, 77, 0.28);
    animation: hub-pulse 1.2s ease infinite;
}

.inline-progress .progress-detail {
    font-size: 0.9rem;
}

button:disabled {
    cursor: progress;
    opacity: 0.72;
    transform: none;
}

button.is-busy {
    position: relative;
}

button.is-busy::before {
    content: "";
    display: inline-block;
    width: 0.82rem;
    height: 0.82rem;
    margin-right: 0.48rem;
    border-radius: 999px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    vertical-align: -0.12rem;
    animation: hub-spin 0.8s linear infinite;
}

@keyframes hub-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes hub-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(23, 98, 77, 0.28);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(23, 98, 77, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(23, 98, 77, 0);
    }
}

.hub-section {
    border-radius: 28px;
    padding: 1.4rem 1.35rem;
    margin-bottom: 1rem;
}

.hub-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hub-broker-rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.hub-broker-card,
.follower-card,
.hub-events,
.front-summary {
    border: 1px solid var(--hub-line);
    border-radius: 24px;
    background: var(--hub-card-strong);
}

.hub-broker-card {
    padding: 1rem;
    display: grid;
    gap: 0.8rem;
}

.hub-broker-card.front {
    border-color: rgba(23, 98, 77, 0.38);
    box-shadow: inset 0 0 0 1px rgba(23, 98, 77, 0.18);
}

.hub-broker-card.hidden {
    opacity: 0.8;
}

.hub-broker-head,
.follower-head,
.front-summary-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.8rem;
}

.hub-broker-meta,
.front-summary-grid,
.follower-stats,
.follower-form-grid,
.follower-orders,
.follower-positions {
    display: grid;
    gap: 0.8rem;
}

.hub-broker-meta,
.front-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pill-row,
.hub-broker-actions,
.follower-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    font-size: 0.82rem;
    background: rgba(31, 26, 22, 0.08);
    color: var(--hub-ink);
}

.pill.live {
    background: rgba(23, 98, 77, 0.12);
    color: var(--hub-accent);
}

.pill.warn {
    background: rgba(179, 98, 31, 0.16);
    color: var(--hub-warn);
}

.pill.ghost {
    background: rgba(31, 26, 22, 0.06);
    color: var(--hub-muted);
}

.meta-tile {
    padding: 0.85rem 0.95rem;
    border-radius: 18px;
    background: rgba(244, 239, 231, 0.8);
}

.meta-tile span {
    display: block;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--hub-muted);
    margin-bottom: 0.32rem;
}

.meta-tile strong {
    display: block;
    font-size: 1rem;
}

.hub-front-workspace {
    display: grid;
    gap: 1rem;
}

.front-summary {
    padding: 1rem;
}

.front-summary-grid {
    margin-top: 0.95rem;
}

.follower-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.follower-card {
    padding: 1rem;
    display: grid;
    gap: 0.9rem;
}

.follower-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.follower-form-grid .full {
    grid-column: 1 / -1;
}

.follower-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.data-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.55rem;
}

.data-row {
    padding: 0.78rem 0.88rem;
    border-radius: 16px;
    background: rgba(244, 239, 231, 0.7);
    border: 1px solid rgba(58, 46, 38, 0.08);
}

.data-row strong {
    display: block;
    margin-bottom: 0.16rem;
}

.data-row span {
    color: var(--hub-muted);
    font-size: 0.92rem;
}

.hub-events {
    padding: 0.7rem;
}

.hub-events .data-row {
    background: rgba(255, 255, 255, 0.82);
}

.empty-state {
    padding: 1rem;
    border-radius: 18px;
    border: 1px dashed var(--hub-line);
    color: var(--hub-muted);
    background: rgba(255, 255, 255, 0.6);
}

@media (max-width: 1100px) {
    .hub-broker-rail,
    .follower-grid,
    .follower-form-grid,
    .hub-broker-meta,
    .front-summary-grid,
    .follower-stats,
    .hub-progress-grid {
        grid-template-columns: 1fr;
    }

    .hub-hero,
    .hub-section-head,
    .hub-hero-actions,
    .hub-broker-head,
    .follower-head,
    .front-summary-head,
    .hub-progress-head {
        grid-template-columns: 1fr;
        display: grid;
    }
}

@media (max-width: 760px) {
    .hub-shell {
        padding: 1rem 0.8rem 2rem;
    }

    .hub-hero,
    .hub-section {
        border-radius: 22px;
        padding: 1rem;
    }

    button,
    .hub-link,
    .hub-toggle {
        width: 100%;
        justify-content: center;
    }
}

textarea {
    width: 100%;
    min-height: 110px;
    border-radius: 14px;
    border: 1px solid var(--hub-line);
    background: rgba(255, 255, 255, 0.92);
    padding: 0.82rem 0.92rem;
    color: var(--hub-ink);
    resize: vertical;
    font: inherit;
}

textarea:focus {
    outline: 2px solid rgba(23, 98, 77, 0.18);
    border-color: rgba(23, 98, 77, 0.45);
}

.hub-strategies,
.strategy-stack,
.strategy-card,
.strategy-create,
.binding-grid,
.binding-card,
.strategy-form-grid,
.binding-form-grid,
.binding-meta {
    display: grid;
    gap: 1rem;
}

.strategy-create,
.strategy-card,
.binding-card {
    border: 1px solid var(--hub-line);
    border-radius: 24px;
    background: var(--hub-card-strong);
    padding: 1rem;
}

.strategy-head,
.binding-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.8rem;
}

.strategy-form-grid,
.binding-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.strategy-form-grid .full,
.binding-form-grid .full {
    grid-column: 1 / -1;
}

.strategy-actions,
.binding-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.binding-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.binding-meta,
.strategy-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.strategy-copy {
    margin: 0;
    color: var(--hub-muted);
    line-height: 1.5;
}

.hub-live-test-grid,
.readiness-grid,
.dispatch-summary-grid {
    display: grid;
    gap: 1rem;
}

.hub-live-test-grid {
    grid-template-columns: 1.05fr 1fr;
}

.readiness-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.live-card,
.dispatch-result,
.readiness-card {
    border: 1px solid var(--hub-line);
    border-radius: 24px;
    background: var(--hub-card-strong);
}

.live-card,
.dispatch-result {
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.readiness-card {
    padding: 0.9rem 1rem;
    display: grid;
    gap: 0.35rem;
}

.readiness-card.ready {
    border-color: rgba(23, 98, 77, 0.24);
    background: rgba(23, 98, 77, 0.08);
}

.readiness-card.warn {
    border-color: rgba(179, 98, 31, 0.18);
    background: rgba(179, 98, 31, 0.08);
}

.readiness-card strong {
    font-size: 0.98rem;
}

.readiness-card span {
    color: var(--hub-muted);
    font-size: 0.9rem;
}

.readiness-note-list {
    display: grid;
    gap: 0.6rem;
}

.readiness-note,
.dispatch-caution {
    padding: 0.85rem 0.95rem;
    border-radius: 18px;
    border: 1px solid rgba(58, 46, 38, 0.08);
}

.readiness-note.live {
    background: rgba(23, 98, 77, 0.1);
    color: var(--hub-accent);
}

.readiness-note.warn,
.dispatch-caution {
    background: rgba(179, 98, 31, 0.12);
    color: var(--hub-warn);
}

.readiness-note.ghost {
    background: rgba(31, 26, 22, 0.05);
    color: var(--hub-muted);
}

.dispatch-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dispatch-result {
    margin-top: 0.4rem;
}

@media (max-width: 1100px) {
    .hub-live-test-grid,
    .readiness-grid,
    .dispatch-summary-grid,
    .binding-grid,
    .binding-meta,
    .strategy-grid,
    .strategy-form-grid,
    .binding-form-grid,
    .strategy-head,
    .binding-head {
        grid-template-columns: 1fr;
        display: grid;
    }
}

.hub-footer {
    margin-top: 0.25rem;
    padding: 0.6rem 0.2rem 0;
    text-align: center;
    color: var(--hub-muted);
    font-size: 0.95rem;
}

.hub-footer p {
    margin: 0;
}
