/* Dark is the fallback when the browser doesn't report the system setting. Light applies
   when the system asks for it (theme "auto") or when the person picked it (data-theme). */
:root {
    --bg: #0f1216;
    --surface: #171b21;
    --surface-2: #1e232b;
    --border: #2a313b;
    --text: #e7eaf0;
    --muted: #9aa3b2;
    --primary: #7c74ff;
    --primary-text: #ffffff;
    --free: #4ade80;
    --free-bg: #12301f;
    --mine: #7aa7ff;
    --mine-bg: #16264a;
    --held: #b3bdcc;
    --held-bg: #232a34;
    --reserved: #b69cff;
    --reserved-bg: #2a2045;
    --warn: #fbbf24;
    --warn-bg: #362a10;
    --danger: #ff7b7b;
    --danger-bg: #3a1717;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f6f7f9;
        --surface: #ffffff;
        --surface-2: #f1f3f6;
        --border: #e3e6eb;
        --text: #151922;
        --muted: #616a7a;
        --primary: #4f46e5;
        --free: #15803d;
        --free-bg: #e7f6ec;
        --mine: #1d4ed8;
        --mine-bg: #e6eeff;
        --held: #475569;
        --held-bg: #eef1f5;
        --reserved: #7c3aed;
        --reserved-bg: #f1eafe;
        --warn: #b45309;
        --warn-bg: #fdf3e2;
        --danger: #c62828;
        --danger-bg: #fdecec;
        --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
        color-scheme: light;
    }
}

:root[data-theme="light"] {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --border: #e3e6eb;
    --text: #151922;
    --muted: #616a7a;
    --primary: #4f46e5;
    --free: #15803d;
    --free-bg: #e7f6ec;
    --mine: #1d4ed8;
    --mine-bg: #e6eeff;
    --held: #475569;
    --held-bg: #eef1f5;
    --reserved: #7c3aed;
    --reserved-bg: #f1eafe;
    --warn: #b45309;
    --warn-bg: #fdf3e2;
    --danger: #c62828;
    --danger-bg: #fdecec;
    --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
    color-scheme: light;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--primary); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* Layout */
.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
main { max-width: 1180px; margin: 0 auto; padding: 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand-lg { font-size: 22px; justify-content: center; }
.logo {
    width: 22px; height: 22px; border-radius: 6px; background: var(--primary);
    background-image: linear-gradient(var(--primary-text), var(--primary-text)), linear-gradient(var(--primary-text), var(--primary-text)), linear-gradient(var(--primary-text), var(--primary-text));
    background-size: 12px 2px, 9px 2px, 12px 2px;
    background-position: 5px 6px, 5px 10px, 5px 14px;
    background-repeat: no-repeat;
}
.conn { background: var(--warn-bg); color: var(--warn); text-align: center; padding: 6px 16px; font-weight: 500; }
.conn.conn-info { background: var(--surface-2); color: var(--muted); font-weight: 400; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
    max-width: 420px; text-align: center; background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 32px 24px; box-shadow: var(--shadow);
}
.login-card p { color: var(--muted); margin: 16px 0 24px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    padding: 7px 12px; border-radius: 8px; font: inherit; font-weight: 550; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 9px; font-size: 13px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.btn-link { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }

/* People */
.avatar {
    width: 24px; height: 24px; border-radius: 50%; flex: none; object-fit: cover;
    background: var(--surface-2); color: var(--muted); display: inline-grid; place-items: center;
    font-size: 11px; font-weight: 700; border: 1px solid var(--border);
}
.avatar-lg { width: 36px; height: 36px; font-size: 14px; }
.presence { display: flex; }
.presence .avatar { margin-left: -6px; border: 2px solid var(--surface); width: 26px; height: 26px; }
.presence .more { margin-left: 4px; color: var(--muted); font-size: 12px; align-self: center; }

/* Alerts */
.alerts { display: grid; gap: 8px; margin-bottom: 16px; }
.alert {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--danger-bg); color: var(--text); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
    border-left: 5px solid var(--danger); border-radius: 10px; padding: 10px 14px;
}
.alert-icon { color: var(--danger); font-weight: 800; font-size: 18px; }
.alert-text { flex: 1 1 320px; }
.alert-text b { color: var(--danger); }

/* Environment cards */
.envs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card {
    --accent: var(--held);
    --accent-bg: var(--held-bg);
    background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--accent);
    border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.card.free { --accent: var(--free); --accent-bg: var(--free-bg); }
.card.mine { --accent: var(--mine); --accent-bg: var(--mine-bg); }
.card.reserved { --accent: var(--reserved); --accent-bg: var(--reserved-bg); }
.card.stale { --accent: var(--warn); --accent-bg: var(--warn-bg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.env-name { font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
    background: var(--accent-bg); color: var(--accent); font-weight: 650; font-size: 12.5px; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.holder { display: flex; align-items: center; gap: 10px; min-width: 0; }
.holder-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.holder-meta { color: var(--muted); font-size: 12.5px; }
.free-text { color: var(--muted); }
.note { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: 13px; overflow-wrap: anywhere; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.flag-warn { background: var(--warn-bg); color: var(--warn); }
.flag-danger { background: var(--danger-bg); color: var(--danger); }
.flag-info { background: var(--surface-2); color: var(--muted); }
.deploy { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; display: grid; gap: 2px; }
.deploy.bad { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); background: var(--danger-bg); }
.deploy-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; overflow-wrap: anywhere; }
.status { font-weight: 600; }
.status-success { color: var(--free); }
.status-failed { color: var(--danger); }
.status-running { color: var(--mine); }
.status-canceled { color: var(--muted); }
.waitlist { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.waitlist .who { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.waitlist .who.me-too { font-weight: 700; color: var(--mine); }
.waitlist .avatar { width: 20px; height: 20px; font-size: 10px; }
.stale-ask {
    background: var(--warn-bg); color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 13px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }

/* Tabs and feed */
.tabs { display: flex; gap: 4px; margin: 26px 0 10px; border-bottom: 1px solid var(--border); }
.tab {
    border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 8px 12px;
    border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.daynav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.day-label { font-weight: 650; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
select, input[type="text"], input[type="date"], textarea {
    font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 6px 10px; max-width: 100%;
}
textarea { width: 100%; resize: vertical; min-height: 64px; }
.check { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.feed li:first-child { border-top: 0; }
.feed li.bad { background: linear-gradient(90deg, var(--danger-bg), transparent 70%); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.feed-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.feed-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sync-status { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.sync-warn { color: var(--warn); }
.feed-dismiss { flex-shrink: 0; margin-top: -3px; }
.env-tag { font-weight: 700; font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); }
.feed-empty { color: var(--muted); padding: 16px 0; text-align: center; }
.feed-more { text-align: center; }
.reason { color: var(--muted); font-style: italic; }

/* Accountability */
.table-wrap { overflow-x: auto; }
.acct { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.acct th, .acct td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.acct th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.acct td.num { font-variant-numeric: tabular-nums; font-weight: 650; }
.acct td.num.hot { color: var(--danger); }
.acct td.num.zero { color: var(--muted); font-weight: 400; }
h3 { margin: 20px 0 6px; font-size: 15px; }

/* Dialog */
dialog {
    border: 1px solid var(--border); border-radius: 14px; padding: 0; width: min(460px, calc(100vw - 32px));
    background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgb(0 0 0 / 25%);
}
dialog::backdrop { background: rgb(10 12 16 / 45%); }
dialog form { padding: 20px 22px; display: grid; gap: 18px; }
dialog h2 { margin: 0; font-size: 17px; }
#dlg-body { display: grid; gap: 18px; }
#dlg-body > * { min-width: 0; }
#dlg-body p { margin: 0; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.chip:has(input:checked) { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend { font-weight: 600; font-size: 13px; padding: 0; margin-bottom: 8px; }
.estimate input[type="datetime-local"] { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; justify-self: start; color-scheme: light dark; }
.est-summary { font-size: 13px; font-weight: 600; }
.est-summary.muted { font-weight: 400; }
.hint { font-size: 12.5px; }
.purpose-tag { display: inline-block; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; font-size: 12.5px; font-weight: 600; }
.purpose-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.purpose-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; overflow-wrap: anywhere; }
.purpose-list li button { flex-shrink: 0; }
.usage th.num, .usage td.num { text-align: right; }
.share-col { width: 40%; min-width: 120px; color: var(--muted); font-variant-numeric: tabular-nums; }
.share { display: inline-block; vertical-align: middle; width: calc(100% - 48px); height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.share span { display: block; height: 100%; background: var(--primary); }
.code { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
.token-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.token-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: var(--surface); border-radius: 6px; padding: 6px 8px; font-size: 12.5px; user-select: all; }
details summary { cursor: pointer; }
.warnbox { background: var(--warn-bg); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: calc(100vw - 32px); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; }
.profile { position: relative; }
.profile-btn { display: flex; align-items: center; gap: 8px; border: 1px solid transparent; background: none; color: var(--text); font: inherit; font-size: 13px; padding: 3px 10px 3px 3px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.profile-btn:hover, .profile-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.profile-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.profile-btn .caret { color: var(--muted); font-size: 11px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / 25%); padding: 6px; display: grid; gap: 2px; }
.menu-head { display: grid; padding: 6px 10px; line-height: 1.35; overflow-wrap: anywhere; }
.menu-head .muted { font-size: 12.5px; }
.menu-label { font-size: 12px; color: var(--muted); padding: 4px 10px 2px; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.menu [role="menuitem"] { border: 0; background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus-visible { background: var(--surface-2); outline: none; }
.menu #menu-signout { color: var(--danger); }
.menu .hint { padding: 2px 10px 4px; }
.theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px 6px 2px; }
.theme-row [role="menuitemradio"] { border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; padding: 6px 4px; border-radius: 8px; cursor: pointer; }
.theme-row [role="menuitemradio"]:hover { background: var(--surface-2); }
.theme-row [role="menuitemradio"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.theme-row [aria-checked="true"], .theme-row [aria-checked="true"]:hover { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.toast.error { background: var(--danger); color: #fff; }

@media (max-width: 560px) {
    .envs { grid-template-columns: 1fr; }
    .presence, #notify-btn { display: none !important; }
    .profile-btn .name { display: none; }
    .feed li { flex-wrap: wrap; }
}

/* Guided tour */
.tour { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
/* The four panels around the spotlight dim the page and swallow clicks outside it. */
.tour-shade { display: none; }
.tour-block:not(.tour-cover) {
    background: rgb(6 8 12 / 62%); opacity: 0;
    transition: left .38s cubic-bezier(.2, .8, .2, 1), top .38s cubic-bezier(.2, .8, .2, 1), width .38s cubic-bezier(.2, .8, .2, 1), height .38s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
.tour-on .tour-block { opacity: 1; }
.tour-ring {
    position: fixed; border-radius: 12px; pointer-events: none; border: 2px solid var(--primary); opacity: 0;
    transition: left .38s cubic-bezier(.2, .8, .2, 1), top .38s cubic-bezier(.2, .8, .2, 1), width .38s cubic-bezier(.2, .8, .2, 1), height .38s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
.tour-on .tour-ring { opacity: 1; }
.tour-centered .tour-ring { opacity: 0; }
.tour-interactive .tour-ring { animation: tour-pulse 1.6s ease-out infinite; }
@keyframes tour-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 55%, transparent); }
    100% { box-shadow: 0 0 0 14px transparent; }
}
.tour-block { position: fixed; pointer-events: auto; }
.tour-interactive .tour-cover { display: none; }
.tour-hidden .tour-shade, .tour-hidden .tour-ring, .tour-hidden .tour-card, .tour-hidden .tour-block { display: none; }

.tour-card {
    position: fixed; left: 0; top: 0; width: min(370px, calc(100vw - 24px)); pointer-events: auto;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 18px 50px rgb(0 0 0 / 35%); padding: 16px 18px 14px; outline: none;
    transition: transform .38s cubic-bezier(.2, .8, .2, 1), opacity .2s;
}
.tour-switching .tour-card { opacity: 0; }
.tour-card::before {
    content: ""; position: absolute; width: 12px; height: 12px; background: var(--surface);
    border: 1px solid var(--border); transform: rotate(45deg); display: none;
}
.tour-card[data-side="bottom"]::before { display: block; top: -7px; left: calc(var(--arrow-x) - 6px); border-right: 0; border-bottom: 0; }
.tour-card[data-side="top"]::before { display: block; bottom: -7px; left: calc(var(--arrow-x) - 6px); border-left: 0; border-top: 0; }
.tour-card[data-side="right"]::before { display: block; left: -7px; top: calc(var(--arrow-y) - 6px); border-right: 0; border-top: 0; }
.tour-card[data-side="left"]::before { display: block; right: -7px; top: calc(var(--arrow-y) - 6px); border-left: 0; border-bottom: 0; }
.tour-progress { height: 3px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.tour-progress span { display: block; height: 100%; background: var(--primary); transition: width .38s ease; }
.tour-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tour-card h3 { margin: 2px 0 6px; font-size: 16px; }
.tour-body { font-size: 13.5px; }
.tour-body p { margin: 0 0 8px; }
.tour-note { background: var(--surface-2); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.tour-list { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 4px; }
.tour-code { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; white-space: pre-wrap; margin: 6px 0 8px; }
.tour-pill { display: inline-block; font-size: 11.5px; font-weight: 650; border-radius: 999px; padding: 1px 8px; margin: 2px 1px; }
.tour-pill.free { background: var(--free-bg); color: var(--free); }
.tour-pill.mine { background: var(--mine-bg); color: var(--mine); }
.tour-pill.held { background: var(--held-bg); color: var(--held); }
.tour-pill.reserved { background: var(--reserved-bg); color: var(--reserved); }
.tour-pill.stale { background: var(--warn-bg); color: var(--warn); }
.tour-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.tour-spacer { flex: 1; }
.tour-hint { background: var(--mine-bg); border-left: 3px solid var(--primary); border-radius: 8px; padding: 9px 11px; font-size: 13px; }
.tour-hint p { margin: 0 0 8px; }

.tour-banner {
    position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 65; display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--primary); border-radius: 999px; padding: 5px 6px 5px 14px;
    box-shadow: var(--shadow); font-size: 13px; font-weight: 600; white-space: nowrap; max-width: calc(100vw - 24px);
}
.tour-banner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: tour-blink 1.4s ease-in-out infinite; }
@keyframes tour-blink { 50% { opacity: .3; } }

.welcome { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgb(6 8 12 / 55%); backdrop-filter: blur(3px); animation: tour-fade .25s ease; }
.welcome-card {
    width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px;
    box-shadow: 0 24px 60px rgb(0 0 0 / 40%); animation: tour-pop .35s cubic-bezier(.2, .9, .3, 1.2);
}
.welcome-card h2 { margin: 14px 0 8px; font-size: 20px; }
.welcome-card p { margin: 0; color: var(--muted); }
.welcome-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.welcome-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.welcome-art span { height: 54px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); position: relative; overflow: hidden; animation: tour-rise .6s cubic-bezier(.2, .9, .3, 1.2) backwards; }
.welcome-art span::after { content: ""; position: absolute; left: 10px; right: 10px; top: 12px; height: 8px; border-radius: 4px; background: var(--free); box-shadow: 0 16px 0 -1px var(--border); }
.welcome-art span:nth-child(2) { animation-delay: .08s; }
.welcome-art span:nth-child(2)::after { background: var(--mine); }
.welcome-art span:nth-child(3) { animation-delay: .16s; }
.welcome-art span:nth-child(3)::after { background: var(--warn); }
@keyframes tour-fade { from { opacity: 0; } }
@keyframes tour-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes tour-rise { from { opacity: 0; transform: translateY(12px); } }

.tour-banner-short { display: none; }
@media (max-width: 560px) {
    .tour-banner-long { display: none; }
    .tour-banner-short { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
    .tour-block, .tour-ring, .tour-card, .tour-progress span { transition: none; }
    .tour-interactive .tour-ring, .tour-banner-dot, .welcome, .welcome-card, .welcome-art span { animation: none; }
}
