:root {
    --bg: #07090c;
    --shell: #0b0f13;
    --panel: #11171d;
    --panel2: #151c23;
    --line: rgba(255,255,255,.12);
    --line2: rgba(255,255,255,.08);
    --text: #f4f6f8;
    --muted: #9ba6b2;
    --soft: #c9d0d8;
    --red: #e20b16;
    --red2: #8c0610;
    --green: #78dd67;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 78% 20%, rgba(226,11,22,.14), transparent 32%),
        linear-gradient(135deg, #040608, #0f151b 58%, #030405);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

.installer-shell {
    width: min(1180px, calc(100vw - 32px));
    height: min(760px, calc(100vh - 32px));
    margin: 16px auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--shell);
    box-shadow: 0 22px 70px rgba(0,0,0,.52);
}

.app-titlebar {
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    background: #070a0d;
    font-size: 13px;
    -webkit-app-region: drag;
}

.title-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.app-mark,
.brand-mark {
    display: grid;
    place-items: center;
    border: 2px solid var(--red);
    color: #fff;
    font-weight: 800;
    border-radius: 50%;
}

.app-mark {
    width: 24px;
    height: 24px;
    font-size: 12px;
}

.title-controls {
    display: flex;
    gap: 4px;
    -webkit-app-region: no-drag;
}

.title-controls button {
    width: 34px;
    height: 26px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--soft);
    cursor: pointer;
    font-weight: 800;
}

.title-controls button:hover {
    background: rgba(255,255,255,.1);
}

.title-controls button[data-window-action="close"]:hover {
    background: #c1121f;
    color: #fff;
}

.installer-body {
    height: calc(100% - 42px);
    display: grid;
    grid-template-columns: 270px 1fr;
}

.rail {
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, #070b0f, #090d11);
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 18px;
    border-bottom: 1px solid var(--line2);
}

.brand-mark {
    width: 42px;
    height: 42px;
    font-size: 18px;
}

.brand-name {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 1px;
}

.brand-name span { color: var(--red); }

.brand-sub {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    margin-top: 2px;
}

.step-list {
    display: grid;
    gap: 4px;
    margin-top: 18px;
}

.step-list button {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    text-align: left;
    padding: 8px 9px;
    border-radius: var(--radius);
    cursor: default;
}

.step-list b {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.36);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.step-list span {
    font-size: 13px;
}

.step-list button.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(226,11,22,.42), rgba(226,11,22,.06), transparent);
    border-color: rgba(226,11,22,.42);
}

.step-list button.active b {
    background: var(--red);
    border-color: #fff;
}

.step-list button.done {
    color: var(--soft);
}

.step-list button.done b {
    border-color: var(--red);
    color: var(--red);
}

.rail-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line2);
}

.runtime-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 12px;
}

.runtime-pill i {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(120,221,103,.12);
}

.content {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,.03), transparent 42%),
        var(--bg);
}

.page {
    display: none;
    flex: 1;
    padding: 30px 38px 18px;
    overflow: auto;
}

.page.active { display: block; }

.page-head {
    max-width: 760px;
    margin-bottom: 20px;
}

.eyebrow {
    color: var(--red);
    font-size: 11px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin: 0 0 8px;
    font-weight: 800;
}

h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.16;
    font-weight: 760;
    letter-spacing: -0.025em;
}

.lead {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.metric-grid article,
.table-card,
.form-card,
.product-card,
.option-grid,
.install-box,
.complete-card {
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(17,23,29,.96), rgba(18,25,32,.82));
    border-radius: var(--radius);
}

.metric-grid article {
    padding: 14px;
    min-height: 86px;
}

.metric-grid strong,
.metric-grid span {
    display: block;
}

.metric-grid strong {
    font-size: 13px;
    margin-bottom: 7px;
}

.metric-grid span {
    color: var(--muted);
    line-height: 1.35;
}

.table-card {
    padding: 8px 18px;
}

.row {
    display: grid;
    grid-template-columns: 180px 1fr 64px;
    gap: 14px;
    align-items: center;
    min-height: 48px;
    border-bottom: 1px solid var(--line2);
}

.row:last-child { border-bottom: 0; }

.row span {
    color: var(--muted);
}

.row b {
    font-weight: 650;
    color: var(--text);
}

.row em {
    color: var(--green);
    font-style: normal;
    font-weight: 800;
    text-align: right;
}

.form-card {
    padding: 18px;
}

.form-card.compact {
    max-width: 640px;
}

label {
    display: block;
    color: var(--soft);
    margin-bottom: 8px;
    font-weight: 650;
}

input {
    font: inherit;
}

input[type="text"],
input:not([type]) {
    width: 100%;
}

.form-card input,
.input-row input {
    width: 100%;
    background: rgba(255,255,255,.045);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 11px;
    border-radius: 7px;
    outline: none;
}

.form-card p {
    color: var(--muted);
    margin: 10px 0 0;
    font-size: 12px;
}

code {
    color: #e9edf2;
    background: rgba(255,255,255,.07);
    padding: 2px 5px;
    border-radius: 5px;
}

.product-grid {
    display: grid;
    gap: 10px;
}

.product-card {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    padding: 14px;
    cursor: pointer;
}

.product-card.selected {
    border-color: rgba(226,11,22,.92);
    box-shadow: inset 3px 0 0 var(--red);
}

.product-card input {
    margin-top: 4px;
    accent-color: var(--red);
}

.product-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.product-title strong {
    font-size: 15px;
}

.product-title small {
    color: var(--muted);
    font-size: 11px;
}

.product-card p {
    color: var(--muted);
    margin: 8px 0 11px;
    line-height: 1.35;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip-row span {
    color: var(--soft);
    border: 1px solid var(--line);
    background: rgba(255,255,255,.04);
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 10px;
}

.mini-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mini-grid div {
    border: 1px solid var(--line2);
    border-radius: 7px;
    padding: 10px;
}

.mini-grid span,
.mini-grid b {
    display: block;
}

.mini-grid span {
    color: var(--muted);
    font-size: 12px;
}

.mini-grid b {
    margin-top: 4px;
}

.option-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 10px 18px;
}

.option-grid label,
.complete-card label {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-weight: 500;
}

input[type="checkbox"] {
    accent-color: var(--red);
    width: 16px;
    height: 16px;
}

.install-box {
    padding: 18px;
}

.progress {
    height: 22px;
    background: rgba(255,255,255,.07);
    border: 1px solid var(--line2);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress span {
    display: block;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--red2), var(--red));
}

pre {
    margin: 0;
    min-height: 230px;
    max-height: 280px;
    overflow: auto;
    background: #030506;
    color: #dbe2ea;
    border: 1px solid var(--line2);
    border-radius: 7px;
    padding: 14px;
    font-size: 12px;
    line-height: 1.5;
}

.complete-card {
    padding: 20px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.checkmark {
    width: 58px;
    height: 58px;
    border: 3px solid var(--green);
    color: var(--green);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 34px;
    flex: 0 0 auto;
}

.complete-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.complete-card p {
    color: var(--muted);
    margin: 0 0 18px;
}

.footerbar {
    height: 64px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(0,0,0,.28);
}

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

button {
    font: inherit;
    border-radius: 7px;
}

.secondary,
.primary,
.input-row button {
    border: 1px solid var(--line);
    padding: 9px 18px;
    min-width: 96px;
    color: var(--text);
    background: rgba(255,255,255,.045);
    cursor: pointer;
}

.primary {
    background: linear-gradient(180deg, #ef0b16, #a0060e);
    border-color: rgba(226,11,22,.8);
    min-width: 132px;
    font-weight: 800;
}

.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-top: 10px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255,255,255,.045);
    color: var(--text);
    font-weight: 800;
    font-size: 12px;
    text-decoration: none;
}

button:disabled {
    opacity: .36;
    cursor: not-allowed;
}

@media (max-width: 980px) {
    .installer-shell {
        width: 100vw;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .installer-body {
        grid-template-columns: 230px 1fr;
    }

    .metric-grid,
    .mini-grid {
        grid-template-columns: 1fr 1fr;
    }

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

/* SiloStreamDeck branding refinement */
.image-mark {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.image-mark img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.brand-image {
    display: block;
    padding: 4px 4px 18px;
}

.brand-image img {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
    object-fit: contain;
}

.brand-image .brand-sub {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line2);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
}

.pin-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}
