:root {
  color-scheme: light dark;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0efea;
  --text: #17181c;
  --muted: #6c707b;
  --faint: #a1a5af;
  --line: rgba(20, 20, 30, 0.08);
  --line-strong: rgba(20, 20, 30, 0.14);
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.04), 0 8px 24px -12px rgba(20, 20, 30, 0.12);
  --shadow-hover: 0 2px 4px rgba(20, 20, 30, 0.05), 0 18px 40px -16px rgba(20, 20, 30, 0.22);
  --up: #16a34a;
  --down: #dc2626;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1016;
    --surface: #161922;
    --surface-2: #1d2130;
    --text: #eceef2;
    --muted: #9298a6;
    --faint: #5f6677;
    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.13);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 20px 44px -16px rgba(0, 0, 0, 0.65);
    --up: #22c55e;
    --down: #f87171;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }

main {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

header.top {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 17px;
}
.brand img { border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.brand em { font-style: normal; color: var(--muted); font-weight: 500; }
.tools { display: flex; align-items: center; gap: 10px; min-width: 0; }
.langs {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.langs a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 3px 9px;
  border-radius: 999px;
  transition: color 160ms ease, background 160ms ease;
}
.langs a:hover { color: var(--text); }
.langs a:focus-visible { outline: 2px solid color-mix(in srgb, var(--muted) 60%, transparent); outline-offset: 1px; }
.langs a[aria-current] { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(20, 20, 30, 0.1), inset 0 0 0 1px var(--line); }
.summary {
  font-size: 13px;
  color: var(--muted);
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hero { padding: 72px 0 36px; }
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 650;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  max-width: 46ch;
  text-wrap: pretty;
}

/* signed out, the heading beside a small scene (server/render.js, HERO_ART): the
   apps around a calm world, by day in the light theme and by night in the dark one */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 400px); align-items: center; gap: 8px 48px; }
.hero-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.hs-a { stop-color: var(--a); }
.hs-b { stop-color: var(--b); }
.hs-sky { --a: #fde6d2; --b: #efe6fb; }
.hs-sun { --a: #ffe6a6; --b: #ffb98a; }
.hs-t1 { --a: #a9a6ff; --b: #7b77f0; }
.hs-t2 { --a: #ffb7a1; --b: #ff8576; }
.hs-t3 { --a: #8fe3c4; --b: #3fbf96; }
.hs-t4 { --a: #ffd98c; --b: #f6ae45; }
.hs-t5 { --a: #a3d6ff; --b: #5aa9f2; }
.hs-ring { fill: none; stroke: rgba(120, 108, 190, 0.22); stroke-width: 1.2; }
.hs-halo { fill: rgba(255, 196, 140, 0.35); }
.hs-cloud { fill: rgba(255, 255, 255, 0.85); animation: hs-drift 22s ease-in-out infinite; }
.hs-stars { fill: #fff; opacity: 0; }
.hs-hill-3 { fill: #e7def8; }
.hs-hill-2 { fill: #d6ece3; }
.hs-hill-1 { fill: #bfe0d0; }
.hs-drop { flood-color: rgba(70, 60, 120, 0.22); }
.hs-glyph { fill: #fff; }
.hs-spark-a { fill: #f2b54b; }
.hs-spark-b { fill: #a7a3f3; }
@media (prefers-color-scheme: dark) {
  .hs-sky { --a: #272c57; --b: #1a1d3b; }
  .hs-sun { --a: #fbf8ff; --b: #c7c1ff; }
  .hs-t1 { --a: #9d9aff; --b: #6763ea; }
  .hs-t2 { --a: #ffa594; --b: #ee6f65; }
  .hs-t3 { --a: #74dbb6; --b: #2fa982; }
  .hs-t4 { --a: #ffd27c; --b: #eb9f37; }
  .hs-t5 { --a: #8fcbff; --b: #4596e6; }
  .hs-ring { stroke: rgba(170, 165, 255, 0.16); }
  .hs-halo { fill: rgba(190, 182, 255, 0.16); }
  .hs-cloud { fill: rgba(201, 196, 255, 0.16); }
  .hs-stars { opacity: 0.9; }
  .hs-hill-3 { fill: #363b75; }
  .hs-hill-2 { fill: #2b3368; }
  .hs-hill-1 { fill: #1f2b55; }
  .hs-drop { flood-color: rgba(0, 0, 0, 0.5); }
  .hs-spark-a { fill: #ffe3a1; }
  .hs-spark-b { fill: #c3bfff; }
}
/* the tiles float, the sparkles and stars twinkle, the cloud drifts: slowly, out of phase */
.hs-bob { animation: hs-bob 7s ease-in-out infinite; }
.hs-bob-2 { animation-duration: 8s; animation-delay: -2s; }
.hs-bob-3 { animation-duration: 6.5s; animation-delay: -4s; }
.hs-bob-4 { animation-duration: 7.5s; animation-delay: -1s; }
.hs-bob-5 { animation-duration: 9s; animation-delay: -5s; }
.hs-tw { animation: hs-tw 4.5s ease-in-out infinite; }
.hs-tw-2 { animation-delay: -1.5s; }
.hs-tw-3 { animation-delay: -3s; }
@keyframes hs-bob { 50% { transform: translateY(-7px); } }
@keyframes hs-tw { 50% { opacity: 0.3; } }
@keyframes hs-drift { 50% { transform: translateX(-12px); } }
@media (prefers-reduced-motion: reduce) {
  .hero-art * { animation: none; }
}
/* narrow: the scene above the heading, smaller */
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 8px; }
  .hero-art { order: -1; justify-self: center; width: min(100%, 290px); }
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

.card {
  --a: #64748b; /* accent; per app in /accents.css */
  --b: #334155;
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 220ms cubic-bezier(.2,.7,.2,1), box-shadow 220ms ease, border-color 220ms ease;
}
.card > a,
.card.pending {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  align-items: start;
  padding: 22px 22px 20px;
  border-radius: inherit;
  outline: none;
  height: 100%;
}
.card:has(> a:hover),
.card:has(> a:focus-visible) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}
.card > a:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--a) 45%, transparent); }

.icon {
  position: relative;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 15px;
}
.icon::before {
  /* soft tinted halo in the app's own colour; shows on hover */
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 24px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--a) 28%, transparent), transparent);
  opacity: 0;
  transition: opacity 260ms ease;
}
.card > a:hover .icon::before { opacity: 1; }
.icon img,
.icon .glyph {
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 15px;
  box-shadow: 0 1px 2px rgba(0,0,0,.14), inset 0 0 0 1px rgba(255,255,255,.08);
}
.icon .glyph {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--a), var(--b));
}

.body { min-width: 0; }
.card h3 {
  margin: 2px 0 4px;
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-wrap: pretty;
}
.badge {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 999px;
  line-height: 1.5;
}
.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--faint);
}
.domain {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-weight: 500;
  color: var(--muted);
}
.status b { font-weight: 500; }
.status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--faint) 18%, transparent);
  transition: background 300ms ease, box-shadow 300ms ease;
}
.status[data-state="up"] i { background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 22%, transparent); }
.status[data-state="down"] i { background: var(--down); box-shadow: 0 0 0 3px color-mix(in srgb, var(--down) 22%, transparent); }
.status[data-state="unknown"] i { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.arrow {
  position: absolute;
  top: 22px;
  right: 18px;
  width: 20px;
  height: 20px;
  color: var(--faint);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 200ms ease, transform 220ms cubic-bezier(.2,.7,.2,1);
}
.card > a:hover .arrow,
.card > a:focus-visible .arrow { opacity: 1; transform: none; }

.card.pending {
  background: transparent;
  box-shadow: none;
  border: 1px dashed var(--line-strong);
}
.card.pending .icon { filter: saturate(.25) opacity(.6); }
.card.pending h3 { color: var(--muted); }
.card.pending .status[data-state="pending"] i { background: var(--faint); box-shadow: none; }

footer {
  margin-top: auto;
  padding-top: 64px;
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--faint);
}
footer .dot { opacity: .6; }

/* next to the sign-in button there is room for the status line only on wider screens */
@media (max-width: 640px) {
  .summary { display: none; }
}
@media (max-width: 560px) {
  main { padding: 20px 16px 40px; }
  .brand span { font-size: 16px; }
}
@media (max-width: 430px) {
  .hero { padding-bottom: 28px; }
  .card > a, .card.pending { padding: 18px 18px 16px; gap: 14px; grid-template-columns: 52px 1fr; }
  .icon, .icon img, .icon .glyph { width: 52px; height: 52px; border-radius: 14px; }
  .arrow { display: none; }
}

/* ---- accounts: header, buttons ------------------------------------------------ */
:root {
  --accent: #4f6bff;
  --accent-ink: #ffffff;
  --danger: #c2410c;
  --ring: color-mix(in srgb, var(--accent) 38%, transparent);
  --field: #f4f3ef;
}
@media (prefers-color-scheme: dark) {
  :root { --accent: #7b8cff; --field: #11131a; --danger: #fb923c; }
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted); cursor: pointer; transition: color 160ms ease, background 160ms ease;
}
.icon-btn:hover { color: var(--text); background: var(--surface); }
.icon-btn svg, .avatar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.icon-btn:focus-visible, .btn:focus-visible, .chip:focus-visible, .link-btn:focus-visible, .avatar:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 13px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; letter-spacing: -0.005em; cursor: pointer;
  transition: transform 120ms ease, filter 160ms ease, background 160ms ease, border-color 160ms ease;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn.small { min-height: 34px; padding: 0 13px; border-radius: 10px; font-size: 13.5px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px -12px var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn.ghost:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.btn.danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn.block { width: 100%; }
.link-btn { border: 0; background: none; padding: 6px 8px; margin: -6px -8px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; }

.account-area { position: relative; display: flex; align-items: center; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; font-weight: 650; font-size: 14.5px;
  background: linear-gradient(145deg, var(--av, #64748b), color-mix(in srgb, var(--av, #64748b) 70%, #000));
  box-shadow: 0 1px 2px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.14);
}
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; min-width: 250px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-hover);
  animation: rise 180ms cubic-bezier(.2,.8,.2,1) both;
}
.menu .who { padding: 10px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { display: block; font-weight: 650; }
.menu .who small { color: var(--muted); }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--surface-2); outline: none; }

.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; }
.hero-cta small { flex-basis: 100%; color: var(--faint); font-size: 13px; margin-top: 2px; }

/* signed in: the home screen replaces the hero */
body.signed-in .hero { display: none; }
body.signed-in .summary { display: none; }

/* a view (sign-in, account, …) replaces the page; the server marks it on <body>, so nothing flashes */
body:not([data-view="home"]) .hero,
body:not([data-view="home"]) .home,
body:not([data-view="home"]) .catalog { display: none !important; }

/* ---- home screen ---------------------------------------------------------------- */
.home { padding: 44px 0 8px; animation: fade 260ms ease both; }
.greet { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.greet h1 { margin: 0 0 6px; font-size: clamp(30px, 4.6vw, 42px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 650; text-wrap: balance; }
.plan-line { margin: 0; color: var(--muted); display: flex; align-items: center; gap: 8px; font-size: 15px; }
.plan-line .pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.quick { display: flex; gap: 8px; }

.block { margin-bottom: 30px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block-head h2, .catalog-head h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.015em; }
.hint { margin: -4px 0 12px; color: var(--faint); font-size: 13px; }

.springboard {
  list-style: none; margin: 0; padding: 20px 16px 14px; display: grid; gap: 18px 8px;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow);
  min-height: 120px; position: relative;
}
.springboard .empty-note { grid-column: 1 / -1; color: var(--muted); font-size: 14.5px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 6px 6px; }
.tile { --a: #64748b; --b: #334155; position: relative; display: grid; justify-items: center; touch-action: manipulation; }
.tile > a, .tile > button.tile-add {
  display: grid; justify-items: center; gap: 8px; width: 100%; padding: 4px 2px; border-radius: 16px;
  color: inherit; text-decoration: none; border: 0; background: none; font: inherit; cursor: pointer;
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.tile .t-icon {
  position: relative; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  box-shadow: 0 2px 6px -2px rgba(0,0,0,.25), 0 10px 22px -14px color-mix(in srgb, var(--a) 80%, #000), inset 0 0 0 1px rgba(255,255,255,.1);
  background: linear-gradient(140deg, var(--a), var(--b)); transition: transform 220ms cubic-bezier(.2,.7,.2,1);
}
.tile .t-icon img { width: 64px; height: 64px; border-radius: 18px; display: block; }
.tile .t-icon .glyph { color: #fff; font-weight: 700; font-size: 22px; }
.tile .t-name { font-size: 12.5px; font-weight: 550; line-height: 1.25; text-align: center; max-width: 92px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile > a:hover .t-icon { transform: translateY(-3px) scale(1.04); }
.tile > a:focus-visible { outline: none; }
.tile > a:focus-visible .t-icon { box-shadow: 0 0 0 3px var(--ring); }
.tile-add .t-icon { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.tile-add .t-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tile .remove {
  position: absolute; top: -6px; left: calc(50% - 40px); width: 24px; height: 24px; border-radius: 50%; border: 0; display: none;
  background: color-mix(in srgb, var(--text) 82%, transparent); color: var(--bg); font-weight: 700; line-height: 1; cursor: pointer; z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.springboard.editing .remove { display: grid; place-items: center; }
.springboard.editing .tile:not(.add) .t-icon { animation: jiggle 330ms ease-in-out infinite alternate; }
.springboard.editing .tile:nth-child(2n) .t-icon { animation-delay: -160ms; animation-duration: 360ms; }
.springboard.editing .tile > a { cursor: grab; }
.tile.dragging { z-index: 10; pointer-events: none; }
.tile.dragging .t-icon { transform: scale(1.12); animation: none !important; box-shadow: 0 18px 40px -12px rgba(0,0,0,.45); }
.tile.drop-target .t-icon { outline: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 4px; }
@keyframes jiggle { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }

.recent { list-style: none; margin: 0; padding: 2px 2px 10px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.recent li { --a: #64748b; --b: #334155; flex: none; scroll-snap-align: start; }
.recent a {
  display: grid; grid-template-columns: 40px auto; grid-template-rows: auto auto; column-gap: 11px; align-items: center;
  padding: 10px 14px 10px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform 200ms cubic-bezier(.2,.7,.2,1), box-shadow 200ms ease; min-width: 170px;
}
.recent a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.recent .r-icon { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(140deg, var(--a), var(--b)); overflow: hidden; display: grid; place-items: center; color: #fff; font-weight: 700; }
.recent .r-icon img { width: 40px; height: 40px; display: block; }
.recent b { font-size: 14px; font-weight: 600; white-space: nowrap; }
.recent time { font-size: 12px; color: var(--faint); }
.recent .empty-note { color: var(--muted); font-size: 14px; padding: 4px 2px; }

/* ---- catalogue tools ---------------------------------------------------------------- */
.catalog { padding-top: 8px; }
.catalog-head { position: sticky; top: 0; z-index: 4; padding: 12px 0 14px; margin-bottom: 4px; background: linear-gradient(var(--bg) 78%, transparent); }
.catalog-head h2 { margin-bottom: 12px; }
.catalog-head .count { color: var(--faint); font-weight: 500; font-size: 14px; margin-left: 6px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { flex: 1 1 260px; position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 13px; width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input {
  width: 100%; min-height: 44px; padding: 10px 40px 10px 40px; border-radius: 13px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 15.5px; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search kbd { position: absolute; right: 11px; font: 600 11.5px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 6px; }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.sorter { display: flex; gap: 8px; }
.sorter select {
  min-height: 44px; padding: 0 34px 0 14px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--surface) no-repeat right 12px center / 10px 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  color: var(--text); font: inherit; font-size: 14.5px; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 1px 2px; margin: 0 -1px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font: inherit; font-size: 14px; font-weight: 550; cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}
.chip span { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip[aria-pressed="true"] span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.sorter .chip { min-height: 44px; border-radius: 13px; }

.grid .group-head { grid-column: 1 / -1; list-style: none; margin: 18px 2px -4px; font-size: 13px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.grid .group-head:first-child { margin-top: 2px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.meta .cat { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.meta .players svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; vertical-align: -3px; }
.card[hidden] { display: none; }
.card .premium-badge { margin-left: 8px; color: #a16207; background: color-mix(in srgb, #facc15 22%, var(--surface)); border-color: color-mix(in srgb, #eab308 35%, transparent); }

.fav {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--faint); cursor: pointer; transition: color 160ms ease, transform 160ms ease, background 160ms ease;
}
.fav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.fav:hover { color: var(--text); background: var(--surface-2); }
.fav[aria-pressed="true"] { color: #f5a524; }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.fav.pop { animation: pop 380ms cubic-bezier(.2,1.6,.4,1); }
.fav:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
body.signed-in .card .arrow { display: none; }
body.signed-in .card > a { padding-right: 52px; }
@keyframes pop { 40% { transform: scale(1.3); } }

/* ---- views: sign-in, sign-up, invite, account, friends ----------------------------- */
.view { padding: 40px 0 10px; animation: fade 240ms ease both; }
.auth {
  width: min(100%, 430px); margin: 4vh auto 0; padding: 30px 28px 24px; border-radius: 26px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px -40px rgba(20,20,40,.45), var(--shadow);
  position: relative; overflow: hidden;
}
.auth::before {
  content: ""; position: absolute; inset: -40% -30% auto; height: 240px; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
}
.auth > * { position: relative; }
.auth .mark { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.auth h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 650; }
.auth .lead { margin: 0 0 20px; color: var(--muted); font-size: 15px; text-wrap: pretty; }
.auth .return-to { display: flex; align-items: center; gap: 12px; margin: -6px 0 20px; padding: 8px 14px 8px 8px; border-radius: 16px;
  background: color-mix(in srgb, currentColor 6%, transparent); color: var(--muted); font-size: 14px; line-height: 1.35; text-wrap: pretty; }
.auth .return-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; overflow: hidden; }
.auth .return-icon img { display: block; width: 100%; height: 100%; }
.form { display: grid; gap: 12px; margin: 0; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field small { color: var(--faint); font-size: 12.5px; }
.field .wrap { position: relative; display: flex; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--field);
  color: var(--text); font: inherit; font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; transition: border-color 150ms, box-shadow 150ms, background 150ms;
}
.field input:focus, .field select:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.field .reveal { position: absolute; right: 6px; top: 7px; bottom: 7px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.error { margin: 0; padding: 10px 13px; border-radius: 11px; background: color-mix(in srgb, #ef4444 12%, var(--surface)); color: #b91c1c; font-size: 14px; }
@media (prefers-color-scheme: dark) { .error { color: #fca5a5; } }
.error:empty { display: none; }
.notice { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 14px; }
.notice.ok { background: color-mix(in srgb, var(--up) 12%, var(--surface)); color: color-mix(in srgb, var(--up) 70%, var(--text)); }
.alt { display: grid; gap: 4px; margin-top: 14px; justify-items: center; }
.join-signin { margin: 0 0 18px; }
.alt .link-btn { margin: 0; padding: 8px 10px; }
.fine { margin: 14px 0 0; color: var(--faint); font-size: 12.5px; text-align: center; text-wrap: pretty; }
details.forgot { margin-top: 6px; text-align: center; }
details.forgot summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; list-style: none; }
details.forgot p { color: var(--muted); font-size: 14px; text-align: left; margin: 10px 0 0; }

.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: clamp(28px, 4vw, 36px); letter-spacing: -0.03em; font-weight: 650; }
.back { width: 40px; height: 40px; }
.panels { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.panel { padding: 22px 22px 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 14px; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.panel p { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }
.panel .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.panel.danger-zone { border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); }
.who-card { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.who-card .avatar { width: 54px; height: 54px; font-size: 21px; cursor: default; }
.who-card b { display: block; font-size: 17px; }
.who-card small { color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow b { display: block; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .grow small { color: var(--faint); font-size: 12.5px; }
.list .avatar { width: 38px; height: 38px; font-size: 15px; cursor: default; flex: none; }
.linkbox { display: flex; gap: 8px; align-items: stretch; margin: 6px 0 8px; }
.linkbox input { flex: 1; min-width: 0; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--field); color: var(--text); font: 13.5px ui-monospace, "SF Mono", Menlo, monospace; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; margin-bottom: 12px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.1); }

/* picker sheet and toast */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(10,12,18,.42); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: grid; place-items: end center; animation: fade 200ms ease both; }
@media (min-width: 700px) { .sheet-backdrop { place-items: center; } }
.sheet {
  width: min(100%, 560px); max-height: min(86dvh, 720px); display: flex; flex-direction: column; background: var(--bg);
  border-radius: 26px 26px 0 0; box-shadow: 0 -20px 60px -20px rgba(0,0,0,.4); animation: rise 260ms cubic-bezier(.2,.8,.2,1) both; overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 700px) { .sheet { border-radius: 26px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet .search { margin: 0 20px 10px; flex: none; }
.sheet-list { list-style: none; margin: 0; padding: 4px 12px 16px; overflow-y: auto; display: grid; gap: 2px; }
.sheet-list li { --a: #64748b; --b: #334155; }
.sheet-list button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 13px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.sheet-list button:hover { background: var(--surface); }
.sheet-list .s-icon { width: 40px; height: 40px; border-radius: 11px; flex: none; overflow: hidden; background: linear-gradient(140deg, var(--a), var(--b)); }
.sheet-list .s-icon img { width: 40px; height: 40px; display: block; }
.sheet-list .grow { flex: 1; font-weight: 550; }
.sheet-list .star { width: 22px; height: 22px; fill: none; stroke: var(--faint); stroke-width: 1.7; stroke-linejoin: round; }
.sheet-list [aria-pressed="true"] .star { fill: #f5a524; stroke: #f5a524; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; padding: 11px 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14.5px; font-weight: 550; box-shadow: 0 14px 40px -12px rgba(0,0,0,.5); animation: rise 220ms ease both; max-width: calc(100vw - 32px); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.toast { animation-name: toast-in; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 560px) {
  .home { padding-top: 26px; }
  .greet { align-items: start; }
  .springboard { padding: 16px 8px 10px; gap: 16px 2px; grid-template-columns: repeat(4, 1fr); border-radius: 22px; }
  .tile .t-icon, .tile .t-icon img { width: 58px; height: 58px; border-radius: 16px; }
  .sorter { width: 100%; }
  .sorter select { flex: 1; }
  .auth { padding: 24px 20px 20px; border-radius: 22px; margin-top: 2vh; }
  .langs a { padding: 3px 7px; }
}
@media (max-width: 430px) {
  /* room for "cloud-apps.net" on one line at 375px; narrower, it wraps */
  header.top { gap: 10px; }
  .brand { gap: 8px; }
  .brand span { font-size: 15px; }
  .langs a { padding: 3px 6px; }
  .tools { gap: 6px; }
  .langs { display: none; }
  body:not(.signed-in) .langs { display: inline-flex; }
  body:not(.signed-in) #search-open { display: none; }
  .fav { top: 10px; right: 10px; }
  body.signed-in .card > a { padding-right: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- signing in with Google, the terms box ------------------------------------------------- */
.oauth { display: grid; gap: 14px; margin: 2px 0 16px; }
/* Google's own colours for its button (its branding rules), light and dark */
.btn.google { background: #fff; color: #1f1f1f; border-color: #747775; gap: 10px; }
.btn.google:hover { background: #f6f8fb; }
@media (prefers-color-scheme: dark) {
  .btn.google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
  .btn.google:hover { background: #1d1d1f; }
}
.btn.google svg { flex: none; }
.or { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--faint); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.check.terms { align-items: flex-start; line-height: 1.45; }
.check.terms input { margin-top: 1px; flex: none; }
.check.terms a { color: var(--accent); font-weight: 600; }
.notice.warn { margin-bottom: 16px; background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: color-mix(in srgb, var(--danger) 72%, var(--text)); }
.auth .notice { margin-bottom: 14px; }

/* ---- account: address state, Google, sign-ins, privacy ------------------------------------- */
.mail-state { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.mail-state .link-btn { font-size: 13px; }
.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 650; }
.tag.ok { background: color-mix(in srgb, var(--up) 12%, var(--surface)); border-color: color-mix(in srgb, var(--up) 22%, transparent); color: color-mix(in srgb, var(--up) 70%, var(--text)); }
.linked { margin: 18px 0 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.linked h3 { margin: 0 0 8px; font-size: 15px; font-weight: 650; }
.linked .grow { flex: 1 1 200px; color: var(--muted); font-size: 14.5px; }
.list.compact li { padding-block: 8px; }
.list .grow { flex: 1 1 auto; min-width: 0; }
.list small { color: var(--muted); }
.legal-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 14px; }
.legal-row .link-btn { margin: 0; padding: 4px 0; }

/* ---- notices under the header ---------------------------------------------------------------- */
.notices { display: grid; gap: 10px; margin: 4px 0 8px; }
.notices:empty { display: none; }
.notice-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-size: 14px; animation: fade 240ms ease both; }
.notice-bar .grow { flex: 1 1 260px; min-width: 0; }
.notice-bar b { display: block; margin-bottom: 2px; }
.notice-bar span { color: var(--muted); }
.notice-bar.install { flex-wrap: nowrap; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 16%, var(--line)); }
.install-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 2px 8px rgb(5 7 15 / 0.18); }
.install-steps { display: block; margin-top: 6px; color: var(--text) !important; animation: fade 200ms ease both; }
.install-actions { display: flex; flex: none; align-items: center; gap: 4px 14px; }
body:not([data-view="home"]) .notice-bar.install { display: none; }
/* the account menu's way onto the home screen (public/js/install.js sheet) */
.install-body { display: grid; gap: 12px; padding: 4px 20px 24px; }
.install-lead { margin: 0; color: var(--muted); }
.install-list { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.install-body .btn.primary { justify-self: start; }
@media (max-width: 560px) {
  .notice-bar.install { flex-wrap: wrap; align-items: flex-start; }
  .notice-bar.install .grow { flex: 1 1 0; }
  .install-actions { flex: 1 1 100%; justify-content: flex-end; }
}
.notice-bar.soft {box-shadow: none; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 18%, var(--line)); }

/* ---- Premium ---------------------------------------------------------------------------------- */
/* support: voluntary donations through PayPal, the supporter's heart, the cancelled donation's feedback */
.support-hero { display: grid; justify-items: start; gap: 2px; overflow: hidden; position: relative; }
.support-hero > p:not(.support-lead):not(.hint):not(.signoff) { margin: 0 0 10px; max-width: 58ch; color: var(--muted); text-wrap: pretty; }
.support-art { width: 92px; height: 92px; margin: -4px 0 8px -6px; fill: #e8577a; }
.panel .support-lead { margin: 0 0 12px; max-width: 54ch; color: var(--text); font-size: 17px; line-height: 1.45; text-wrap: pretty; }
.support-hero .hint, .panel > .hint { margin: 10px 0 0; max-width: 58ch; }
.signoff { margin: 14px 0 4px; font-weight: 600; color: var(--text); }
.donate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 8px 0 2px; }
.claim { margin: 6px 0 10px; }
.claim .btn { margin-top: 4px; }
.badge-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 4px 0 10px; color: var(--text); }
.heart-badge { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
.heart-badge svg { width: 15px; height: 15px; fill: #e8577a; flex: none; }
.heart-badge:not(.mini) { padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 650; color: #c23a5e; background: color-mix(in srgb, #e8577a 12%, var(--surface)); border: 1px solid color-mix(in srgb, #e8577a 26%, transparent); }
.heart-badge.mini { margin-left: 6px; }
.heart-badge.mini svg { width: 14px; height: 14px; }
.roles { margin: 6px 0 0; }
.roles .pill, .plan-line > .pill:only-child { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; color: var(--muted); border: 1px solid var(--line-strong); }
.choices { display: grid; gap: 6px; margin: 0 0 14px; padding: 0; border: 0; }
.choices legend { margin-bottom: 6px; padding: 0; font-size: 14px; font-weight: 600; }
.choice { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14.5px; }
.choice:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.choice input { accent-color: var(--accent); margin: 0; }
.panel textarea { width: 100%; resize: vertical; min-height: 84px; font: inherit; }
.support-link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 600; }
.support-link:hover { color: var(--text); }
.support-link .heart { width: 13px; height: 13px; fill: #e8577a; }
@media (prefers-color-scheme: dark) {
  .heart-badge:not(.mini) { color: #ff8fab; }
}

.premium-hero { display: grid; justify-items: start; gap: 2px; overflow: hidden; position: relative; }
.premium-art { width: 92px; height: 92px; margin: -4px 0 8px -6px; color: var(--accent); }
.panel .premium-lead { margin: 0 0 12px; max-width: 54ch; color: var(--text); font-size: 17px; line-height: 1.45; text-wrap: pretty; }
.premium-hero .row { margin-top: 6px; }
.premium-hero .hint { margin: 10px 0 0; }
.perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.perks li { position: relative; padding-left: 30px; color: var(--muted); font-size: 14.5px; }
.perks li::before { content: "✓"; position: absolute; left: 0; top: -1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.premium-apps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.premium-apps a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.premium-apps a:hover { border-color: var(--line-strong); }
.premium-apps .icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 11px; background: linear-gradient(135deg, var(--a, #8a94ff), var(--b, #5b65d9)); color: #fff; font-size: 13px; font-weight: 700; }
.premium-apps .icon img { width: 100%; height: 100%; object-fit: cover; }

/* ---- the legal pages (rendered on the server, printable) ------------------------------------- */
.legal-doc { max-width: 760px; margin: 0 auto; padding: 4px 0 24px; line-height: 1.65; }
.legal-doc h1 { margin: 0 0 14px; font-size: 30px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 650; }
.legal-doc h2 { margin: 34px 0 10px; font-size: 19px; letter-spacing: -0.01em; font-weight: 650; scroll-margin-top: 16px; }
.legal-doc h3 { margin: 22px 0 8px; font-size: 16px; font-weight: 650; }
.legal-doc p, .legal-doc li { color: color-mix(in srgb, var(--text) 86%, var(--muted)); font-size: 15.5px; }
.legal-doc ul, .legal-doc ol { padding-left: 22px; }
.legal-doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-doc table { display: block; width: 100%; overflow-x: auto; margin: 14px 0; border-collapse: collapse; font-size: 14px; }
.legal-doc th, .legal-doc td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-doc th { background: var(--surface-2); color: var(--text); font-weight: 650; }
.legal-doc aside.note { margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 14.5px; }
.legal-doc mark.todo { padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, #f59e0b 30%, transparent); color: inherit; }

footer { flex-wrap: wrap; }
footer .legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; flex-basis: 100%; margin-top: 4px; }
footer .legal-links a, footer .legal-links .link-btn { margin: 0; padding: 2px 0; color: var(--muted); font-size: 12.5px; font-weight: 500; }
footer .legal-links a:hover, footer .legal-links .link-btn:hover { color: var(--text); }
footer .legal-links a[aria-current] { color: var(--text); }

@media print {
  .top, footer, .notices { display: none !important; }
  .legal-doc { max-width: none; }
  .legal-doc a { color: inherit; }
}
.panel .premium-you { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--text); font-size: 14px; font-weight: 550; }
.legal-doc .table-wrap { margin: 14px 0; overflow-x: auto; }
.legal-doc .table-wrap table { display: table; margin: 0; }
.legal-doc code { padding: 1px 5px; border-radius: 6px; background: var(--surface-2); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }
.oauth .btn { margin: 0; }
/* the SDK's cookie banner and dialog (shared with the apps) take the dashboard's accent */
:root { --ca-accent: var(--accent); }
details.unlink { margin-top: 10px; }
details.unlink summary { cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 600; }
details.unlink .form { margin-top: 10px; }

/* the Support page's PayPal button, at the top of the page (views.js donateButton) */
#donate-button { min-height: 52px; display: flex; align-items: center; }
#donate-button img { display: block; cursor: pointer; }
.support-back { margin-top: 14px; }
