/* Mac Admin design system */
:root {
  --bg: #f4f5f8; --surface: #ffffff; --surface-2: #f8f9fb; --text: #161b26; --muted: #6b7385; --faint: #9aa2b2;
  --border: #e3e6ec; --border-strong: #d2d7e0;
  --accent: #2563eb; --accent-2: #4f8cff; --accent-soft: #e8efff; --accent-text: #fff;
  --good: #15803d; --good-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fdf3e2; --bad: #c0262d; --bad-soft: #fdecec;
  --info-soft: #eaf1ff; --code-bg: #f1f3f7;
  --side-bg: #0f1420; --side-text: #c9cfdb; --side-muted: #7e8698; --side-active: #1d2433; --side-border: #1f2636;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.18);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f16; --surface: #141925; --surface-2: #181e2b; --text: #e7eaf0; --muted: #9aa3b5; --faint: #6c7486;
    --border: #232a39; --border-strong: #2e3647;
    --accent: #5b8cff; --accent-2: #7aa2ff; --accent-soft: #1b2847; --accent-text: #fff;
    --good: #4ade80; --good-soft: #12291c; --warn: #f5b84b; --warn-soft: #2e2311; --bad: #f87171; --bad-soft: #351719;
    --info-soft: #17223b; --code-bg: #1c2230;
    --side-bg: #090c12; --side-active: #161c29; --side-border: #161b26;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; letter-spacing: -.01em; margin: 0 0 .25rem; }
h2 { font-size: 1.02rem; margin: 0 0 .8rem; letter-spacing: -.005em; }
h3 { font-size: .95rem; margin: 1.2rem 0 .5rem; }
code, pre, textarea.code { font-family: var(--mono); font-size: .86em; }
code { background: var(--code-bg); padding: .1em .38em; border-radius: 5px; overflow-wrap: anywhere; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .faint { color: var(--faint); }
.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* --- Shell --- */
body.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; padding: 1rem .7rem; border-right: 1px solid var(--side-border); }
.logo { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; font-size: 1.05rem; padding: .3rem .5rem 1.2rem; }
.logo:hover { text-decoration: none; }
.logo-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #fff; }
.logo-mark svg { width: 17px; height: 17px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a, .side-foot a, .side-btn { display: flex; align-items: center; gap: .7rem; padding: .52rem .65rem; border-radius: 8px; color: var(--side-text); font-weight: 500; font-size: .93rem; }
.side-nav a:hover, .side-foot a:hover, .side-btn:hover { background: var(--side-active); color: #fff; text-decoration: none; }
.side-nav a.active, .side-foot a.active { background: var(--side-active); color: #fff; box-shadow: inset 2px 0 0 var(--accent-2); }
.side-nav svg, .side-foot svg { color: var(--side-muted); }
.side-nav a.active svg { color: var(--accent-2); }
.side-nav .count { margin-left: auto; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 0 .45rem; min-width: 1.3rem; text-align: center; }
.side-foot { border-top: 1px solid var(--side-border); padding-top: .6rem; display: flex; flex-direction: column; gap: 2px; }
.side-btn { width: 100%; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: .7rem 1.6rem; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.globalsearch { position: relative; flex: 1; max-width: 560px; }
.globalsearch svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.globalsearch input { width: 100%; padding: .55rem .8rem .55rem 2.2rem; border-radius: 10px; background: var(--surface); }
.topbar .small-btn { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; }
.topbar .small-btn svg { width: 15px; height: 15px; }
main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.6rem 1.6rem 4rem; }
main.wide { max-width: 1440px; }
body.bare main.auth { max-width: 440px; padding-top: 12vh; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head p { margin: 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* --- Cards & layout --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); overflow-x: auto; }
.card.narrow { max-width: 440px; margin: 0 auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }
details.card > summary { cursor: pointer; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.grid .card { margin-bottom: 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 900px) { .span-2 { grid-column: auto; } .grid.two { grid-template-columns: 1fr; } }

.kpi { display: flex; flex-direction: column; gap: .15rem; position: relative; }
.kpi .label { color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi .sub { font-size: .84rem; color: var(--muted); }
.kpi.good .value { color: var(--good); } .kpi.warn .value { color: var(--warn); } .kpi.bad .value { color: var(--bad); }
.kpi .kpi-icon { position: absolute; right: 0; top: 0; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi.good .kpi-icon { background: var(--good-soft); color: var(--good); } .kpi.warn .kpi-icon { background: var(--warn-soft); color: var(--warn); } .kpi.bad .kpi-icon { background: var(--bad-soft); color: var(--bad); }

/* --- Flash --- */
.flash { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid; white-space: pre-wrap; }
.flash.ok { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.flash.err { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

/* --- Forms --- */
form { margin: 0; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.stack label, label.field { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; font-size: .9rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .3rem 0; }
.row.tight { margin: 0; flex-wrap: nowrap; gap: .35rem; }
.row.tight form { display: inline; }
.grow { flex: 1; min-width: 12rem; }
.right { display: flex; justify-content: flex-end; margin-top: .6rem; }
label.inline { display: flex; flex-direction: row; align-items: center; gap: .45rem; font-weight: 400; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .5rem .65rem; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
textarea.code { width: 100%; min-height: 12rem; tab-size: 2; white-space: pre; line-height: 1.5; }
input.num { width: 5rem; }

button, .button { font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .48rem .95rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); white-space: nowrap; transition: background .12s, border-color .12s; }
button:hover, .button:hover { border-color: var(--accent); text-decoration: none; }
button svg, .button svg { width: 16px; height: 16px; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.primary:hover, .button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
button.danger { color: var(--bad); }
button.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
button.small { padding: .22rem .6rem; font-size: .84rem; }
button.link { border: 0; background: none; color: var(--accent); padding: .3rem .3rem; }
button.toggle { min-width: 4.2rem; font-weight: 600; }
button.toggle.on { background: var(--good); border-color: var(--good); color: #fff; }
button.toggle.off { color: var(--muted); }
button.ensure.present { color: var(--good); } button.ensure.absent { color: var(--bad); }

/* --- Lists & tables --- */
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .5rem .2rem; border-bottom: 1px solid var(--border); }
.items li:last-child { border-bottom: 0; }
li.absent > span:first-child, tr.absent td:first-child { text-decoration: line-through; color: var(--muted); }
.filter { width: 100%; margin-bottom: .7rem; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: .45rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .6rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr.clickable { cursor: pointer; }
tr.revoked td { color: var(--muted); }
.withicon { display: inline-flex; align-items: center; gap: .6rem; }
.withicon img { border-radius: 6px; flex: none; }

/* --- Pills, badges, dots --- */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .05rem .5rem; border-radius: 99px; background: var(--accent); color: var(--accent-text); }
.badge.warn { background: var(--warn); }
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 600; padding: .15rem .6rem; border-radius: 99px; background: var(--code-bg); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.success, .pill.ok, .pill.healthy, .pill.done { background: var(--good-soft); color: var(--good); }
.pill.changed, .pill.running, .pill.working, .pill.sent, .pill.queued { background: var(--info-soft); color: var(--accent); }
.pill.failed, .pill.error, .pill.lost, .pill.attention, .pill.critical { background: var(--bad-soft); color: var(--bad); }
.pill.skipped, .pill.offline, .pill.warning { background: var(--warn-soft); color: var(--warn); }
.pill.revoked, .pill.cancelled, .pill.none { background: var(--code-bg); color: var(--faint); }
.pill.running::before, .pill.working::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }

/* --- Tabs & crumbs --- */
.crumbs { margin: 0 0 .5rem; color: var(--muted); font-size: .9rem; }
.tabs { display: flex; gap: .1rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: .4rem 0 1.2rem; }
.tabs a { padding: .55rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }

/* --- Facts --- */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }

/* --- Charts --- */
.donut-wrap { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; }
.donut circle { fill: none; stroke-width: 14; }
.donut .track { stroke: var(--code-bg); }
.donut text { fill: var(--text); stroke: none; font-size: 22px; font-weight: 700; font-family: var(--font); }
.donut text.sub { font-size: 9px; font-weight: 500; fill: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; }
.legend li { display: flex; align-items: center; gap: .5rem; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.c-healthy { stroke: #22c55e; background: #22c55e; } .c-attention { stroke: #ef4444; background: #ef4444; }
.c-offline { stroke: #f59e0b; background: #f59e0b; } .c-working { stroke: #3b82f6; background: #3b82f6; }
.c-0 { stroke: #3b82f6; background: #3b82f6; } .c-1 { stroke: #8b5cf6; background: #8b5cf6; } .c-2 { stroke: #06b6d4; background: #06b6d4; }
.c-3 { stroke: #f59e0b; background: #f59e0b; } .c-4 { stroke: #ec4899; background: #ec4899; } .c-5 { stroke: #64748b; background: #64748b; }
.bars { display: flex; flex-direction: column; gap: .7rem; }
.bar-row { display: grid; grid-template-columns: 7rem 1fr 3.5rem; align-items: center; gap: .7rem; font-size: .88rem; }
.bar-row .num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { width: 100%; height: 8px; display: block; }
.bar rect.track { fill: var(--code-bg); }
.bar rect.fill { fill: var(--accent); } .bar rect.fill.good { fill: #22c55e; } .bar rect.fill.warn { fill: #f59e0b; } .bar rect.fill.bad { fill: #ef4444; }
.gauge { width: 100%; height: 10px; }

/* --- Timeline --- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--faint); font-size: .8rem; white-space: nowrap; }

/* --- Mac header & live run --- */
.machead { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .3rem; }
.machead .macicon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--border); color: var(--accent); }
.machead .macicon svg { width: 28px; height: 28px; }
.machead h1 { margin: 0; }
.machead .sub { color: var(--muted); font-size: .9rem; }
.quick { display: flex; gap: .45rem; flex-wrap: wrap; margin: .9rem 0 .4rem; }
.quick form { display: inline; }
.live { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.live-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.live-head .pct { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress { width: 100%; height: 10px; margin: .7rem 0; }
.progress rect.track { fill: var(--code-bg); } .progress rect.fill { fill: var(--accent); transition: width .4s; }
.live-items { list-style: none; margin: 0; padding: 0; max-height: 18rem; overflow: auto; font-size: .88rem; }
.live-items li { display: flex; gap: .6rem; align-items: center; padding: .3rem 0; border-bottom: 1px dashed var(--border); }
.live-items li .msg { color: var(--muted); margin-left: auto; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }

/* --- Code blocks --- */
pre { margin: 0; }
pre.key, pre.output { background: var(--code-bg); padding: .75rem .9rem; border-radius: var(--radius-sm); white-space: pre-wrap; overflow-wrap: anywhere; margin: .6rem 0; }
pre.key { cursor: copy; }
pre.key.big { font-size: .95rem; padding: 1rem 1.1rem; border: 1px dashed var(--border-strong); }
pre.output { max-height: 22rem; overflow: auto; font-size: .82rem; }
pre.output.long { max-height: 70vh; }
pre.terminal { background: #0b0f17; color: #d6deeb; border-radius: var(--radius-sm); padding: .9rem 1rem; font-size: .82rem; max-height: 26rem; overflow: auto; white-space: pre-wrap; margin: .5rem 0 0; }

/* --- Auth --- */
.qr { display: block; margin: 1rem auto; background: #fff; padding: 10px; border-radius: 10px; }
.secret { display: block; margin-top: .5rem; letter-spacing: .08em; }
.codes { columns: 2; list-style: none; padding: 0; } .codes li { margin: .3rem 0; }
.steps { padding-left: 1.2rem; } .steps li { margin: .3rem 0; }

/* --- Search suggestions --- */
.combo { position: relative; flex: 1; min-width: 14rem; }
.combo input { width: 100%; }
.suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; list-style: none; margin: 0; padding: .25rem; z-index: 10; max-height: 22rem; overflow: auto; box-shadow: var(--shadow-lg); }
.suggestions li { padding: .45rem .6rem; border-radius: 7px; cursor: pointer; }
.suggestions li:hover, .suggestions li.active { background: var(--code-bg); }
.suggestions .tok { font-weight: 600; } .suggestions .desc { display: block; color: var(--muted); font-size: .82rem; }

/* --- Misc --- */
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.cta-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: .5rem; }
.empty-state h2 { color: var(--text); }
.check-list { list-style: none; padding: 0; margin: 0; columns: 2; }
.check-list li { break-inside: avoid; padding: .2rem 0; }

/* --- Add software picker --- */
.picker-top { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; margin-bottom: .4rem; }
.searchbox { position: relative; flex: 1; min-width: 16rem; }
.searchbox svg { position: absolute; left: .8rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.searchbox input { width: 100%; padding: .7rem .9rem .7rem 2.4rem; font-size: 1rem; border-radius: 10px; background: var(--surface); }
.seg { display: inline-flex; background: var(--code-bg); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: .45rem .8rem; border-radius: 8px; color: var(--muted); font-weight: 500; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0 1rem; }
.chips button { border-radius: 99px; padding: .3rem .85rem; font-size: .86rem; }
.chips button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .75rem; padding-bottom: 6rem; }
.appcard { position: relative; display: flex; gap: .75rem; align-items: flex-start; padding: .9rem; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; user-select: none; box-shadow: var(--shadow); }
.appcard:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(16,24,40,.09); }
.appcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.appcard img { width: 44px; height: 44px; border-radius: 10px; flex: none; object-fit: contain; background: var(--code-bg); }
.appcard .meta { display: flex; flex-direction: column; min-width: 0; gap: .1rem; padding-right: 1.4rem; }
.appcard .meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appcard .by { font-size: .8rem; color: var(--muted); }
.appcard .desc { font-size: .82rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.appcard .tick { position: absolute; top: .7rem; right: .7rem; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface); }
.appcard.selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.appcard.selected .tick { background: var(--accent); border-color: var(--accent); }
.appcard.selected .tick::after, .appcard.added .tick::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.appcard.added { cursor: default; opacity: .7; }
.appcard.added:hover { transform: none; box-shadow: var(--shadow); border-color: var(--border); }
.appcard.added .tick { background: var(--good); border-color: var(--good); }
.empty { text-align: center; padding: 2rem 0; }
.selectbar { position: fixed; left: calc(50% + 118px); bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: .8rem; padding: .6rem .7rem .6rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 2rem); }
.sel-icons { display: flex; }
.sel-icons img { width: 28px; height: 28px; border-radius: 7px; margin-left: -6px; border: 2px solid var(--surface); background: var(--code-bg); }
.sel-icons img:first-child { margin-left: 0; }
#sel-count { font-weight: 600; white-space: nowrap; }

/* --- Responsive --- */
@media (max-width: 860px) {
  body.shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: .4rem; padding: .5rem .7rem; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--side-border); }
  .logo { padding: 0 .4rem 0 0; } .logo { font-size: 0; gap: 0; }
  .side-nav { flex-direction: row; flex: none; }
  .side-nav a span, .side-foot a span, .side-btn span { display: none; }
  .side-nav .count { display: inline; margin-left: .2rem; }
  .side-foot { flex-direction: row; border-top: 0; padding-top: 0; margin-left: auto; }
  .topbar { padding: .6rem 1rem; }
  main { padding: 1rem 1rem 3rem; }
  .selectbar { left: 1rem; right: 1rem; transform: none; }
  .sel-icons { display: none; }
  .check-list { columns: 1; }
}
.tightbar { display: block; width: 5rem; margin-bottom: .15rem; }
h2.spaced { margin-top: 1.2rem; }
.cmd { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.cmd:last-child { border-bottom: 0; }
details.cmd summary { cursor: pointer; }
a.card { color: inherit; } a.card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.synchead { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin: .2rem 0 .2rem; }
.syncchip { display: inline-flex; align-items: center; gap: .35rem; }
.pill.in_sync { background: var(--good-soft); color: var(--good); }
.pill.syncing { background: var(--info-soft); color: var(--accent); }
.pill.syncing::before { animation: pulse 1.2s ease-in-out infinite; }
.pill.pending { background: color-mix(in srgb, #8b5cf6 15%, var(--surface)); color: #8b5cf6; }
.pill.out_of_sync { background: var(--bad-soft); color: var(--bad); }
.pill.no_config { background: var(--code-bg); color: var(--faint); }
.machead h1 .pill { vertical-align: middle; font-size: .78rem; }
.items.pickable li { padding: .35rem .2rem; }
.items.pickable label { cursor: pointer; }
