:root {
    color-scheme: dark;
    --bg: #0b1421;
    --panel: #111e2e;
    --panel-soft: #152537;
    --border: #25364a;
    --text: #e6eef5;
    --muted: #8da2b7;
    --green: #67e5b5;
    --amber: #ffc77b;
    --red: #ff8e96;
    --radius: 17px;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "PingFang SC",
        sans-serif;
    font-synthesis: none;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: radial-gradient(ellipse at 53% 3%, #16352855, transparent 45%), var(--bg);
    color: var(--text);
    font-size: 13px;
}
button,
select {
    font: inherit;
}
button,
a,
select {
    -webkit-tap-highlight-color: transparent;
}
button {
    cursor: pointer;
}
button:disabled {
    cursor: not-allowed;
    opacity: 0.38;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 3px;
}
a {
    color: inherit;
}
.topbar {
    height: 83px;
    border-bottom: 1px solid #243246;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4vw;
    background: #0b1421b8;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    font-size: 17px;
    font-weight: 760;
    letter-spacing: 0.5px;
}
.brand small {
    display: block;
    font-size: 9px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 2.4px;
    margin-top: 5px;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border-radius: 12px;
    background: var(--green);
    color: #102c24;
    font-size: 31px;
    font-weight: 400;
}
.top-meta {
    display: flex;
    gap: 22px;
    align-items: center;
    font-size: 11px;
    color: var(--muted);
}
.engine-badge {
    border: 1px solid #345747;
    padding: 7px 10px;
    border-radius: 6px;
    color: #b2e5cc;
    font-size: 9px;
    letter-spacing: 1.2px;
}
.engine-badge i,
.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
    margin-right: 6px;
}
.quiet-link {
    text-decoration: none;
    color: #c0cddd;
}
.workspace {
    max-width: 1510px;
    padding: 36px 4vw 22px;
    margin: auto;
}
.intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 20px;
}
.eyebrow {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--green);
    margin: 0 0 12px;
}
h1 {
    font-size: clamp(20px, 2.1vw, 29px);
    letter-spacing: -0.7px;
    font-weight: 660;
    margin: 0;
    line-height: 1.5;
}
h1 em {
    font-style: normal;
    color: var(--green);
}
.intro-copy {
    color: var(--muted);
    margin: 10px 0 0;
    line-height: 1.8;
    font-size: 12px;
}
.session-pill {
    display: flex;
    gap: 11px;
    align-items: center;
    background: #152535;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 12px 17px;
    white-space: nowrap;
}
.session-pill small,
.business-status small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-bottom: 5px;
}
.session-pill strong {
    font-size: 12px;
}
.status-dot {
    background: #91aac0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.ok {
    background: var(--green);
    box-shadow: 0 0 9px #67e5b533;
}
.status-dot.warn {
    background: var(--amber);
}
.columns {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(340px, 1.28fr) minmax(275px, 1.08fr);
    gap: 26px;
    align-items: start;
}
.controls-column,
.diagnostics-column {
    display: grid;
    gap: 18px;
}
.panel {
    background: linear-gradient(135deg, #142234, #101c2b);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.panel-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 15px;
}
.panel h2 {
    font-size: 13px;
    font-weight: 650;
    margin: 0;
    letter-spacing: 0.3px;
}
.step-index {
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}
.micro-tag {
    margin-left: auto;
    border: 1px solid #334253;
    border-radius: 4px;
    color: #96aabc;
    padding: 3px 6px;
    font-size: 9px;
    white-space: nowrap;
}
.help {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.75;
    margin: 8px 0 13px;
}
.scenario-grid {
    display: grid;
    gap: 8px;
}
.scenario-grid button {
    display: grid;
    grid-template-columns: 30px 1fr;
    text-align: left;
    gap: 2px 9px;
    padding: 11px 10px;
    border: 1px solid #2b3c50;
    border-radius: 9px;
    background: #152436;
    color: #d6e2ee;
    transition: 0.2s;
}
.scenario-grid button > span {
    grid-row: span 2;
    align-self: center;
    text-align: center;
    font-size: 17px;
    color: #98afc2;
}
.scenario-grid b {
    font-size: 11px;
    font-weight: 600;
}
.scenario-grid small {
    font-size: 9px;
    color: #8ca1b6;
}
.scenario-grid button:hover {
    border-color: #608779;
    background: #1a302f;
}
.scenario-grid button.selected {
    border-color: #68c9a2;
    background: #1b3632;
    box-shadow: inset 2px 0 var(--green);
}
.scenario-grid button.selected > span {
    color: var(--green);
}
.scenario-grid button.selected b {
    color: #9ff3d0;
}
.field {
    display: block;
    color: #a3b4c6;
    font-size: 10px;
    margin: 14px 0;
}
.field select {
    display: block;
    width: 100%;
    margin-top: 8px;
    border: 1px solid #30445b;
    border-radius: 7px;
    padding: 10px 27px 10px 10px;
    background: #0d1a29;
    color: #dde7f0;
    font-size: 11px;
}
.button {
    padding: 11px 13px;
    border-radius: 8px;
    border: 1px solid #334b60;
    font-weight: 600;
    font-size: 11px;
    line-height: 1.3;
    transition: background 0.2s;
}
.button.secondary {
    color: #c9d8e5;
    background: #192c40;
}
.button.secondary:hover:not(:disabled) {
    background: #244157;
    border-color: #5f849b;
}
.button.primary {
    background: var(--green);
    color: #0c3025;
    border-color: var(--green);
}
.button.primary:hover:not(:disabled) {
    background: #8cf0cb;
}
.button-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 18px;
}
.text-button {
    border: 0;
    background: none;
    color: #8dbbad;
    font-size: 10px;
    margin: 13px 0 0;
    padding: 0;
    text-align: left;
    display: block;
}
.text-button:hover {
    color: var(--green);
}
.preview-caption {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #c5d5e3;
    margin: 0 0 14px;
    gap: 3px;
}
.preview-caption > span:last-child {
    color: #768da3;
    margin-left: 12px;
}
.phone {
    max-width: 398px;
    margin: auto;
    position: relative;
    padding: 0 14px 18px;
    background: linear-gradient(180deg, #152538, #0d1a2a);
    border: 1px solid #536678;
    border-radius: 35px;
    box-shadow:
        0 22px 60px #0005,
        0 0 0 5px #132130;
}
.phone-status {
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 10px;
    color: #a6b8c8;
}
.phone-status > span:last-child {
    letter-spacing: 2px;
}
.app-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 6px 17px;
}
.app-top img {
    width: 37px;
    height: 37px;
    border-radius: 10px;
}
.app-top strong {
    font-size: 11px;
    letter-spacing: 1.5px;
}
.app-top small {
    display: block;
    font-size: 9px;
    color: #8da3b8;
    margin-top: 5px;
}
.core-tag {
    margin-left: auto;
    background: #20374a;
    border: 1px solid #385267;
    padding: 5px 9px;
    border-radius: 6px;
    color: #a9d0df;
    font-family: ui-monospace, monospace;
    font-size: 11px;
}
.policy-banner {
    font-size: 10px;
    min-height: 31px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    border-radius: 6px;
    color: #b6cbda;
    background: #24384b;
    margin-bottom: 15px;
}
.policy-banner.force {
    background: #48302c;
    color: #ffd4a5;
}
.policy-banner.success {
    background: #203f35;
    color: #a5f0ce;
}
.policy-banner.silent {
    background: #1a3032;
    color: #9fbab5;
}
.game-content {
    padding: 0 3px;
}
.balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0 17px;
}
.balance-row > span {
    font-size: 8px;
    letter-spacing: 1.1px;
    color: #90a5b8;
}
.balance-row strong {
    font-size: 12px;
    font-weight: 650;
}
.balance-row i {
    color: var(--amber);
    font-style: normal;
    margin-left: 5px;
}
.hero-card {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 92% 50%, #355c4f 0, transparent 44%), linear-gradient(115deg, #244837, #1b332f);
    border: 1px solid #466151;
    border-radius: 12px;
    padding: 19px 15px 13px;
}
.hero-card:after {
    content: "✦";
    position: absolute;
    right: 15px;
    top: 38px;
    font-size: 94px;
    line-height: 1;
    color: #a8d9a226;
    transform: rotate(-12deg);
}
.hero-kicker {
    font-size: 6px;
    letter-spacing: 1px;
    color: #b4d4b1;
}
.hero-card h2 {
    font-size: 27px;
    line-height: 1.12;
    letter-spacing: -0.5px;
    margin: 15px 0 17px;
    font-weight: 820;
}
.hero-card h2 em {
    font-style: normal;
    color: #e0e9a8;
}
.hero-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #7e9d7144;
    padding-top: 10px;
    font-size: 8px;
    color: #a6c1ad;
}
.hero-bottom > span:last-child {
    font-size: 18px;
    color: #cde69b;
}
.game-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 22px 0 12px;
}
.game-heading h3 {
    font-size: 12px;
    letter-spacing: 0.2px;
    margin: 0;
}
.game-heading > span {
    font-size: 7px;
    letter-spacing: 1px;
    color: #94aabd;
}
.game-cards {
    display: flex;
    gap: 9px;
}
.game-cards img {
    display: block;
    width: calc((100% - 18px) / 3);
    aspect-ratio: 265/350;
    object-fit: cover;
    border-radius: 9px;
    border: 1px solid #3c3c49;
}
.game-cards.is-playing img {
    animation: pulse 1s infinite alternate;
}
.game-cards.is-playing img:nth-child(2) {
    animation-delay: 0.2s;
}
.game-cards.is-playing img:nth-child(3) {
    animation-delay: 0.4s;
}
.business-status {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 15px 0 11px;
}
.business-status strong {
    font-size: 10px;
    color: #d4e3ec;
}
.business-status small {
    font-size: 8px;
    margin-bottom: 4px;
}
.gate-tag {
    margin-left: auto;
    font-size: 8px;
    border: 1px solid #45596c;
    border-radius: 5px;
    padding: 4px 6px;
    color: #a2bdcd;
}
.gate-tag.locked {
    border-color: #6c5245;
    color: #f2c893;
}
.business-buttons {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 5px;
}
.business-buttons .button {
    padding: 10px 3px;
    font-size: 10px;
}
.settle {
    width: 100%;
    margin-top: 9px;
    background: #263b4d;
    border-color: #3d596a;
    color: #bfe4de;
}
.phone-note {
    text-align: center;
    font-size: 8px;
    line-height: 1.6;
    color: #7f98ad;
    margin: 10px 0 0;
}
.phone-bottom {
    display: flex;
    justify-content: space-around;
    color: #7e98b0;
    padding: 21px 0 10px;
    margin-top: 12px;
    border-top: 1px solid #263b4d;
}
.phone-bottom > span {
    font-size: 15px;
    text-align: center;
}
.phone-bottom small {
    display: block;
    font-size: 7px;
    margin-top: 6px;
}
.phone-bottom > span:first-child {
    color: var(--green);
}
.phone-handle {
    width: 91px;
    height: 3px;
    border-radius: 5px;
    background: #8796a4;
    margin: 9px auto 0;
}
.preview-footnote {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 22px;
    color: #738ba1;
    font-size: 8px;
}
.preview-footnote span:before {
    content: "✓";
    color: #75bda0;
    margin-right: 4px;
}
.experiment-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 19px;
}
.experiment-actions .button {
    font-size: 9px;
    padding: 9px;
}
.centered {
    text-align: center;
    margin-top: 10px;
}
.core-comparison {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #0c1927;
    border: 1px solid #2c4055;
    border-radius: 11px;
    padding: 17px 3px;
    margin-top: 5px;
}
.core-comparison small {
    font-size: 9px;
    color: #89a3b8;
}
.core-comparison strong {
    display: block;
    font-size: 33px;
    font-weight: 650;
    letter-spacing: -1px;
    margin-top: 7px;
    font-family: ui-monospace, monospace;
}
.core-comparison > span {
    font-size: 20px;
    color: #496578;
}
.core-comparison > div:last-child strong {
    color: var(--green);
}
.facts {
    margin: 18px 0;
}
.facts > div {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin: 13px 0;
    align-items: center;
    font-size: 10px;
}
.facts dt {
    color: #8da2b7;
}
.facts dd {
    margin: 0;
    font-family: ui-monospace, monospace;
    font-size: 10px;
    text-align: right;
    word-break: break-word;
    color: #c6dbea;
}
.facts dd.good {
    color: var(--green);
}
.facts dd.warn {
    color: var(--amber);
}
.full {
    width: 100%;
}
.icon-button {
    margin-left: auto;
    border: 1px solid #324a5d;
    background: #1d3143;
    color: #b2cbd6;
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 15px;
}
.timeline-panel {
    padding-bottom: 10px;
}
.timeline {
    max-height: 285px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #365066 transparent;
}
.event {
    display: grid;
    grid-template-columns: 6px 1fr;
    gap: 10px;
    padding: 0 0 17px;
    font-size: 10px;
    position: relative;
}
.event > i {
    width: 5px;
    height: 5px;
    background: #6b91a1;
    border-radius: 50%;
    margin-top: 5px;
}
.event:not(:last-child):before {
    content: "";
    width: 1px;
    background: #2c4457;
    position: absolute;
    left: 2px;
    top: 13px;
    bottom: 3px;
}
.event time {
    color: #627f98;
    font-size: 8px;
    font-family: ui-monospace, monospace;
}
.event b {
    font-size: 8px;
    color: #9bc5bd;
    letter-spacing: 0.5px;
    margin-left: 5px;
    font-weight: 500;
}
.event p {
    margin: 5px 0 0;
    line-height: 1.7;
    color: #c1d0dd;
    overflow-wrap: anywhere;
}
.event.failed > i {
    background: var(--amber);
}
.event.success > i {
    background: var(--green);
}
.console-guide p {
    font-size: 10px;
    color: #9bafc2;
    line-height: 1.8;
}
.console-guide pre {
    font-family: ui-monospace, monospace;
    font-size: 10px;
    line-height: 2;
    background: #0b1825;
    padding: 12px;
    border-radius: 7px;
    color: #a5e8c8;
    overflow: auto;
}
kbd {
    font-size: 9px;
    border: 1px solid #3d5265;
    border-radius: 4px;
    padding: 2px 4px;
}
.footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #243446;
    display: flex;
    justify-content: space-between;
    color: #637e96;
    font-size: 9px;
}
.modal-layer {
    position: absolute;
    inset: 35px 0 0;
    z-index: 5;
    border-radius: 0 0 35px 35px;
    background: #07121cce;
    backdrop-filter: blur(5px);
    display: grid;
    place-items: center;
    padding: 26px;
}
.modal-layer[hidden] {
    display: none;
}
.update-dialog {
    width: 100%;
    background: linear-gradient(150deg, #1e3445, #132435);
    border: 1px solid #46616c;
    border-radius: 19px;
    padding: 26px 20px;
    text-align: center;
    box-shadow: 0 20px 60px #0008;
}
.dialog-symbol {
    display: grid;
    place-items: center;
    border-radius: 15px;
    width: 52px;
    height: 52px;
    font-size: 28px;
    color: var(--green);
    background: #30584775;
    margin: 0 auto 17px;
}
.dialog-symbol.warn {
    color: var(--amber);
    background: #664e365e;
}
.update-dialog h2 {
    font-size: 20px;
    letter-spacing: -0.3px;
    margin: 0 0 12px;
}
.update-dialog p {
    font-size: 11px;
    line-height: 1.8;
    color: #a6bfce;
    margin: 0 0 17px;
}
.update-dialog .version-transition {
    border: 1px solid #365365;
    border-radius: 7px;
    font-size: 12px;
    color: #c1dbe1;
    padding: 10px;
    margin: 0 0 16px;
    font-family: ui-monospace, monospace;
}
.update-dialog .version-transition strong {
    color: var(--green);
}
.dialog-buttons {
    display: grid;
    gap: 8px;
}
.dialog-buttons .button {
    width: 100%;
    padding: 12px;
}
.dialog-detail {
    font-size: 9px !important;
    color: #839daf !important;
    margin-top: 14px !important;
    margin-bottom: 0 !important;
    overflow-wrap: anywhere;
}
.spinner {
    display: inline-block;
    width: 27px;
    height: 27px;
    border: 2px solid #4e776a;
    border-top-color: var(--green);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}
.pending-note {
    color: var(--amber);
}
@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}
@keyframes pulse {
    to {
        filter: brightness(1.2);
        transform: translateY(-3px);
    }
}
@media (min-width: 1600px) {
    .workspace {
        padding-left: 24px;
        padding-right: 24px;
    }
    .columns {
        gap: 36px;
    }
    .panel {
        padding: 23px;
    }
}
@media (max-width: 1120px) {
    .workspace {
        padding: 28px 24px;
    }
    .topbar {
        padding: 0 24px;
    }
    .columns {
        grid-template-columns: minmax(230px, 0.9fr) minmax(340px, 1.25fr);
        gap: 24px;
    }
    .diagnostics-column {
        grid-column: 1/-1;
        grid-template-columns: 1fr 1fr;
    }
    .console-guide {
        grid-column: 1/-1;
    }
    .session-pill {
        display: none;
    }
    .timeline {
        max-height: 360px;
    }
    .local-tag {
        display: none;
    }
}
@media (max-width: 660px) {
    .topbar {
        height: 70px;
        padding: 0 18px;
    }
    .brand {
        font-size: 14px;
    }
    .brand-mark {
        width: 33px;
        height: 33px;
    }
    .brand small {
        font-size: 7px;
        letter-spacing: 2px;
    }
    .top-meta {
        gap: 8px;
    }
    .quiet-link {
        display: none;
    }
    .engine-badge {
        font-size: 7px;
    }
    .workspace {
        padding: 24px 18px;
    }
    .intro {
        margin-bottom: 24px;
    }
    h1 {
        font-size: 21px;
    }
    .intro-copy {
        font-size: 11px;
    }
    .columns {
        display: flex;
        flex-direction: column;
        gap: 25px;
    }
    .controls-column,
    .preview-column,
    .diagnostics-column {
        width: 100%;
    }
    .controls-column {
        display: contents;
    }
    .controls-column > .panel:first-child {
        order: 0;
    }
    .preview-column {
        order: 1;
    }
    .controls-column > .panel:nth-child(2) {
        order: 2;
    }
    .diagnostics-column {
        order: 3;
        display: grid;
        grid-template-columns: 1fr;
    }
    .console-guide {
        grid-column: auto;
    }
    .scenario-grid {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }
    .scenario-grid button {
        grid-template-columns: 22px 1fr;
        gap: 3px 5px;
        padding: 10px 6px;
    }
    .scenario-grid button > span {
        font-size: 14px;
    }
    .scenario-grid b {
        font-size: 10px;
    }
    .scenario-grid small {
        font-size: 8px;
        line-height: 1.5;
    }
    .phone {
        max-width: 380px;
        width: calc(100% - 10px);
    }
    .panel {
        padding: 17px;
    }
    .footer {
        gap: 14px;
        flex-direction: column;
        line-height: 1.6;
    }
    .preview-caption {
        margin-top: 0;
    }
    .intro-copy {
        max-width: 330px;
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *:before,
    *:after {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 660px) {
    .controls-column > .panel {
        width: 100%;
    }
}

#openLegacyLab {
    display: block;
    text-decoration: none;
    text-align: center;
    margin-bottom: 14px;
    white-space: normal;
    line-height: 1.7;
}
