/* Phoenix Skill Store. Builds on the tokens and primitives in theme.css and
   loads nothing from outside: no web fonts, no remote images.

   Mobile first. Phones get a bottom tab bar, list-style app rows and a bottom
   sheet for installs; from 600px cards become tiles in a grid, and from 760px
   the tabs move into the header. */

:root {
  --bar-h: 60px;
  --tabbar-h: 64px;
}

body { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
/* Focus and scrollIntoView stop clear of the sticky header and the phone's fixed tab bar, so a focused control is never hidden under either. */
html { scroll-padding-top: calc(var(--bar-h) + .75rem); scroll-padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + .75rem); }
@media (min-width: 760px) { html { scroll-padding-bottom: .75rem; } }
main { flex: 1; width: 100%; max-width: var(--wide); margin-inline: auto; padding: 0 var(--gutter) 2.5rem; }
html:not(.js) .js-only { display: none !important; }
.store-content { outline: none; }
.icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.meta { color: var(--muted); font-size: var(--t-sm); }
.mono { font-family: var(--font-mono); font-size: var(--t-xs); overflow-wrap: anywhere; }

/* ==========================================================================
   Header and tabs
   ========================================================================== */

.store-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-soft);
}
/* The blur lives on a layer of its own: a backdrop-filter on the header would
   make it the containing block of the fixed phone tab bar inside it. */
.store-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}
@supports not (backdrop-filter: blur(1px)) { .store-header::before { background: var(--bg); } }
.store-bar {
  max-width: var(--wide);
  height: var(--bar-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: .7rem;
}
.store-bar .brand { font-size: 1.0625rem; }
.store-name {
  padding: .2rem .62rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: var(--t-xs);
  font-weight: 650;
  letter-spacing: .02em;
}
.store-signin { margin-inline-start: auto; }

/* Phones: a bottom tab bar within thumb reach. */
.store-tabs {
  position: fixed;
  z-index: 60;
  inset: auto 0 0;
  display: flex;
  gap: .25rem;
  padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--border-soft);
}
.store-tabs a {
  flex: 1;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: .6875rem;
  font-weight: 620;
  letter-spacing: .01em;
}
.store-tabs a .icon { width: 22px; height: 22px; }
.store-tabs a:hover { color: var(--fg); }
.store-tabs a[aria-current="page"] { color: var(--accent); }
.store-tabs a[aria-current="page"] .icon { filter: drop-shadow(0 0 8px var(--accent-glow)); }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .store-tabs {
    position: static;
    margin-inline-start: .75rem;
    padding: 0;
    background: none;
    border: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .store-tabs a {
    flex: none;
    flex-direction: row;
    gap: .45rem;
    min-height: 38px;
    padding: .4rem .85rem;
    color: var(--fg-dim);
    font-size: var(--t-sm);
    font-weight: 560;
  }
  .store-tabs a .icon { width: 17px; height: 17px; }
  .store-tabs a:hover { background: var(--panel-2); }
  .store-tabs a[aria-current="page"] { color: var(--fg); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--border); }
  .store-tabs a[aria-current="page"] .icon { color: var(--accent); filter: none; }
}

/* ==========================================================================
   Intro
   ========================================================================== */

.intro {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 1rem;
  padding: 1.6rem 0 .75rem;
}
.intro-glow {
  position: absolute;
  z-index: -1;
  inset: -3rem 0 auto;
  height: 380px;
  pointer-events: none;
  background:
    radial-gradient(38% 55% at 22% 32%, var(--accent-glow), transparent 72%),
    radial-gradient(30% 48% at 82% 12%, color-mix(in srgb, var(--accent-hot) 14%, transparent), transparent 72%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.intro h1 {
  margin: .7rem 0 .8rem;
  font-size: clamp(1.95rem, 1.35rem + 2.7vw, 3.35rem);
  font-weight: 680;
  line-height: 1.04;
  letter-spacing: -.036em;
}
.intro h1 .grad { display: block; }
.intro-lede { max-width: 46ch; color: var(--fg-dim); font-size: var(--t-md); line-height: 1.6; }
.intro-art { display: none; }
.intro-art svg { width: 100%; max-width: 380px; height: auto; margin-inline: auto; display: block; overflow: visible; }
.art-tile path { fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.art-tile { animation: float-slow 7s var(--ease) infinite; }
.art-tile.t2 { animation-delay: -2s; }
.art-tile.t3 { animation-delay: -4s; animation-duration: 8s; }
.art-tile.t4 { animation-delay: -1s; animation-duration: 9s; }
/* Faint outlines of more apps around the four tiles; theme tokens keep them quiet in both themes. */
.art-ghost { color: var(--fg); animation: float-slow 9s var(--ease) infinite; }
.art-ghost rect { fill: currentColor; fill-opacity: .05; stroke: currentColor; stroke-opacity: .2; stroke-width: 1.5; }
.art-ghost path { fill: none; stroke: currentColor; stroke-opacity: .5; stroke-width: 2; stroke-linecap: round; }
.art-ghost.g2 { animation-delay: -3s; animation-duration: 10s; }
.art-ghost.g3 { animation-delay: -6s; animation-duration: 11s; }
@media (min-width: 900px) {
  .intro { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: center; padding: 2.75rem 0 1.25rem; }
  .intro-art { display: block; }
}

/* ==========================================================================
   Catalog tools: search, categories, your robots
   ========================================================================== */

.catalog-tools { display: grid; gap: .85rem; margin: .75rem 0 1.5rem; }
.search-field { position: relative; display: flex; align-items: center; max-width: 720px; }
.search-field > .icon { position: absolute; left: 1.05rem; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-field input {
  min-height: 52px;
  padding: .75rem 3rem .75rem 2.9rem;
  border-radius: var(--radius-pill);
  background: var(--panel);
  box-shadow: var(--shadow-sm), var(--edge);
  font-size: var(--t-md);
}
.search-key {
  position: absolute;
  right: 1rem;
  min-width: 1.6rem;
  padding: .05rem .4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  text-align: center;
  pointer-events: none;
}
.search-field:has(input:not(:placeholder-shown)) .search-key { display: none; }
@media (hover: none) { .search-key { display: none; } }

/* The row scrolls sideways on narrow screens. A static fade at the edge it
   continues past says so, and the end padding lets the last chip scroll clear
   of the fade. Forced colours get a real scrollbar instead (below). */
.category-chips {
  --chip-fade: 2rem;
  display: flex;
  flex-wrap: nowrap;
  gap: .5rem;
  overflow-x: auto;
  margin-inline: calc(var(--gutter) * -1);
  padding: .3rem calc(var(--gutter) + var(--chip-fade)) .45rem var(--gutter);
  scroll-padding-inline: var(--gutter) calc(var(--gutter) + var(--chip-fade));
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 min(var(--gutter), 1rem), #000 calc(100% - var(--gutter) - var(--chip-fade)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 min(var(--gutter), 1rem), #000 calc(100% - var(--gutter) - var(--chip-fade)), transparent);
}
.category-chips::-webkit-scrollbar { display: none; }
.chip-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 40px;
  padding: .4rem .55rem .4rem .85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg-dim);
  font-size: var(--t-sm);
  font-weight: 560;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.chip-btn .icon { width: 16px; height: 16px; }
.chip-btn:hover { border-color: var(--accent-line); color: var(--fg); }
.chip-btn[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chip-count {
  min-width: 1.5em;
  padding: .05rem .4rem;
  border-radius: var(--radius-pill);
  background: var(--panel-3);
  color: var(--muted);
  font-size: .6875rem;
  font-weight: 650;
  text-align: center;
}
.chip-btn[aria-pressed="true"] .chip-count { background: color-mix(in srgb, var(--bg) 22%, transparent); color: inherit; }

.robot-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.robot-strip-label { margin-inline-end: .2rem; color: var(--muted); font-size: var(--t-xs); font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.robot-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 38px;
  padding: .3rem .8rem .3rem .35rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--fg);
  font-size: var(--t-sm);
  font-weight: 560;
}
.robot-chip:hover { border-color: var(--border); }
.robot-strip-state { color: var(--muted); font-size: var(--t-xs); font-weight: 500; }

/* ==========================================================================
   App tiles and badges
   ========================================================================== */

/* App identity colours are fixed mid-tones that read on both themes. */
.tile-game, .tone-game { --t1: #ffbf5e; --t2: #f2603a; }
.tile-music, .tone-music { --t1: #4fdc9a; --t2: #11946a; }
.tile-home, .tone-home { --t1: #7fb2ff; --t2: #3a62d4; }
.tile-agent, .tone-agent { --t1: #c39bff; --t2: #e2507a; }
.tile-mono-0, .tone-mono-0 { --t1: #5ee0cf; --t2: #128a7e; }
.tile-mono-1, .tone-mono-1 { --t1: #9fa8ff; --t2: #4f55d1; }
.tile-mono-2, .tone-mono-2 { --t1: #ff9fb2; --t2: #d4446a; }
.tile-mono-3, .tone-mono-3 { --t1: #ffcf6e; --t2: #cf7d14; }
.tile-mono-4, .tone-mono-4 { --t1: #8fd8ff; --t2: #2b7fcf; }
.tile-mono-5, .tone-mono-5 { --t1: #b8c3d6; --t2: #56637d; }
.tile-mono-6, .tone-mono-6 { --t1: #b7ec6b; --t2: #44901a; }
.tile-mono-7, .tone-mono-7 { --t1: #ffae8a; --t2: #d9532f; }

.app-tile {
  --tile: 56px;
  position: relative;
  flex: none;
  width: var(--tile);
  height: var(--tile);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: calc(var(--tile) * .28);
  background: linear-gradient(140deg, var(--t1, #9aa6bb), var(--t2, #5d6b85));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -2px 6px rgba(0, 0, 0, .14), 0 8px 18px -10px var(--t2, #000);
}
.app-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 18% 0%, rgba(255, 255, 255, .3), transparent 55%);
  pointer-events: none;
}
.tile-glyph { width: 52%; height: 52%; stroke-width: 1.7; }
.monogram { font-size: calc(var(--tile) * .36); font-weight: 720; letter-spacing: -.02em; text-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.tile-sm { --tile: 44px; }
.tile-md { --tile: 48px; }
.tile-lg { --tile: 72px; }
.tile-xl { --tile: 84px; }
@media (min-width: 600px) { .tile-xl { --tile: 112px; } }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  padding: .18rem .55rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 640;
  line-height: 1.35;
  white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-error { background: var(--error-soft); color: var(--error); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-info .icon { animation: soft-pulse 1.8s var(--ease) infinite; }
.badge-muted { background: var(--panel-3); color: var(--fg-dim); }
@keyframes soft-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.publisher { display: inline-flex; align-items: center; }
.verified {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-inline-start: .3rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.verified .icon { width: 10px; height: 10px; stroke-width: 3.2; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn .icon { width: 16px; height: 16px; }
.btn[aria-busy="true"] { cursor: progress; opacity: .7; }
.btn-lg, .btn-primary { min-height: 44px; }
/* The store's "get" pill: a soft accent that fills on hover. */
.btn-get {
  --btn-bg: var(--accent-soft);
  --btn-fg: var(--accent);
  --btn-border: var(--accent-line);
  min-height: 38px;
  padding: .42rem 1rem;
  border-radius: var(--radius-pill);
  box-shadow: none;
  font-size: var(--t-sm);
  font-weight: 650;
}
.btn-get:hover { background-color: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-get-quiet { --btn-bg: var(--panel-2); --btn-fg: var(--fg); --btn-border: var(--border); }
.btn-get-quiet:hover { background-color: var(--panel-3); border-color: var(--border); color: var(--fg); }
.btn-danger-quiet { color: var(--error); }
.btn-danger-quiet:hover { background: var(--error-soft); color: var(--error); }
.btn-danger { --btn-bg: var(--error); --btn-fg: #fff; --btn-border: transparent; min-height: 44px; font-weight: 620; }
.btn-danger:hover { background-color: var(--error); border-color: transparent; filter: brightness(1.08); }

/* ==========================================================================
   Shelves and app cards
   ========================================================================== */

.shelf { margin: 2.25rem 0; }
.shelf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.shelf-head h2 { font-size: var(--t-xl); letter-spacing: -.026em; }
.shelf-head p { margin-top: .3rem; color: var(--muted); font-size: var(--t-sm); }

.app-grid { display: grid; gap: .75rem; }
.app-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "tile body" "foot foot";
  gap: .8rem .95rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  background: var(--panel);
  box-shadow: var(--edge);
  transition: transform var(--step) var(--ease-out), border-color var(--step) var(--ease), box-shadow var(--step) var(--ease);
}
.app-card > .app-tile { grid-area: tile; }
.app-card-body { grid-area: body; min-width: 0; align-self: center; }
.app-card-title { font-size: var(--t-md); font-weight: 640; letter-spacing: -.016em; }
/* The title link covers the card; the action stays above it. */
.app-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.app-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .2rem; margin-top: .15rem; color: var(--muted); font-size: var(--t-xs); }
.app-card-pitch {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: .45rem;
  color: var(--fg-dim);
  font-size: var(--t-sm);
  line-height: 1.5;
}
/* Badge and action share a row while they fit; the action wraps (staying on
   the right) rather than overlapping, and the note always takes a full row. */
.app-card-foot {
  grid-area: foot;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--hairline);
}
.app-card-foot > .state-text { flex: 1 1 4rem; min-width: 0; }
.app-card-foot .btn, .app-card-foot a.btn { position: relative; z-index: 1; margin-inline-start: auto; }
.app-card-foot > .card-note { flex: 1 1 100%; order: 3; }
.app-card:hover { transform: translateY(-2px); border-color: var(--border); box-shadow: var(--shadow), var(--edge); }
@supports selector(:has(*)) {
  .app-card:has(.app-card-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
  .app-card-link:focus-visible { outline: none; }
}
.app-card.is-installed, .app-card.is-installed-setup { background: linear-gradient(180deg, color-mix(in srgb, var(--ok) 5%, var(--panel)), var(--panel) 60%); }
.state-note { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; min-width: 0; }
.state-text { color: var(--muted); font-size: var(--t-xs); line-height: 1.45; }

@media (min-width: 600px) {
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1rem; }
  .app-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "tile" "body" "foot";
    gap: 1rem;
    padding: 1.25rem;
  }
  .app-card-body { align-self: start; }
  .app-card-pitch { -webkit-line-clamp: 3; }
}

/* ==========================================================================
   Featured spotlight
   ========================================================================== */

.spotlight {
  position: relative;
  display: grid;
  overflow: hidden;
  margin: .25rem 0 2.25rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-soft);
  background: var(--panel);
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--t2) 24%, transparent), transparent 62%),
    radial-gradient(60% 80% at 0% 100%, color-mix(in srgb, var(--t1) 10%, transparent), transparent 70%),
    linear-gradient(160deg, var(--panel), var(--bg-soft));
  box-shadow: var(--shadow-lg), var(--edge);
}
.spotlight-copy { display: grid; gap: .55rem; align-content: start; padding: 1.3rem 1.25rem 1.5rem; }
.spotlight h2 { font-size: clamp(1.65rem, 1.2rem + 1.9vw, 2.5rem); letter-spacing: -.032em; line-height: 1.08; }
.spotlight h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.spotlight-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; color: var(--muted); font-size: var(--t-sm); }
.spotlight-pitch { max-width: 50ch; color: var(--fg-dim); font-size: var(--t-md); line-height: 1.6; }
.spotlight-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .7rem; }
.spotlight .state-note { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }

.spot-art { position: relative; order: -1; height: 196px; display: grid; place-items: center; overflow: hidden; }
.spot-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--t1) 42%, transparent), transparent 66%);
}
.spot-art .app-tile { position: relative; z-index: 1; transform: rotate(-6deg); box-shadow: 0 24px 48px -22px rgba(0, 0, 0, .7); }
.spot-art .tile-spot { --tile: 120px; }
@media (min-width: 720px) {
  .spotlight { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .spotlight-copy { align-content: center; padding: 2.25rem 2.25rem 2.4rem; }
  .spot-art { order: 0; height: auto; min-height: 300px; }
  .spot-art .tile-spot { --tile: 148px; }
}

.publish-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .9rem 1rem;
  margin: 2.5rem 0 .5rem;
  padding: 1.2rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  background: var(--bg-soft);
}
.publish-band h2 { font-size: var(--t-md); }
.publish-band p { margin-top: .2rem; color: var(--muted); font-size: var(--t-sm); }
.publish-band .btn { grid-column: 1 / -1; justify-self: start; }
.publish-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}
@media (min-width: 720px) {
  .publish-band { grid-template-columns: auto minmax(0, 1fr) auto; }
  .publish-band .btn { grid-column: auto; }
}

/* ==========================================================================
   Empty, error and loading states
   ========================================================================== */

.empty-state {
  display: grid;
  justify-items: center;
  gap: .6rem;
  margin: 1.25rem 0;
  padding: 2.5rem 1.25rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  text-align: center;
}
.empty-state h1, .empty-state h2 { font-size: var(--t-xl); letter-spacing: -.024em; }
.empty-state p { max-width: 46ch; color: var(--fg-dim); }
.empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: .35rem;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
  color: var(--accent);
}
.empty-icon .icon { width: 26px; height: 26px; }
.empty-state.is-error .empty-icon { background: var(--error-soft); color: var(--error); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: .5rem; }

.loading-state { display: grid; gap: 1rem; padding: 1.25rem 0 2rem; }
.loading-label { display: inline-flex; align-items: center; gap: .6rem; color: var(--fg-dim); font-size: var(--t-sm); }
.skeleton-card { display: grid; gap: .75rem; padding: 1.25rem; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--panel); }
.sk-tile { width: 56px; height: 56px; border-radius: 16px; }
.sk-line { width: 72%; height: 12px; }
.sk-line.short { width: 42%; }

/* ==========================================================================
   App page
   ========================================================================== */

.detail { padding-top: 1rem; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 40px;
  margin-inline-start: -.35rem;
  padding: .35rem .65rem .35rem .35rem;
  border-radius: var(--radius-sm);
  color: var(--fg-dim);
  font-size: var(--t-sm);
  font-weight: 540;
}
.back-link:hover { background: var(--panel-2); color: var(--fg); }
.detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "tile title" "cta cta";
  gap: 1.1rem 1.15rem;
  align-items: center;
  padding: 1rem 0 1.6rem;
}
.detail-head > .app-tile { grid-area: tile; }
.detail-title { grid-area: title; min-width: 0; }
.detail-title h1 { margin: .3rem 0; font-size: clamp(1.7rem, 1.25rem + 2.1vw, 2.8rem); letter-spacing: -.035em; line-height: 1.06; }
.detail-publisher { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; color: var(--fg-dim); font-size: var(--t-sm); }
.detail-trust { color: var(--muted); }
.detail-cta { grid-area: cta; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.detail-cta .state-note { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
@media (max-width: 599px) { .detail-cta > .btn { flex: 1 1 100%; } }
@media (min-width: 600px) {
  .detail-head { grid-template-areas: "tile title" "tile cta"; align-items: start; column-gap: 1.6rem; }
  .detail-title { align-self: end; }
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 2rem;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--border-soft);
}
.fact { padding: .85rem 1rem; background: var(--panel); }
.fact dt { color: var(--muted); font-size: .6875rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.fact dd { margin: .25rem 0 0; color: var(--fg); font-size: var(--t-sm); font-weight: 600; }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.detail-section { margin: 0 0 2rem; }
.detail-section h2 { font-size: var(--t-lg); letter-spacing: -.02em; }
.section-title { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.detail-description { max-width: 70ch; margin-top: .6rem; color: var(--fg-dim); font-size: var(--t-md); line-height: 1.65; }
.whats-new > p { max-width: 70ch; color: var(--fg-dim); }
.bubble-list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.bubble {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .9rem;
  border: 1px solid var(--border-soft);
  border-radius: 18px 18px 18px 6px;
  background: var(--panel-2);
  font-size: var(--t-sm);
}
.bubble .icon { color: var(--accent); }
.setup-note { margin: 0 0 2rem; align-items: flex-start; }
.setup-note .icon { margin-top: .2rem; color: var(--accent); }

.robots-section { padding: 1.1rem 1.15rem; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--edge); }
.robot-rows { display: grid; margin: 0; padding: 0; list-style: none; }
.robot-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .55rem .9rem;
  padding: .9rem 0;
  border-top: 1px solid var(--hairline);
}
.robot-row:first-child { padding-top: .2rem; border-top: 0; }
.robot-row:last-child { padding-bottom: .1rem; }
.robot-row-name { font-weight: 620; }
.row-state { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: .4rem; }
.robot-row-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: .5rem; }
.robot-row-actions:empty { display: none; }
.row-hint { color: var(--muted); font-size: var(--t-xs); }
.robot-row .row-hint { grid-column: 2; }
@media (min-width: 720px) {
  .robot-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .robot-row-actions { grid-column: 3; justify-content: flex-end; }
  .robot-row .row-hint { grid-column: 2 / -1; }
}
/* Native apps use the same approved card/robot-row layout. */
.row-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.badge-moved { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.badge-origin { color: var(--fg-dim); background: var(--panel-2); }
.install-policy { margin: .85rem 0; padding: .85rem 1rem; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--bg-soft); }
.policy-label { display: flex; align-items: flex-start; gap: .6rem; font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.policy-label input { flex: none; margin-top: .2rem; accent-color: var(--accent); }
.install-policy p { margin-top: .4rem; }
.approval-list { margin: 1rem 0; }
.approval-list h3 { font-size: var(--t-md); margin-bottom: .5rem; }
.approval-row { border: 1px solid var(--accent-line); }

.inline-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; color: var(--fg-dim); font-size: var(--t-sm); }

.info-grid { display: grid; gap: .9rem; margin: 0 0 2rem; }
@media (min-width: 860px) { .info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.info-card {
  display: grid;
  align-content: start;
  gap: .65rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--edge);
}
.info-card h2 { display: flex; align-items: center; gap: .5rem; font-size: var(--t-md); }
.info-card h2 .icon { color: var(--accent); }
.info-card p { color: var(--fg-dim); font-size: var(--t-sm); }
.info-card p.meta { color: var(--muted); }
.perm-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.perm-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .75rem; }
.perm-list strong { display: block; font-size: var(--t-sm); font-weight: 600; }
.perm-list li > span:last-child > span { display: block; margin-top: .1rem; color: var(--muted); font-size: var(--t-xs); }
.perm-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.plain-list { display: grid; gap: .4rem; margin: 0; padding-left: 1.15rem; color: var(--fg-dim); font-size: var(--t-sm); }
.plain-list.numbered li::marker { color: var(--accent); font-weight: 700; }
.link-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.fine-print { padding-top: 1.25rem; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: var(--t-xs); }

/* ==========================================================================
   Robots
   ========================================================================== */

/* Robots are shown by name: a plain initial badge, never a drawing of Jibo. Each state has its own shape as well as its
   colour, beside its text label: online carries a round dot, offline a dashed outline, needs-update a "!" tag. */
.robot-avatar {
  --size: 44px;
  position: relative;
  flex: none;
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.robot-initial { color: var(--fg); font-size: calc(var(--size) * .36); font-weight: 700; line-height: 1; letter-spacing: .01em; }
.robot-initial::before { content: attr(data-initial); }
.robot-avatar.is-offline { background: var(--panel); box-shadow: none; border: 2px dashed var(--muted); }
.robot-avatar.is-offline .robot-initial { color: var(--fg-dim); }
.robot-avatar.is-blocked { box-shadow: inset 0 0 0 2px var(--muted); }
.robot-avatar.is-online::after, .robot-avatar.is-blocked::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  border: 2px solid var(--panel);
}
.robot-avatar.is-online::after { width: 28%; height: 28%; border-radius: 50%; background: var(--ok); }
.robot-avatar.is-blocked::after {
  --mark: max(13px, calc(var(--size) * .34));
  content: "i";
  right: -3px;
  bottom: -3px;
  width: var(--mark);
  height: var(--mark);
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--muted);
  color: var(--panel);
  font-size: calc(var(--mark) * .7);
  font-weight: 800;
  line-height: 1;
}
.avatar-xs { --size: 28px; }
.avatar-lg { --size: 56px; }
.robot-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .1rem .4rem; color: var(--fg-dim); font-size: var(--t-xs); }
.robot-firmware { color: var(--muted); }
.status-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--faint); }
.status-dot.online { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.status-dot.offline { border: 1.5px solid var(--muted); background: transparent; }
.status-dot.blocked { background: var(--muted); }

/* ==========================================================================
   Install sheet
   ========================================================================== */

dialog.sheet {
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--overlay);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
}
dialog.sheet::backdrop { background: rgba(4, 6, 10, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.sheet[open] { animation: sheet-up var(--slow) var(--ease-out); }
@keyframes sheet-up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@media (min-width: 640px) {
  dialog.sheet { width: min(580px, calc(100% - 2rem)); max-height: calc(100dvh - 3rem); margin: auto; border-bottom: 1px solid var(--border); border-radius: var(--radius-xl); }
}
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .85rem;
  padding: 1rem 1rem .9rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--overlay);
}
.sheet-head h2 { font-size: var(--t-lg); letter-spacing: -.02em; }
.sheet-sub { margin-top: .15rem; color: var(--muted); font-size: var(--t-xs); }
.sheet-close { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--fg-dim); }
.sheet-close:hover { background: var(--panel-3); color: var(--fg); }
.sheet-close .icon { width: 18px; height: 18px; }
.sheet-body { display: grid; gap: 1.15rem; padding: 1.15rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); }
.sheet-body > p:not([class]) { color: var(--fg-dim); }
.step { display: grid; gap: .65rem; min-width: 0; }
.step-title { display: flex; align-items: center; gap: .55rem; padding: 0; color: var(--fg); font-size: var(--t-sm); font-weight: 640; }
.step-num {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 720;
}
.robot-options { display: grid; gap: .55rem; }
.robot-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: .8rem;
  padding: .8rem .95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.robot-option:hover { border-color: var(--panel-3); }
.robot-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.robot-option input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
/* theme.css gives every focused input a text-field ring and background; radios
   and checkboxes keep their native look. Native radios also ignore
   border-radius on their focus ring, so the keyboard ring goes on the card. */
.robot-option input:focus, .consent input:focus { box-shadow: none; background: transparent; }
@supports selector(:has(*)) {
  .robot-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
  .robot-option input:focus-visible { outline: none; }
}
.robot-option-text { display: grid; gap: .15rem; min-width: 0; }
.robot-option-name { font-weight: 640; }
.robot-option-check { color: var(--muted); font-size: var(--t-xs); font-weight: 620; }
.robot-option[data-state="ready"] .robot-option-check { color: var(--ok); }
.robot-option[data-state="waiting"] .robot-option-check { color: var(--fg-dim); }
.robot-option[data-state="blocked"] .robot-option-check { color: var(--warn); }
/* A robot that cannot take the release stays visible with its reason, but cannot be chosen. */
.robot-option[data-state="blocked"] { border-style: dashed; background: var(--bg-soft); cursor: not-allowed; }
.robot-option[data-state="blocked"]:hover { border-color: var(--border); }
.robot-option[data-state="blocked"] .robot-option-name { color: var(--fg-dim); }
.consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: .75rem;
  padding: .85rem .95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--fg);
  font-size: var(--t-sm);
  cursor: pointer;
}
.consent input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.consent:has(input:checked) { border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: var(--ok-soft); }
.consent:has(input[aria-invalid="true"]) { border-color: var(--error); }
.consent-hint { color: var(--error); font-size: var(--t-xs); font-weight: 560; }
.consent-hint:empty, .sheet-error:empty { display: none; }
.sheet-note { display: flex; align-items: flex-start; gap: .55rem; color: var(--muted); font-size: var(--t-xs); line-height: 1.5; }
.sheet-note .icon { margin-top: .1rem; }
.selection-status { padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--panel-2); color: var(--fg-dim); font-size: var(--t-sm); }
.selection-status[data-tone="error"] { background: var(--warn-soft); color: var(--warn); }
.selection-status[data-tone="wait"] { color: var(--muted); }
.selection-status:empty, .gate-hint:empty { display: none; }
.gate-hint { margin-bottom: -.55rem; color: var(--muted); font-size: var(--t-xs); text-align: right; }
/* Plainly not ready: off because no robot can take the release, or waiting for
   consent, when it stays focusable and pressable (pressing flags the box). */
.sheet-actions .btn-primary:disabled,
.sheet-actions .btn-primary.is-waiting[aria-disabled="true"] {
  pointer-events: auto;
  cursor: not-allowed;
  opacity: 1;
  background: var(--panel-3);
  color: var(--muted);
  box-shadow: none;
  filter: none;
}
.sheet-error { color: var(--error); font-size: var(--t-sm); font-weight: 560; }
.sheet-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; padding-top: .2rem; }
.sheet-actions .btn { min-height: 46px; }
@media (max-width: 479px) {
  .sheet-actions .btn { flex: 1 1 auto; }
  .sheet-actions .btn-primary, .sheet-actions .btn-danger { flex-basis: 100%; order: -1; }
  .gate-hint { text-align: center; }
}
.whats-new-box { display: grid; gap: .35rem; padding: .85rem .95rem; border-radius: var(--radius); background: var(--panel-2); color: var(--fg-dim); font-size: var(--t-sm); }

.steps { display: grid; margin: 0; padding: 0; list-style: none; }
.step-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: .85rem;
  padding: .5rem 0;
  color: var(--muted);
  font-size: var(--t-sm);
}
.step-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: calc(50% + 15px);
  width: 2px;
  height: calc(100% - 30px);
  border-radius: 1px;
  background: var(--border);
}
.step-dot { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid var(--border); border-radius: 50%; background: var(--panel); }
.step-dot .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.step-item.is-done { color: var(--fg-dim); }
.step-item.is-done .step-dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.step-item.is-done::before { background: var(--ok); }
.step-item.is-current { color: var(--fg); font-weight: 640; }
.step-item.is-current .step-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step-item.is-current .step-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: dot-pulse 1.6s var(--ease) infinite; }
.step-item.is-failed { color: var(--error); font-weight: 600; }
.step-item.is-failed .step-dot { border-color: var(--error); background: var(--error); color: #fff; }
@keyframes dot-pulse { 0%, 100% { opacity: .6; transform: scale(.75); } 50% { opacity: 1; transform: scale(1.1); } }
.result-mark { width: 64px; height: 64px; display: grid; place-items: center; margin: .25rem auto 0; border-radius: 50%; }
.result-mark.is-ok { background: var(--ok-soft); color: var(--ok); }
.result-mark.is-error { background: var(--error-soft); color: var(--error); }
.result-mark .icon { width: 30px; height: 30px; stroke-width: 2.4; }

/* ==========================================================================
   Installed apps
   ========================================================================== */

.view-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 1.5rem 0 .5rem; }
.view-head h1 { font-size: var(--t-2xl); letter-spacing: -.03em; }
.view-head p { max-width: 62ch; margin-top: .35rem; color: var(--muted); font-size: var(--t-sm); }
.library { display: grid; gap: 1.1rem; padding-bottom: 1rem; }
.robot-panel {
  display: grid;
  gap: .9rem;
  padding: 1.1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow), var(--edge);
}
@media (min-width: 720px) { .robot-panel { padding: 1.35rem 1.5rem; } }
.robot-panel-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .9rem; }
.robot-panel-title { display: grid; gap: .2rem; min-width: 0; }
.robot-panel-title h2 { font-size: var(--t-lg); overflow-wrap: anywhere; }
.robot-count { padding: .25rem .65rem; border-radius: var(--radius-pill); background: var(--panel-2); color: var(--muted); font-size: var(--t-xs); font-weight: 620; white-space: nowrap; }
@media (max-width: 479px) { .robot-count { display: none; } }
.robot-panel .notice { align-items: flex-start; }
.robot-panel .notice .icon { margin-top: .15rem; }
.app-rows, .pending-list { display: grid; margin: 0; padding: 0; list-style: none; }
.app-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "tile main badge" "actions actions actions";
  align-items: center;
  gap: .55rem .85rem;
  padding: .85rem 0;
  border-top: 1px solid var(--hairline);
}
.app-row > .app-tile { grid-area: tile; }
.app-row-main { grid-area: main; min-width: 0; }
.row-badge { grid-area: badge; }
.app-row-actions { grid-area: actions; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
@media (min-width: 760px) {
  .app-row { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "tile main badge actions"; }
}
.app-row-name { font-weight: 620; overflow-wrap: anywhere; }
.app-row-name a:hover { color: var(--accent); }
.app-row-meta { margin-top: .1rem; color: var(--muted); font-size: var(--t-xs); }
.row-note { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; font-size: var(--t-xs); }
.row-note.warn { color: var(--warn); }
.pending-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "tile main" "actions actions";
  align-items: center;
  gap: .55rem .85rem;
  margin-bottom: .5rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
  border-radius: var(--radius);
  background: var(--info-soft);
}
.pending-row > .app-tile { grid-area: tile; }
.pending-main { grid-area: main; min-width: 0; }
.pending-row .app-row-actions { grid-area: actions; }
@media (min-width: 760px) { .pending-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "tile main actions"; } }
.progress-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; max-width: 320px; margin: .45rem 0 .35rem; }
.track-seg { height: 5px; border-radius: 3px; background: var(--border); }
.track-seg.is-done { background: var(--ok); }
.track-seg.is-current { background: linear-gradient(90deg, var(--info) 0%, color-mix(in srgb, var(--info) 30%, transparent) 50%, var(--info) 100%); background-size: 200% 100%; animation: track-flow 1.6s linear infinite; }
.track-seg.is-failed { background: var(--error); }
@keyframes track-flow { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.activity { padding-top: .5rem; border-top: 1px solid var(--hairline); }
.activity summary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 40px;
  color: var(--fg-dim);
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.activity summary::-webkit-details-marker { display: none; }
.activity summary::before {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 .25rem 0 .15rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--fast) var(--ease);
}
.activity[open] summary::before { transform: rotate(45deg); }
.activity-list { display: grid; margin: .2rem 0 0; padding: 0; list-style: none; }
.activity-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .55rem 0; font-size: var(--t-sm); }
.activity-main > p:first-child { color: var(--fg-dim); }
.activity-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--muted); }
.activity-icon .icon { width: 15px; height: 15px; }
.activity-item.is-ok .activity-icon { background: var(--ok-soft); color: var(--ok); }
.activity-item.is-error .activity-icon { background: var(--error-soft); color: var(--error); }

/* ==========================================================================
   Publisher desk and operator review
   ========================================================================== */

.pub { display: grid; gap: 1.1rem; padding-bottom: 1rem; }
.pub-grid { display: grid; gap: 1.1rem; align-items: start; }
@media (min-width: 860px) { .pub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pub-card {
  display: grid;
  align-content: start;
  gap: .85rem;
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--edge);
}
.pub-card h2 { font-size: var(--t-lg); letter-spacing: -.018em; }
.pub-card > p { color: var(--fg-dim); font-size: var(--t-sm); }
.pub-form { display: grid; gap: .9rem; }
.form-actions { display: flex; justify-content: flex-end; }
.pub-disclosure summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 32px; cursor: pointer; list-style: none; }
.pub-disclosure summary::-webkit-details-marker { display: none; }
.pub-disclosure summary .icon { color: var(--muted); transition: transform var(--fast) var(--ease); }
.pub-disclosure[open] summary .icon { transform: rotate(90deg); }
.pub-section-title { margin-top: .75rem; font-size: var(--t-xl); letter-spacing: -.024em; }
.usage-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }
.meter { height: 10px; overflow: hidden; border-radius: var(--radius-pill); background: var(--panel-3); }
.meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--grad-brand); }
.cap-list { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; color: var(--fg-dim); font-size: var(--t-sm); }
.pub-app-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .85rem; }
.pub-app-head > div:only-child, .op-card .pub-app-head { grid-template-columns: minmax(0, 1fr) auto; }
.pub-app-head h3 { font-size: var(--t-md); overflow-wrap: anywhere; }
.pub-upload { display: grid; gap: .55rem; padding: .9rem; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg-soft); }
@media (min-width: 640px) {
  .pub-upload { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .pub-upload .field-label { grid-column: 1 / -1; }
}
.file-input { min-width: 0; color: var(--fg-dim); font-size: var(--t-sm); }
.file-input::file-selector-button {
  margin-inline-end: .75rem;
  padding: .45rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--fg);
  font: inherit;
  font-weight: 560;
  cursor: pointer;
}
.pub-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.release-list { display: grid; margin: 0; padding: 0; list-style: none; }
.release-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .6rem 0; border-top: 1px solid var(--hairline); font-size: var(--t-sm); }
.release-version { margin-inline-end: auto; font-weight: 600; }
.op-list { display: grid; gap: .9rem; }
@media (min-width: 860px) { .op-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.audit-list { display: grid; margin: 0; padding: 0; list-style: none; color: var(--fg-dim); font-size: var(--t-sm); }
.audit-list li { display: grid; gap: .1rem; padding: .55rem 0; border-top: 1px solid var(--hairline); }
.audit-list li:first-child { border-top: 0; }
.audit-list time { color: var(--muted); font-size: var(--t-xs); }

/* Publish a theme: a drop zone, the check before publishing (the pack's own
   preview image, a drawn impression in its colours and what it changes),
   upload progress, then the published release and its listing. */
.theme-upload { gap: 1rem; }
.tu-top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .9rem; }
.tu-top h2 { font-size: var(--t-lg); letter-spacing: -.018em; }
.tu-top p { margin-top: .15rem; color: var(--fg-dim); font-size: var(--t-sm); }
.tu-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .55rem;
  padding: 1.35rem 1rem 1.2rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  text-align: center;
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.tu-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.tu-drop-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--accent); }
.tu-drop.is-over .tu-drop-icon { background: var(--accent); color: var(--accent-ink); }
.tu-drop-title { font-weight: 620; }
.tu-drop-hint { max-width: 56ch; }
/* After a file is chosen the zone folds into one row above the check. */
.theme-upload:not([data-phase="empty"]) .tu-drop { grid-template-columns: auto minmax(0, 1fr) auto; justify-items: start; align-items: center; gap: .3rem .85rem; padding: .7rem .9rem; text-align: start; }
.theme-upload:not([data-phase="empty"]) .tu-drop-icon { grid-row: span 2; width: 36px; height: 36px; }
.theme-upload:not([data-phase="empty"]) .tu-drop-title { font-size: var(--t-sm); }
.theme-upload:not([data-phase="empty"]) .tu-pick { grid-column: 3; grid-row: 1 / span 2; }
.theme-upload:not([data-phase="empty"]) .tu-drop-hint { grid-column: 2; font-size: var(--t-xs); }
@media (max-width: 599px) {
  .theme-upload:not([data-phase="empty"]) .tu-drop { grid-template-columns: auto minmax(0, 1fr); }
  .theme-upload:not([data-phase="empty"]) .tu-pick { grid-column: 1 / -1; grid-row: auto; justify-self: stretch; }
}
.tu-input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
@media (hover: none) and (pointer: coarse) { .tu-drag-only { display: none; } }
.tu-steps { display: grid; gap: .45rem; margin: 0; padding-inline-start: 1.25rem; color: var(--fg-dim); font-size: var(--t-sm); }
.tu-steps strong { color: var(--fg); font-weight: 620; }
.tu-reading { justify-self: start; }
.tu-preview, .tu-progress, .tu-result, .tu-error { display: grid; gap: 1rem; min-width: 0; }
.tu-preview { padding-top: .25rem; }
.tu-preview-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 1.25rem; }
.tu-preview-top h3 { margin-top: .2rem; font-size: var(--t-xl); letter-spacing: -.024em; overflow-wrap: anywhere; }
/* Headings take focus only from script, to move screen readers and keyboards to the new step; they are not controls, so no ring. */
.theme-upload h3[tabindex="-1"]:focus, .theme-upload h3[tabindex="-1"]:focus-visible { outline: none; }
.tu-version { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: .45rem; }
.tu-file { display: inline-flex; align-items: center; gap: .35rem; min-width: 0; overflow-wrap: anywhere; }
.tu-file .icon { flex: none; width: 16px; height: 16px; }
.tu-preview-body { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { .tu-preview-body { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } }
.tu-figures { display: grid; gap: .9rem; align-content: start; }
@media (min-width: 600px) and (max-width: 899px) { .tu-figures { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; } }
@media (min-width: 900px) { .tu-figures { position: sticky; top: 5.5rem; } }
.tu-figure { display: grid; gap: .4rem; margin: 0; min-width: 0; }
.tu-figure .theme-shot { width: 100%; }
.tu-shot { display: block; width: 100%; max-width: 420px; aspect-ratio: 1; object-fit: contain; border-radius: var(--radius); background: var(--bg-soft); box-shadow: 0 0 0 1px var(--border-soft); }
.tu-details { display: grid; gap: .8rem; min-width: 0; }
.tu-description { color: var(--fg-dim); font-size: var(--t-sm); overflow-wrap: anywhere; white-space: pre-line; }
.tu-details h4 { font-size: var(--t-md); }
.tu-changes { display: grid; gap: .1rem; margin: 0; padding: 0; list-style: none; }
.tu-change { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--hairline); }
.tu-change:first-child { border-top: 0; }
.tu-change-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); }
.tu-change-icon .icon { width: 18px; height: 18px; }
.tu-change-title { font-weight: 620; font-size: var(--t-sm); }
.tu-swatches { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin: .45rem 0 0; padding: 0; list-style: none; }
.tu-swatches li { display: inline-flex; align-items: center; gap: .4rem; color: var(--fg-dim); font-size: var(--t-xs); }
.tu-chip { width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 0 0 1px rgba(0, 0, 0, .35); }
.tu-icons { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.tu-icons img { width: 32px; height: 32px; padding: 3px; border-radius: 8px; background: var(--panel-3); }
.tu-never { display: flex; gap: .5rem; align-items: flex-start; color: var(--muted); font-size: var(--t-xs); }
.tu-never .icon { flex: none; width: 15px; height: 15px; margin-top: .1rem; }
.tu-facts { display: grid; gap: 0; margin: 0; font-size: var(--t-sm); }
.tu-facts > div { display: grid; gap: .1rem .9rem; padding: .5rem 0; border-top: 1px solid var(--hairline); }
@media (min-width: 560px) { .tu-facts > div { grid-template-columns: 9.5rem minmax(0, 1fr); } }
.tu-facts dt { color: var(--muted); }
.tu-facts dd { margin: 0; color: var(--fg); overflow-wrap: anywhere; }
.tu-blocked { align-items: flex-start; }
.tu-blocked .icon { flex: none; margin-top: .15rem; }
.tu-blocked p + p { margin-top: .2rem; color: var(--fg-dim); }
.tu-submit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding-top: .9rem; border-top: 1px solid var(--border-soft); }
.tu-submit > .meta { flex: 1 1 22rem; }
.tu-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
@media (max-width: 479px) {
  .tu-submit .tu-actions, .tu-result .tu-actions, .tu-error .tu-actions { width: 100%; }
  .tu-submit .tu-actions .btn, .tu-result .tu-actions .btn, .tu-error .tu-actions .btn { flex: 1 1 100%; min-height: 46px; }
  .tu-submit .btn-primary { order: -1; }
}
.tu-progress progress { width: 100%; height: 10px; overflow: hidden; border: 0; border-radius: var(--radius-pill); background: var(--panel-3); appearance: none; -webkit-appearance: none; }
.tu-progress progress::-webkit-progress-bar { border-radius: inherit; background: var(--panel-3); }
.tu-progress progress::-webkit-progress-value { border-radius: inherit; background: var(--grad-brand); transition: width var(--fast) var(--ease); }
.tu-progress progress::-moz-progress-bar { border-radius: inherit; background: var(--grad-brand); }
.tu-progress progress:indeterminate { background: linear-gradient(90deg, var(--panel-3) 0 30%, var(--accent) 50%, var(--panel-3) 70% 100%) 0 0 / 300% 100%; animation: tu-sweep 1.4s linear infinite; }
.tu-progress progress:indeterminate::-webkit-progress-bar { background: transparent; }
@keyframes tu-sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
.tu-error { padding: 1rem 1.1rem; border: 1px solid color-mix(in srgb, var(--error) 45%, transparent); border-radius: var(--radius); background: var(--error-soft); }
.tu-error-top, .tu-result-top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .75rem; }
.tu-error-top h3, .tu-result-top h3 { font-size: var(--t-md); }
.tu-error-icon, .tu-result-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.tu-error-icon { background: var(--error); color: #fff; }
.tu-result-icon { background: var(--ok-soft); color: var(--ok); }
.tu-error .tu-facts > div { border-top-color: color-mix(in srgb, var(--error) 22%, transparent); }
.tu-field { font-weight: 640; color: var(--error); overflow-wrap: anywhere; }
.tu-result { padding: 1rem 1.1rem; border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); border-radius: var(--radius); background: color-mix(in srgb, var(--ok-soft) 60%, transparent); }
.tu-listing .badge { vertical-align: middle; }
.pub-upload-theme { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .pub-upload-theme { grid-template-columns: minmax(0, 1fr) auto; } }

/* ==========================================================================
   Themes: catalog cards, theme pages and each Jibo's Appearance
   ========================================================================== */

/* A theme's tile is its swatch glyph in the theme's colours (set inline from
   the first-party palettes); other themes get a quiet slate. */
.tile-theme { --t1: #98a2b6; --t2: #4b5468; }

/* A drawn impression of a theme's menus: a 16:9 robot screen in the theme's
   palette with abstract buttons, a title bar and label bars. It is never a
   picture of Jibo, and every size scales with its own width. */
.theme-shot {
  --ts-bg: #06080c; --ts-surface: #2b3645; --ts-surface2: #1b222c; --ts-text: #fff; --ts-muted: #c6cfdb; --ts-accent: #a9c2ff;
  position: relative;
  isolation: isolate;
  display: block;
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--ts-bg);
  color: var(--ts-text);
  box-shadow: 0 0 0 1px var(--border-soft), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.ts-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(58% 72% at 50% 60%, color-mix(in srgb, var(--ts-accent) 20%, transparent), transparent 72%);
}
/* Sliding cards get faint orbit arcs behind them. */
.layout-slide .ts-glow {
  background:
    radial-gradient(150cqi 92cqi at 50% 128%, transparent 61%, color-mix(in srgb, var(--ts-accent) 22%, transparent) 61.3%, transparent 61.7%),
    radial-gradient(120cqi 70cqi at 50% 132%, transparent 63%, color-mix(in srgb, var(--ts-accent) 16%, transparent) 63.4%, transparent 63.9%),
    radial-gradient(60% 70% at 50% 58%, color-mix(in srgb, var(--ts-surface) 70%, transparent), transparent 74%);
}
.ts-title { position: absolute; top: 5cqi; left: 50%; width: 21cqi; height: 2.5cqi; translate: -50% 0; border-radius: 99px; background: var(--ts-muted); opacity: .55; }
.ts-row { position: absolute; inset: 13cqi 0 auto; display: flex; justify-content: center; align-items: center; }
.ts-item { flex: none; display: flex; flex-direction: column; align-items: center; }
.ts-btn { display: grid; place-items: center; }
.ts-btn .icon { stroke: currentColor; stroke-width: 1.7; }
.ts-label { height: 2.1cqi; border-radius: 99px; background: var(--ts-text); opacity: .86; }
/* Native: three sunrise buttons per page, labels below, page dots. */
.layout-native .ts-row { gap: 8cqi; }
.layout-native .ts-btn { width: 19cqi; height: 19cqi; border-radius: 50%; background: radial-gradient(circle at 50% 28%, var(--ts-surface), var(--ts-surface2) 78%); }
.layout-native .ts-btn .icon { width: 46%; height: 46%; }
.layout-native .is-focus .ts-btn { box-shadow: 0 0 0 1cqi var(--ts-accent); }
.layout-native .ts-label { width: 11cqi; margin-top: 4cqi; }
.ts-dots { position: absolute; bottom: 4.2cqi; left: 50%; display: flex; gap: 1.6cqi; translate: -50% 0; }
.ts-dots i { width: 1.4cqi; height: 1.4cqi; border-radius: 50%; background: var(--ts-muted); opacity: .45; }
.ts-dots i:nth-child(2) { opacity: .95; }
/* Slide: rounded cards that run past both edges, labels on each card. */
.layout-slide .ts-row { top: 14cqi; gap: 2.4cqi; }
.layout-slide .ts-item { width: 19cqi; height: 23cqi; justify-content: center; gap: 2.6cqi; border-radius: 3cqi; background: linear-gradient(180deg, var(--ts-surface), var(--ts-surface2)); }
.layout-slide .ts-btn { width: 9.5cqi; height: 9.5cqi; }
.layout-slide .ts-btn .icon { width: 100%; height: 100%; }
.layout-slide .is-focus { box-shadow: 0 0 0 .9cqi var(--ts-accent); }
.layout-slide .ts-label { width: 11cqi; }
.theme-shot.is-unknown { display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--panel-2) 0 10px, var(--bg-soft) 10px 20px); color: var(--muted); }
.ts-none { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--panel); color: var(--fg-dim); font-size: var(--t-xs); font-weight: 600; }

.theme-note { display: flex; align-items: flex-start; gap: .55rem; max-width: 76ch; margin: -.4rem 0 1rem; color: var(--muted); font-size: var(--t-sm); line-height: 1.5; }
.theme-note > .icon { margin-top: .2rem; color: var(--accent); }
.theme-note a { color: var(--fg-dim); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.theme-note a:hover { color: var(--accent); }
.app-card.is-theme { grid-template-columns: minmax(0, 1fr); grid-template-areas: "shot" "body" "foot"; }
.app-card.is-theme > .theme-shot { grid-area: shot; width: 100%; }
@media (min-width: 600px) {
  .theme-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
  .app-card.is-theme { padding: 1rem; }
  .app-card.is-theme .app-card-body, .app-card.is-theme .app-card-foot { padding-inline: .25rem; }
}

.theme-figures { display: grid; gap: 1rem; }
@media (min-width: 720px) { .theme-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.theme-figure { display: grid; gap: .55rem; margin: 0; }
.theme-figure .theme-shot { width: 100%; border-radius: var(--radius-lg); }
.theme-figure.is-main .theme-shot { box-shadow: 0 0 0 1px var(--border-soft), var(--shadow); }
.theme-figure figcaption { color: var(--muted); font-size: var(--t-sm); }
.theme-figure figcaption strong { color: var(--fg); font-weight: 620; }
.theme-gallery > .meta { max-width: 72ch; margin-top: .8rem; }
.robots-note { margin: -.2rem 0 .7rem; }

/* My Jibo → Appearance, in each robot's panel. */
.appearance { display: grid; gap: .85rem; padding-top: 1rem; border-top: 1px solid var(--hairline); }
.appearance-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.appearance-head h3 { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--t-md); letter-spacing: -.012em; }
.appearance-head h3 .icon { color: var(--accent); }
.appearance-note { display: flex; align-items: flex-start; gap: .5rem; color: var(--muted); font-size: var(--t-sm); }
.appearance-note .icon { margin-top: .2rem; }
.appearance-current {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .9rem 1.1rem;
  padding: .85rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.appearance-current .theme-shot { width: clamp(112px, 28vw, 196px); border-radius: 10px; }
.appearance-current-text { display: grid; gap: .1rem; min-width: 0; }
.look-now-label { color: var(--muted); font-size: .6875rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.appearance-name { font-size: var(--t-lg); font-weight: 650; letter-spacing: -.02em; overflow-wrap: anywhere; }
.appearance-status { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: .45rem; }
@media (max-width: 479px) {
  .appearance-current { grid-template-columns: minmax(0, 1fr); }
  .appearance-current .theme-shot { width: 100%; }
}
.appearance-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .55rem; }
.appearance-actions .btn { margin-inline-start: -.35rem; }
.appearance-update { flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.appearance-update > span { flex: 1 1 16rem; color: var(--fg); }
.theme-rows { margin-top: -.25rem; }

/* The Appearance sheet. */
.look-now-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .9rem;
  padding: .8rem .9rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.look-now-box .theme-shot { width: 108px; border-radius: 9px; }
.look-now-text { display: grid; gap: .15rem; min-width: 0; }
.look-now-name { font-weight: 640; overflow-wrap: anywhere; }
.look-now-status { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin-top: .25rem; }
.look-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr)); gap: .6rem; }
.look-option {
  display: grid;
  align-content: start;
  gap: .55rem;
  padding: .5rem .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.look-option:hover { border-color: var(--panel-3); }
.look-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.look-option .theme-shot { width: 100%; border-radius: 9px; }
.look-option-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: .5rem; padding-inline: .2rem; }
.look-option input, .option-row input { width: 18px; height: 18px; margin: .1rem 0 0; accent-color: var(--accent); }
.look-option input:focus, .option-row input:focus { box-shadow: none; background: transparent; }
@supports selector(:has(*)) {
  .look-option:has(input:focus-visible), .option-row:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
  .look-option input:focus-visible, .option-row input:focus-visible { outline: none; }
}
.look-option-text { display: grid; gap: .1rem; min-width: 0; }
.look-option-name { font-size: var(--t-sm); font-weight: 640; }
.look-option-sub, .look-option-eye { color: var(--muted); font-size: var(--t-xs); }
.look-now { justify-self: start; margin-top: .2rem; padding: .05rem .5rem; border-radius: var(--radius-pill); background: var(--ok-soft); color: var(--ok); font-size: .6875rem; font-weight: 650; }
.look-options-step { min-width: 0; margin: 0; padding: 0; border: 0; }
.look-options-step > .meta { margin-top: -.25rem; }
.option-group { display: grid; gap: .45rem; }
@media (min-width: 520px) { .option-group { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.option-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: .6rem;
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--fg);
  font-size: var(--t-sm);
  cursor: pointer;
}
.option-row strong { display: block; font-weight: 610; }
.option-row > span > span { display: block; margin-top: .1rem; color: var(--muted); font-size: var(--t-xs); }
.option-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.look-options-step:disabled .option-row { cursor: not-allowed; opacity: .55; }
/* The sheet is long on phones: its two buttons stay in reach at the bottom. */
.sheet-actions.is-sticky {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -1.25rem calc(-1.25rem - env(safe-area-inset-bottom));
  padding: .75rem 1.25rem calc(.85rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-soft);
  background: var(--overlay);
}

/* ==========================================================================
   Messages and footer
   ========================================================================== */

/* The status line is always in the accessibility tree; only its box shows. */
.store-toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + .75rem);
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: min(460px, calc(100vw - 2rem));
  translate: -50% 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--step) var(--ease), transform var(--step) var(--ease-out);
}
.store-toast.is-visible {
  padding: .7rem .6rem .7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--overlay);
  box-shadow: var(--shadow-lg);
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.store-toast[data-tone="error"].is-visible { border-color: var(--error); }
.store-toast[data-tone="ok"].is-visible { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
#message { color: var(--fg); font-size: var(--t-sm); font-weight: 540; }
.store-toast[data-tone="error"] #message { color: var(--error); }
.toast-close { width: 32px; height: 32px; flex: none; border-radius: 50%; color: var(--fg-dim); font-size: 1.25rem; line-height: 1; }
.toast-close:hover { background: var(--panel-2); color: var(--fg); }
@media (min-width: 760px) { .store-toast { left: auto; right: 1.5rem; bottom: 1.5rem; translate: none; } }

.store-footer { margin-top: 1.5rem; border-top: 1px solid var(--border-soft); background: var(--bg-soft); }
.footer-inner {
  max-width: var(--wide);
  margin-inline: auto;
  padding: 1.75rem var(--gutter) 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  color: var(--muted);
  font-size: var(--t-sm);
}
.footer-inner strong { color: var(--fg); font-size: var(--t-base); font-weight: 620; }
.footer-inner p { max-width: 60ch; margin-top: .3rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.footer-inner nav a { color: var(--fg-dim); }
.footer-inner nav a:hover { color: var(--accent); }

/* ==========================================================================
   Light theme, reduced motion, forced colours
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .app-card:hover { transform: none; }
  dialog.sheet[open] { animation: none; }
  .tu-progress progress:indeterminate { animation: none; background: var(--accent-soft); }
}

/* One-time bundled-app move. Text only; no robot artwork. */
.migration-panel { margin: 20px 0; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel-2); }
.migration-panel h3 { margin: 0 0 12px; font-size: 17px; line-height: 1.4; }
.migration-panel > p { margin: 10px 0; line-height: 1.5; }
.migration-apps { list-style: none; padding: 0; margin: 16px 0; }
.migration-apps > li { padding: 12px 0; border-top: 1px solid var(--border); }
.migration-app-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.migration-permissions { overflow-wrap: anywhere; margin: 8px 0 0; }
.migration-error { color: var(--error); margin: 8px 0 0; }
.migration-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 540px) {
  .migration-panel { padding: 16px; }
  .migration-actions .btn { flex: 1 1 100%; }
}

@media (forced-colors: active) {
  .app-card, .robot-panel, .info-card, .pub-card, .robot-option, .consent, .chip-btn, .badge, .empty-state, .spotlight { border: 1px solid CanvasText; }
  .chip-btn[aria-pressed="true"], .robot-option:has(input:checked) { outline: 3px solid Highlight; }
  .status-dot, .app-tile, .robot-avatar, .meter-fill, .track-seg { forced-color-adjust: none; }
  /* A theme impression is a picture of colours: keep them, framed. */
  .theme-shot { forced-color-adjust: none; outline: 1px solid CanvasText; }
  .look-option, .option-row, .appearance-current, .look-now-box { border: 1px solid CanvasText; }
  .look-option:has(input:checked), .option-row:has(input:checked) { outline: 3px solid Highlight; }
  .category-chips { -webkit-mask-image: none; mask-image: none; scrollbar-width: thin; }
  .category-chips::-webkit-scrollbar { display: block; height: 6px; }
  .sheet-actions .btn-primary:disabled, .sheet-actions .btn-primary.is-waiting[aria-disabled="true"] { color: GrayText; border-color: GrayText; }
}
