/* Community Stride Asset Store — theme */
:root {
    --bg: #0f1115;
    --surface: #181b22;
    --surface-2: #20242d;
    --border: #2a2f3a;
    --text: #e6e8ec;
    --muted: #9aa3b2;
    --accent: #5b8def;
    --accent-2: #8a5bef;
    --ok: #4ade80;
    --warn: #fbbf24;
    --radius: 10px;
    color-scheme: dark;
}

/* Light theme — toggled via data-theme (interop.js applies the saved/OS preference pre-render). */
:root[data-theme="light"] {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #eef0f4;
    --border: #d9dde5;
    --text: #1b202a;
    --muted: #5d6675;
    --accent: #3465d4;
    --accent-2: #7647d8;
    --ok: #15803d;
    --warn: #b45309;
    color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.app-header {
    display: flex; align-items: center; gap: .75rem;
    padding: .8rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(91,141,239,.08), transparent);
    position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--text); font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); font-size: 1.3rem; }
.brand-text strong { color: var(--accent); }
.brand-tag {
    font-size: .65rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--warn); border: 1px solid var(--warn); border-radius: 999px; padding: .1rem .5rem;
}
.brand-link { font-size: .82rem; color: var(--muted); margin-left: .4rem; }
.brand-link:hover { color: var(--accent); }
.app-nav { margin-left: auto; font-size: .9rem; display: flex; align-items: center; }
.btn-dl {
    background: var(--accent); color: #fff; border-radius: 7px; padding: .35rem .7rem;
    font-size: .85rem; font-weight: 600; margin-right: 1rem;
}
.btn-dl:hover { filter: brightness(1.1); text-decoration: none; }
.theme-toggle {
    background: transparent; border: 1px solid var(--border); border-radius: 7px;
    padding: .25rem .5rem; cursor: pointer; font-size: .9rem; margin-right: 1rem;
}
.theme-toggle:hover { border-color: var(--accent); }
/* The desktop window controls are anchors (they must still work with a dead circuit) */
a.theme-toggle { display: inline-block; text-decoration: none; color: var(--text); line-height: 1.4; }
a.theme-toggle:hover { text-decoration: none; }

/* About page links */
.links { display: flex; flex-direction: column; gap: .8rem; }
.link-row { display: flex; flex-direction: column; gap: .15rem; }
.link-row > a:first-child { font-weight: 600; font-size: .95rem; }
.link-row > span { color: var(--muted); font-size: .85rem; line-height: 1.4; }
.app-main { flex: 1; padding: 1.5rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.app-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; text-align: center; }
.app-footer .ver-link { color: var(--muted); font-family: 'Cascadia Code', Consolas, monospace; }
.app-footer .ver-link:hover { color: var(--accent); }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.2rem; }
.toolbar input[type=text], .toolbar select {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: .5rem .7rem; font-size: .9rem;
}
.toolbar input[type=text] { flex: 1; min-width: 220px; }
.toolbar label { color: var(--muted); font-size: .85rem; display: inline-flex; align-items: center; gap: .35rem; }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
/* The link is the card's content, so it stays clickable with or without this stylesheet. The tag
   chips are siblings of it: a <button> inside an <a> is invalid HTML. */
.card-link, .card-link:hover { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Certification at a glance: green edge for certified, accent-blue for the rest. */
.card.cert { border-color: rgba(74, 222, 128, .45); }
.card.cert:hover { border-color: var(--ok); }
.card.uncert { border-color: rgba(91, 141, 239, .35); }
.card.uncert:hover { border-color: var(--accent); }
.card-thumb {
    position: relative; overflow: hidden;
    height: 120px; display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Once a thumbnail has painted, the placeholder letter must go: half the thumbnails have
   transparent pixels and the letter would read as part of the artwork. */
.has-thumb .thumb-initial { display: none; }
.hover-media { z-index: 1; background: #000; }
/* Corner marker: this asset ships a demo the app can run. */
.thumb-demo {
    position: absolute; top: .4rem; right: .4rem; z-index: 2;
    font-size: .62rem; font-weight: 600; letter-spacing: .02em;
    padding: .1rem .4rem; border-radius: 999px;
    background: rgba(10, 12, 18, .72); color: #fff;
    border: 1px solid rgba(255, 255, 255, .28);
    backdrop-filter: blur(2px);
}
.card-body { padding: .8rem .9rem; display: flex; flex-direction: column; gap: .4rem; }
.card-title { font-weight: 600; color: var(--text); }
.card-desc { color: var(--muted); font-size: .82rem; line-height: 1.35; min-height: 2.4em; }
.card-meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .2rem; }

/* Badges & tags */
.badge {
    font-size: .68rem; padding: .12rem .5rem; border-radius: 999px;
    background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge.cat { color: var(--accent); border-color: rgba(91,141,239,.4); }
.badge.stride { color: var(--text); }
.badge.certified { color: var(--ok); border-color: rgba(74,222,128,.4); }
.nav-dot { color: #ef4444; font-size: .55rem; vertical-align: super; margin-left: .15rem; }
.badge.nuget { color: var(--accent-2); border-color: rgba(138,91,239,.4); }
.badge.stars { color: #facc15; border-color: rgba(250,204,21,.4); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.tag { font-size: .7rem; color: var(--muted); }
.card-tags { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; padding: 0 .9rem .8rem; margin-top: -.4rem; }
.tag-chip {
    font-size: .68rem; padding: .12rem .5rem; border-radius: 999px; cursor: pointer;
    background: transparent; color: var(--muted); border: 1px dashed var(--border);
    font-family: inherit;
}
.tag-chip:hover { color: var(--accent); border-color: var(--accent); }
.tag-chip.active { color: var(--accent); border-style: solid; border-color: rgba(91,141,239,.4); }
.tag-more { font-size: .68rem; color: var(--muted); }
.active-tags { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: -.6rem 0 .8rem; }
.active-tags .lbl { font-size: .75rem; color: var(--muted); }

/* Hero (default landing view) */
.hero {
    position: relative;
    padding: 1.4rem 1.6rem; margin-bottom: 1.2rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(91,141,239,.12), rgba(138,91,239,.06));
}
.banner-close {
    background: transparent; border: none; color: var(--muted); cursor: pointer;
    font-size: .9rem; padding: .2rem .45rem; border-radius: 6px; line-height: 1;
}
.banner-close:hover { color: var(--text); background: var(--surface-2); }
.hero-close { position: absolute; top: .6rem; right: .6rem; }
.hero h2 { margin: 0 0 .4rem; font-size: 1.35rem; }
.hero p { margin: 0 0 .8rem; color: var(--muted); max-width: 60rem; line-height: 1.5; }
.hero-actions { display: flex; gap: .6rem; }
.row-title { font-size: 1rem; margin: 1.2rem 0 .8rem; color: var(--text); }

/* States */
.notice { color: var(--muted); padding: 2rem 0; }
.notice.error { color: var(--warn); }
.cache-note { color: var(--warn); font-size: .8rem; margin-bottom: .8rem; }

/* Detail */
.detail-head { display: flex; gap: 1.2rem; align-items: flex-start; margin-bottom: 1.2rem; }
.detail-thumb { position: relative; overflow: hidden; width: 96px; height: 96px; border-radius: var(--radius); flex: none;
    display: flex; align-items: center; justify-content: center; font-size: 2.4rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.detail h1 { margin: 0 0 .2rem; font-size: 1.5rem; }
.detail .sub { color: var(--muted); font-size: .9rem; }
.detail section { margin: 1.2rem 0; }
.detail h2 { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 .5rem; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: .4rem .8rem; font-size: .9rem; }
.extdeps { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.extdep { display: flex; align-items: baseline; gap: .6rem; padding: .45rem .85rem;
    border-top: 1px solid var(--border); font-size: .9rem; }
.extdep:first-child { border-top: none; }
.extdep-name { word-break: break-all; }
.extdep-ver { color: var(--muted); flex: none; white-space: nowrap; }

/* Repository file tree */
.filetree { border: 1px solid var(--border); border-radius: 10px; padding: .4rem .7rem; max-height: 400px; overflow: auto; font-size: .85rem; }
.tree-folder { margin: .05rem 0; }
.tree-folder > summary { cursor: pointer; list-style: none; padding: .15rem 0; user-select: none; }
.tree-folder > summary::-webkit-details-marker { display: none; }
.tree-folder > summary::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); transition: transform .12s ease; }
.tree-folder[open] > summary::before { transform: rotate(90deg); }
.tree-children { margin-left: .8rem; border-left: 1px solid var(--border); padding-left: .7rem; }
.tree-file { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .15rem 0; }
.tree-ico { opacity: .85; margin-right: .15rem; }
.filesize { color: var(--muted); flex: none; white-space: nowrap; }

/* Rendered README */
.readme { line-height: 1.6; }
.readme h1, .readme h2, .readme h3, .readme h4 { margin: 1.2rem 0 .5rem; line-height: 1.3; }
.readme h1 { font-size: 1.5rem; } .readme h2 { font-size: 1.25rem; } .readme h3 { font-size: 1.05rem; }
.readme p { margin: .5rem 0; }
.readme ul, .readme ol { margin: .5rem 0 .5rem 1.4rem; }
.readme code { background: var(--surface-2); padding: .1rem .35rem; border-radius: 5px; font-size: .9em; }
.readme pre { background: var(--surface-2); padding: .8rem; border-radius: 8px; overflow-x: auto; border: 1px solid var(--border); }
.readme pre code { background: none; padding: 0; }
.readme img { max-width: 100%; height: auto; border-radius: 6px; }
.readme a { color: var(--accent); }
.readme table { border-collapse: collapse; margin: .5rem 0; }
.readme th, .readme td { border: 1px solid var(--border); padding: .3rem .6rem; }
.readme blockquote { border-left: 3px solid var(--border); margin: .5rem 0; padding: .2rem .9rem; color: var(--muted); }

.kv .k { color: var(--muted); }
.mono { font-family: 'Cascadia Code', Consolas, monospace; font-size: .82rem; }
.back { display: inline-block; margin-bottom: 1rem; color: var(--muted); }
/* Import-mode tabs */
.modes { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 0; }
/* The selected tab's content, framed: without a box the panel had no visible start or end, and
   only the Install tab looked like anything because its call-out carried its own border. */
.mode-panel { border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius);
    padding: .9rem 1rem; margin-bottom: 1rem; background: var(--surface); }
.mode-panel > :first-child { margin-top: 0; }
.mode-panel > :last-child { margin-bottom: 0; }
.mode {
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--muted); padding: .5rem .9rem; cursor: pointer; font-size: .9rem; font-weight: 600;
}
.mode:hover:not(.disabled):not(.active) { color: var(--text); }
.mode.active { color: var(--accent); border-bottom-color: var(--accent); }
.mode.disabled { opacity: .4; cursor: not-allowed; }
.mode-desc { color: var(--muted); font-size: .85rem; margin: 0 0 .7rem; }
.mode-desc code { background: var(--bg); padding: .05rem .3rem; border-radius: 4px; }
.install-grid { display: flex; flex-direction: column; gap: .5rem; max-width: 760px; }
.field { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; }
.install-cta { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; padding: .7rem .8rem;
    background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); border: 1px solid var(--accent);
    border-radius: var(--radius); flex-wrap: wrap; }
/* The demo sits above the install tabs and keeps its frame: it is the loudest thing on the page,
   which is the point — trying an asset beats reading about it. */
.demo-cta { margin-top: 1rem; }

/* Inside a tab panel the call-out is already framed by it; a second border reads as a nested box. */
.mode-panel .install-cta.plain { background: none; border: none; padding: 0; margin-bottom: 0; }

/* Screenshot gallery + lightbox */
.gallery { display: flex; flex-wrap: wrap; gap: .5rem; margin: .2rem 0 1rem; }
.gallery .shot { padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
    background: var(--surface-2); cursor: zoom-in; width: 132px; height: 88px; flex: none; transition: border-color .12s ease; }
.gallery .shot:hover { border-color: var(--accent); }
.gallery .shot img, .gallery .shot video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .shot { position: relative; }
.shot-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.4rem; text-shadow: 0 1px 6px rgba(0,0,0,.7); pointer-events: none;
    background: rgba(0,0,0,.18); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.82);
    display: flex; align-items: center; justify-content: center; padding: 3vh 4vw; }
.lightbox .lb-img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5); cursor: default; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px;
    border: none; border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; font-size: 2rem;
    cursor: pointer; line-height: 1; }
.lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-nav.prev { left: 2vw; } .lb-nav.next { right: 2vw; }
.lb-close { position: absolute; top: 2.5vh; right: 2.5vw; width: 40px; height: 40px; border: none;
    border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 1.1rem; cursor: pointer; }
.lb-close:hover { background: rgba(255,255,255,.22); }
.lb-caption { position: absolute; bottom: 2.5vh; left: 50%; transform: translateX(-50%);
    display: flex; gap: .6rem; align-items: center; max-width: 80vw;
    background: rgba(0,0,0,.5); padding: .25rem .75rem; border-radius: 999px; }
.lb-name { color: #fff; font-size: .84rem; font-family: 'Cascadia Code', Consolas, monospace;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-count { color: rgba(255,255,255,.65); font-size: .8rem; flex: none; }

/* File-system picker (desktop install) */
.fb-path { display: flex; gap: .4rem; align-items: center; }
.fb-path .ipt { flex: 1; }
.fs { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.fs-row { display: flex; align-items: center; gap: .5rem; background: none; border: none; border-bottom: 1px solid var(--border);
    color: var(--text); text-align: left; padding: .4rem .7rem; cursor: pointer; font-size: .88rem; }
.fs-row:last-child { border-bottom: none; }
.fs-row:hover { background: var(--surface-2); }
.fs-row.file { color: var(--accent); }
.fs-ico { width: 1.2rem; }
.check { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; font-size: .9rem; }
.check .install-hint { margin-left: .3rem; }

/* Publish page */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.panel h2 { margin-top: 0; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem; }
.form label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; color: var(--muted); }
.form label.wide { grid-column: 1 / -1; }
.form.one-col { grid-template-columns: 1fr; }
.form.one-col label:has(> input[type=checkbox]) { flex-direction: row; align-items: center; gap: .45rem; }
.ipt { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: .45rem .6rem; font-size: .9rem; }
/* .problems is for lists of things that are wrong (it is warning-coloured); .bullets is the plain
   prose list. They used to be one class, which is why the RFC page carried an inline colour
   override on every list it had. */
.problems, .bullets { margin: .6rem 0 0; padding-left: 1.1rem; font-size: .82rem; }
.problems li, .bullets li { margin: .1rem 0; }
.problems { color: var(--warn); }
.bullets { color: var(--text); }

/* Environment badge */
.env { font-size: .8rem; margin-right: 1rem; }
.env.local { color: var(--ok); }
.env.online { color: var(--accent); }

/* Install / commands */
.cmd { display: flex; align-items: center; gap: .5rem; margin: .4rem 0; }
.cmd code {
    flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
    padding: .45rem .6rem; font-family: 'Cascadia Code', Consolas, monospace; font-size: .82rem; overflow-x: auto;
}
.btn {
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
    border-radius: 6px; padding: .45rem .7rem; cursor: pointer; font-size: .82rem;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover, .btn[disabled]:hover { border-color: var(--border); filter: none; }
.install-hint { color: var(--muted); font-size: .82rem; margin-top: .3rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Boot loading indicator (shown until the WASM runtime starts) */
.loading-progress {
    position: relative; display: block; width: 6rem; height: 6rem; margin: 22vh auto 1rem auto;
}
.loading-progress circle {
    fill: none; stroke: var(--border); stroke-width: .5rem;
    transform-origin: 50% 50%; transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%;
    transition: stroke-dasharray .05s ease-in-out;
}
.loading-progress-text {
    position: absolute; text-align: center; font-weight: 600; inset: calc(22vh + 2.6rem) 0 auto 0; color: var(--muted);
}
.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* Blazor Server reconnection overlay (themed) */
#components-reconnect-modal { display: none; }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex; position: fixed; inset: 0; z-index: 2000;
    align-items: center; justify-content: center;
    background: rgba(8, 10, 14, .72); backdrop-filter: blur(3px);
}
.reconnect-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 1.6rem 2rem; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.5); min-width: 280px;
}
.reconnect-spinner {
    width: 38px; height: 38px; margin: 0 auto .9rem; border-radius: 50%;
    border: 3px solid var(--border); border-top-color: var(--accent);
    animation: reconnect-spin .8s linear infinite;
}
@keyframes reconnect-spin { to { transform: rotate(360deg); } }
.reconnect-title { font-weight: 600; color: var(--text); }
.reconnect-sub { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
#components-reconnect-modal.components-reconnect-failed .reconnect-spinner,
#components-reconnect-modal.components-reconnect-rejected .reconnect-spinner { border-top-color: var(--warn); animation: none; }

/* Blazor error UI — hidden until an actual error occurs */
#blazor-error-ui {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    background: var(--surface-2); color: var(--text);
    border-top: 1px solid var(--warn); padding: .8rem 1.2rem; box-shadow: 0 -2px 10px rgba(0,0,0,.4);
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* Blazor-free escape hatch — plain links, so they keep working with a dead circuit */
.rescue-row { display: inline-flex; gap: .4rem; margin-left: .8rem; flex-wrap: wrap; }
.reconnect-card .rescue-row { display: flex; justify-content: center; margin: 1rem 0 0; }
.rescue-btn {
    padding: .3rem .7rem; border-radius: 8px; text-decoration: none; font-size: .8rem;
    border: 1px solid var(--border); color: var(--text); background: var(--surface-2);
}
.rescue-btn:hover { border-color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- UI polish pass */
html, body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

.card { box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: border-color .15s, transform .15s, box-shadow .15s; }
.card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.4); }

.badge { padding: .15rem .55rem; font-weight: 500; }
.btn { transition: filter .12s ease, border-color .12s ease, transform .05s ease; border-radius: 7px; }
.btn:active { transform: translateY(1px); }

.panel { box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.detail h1 { letter-spacing: -.01em; }

/* Key/value detail blocks → bordered rows */
.detail .kv, .panel .kv { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; gap: 0; }
.kv > span { padding: .5rem .85rem; border-top: 1px solid var(--border); display: flex; align-items: center; }
.kv > span.k { color: var(--muted); background: rgba(255,255,255,.02); }
.kv > span:first-child, .kv > span:nth-child(2) { border-top: none; }

.cache-note { border-radius: 9px; padding: .6rem .85rem; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.32); color: #fde68a; }

/* Validation panel (per-line, coloured, with icons) */
.validation { border-radius: 11px; padding: .85rem 1rem; margin: 1rem 0; border: 1px solid; }
.validation.error { background: linear-gradient(180deg, rgba(239,68,68,.12), rgba(239,68,68,.05)); border-color: rgba(239,68,68,.45); }
.validation.warning { background: linear-gradient(180deg, rgba(251,191,36,.12), rgba(251,191,36,.05)); border-color: rgba(251,191,36,.45); }
.validation-head { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .95rem; }
.validation.error .validation-head { color: #fca5a5; }
.validation.warning .validation-head { color: #fcd34d; }
.vbig { font-size: 1.15rem; }
.validation-list { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.vline { display: flex; align-items: flex-start; gap: .5rem; font-size: .85rem; line-height: 1.4;
    background: rgba(0,0,0,.18); border-radius: 7px; padding: .4rem .6rem; }
.vline.err { color: #fecaca; }
.vline.warn { color: #fde9b5; }
.vline .vico { flex: none; font-weight: 700; }
.vcode { font-family: 'Cascadia Code', Consolas, monospace; font-size: .72rem; opacity: .8;
    background: rgba(255,255,255,.07); border-radius: 4px; padding: .05rem .35rem; margin-right: .25rem; }

/* Inputs: subtle focus ring */
.ipt:focus, .toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(91,141,239,.25); }

/* ---------------------------------------------------------------- Publish page */
.lead { color: var(--muted); font-size: .98rem; line-height: 1.6; max-width: 820px; margin: 0 0 1.4rem; }
.lead code { background: var(--surface-2); padding: .05rem .35rem; border-radius: 5px; font-size: .88em; }

/* Tracked-files documentation: annotated tree + descriptions */
.tracked { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 1.4rem; align-items: start; }
@media (max-width: 720px) { .tracked { grid-template-columns: 1fr; } }
.tracked-tree {
    font-family: 'Cascadia Code', Consolas, monospace; font-size: .82rem; line-height: 1.7;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    padding: .9rem 1rem; white-space: pre; overflow-x: auto; color: var(--muted); position: sticky; top: 5rem;
}
.tracked-tree .t-dir { color: var(--accent); }
.tracked-tree .t-file { color: var(--text); }
.tracked-tree .t-file.req { color: #fff; font-weight: 600; }
.tracked-tree .t-dim { color: var(--muted); opacity: .7; }

.tracked-docs { margin: 0; display: flex; flex-direction: column; gap: .1rem; }
.trackfile { padding: .7rem 0; border-top: 1px solid var(--border); }
.trackfile:first-child { border-top: none; padding-top: 0; }
.trackfile dt { display: flex; align-items: center; gap: .5rem; font-size: .95rem; margin-bottom: .3rem; }
.trackfile dt code { background: var(--surface-2); padding: .1rem .4rem; border-radius: 5px; font-size: .88rem; color: var(--text); }
.trackfile dd { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.55; }
.trackfile dd code { background: var(--bg); padding: .05rem .3rem; border-radius: 4px; }
.t-ico { font-size: 1rem; }
.pill { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
    padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: var(--surface-2); }
.pill.req { color: var(--accent); border-color: rgba(91,141,239,.45); }

.callout { margin-top: 1.2rem; padding: .7rem .9rem; border-radius: 9px;
    background: rgba(91,141,239,.08); border: 1px solid rgba(91,141,239,.3); color: #c9d7f5; line-height: 1.5; }

/* Generated registry-entry preview */
.entry-preview { margin: 1rem 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.entry-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .5rem .85rem; background: var(--surface-2); font-size: .84rem; color: var(--muted); }
.entry-preview-head code { color: var(--text); }
.entry-json { margin: 0; padding: .85rem 1rem; background: var(--bg); overflow-x: auto;
    font-family: 'Cascadia Code', Consolas, monospace; font-size: .82rem; line-height: 1.5; color: var(--text); }

/* Method tabs share the .modes/.mode look; give them a touch more presence here */
.panel .modes { margin-top: 1rem; }

.signed-in { color: var(--ok); }
.steps { margin: .3rem 0 1rem 1.1rem; padding: 0; color: var(--text); font-size: .9rem; line-height: 1.6; }
.steps li { margin: .35rem 0; }
.steps code { background: var(--surface-2); padding: .05rem .35rem; border-radius: 5px; font-size: .88em; }
.manual-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ---------------------------------------------------------------- My projects manager (two-pane) */
.mp-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 820px) { .mp-layout { grid-template-columns: 1fr; } }

.mp-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; position: sticky; top: 5rem; }
.mp-list-head { padding: .6rem .85rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }
.mp-item { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.mp-item.active { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.mp-item.active .mp-item-name { color: var(--accent); }
.mp-item-main { flex: 1; display: flex; align-items: center; gap: .5rem; min-width: 0;
    background: none; border: none; color: var(--text); text-align: left; padding: .55rem .8rem; cursor: pointer; font-size: .9rem; }
.mp-item-main:hover { background: var(--surface-2); }
.mp-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-ico { flex: none; }
.mp-remove { background: none; border: none; color: var(--muted); cursor: pointer; padding: .4rem .6rem; font-size: .8rem; }
.mp-remove:hover { color: var(--warn); }
.mp-add { width: calc(100% - 1.2rem); margin: .6rem; }
.mp-add-browser { padding: .6rem; border-top: 1px solid var(--border); }

.mp-detail { min-height: 200px; }
.mp-empty { color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); padding: 2.5rem 1.5rem; text-align: center; }
.mp-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.mp-detail-head h2 { font-size: 1.2rem; }

.mp-proj { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; }
.mp-proj-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .85rem;
    background: var(--surface); border-bottom: 1px solid var(--border); font-weight: 600; font-size: .92rem; }
.mp-none { padding: .7rem .85rem; margin: 0; }
.mp-attach { display: flex; align-items: center; gap: .45rem; padding: .5rem .85rem;
    border-bottom: 1px solid var(--border); }
.mp-assets { display: flex; flex-direction: column; }
.mp-asset { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .55rem .85rem; border-bottom: 1px solid var(--border); }
.mp-asset:last-child { border-bottom: none; }
.mp-asset-main { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; min-width: 0; }
.mp-asset-name { font-weight: 600; }
.mp-asset-actions { display: flex; gap: .4rem; flex: none; }

/* ---------------------------------------------------------------- Update banner */
.update-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem 1rem;
    padding: .6rem 1.2rem; background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    border-bottom: 1px solid var(--accent); font-size: .9rem;
}
.update-banner .update-actions { display: flex; gap: .5rem; align-items: center; }

/* ---------------------------------------------------------------- Download page */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin: 1.4rem 0 .6rem; }
.dl-card {
    position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem;
    padding: 1.6rem 1rem 1.1rem; border: 1px solid var(--border); border-radius: 14px;
    background: linear-gradient(180deg, var(--surface), var(--surface-2)); color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.dl-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.dl-card.recommended { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(91,141,239,.18); }
.dl-ribbon { position: absolute; top: .7rem; right: .7rem; font-size: .62rem; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: #fff; background: var(--accent); padding: .12rem .5rem; border-radius: 999px; }
.dl-os { font-size: 2.6rem; line-height: 1; margin-bottom: .1rem; filter: saturate(1.1); }
.dl-label { font-weight: 700; font-size: 1rem; }
.dl-file { color: var(--muted); font-size: .74rem; word-break: break-all; }
.dl-cta { margin-top: .5rem; font-size: .82rem; font-weight: 600; color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 8px; padding: .35rem .9rem; transition: background .12s ease; }
.dl-card:hover .dl-cta { background: var(--accent); color: #fff; border-color: var(--accent); }
.dl-note { text-align: center; margin-bottom: 1.4rem; }
.dl-version { text-align: center; color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }
.dl-version strong { color: var(--accent); font-family: 'Cascadia Code', Consolas, monospace; }
.dl-ver-badge { font-size: .68rem; font-weight: 600; color: var(--accent); font-family: 'Cascadia Code', Consolas, monospace;
    border: 1px solid rgba(91,141,239,.4); border-radius: 999px; padding: .05rem .5rem; }

/* ---------------------------------------------------------------- Modal / popup */
.modal-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(8,10,14,.68); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; padding: 4vh 3vw; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    width: 100%; max-width: 480px; max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.55); overflow: hidden; }
.modal-card.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .8rem 1.1rem; border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 700; }
.modal-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .2rem .4rem; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 1rem 1.1rem; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1.1rem; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- Install: project picker */
.pick-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pick-row { display: flex; align-items: center; gap: .5rem; background: none; border: none; border-bottom: 1px solid var(--border);
    color: var(--text); text-align: left; padding: .55rem .8rem; cursor: pointer; font-size: .9rem; }
.pick-row:last-child { border-bottom: none; }
.pick-row:hover:not(:disabled) { background: var(--surface-2); }
.pick-row.active { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.pick-row.active .pick-name { color: var(--accent); }
.pick-row:disabled { opacity: .5; cursor: not-allowed; }
.pick-name { font-weight: 600; }
.pick-path { margin: 0 0 0 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.clone-modes { margin: .9rem 0 .2rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.02); }
.clone-modes .check { align-items: flex-start; }

/* Operation log: what an install, update or uninstall actually did — one line per step, so a
   failure stands out instead of being buried in a paragraph of run-on sentences. Cache paths can
   be long, hence the anywhere-wrap. */
.op-log {
    list-style: none; margin: .8rem 0 0; padding: .6rem .8rem;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
    font-size: .82rem; line-height: 1.5; color: var(--muted);
    display: flex; flex-direction: column; gap: .25rem;
    max-height: 18rem; overflow-y: auto;
}
.op-log li { overflow-wrap: anywhere; }
.op-log li.ok { color: var(--text); }
.op-log li.warn { color: var(--warn); }
.op-log li.bad { color: #f87171; }
