/* AppBOX – dark theme (w3schools.com dark palette, appbox.co-style layout) */

:root {
    --bg:          #1d2a35;   /* w3schools dark page background */
    --surface:     #282a35;   /* w3schools top nav */
    --surface-2:   #38444d;   /* w3schools dark panels */
    --surface-3:   #45525c;
    --border:      #3e4b55;
    --text:        #f1f1f1;
    --text-muted:  #a3adb5;
    --accent:      #04aa6d;   /* w3schools green */
    --accent-hover:#059862;
    --accent-soft: rgba(4, 170, 109, .14);
    --warn:        #fff4a3;   /* w3schools yellow */
    --warn-soft:   rgba(255, 244, 163, .12);
    --danger:      #f44336;   /* w3schools red */
    --danger-soft: rgba(244, 67, 54, .14);

    --topbar-h:  64px;
    --sidebar-w: 248px;
    --radius:    12px;
    --shadow:    0 10px 30px rgba(0, 0, 0, .25);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.muted { color: var(--text-muted); }
.icon { flex-shrink: 0; }

/* ---------- Buttons & badges ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border: 1px solid transparent; border-radius: 8px;
    font: inherit; font-weight: 600; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); padding: 8px 14px; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 0; border-radius: 8px;
    background: transparent; color: var(--text-muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.badge-soon { background: var(--warn-soft); color: var(--warn); }
.badge-live { background: var(--accent-soft); color: var(--accent); }

/* ---------- Top bar ---------- */

.topbar {
    position: fixed; inset: 0 0 auto 0; z-index: 30;
    height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--accent); color: #fff;
}
.brand-mark-lg { width: 48px; height: 48px; border-radius: 12px; }

.topbar-divider { width: 1px; height: 24px; background: var(--border); }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface-3); color: var(--text); font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-form { margin: 0; }

.sidebar-toggle { display: none; }

/* ---------- Layout ---------- */

.layout { display: flex; min-height: 100vh; padding-top: var(--topbar-h); }

.sidebar {
    position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 20;
    width: var(--sidebar-w);
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 20px 12px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-heading {
    padding: 0 12px 8px; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted);
}
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
    color: var(--text-muted); font-weight: 500;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--text); border-left-color: var(--accent); }
.nav-link.active .icon { color: var(--accent); }
.nav-label { flex: 1; }
.sidebar-footer {
    display: flex; align-items: center; gap: 8px;
    padding: 12px; font-size: 12px; color: var(--text-muted);
    border-top: 1px solid var(--border);
}
.sidebar-backdrop { display: none; }

.content {
    flex: 1; min-width: 0;
    margin-left: var(--sidebar-w);
    padding: 32px;
}

/* ---------- Overview ---------- */

.hero {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
    padding: 28px 32px; margin-bottom: 28px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
}
.hero h2 { font-size: 26px; margin: 4px 0 6px; }
.hero p { margin: 0; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }

.card-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 22px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border);
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent);
}
.card h3 { font-size: 18px; margin-top: 6px; }
.card p { margin: 0; color: var(--text-muted); flex: 1; }
.card-stat { display: flex; align-items: baseline; gap: 8px; }
.card-stat-value { font-size: 32px; font-weight: 700; line-height: 1; color: var(--accent); }
.card-stat-label { font-size: 13px; color: var(--text-muted); }
.card-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: 14px; }

/* ---------- Coming soon ---------- */

.coming-soon {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
    max-width: 560px; margin: 40px auto; padding: 48px 32px;
    border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--border);
}
.coming-soon-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 84px; height: 84px; border-radius: 20px;
    background: var(--accent-soft); color: var(--accent);
}
.coming-soon h2 { font-size: 28px; }
.coming-soon p { margin: 0 0 8px; color: var(--text-muted); }

/* ---------- Login ---------- */

.auth {
    background:
        radial-gradient(circle at 20% 10%, rgba(4, 170, 109, .12), transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(4, 170, 109, .08), transparent 40%),
        var(--bg);
}
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
    width: 100%; max-width: 400px; padding: 36px 32px;
    border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; font-size: 22px; font-weight: 700; }
.auth-card h1 { font-size: 22px; }
.auth-card > .muted { margin: 4px 0 20px; }
.auth-form { display: flex; flex-direction: column; }
.auth-form label { font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
.auth-form .btn { margin-top: 24px; padding: 12px; }

.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-icon input {
    width: 100%; padding: 11px 12px 11px 40px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text); font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.input-icon input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 4px; }
.alert-error { background: var(--danger-soft); color: #ff8a80; border: 1px solid rgba(244, 67, 54, .35); }

/* ---------- AppStore: catalog ---------- */

.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.is-loading { position: relative; color: transparent; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 18px; height: 18px;
    border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%;
    animation: spin .7s linear infinite;
}
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; }
.link:hover { text-decoration: underline; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .9em; }

.store-hero { margin-bottom: 20px; }
.store-search { width: min(340px, 100%); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-muted);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.chip-count {
    min-width: 22px; padding: 0 6px; border-radius: 999px;
    background: var(--surface-3); color: var(--text); font-size: 11px; text-align: center;
}
.chip.active .chip-count { background: var(--accent); color: #fff; }

.app-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.app-card { gap: 14px; }
.app-card-head { display: flex; align-items: center; gap: 14px; }
.app-icon {
    position: relative; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.app-icon img { width: 34px; height: 34px; object-fit: contain; }
.app-icon.no-img img { display: none; }
.app-icon.no-img::before {
    content: attr(data-letter);
    font-size: 22px; font-weight: 700; color: var(--accent);
}
.app-icon-lg { width: 64px; height: 64px; border-radius: 14px; }
.app-icon-lg img { width: 44px; height: 44px; }
.app-title { min-width: 0; }
.card .app-title h3 { margin: 0; font-size: 17px; }
.app-cat { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }

.spec-row { display: flex; flex-wrap: wrap; gap: 6px; }
.spec {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 6px;
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text-muted); font-size: 12px; font-weight: 600;
}
.spec .icon { color: var(--accent); }
.app-card-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding-top: 14px; border-top: 1px solid var(--border);
}
.app-image {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-muted); font-size: 12px;
}
.store-empty { text-align: center; padding: 48px 0; }

/* ---------- AppStore: deploy dialog ---------- */

.modal {
    width: min(860px, calc(100% - 32px)); max-height: calc(100vh - 48px);
    padding: 0; border: 1px solid var(--border); border-radius: 16px;
    background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.modal::backdrop, .splash::backdrop { background: rgba(10, 16, 22, .7); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .18s ease-out; }
.modal-panel { display: flex; flex-direction: column; max-height: calc(100vh - 50px); margin: 0; }
.modal-head {
    display: flex; align-items: center; gap: 16px;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { flex: 1; min-width: 0; }
.modal-title h2 { font-size: 22px; }
.modal-title .eyebrow { margin: 0; }
.modal-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; }
.modal-foot {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface);
    border-radius: 0 0 16px 16px;
}
.foot-msg { flex: 1; font-size: 13px; color: var(--text-muted); }

.modal .alert { margin-top: 16px; }
.alert-ok { background: var(--accent-soft); color: #6fe0b3; border: 1px solid rgba(4, 170, 109, .4); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(255, 244, 163, .3); }
.alert-extra { margin-top: 6px; font-size: 13px; opacity: .9; }
.note {
    display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 10px 14px;
    border-radius: 8px; background: var(--surface-2); color: var(--text-muted); font-size: 13px;
}
.note .icon { color: var(--accent); margin-top: 2px; }

.form-section { padding: 20px 0 4px; }
.form-section + .form-section { border-top: 1px solid var(--border); margin-top: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 15px; margin-bottom: 14px; }
.section-head .section-title { margin: 0; }
.section-title .icon { color: var(--accent); }
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
}

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.req { color: var(--danger); }
.field-msg { margin: 6px 0 0; font-size: 12.5px; color: var(--text-muted); }
.field-msg.is-error { color: #ff8a80; }
.field-msg.is-ok { color: #6fe0b3; }
.field-msg code, .deploy-summary code { color: var(--text); background: var(--bg); padding: 1px 5px; border-radius: 4px; }

.modal input:not([type="checkbox"]):not([type="range"]), .modal select {
    width: 100%; min-width: 0; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text); font: inherit; font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.modal input:focus, .modal select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal input[readonly] { color: var(--text-muted); background: var(--surface-2); }
.modal input[aria-invalid="true"] { border-color: var(--danger); }
.modal select { appearance: none; padding-right: 30px; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

.input-status { position: relative; display: flex; align-items: center; }
.input-status input { padding-right: 40px !important; }
.has-prefix input { padding-left: 68px !important; }
.input-prefix { position: absolute; left: 12px; color: var(--text-muted); font-size: 14px; pointer-events: none; }
.status-icon {
    position: absolute; right: 10px; display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
}
.status-icon.is-ok { background: var(--accent); color: #fff; }
.status-icon.is-error { color: var(--danger); }
.status-icon.is-loading::after {
    content: ""; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .7s linear infinite;
}
.status-icon .icon { width: 14px; height: 14px; }
.status-icon.is-error .icon { width: 18px; height: 18px; }

.input-group { display: flex; gap: 6px; }
.input-group input { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; }
.input-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex-shrink: 0;
    min-width: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface-2); color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.input-btn:hover { color: var(--text); background: var(--surface-3); }

.config-lock {
    display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 18px 20px;
    border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-muted); font-size: 14px;
}
.config-lock .icon { color: var(--warn); }

.slider-field { padding: 14px 16px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.slider-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.slider-head label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.slider-head label .icon { color: var(--accent); }
.slider-head output { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.slider-scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--text-muted); }
input[type="range"] {
    --fill: 50%;
    width: 100%; height: 6px; margin: 8px 0; border-radius: 999px; appearance: none; cursor: pointer;
    background: linear-gradient(to right, var(--accent) var(--fill), var(--surface-3) var(--fill));
}
input[type="range"]::-webkit-slider-thumb {
    appearance: none; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
input[type="range"]::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%;
    background: #fff; border: 3px solid var(--accent);
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.kv-table { display: flex; flex-direction: column; gap: 8px; }
.kv-row { display: grid; gap: 8px; align-items: center; }
.kv-ports { grid-template-columns: 1fr 1fr 96px 64px 40px; }
.kv-volumes { grid-template-columns: 1.3fr 1.3fr 130px 40px; }
.kv-env { grid-template-columns: 1fr 1.8fr 40px; }
.kv-head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.kv-row input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px !important; }
.icon-btn-sm { width: 40px; height: 40px; }
.icon-btn-sm:hover { color: var(--danger); background: var(--danger-soft); }
.lock-tag {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border-radius: 8px; background: var(--accent-soft); color: var(--accent);
}
.field-msg > .icon { vertical-align: -1px; color: var(--accent); }

.switch { position: relative; display: inline-flex; width: 40px; height: 22px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
    width: 100%; height: 100%; border-radius: 999px; background: var(--surface-3);
    transition: background .15s; pointer-events: none;
}
.switch span::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transition: transform .15s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

.deploy-summary {
    display: flex; flex-direction: column; gap: 8px; margin-top: 20px; padding: 14px 16px;
    border-radius: 10px; background: var(--accent-soft); border: 1px solid rgba(4, 170, 109, .3); font-size: 13.5px;
}
.deploy-summary div { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.deploy-summary .icon { color: var(--accent); }

.compose-preview { margin-top: 16px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.compose-preview summary, .splash-log summary {
    display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer;
    font-size: 13.5px; font-weight: 600; color: var(--text-muted); list-style: none;
}
.compose-preview summary::-webkit-details-marker, .splash-log summary::-webkit-details-marker { display: none; }
.compose-preview summary:hover, .splash-log summary:hover { color: var(--text); }
.compose-preview pre, .splash-log pre {
    margin: 0; padding: 14px 16px; max-height: 320px; overflow: auto;
    background: #151f28; color: #cfe3d8; font: 12.5px/1.55 ui-monospace, Menlo, Consolas, monospace; white-space: pre;
}
.compose-preview pre.is-error { color: #ff8a80; white-space: pre-wrap; }

/* ---------- AppStore: deployment splash ---------- */

.splash {
    width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 24px 16px;
    border: 0; background: transparent; color: var(--text);
    display: none; align-items: center; justify-content: center;
}
.splash[open] { display: flex; }
.splash::backdrop {
    background:
        radial-gradient(circle at 30% 20%, rgba(4, 170, 109, .18), transparent 45%),
        radial-gradient(circle at 70% 80%, rgba(4, 170, 109, .10), transparent 45%),
        rgba(29, 42, 53, .96);
}
.splash-card {
    width: min(540px, 100%); max-height: 100%; overflow-y: auto;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 36px 32px 28px; border-radius: 18px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
    animation: modal-in .25s ease-out;
}
.splash-card h2 { font-size: 22px; margin-top: 22px; }
.splash-card > .muted { margin: 4px 0 0; }

.splash-icon { position: relative; display: flex; align-items: center; justify-content: center; width: 104px; height: 104px; }
.splash-icon img { width: 56px; height: 56px; object-fit: contain; }
.splash-icon.no-img img { display: none; }
.splash-icon.no-img::before { content: attr(data-letter); font-size: 40px; font-weight: 700; color: var(--accent); }
.splash-ring {
    position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(var(--accent) 0 25%, transparent 25% 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    animation: spin 1.1s linear infinite;
}
.splash-icon::after {
    content: ""; position: absolute; inset: 10px; z-index: -1; border-radius: 50%;
    background: var(--surface-2); box-shadow: 0 0 0 1px var(--border);
}
.splash-icon { isolation: isolate; }
.splash.is-done .splash-ring { animation: none; background: var(--accent); }
.splash.is-failed .splash-ring { animation: none; background: var(--danger); }

.progress { width: 100%; height: 6px; margin: 22px 0 18px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress span {
    display: block; height: 100%; width: 4%; border-radius: inherit;
    background: repeating-linear-gradient(45deg, var(--accent) 0 10px, var(--accent-hover) 10px 20px);
    background-size: 28px 28px; animation: stripes 1s linear infinite;
    transition: width .6s ease;
}
.splash.is-done .progress span, .splash.is-failed .progress span { animation: none; }
.splash.is-failed .progress span { background: var(--danger); }

.splash-steps { list-style: none; width: 100%; margin: 0; padding: 0; text-align: left; }
.splash-steps li {
    display: flex; align-items: center; gap: 12px; padding: 8px 4px;
    color: var(--text-muted); font-size: 14px; transition: color .2s;
}
.step-dot {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface-3);
}
.step-dot .icon { width: 13px; height: 13px; stroke-width: 3; }
.splash-steps li.is-active { color: var(--text); font-weight: 600; }
.splash-steps li.is-active .step-dot { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.splash-steps li.is-done { color: var(--text); }
.splash-steps li.is-done .step-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.splash-steps li.is-failed { color: #ff8a80; font-weight: 600; }
.splash-steps li.is-failed .step-dot { background: var(--danger); border-color: var(--danger); color: #fff; }

.splash-card .alert { width: 100%; margin-top: 16px; text-align: left; }
.splash-log { width: 100%; margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; text-align: left; }
.splash-log pre { max-height: 220px; }
.splash-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes stripes { to { background-position: 28px 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
    .splash-ring, .progress span, .splash-steps li.is-active .step-dot { animation-duration: 3s; }
    .modal[open], .splash-card { animation: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
    .field-grid { grid-template-columns: 1fr; }
    .modal { width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
    .modal-panel { max-height: 100vh; height: 100%; }
    .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
    .modal-foot { border-radius: 0; }
    .foot-msg { display: none; }
    .kv-ports { grid-template-columns: 1fr 1fr 80px 48px 40px; }
    .kv-volumes { grid-template-columns: 1fr 1fr 40px; }
    .kv-volumes select { grid-column: 1 / 3; }
    .kv-volumes.kv-head span:nth-child(3) { display: none; }
    .splash-card { padding: 28px 20px 22px; }
}

@media (max-width: 900px) {
    .sidebar-toggle { display: inline-flex; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop {
        display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 15;
        background: rgba(0, 0, 0, .5);
    }
    .content { margin-left: 0; padding: 20px 16px; }
    .topbar { padding: 0 12px; }
    .topbar-divider, .topbar-title, .user-meta { display: none; }
    .hero { padding: 22px 20px; }
}

@media (max-width: 480px) {
    .hide-sm { display: none; }
}
