/* Shuffle Mirrors — lobby-style layout.
   Palette sampled from shuffle.com: #080808 page, #121418 panels, #2A2E38 borders, #343843 chips,
   Electric Violet #7717FF accent, logo violet #886CFF. */

/* ===== Fonts ===== */
@font-face { font-family: "Aeonik"; src: url("fonts/aeonik-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Aeonik"; src: url("fonts/aeonik-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Aeonik"; src: url("fonts/aeonik-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Aeonik"; src: url("fonts/aeonik-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Aeonik"; src: url("fonts/aeonik-black.woff2") format("woff2"); font-weight: 800 900; font-display: swap; }

/* ===== Tokens ===== */
:root {
  color-scheme: dark;
  --bg: #080808;
  --panel: #121418;
  --panel-2: #1a1d23;
  --chip: #343843;
  --chip-hover: #414653;
  --border: #2a2e38;
  --text: #fff;
  --text-2: #b4b8c3;
  --text-3: #7d828f;
  --violet: #7717ff;
  --violet-hover: #6510e0;
  --violet-soft: #886cff;
  --green: #1fd17a;
  --amber: #ffb300;
  --red: #ff4d5e;
  --radius: 8px;
  --radius-sm: 6px;
  --ease: cubic-bezier(.33, 1, .68, 1);
  --display: "Barlow Condensed", Aeonik, sans-serif;
  --tile-w: 156px;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 400 15px/1.5 Aeonik, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }
main.wrap { flex: 1; padding-top: 20px; padding-bottom: 56px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { flex: none; }
:where(a, button, input):focus-visible { outline: 2px solid var(--violet-soft); outline-offset: 2px; }
.search input:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px; border: 0; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer; transition: background-color .15s, transform .15s var(--ease), opacity .15s; }
.btn:active { transform: scale(.97); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-hover); }
.btn-light { background: #fff; color: #111; }
.btn-light:hover { background: #e9e6ff; }
.btn-dark { background: rgba(8,8,8,.55); color: #fff; backdrop-filter: blur(6px); }
.btn-dark:hover { background: rgba(8,8,8,.75); }
.btn-ghost { height: 32px; padding: 0 12px; background: var(--chip); font-size: 13px; font-weight: 500; }
.btn-ghost:hover { background: var(--chip-hover); }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-sm); background: var(--chip); cursor: pointer; transition: background-color .15s, opacity .15s; }
.icon-btn:hover { background: var(--chip-hover); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn[hidden], .btn[hidden] { display: none; }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Status dot ===== */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot[data-grade="fast"] { background: var(--green); box-shadow: 0 0 8px rgba(31,209,122,.6); }
.dot[data-grade="medium"] { background: var(--amber); }
.dot[data-grade="slow"] { background: var(--red); }
.dot[data-grade="offline"] { background: var(--text-3); }
.dot[data-grade="checking"] { animation: blink 1s ease-in-out infinite alternate; }
@keyframes blink { to { opacity: .3; } }

/* ===== Top bar ===== */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(8,8,8,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 22px; width: auto; }
.brand-tag { padding: 2px 8px; border-radius: var(--radius-sm); background: var(--chip); color: var(--text-2); font-size: 12px; font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .live-pill { display: none; } .brand img { height: 19px; } .brand-tag { display: none; } }

/* ===== Hero: split layout — headline left, live Top 3 right ===== */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 28px; align-items: center; margin-bottom: 20px; padding: 32px; border-radius: 12px; border: 1px solid var(--border);
  background: radial-gradient(70% 120% at 100% 0%, rgba(119,23,255,.28), transparent 65%), var(--panel); }
.hero-main { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; animation: fadeUp .5s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; background: var(--chip); color: var(--text-2); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.hero h1 { margin: 2px 0 0; font: italic 800 64px/.86 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.hero h1 em { color: var(--violet-soft); font-style: italic; }
.hero-sub { margin: 0; color: var(--text-2); font-size: 15px; min-height: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; font-weight: 700; border-radius: var(--radius); }
.hero-status { margin: 0; color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }

.hero-board { padding: 18px; border-radius: 10px; background: rgba(8,8,8,.55); border: 1px solid var(--border); }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.board-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.board-note { color: var(--text-3); font-size: 12px; }
.board-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.board-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: var(--radius); background: var(--panel-2); transition: background-color .15s; }
a.board-row:hover { background: var(--chip); }
.board-row.sk { display: block; }
.board-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--chip); font: italic 800 16px/1 var(--display); }
li:first-child .board-rank { background: var(--violet); }
.board-host { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.board-bar { display: block; height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.board-bar i { display: block; height: 100%; border-radius: 2px; background: var(--green); transition: width .4s var(--ease); }
.board-bar i[data-grade="medium"] { background: var(--amber); }
.board-bar i[data-grade="slow"] { background: var(--red); }
.board-ms { color: var(--text-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.board-go svg { width: 14px; height: 14px; fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.board-more { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 10px; padding: 8px; border: 0; border-radius: var(--radius); background: none; color: var(--violet-soft); font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .15s; }
.board-more:hover { background: var(--panel-2); }
.board-more svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.board-empty { padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-2); font-size: 14px; }
@media (max-width: 899px) {
  .hero { grid-template-columns: 1fr; padding: 24px 18px; gap: 20px; }
  .hero h1 { font-size: 52px; }
}
@media (max-width: 599px) {
  .hero { padding: 20px 16px 16px; gap: 16px; }
  .hero-main { gap: 10px; }
  .hero h1 { font-size: 44px; }
  .hero-sub { font-size: 14px; }
  .hero-board { padding: 12px; }
  .board-note { display: none; }
  .board-row { min-height: 44px; padding: 6px 10px; gap: 10px; }
  .board-rank { width: 24px; height: 24px; font-size: 14px; }
  .board-more { margin-top: 6px; }
}
@media (max-width: 420px) { .hero-actions .btn { flex: 1; padding: 0 12px; } }

/* ===== Toolbar: tabs + search ===== */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--chip); color: var(--text); }
.tab-count { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--text-3); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.tab-count:empty { display: none; }
.tab[aria-selected="true"] .tab-count { background: var(--violet); color: #fff; }
.tab svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab[data-tab="lobby"] svg, .tab[data-tab="recommended"] svg { fill: currentColor; stroke: none; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); cursor: text; transition: border-color .15s; }
.search:focus-within { border-color: var(--violet-soft); }
.search > svg { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 1.8; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 500 14px Aeonik, sans-serif; }
.search input::placeholder { color: var(--text-3); font-weight: 400; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--radius-sm); background: var(--chip); cursor: pointer; }
.search-clear svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search-clear[hidden] { display: none; }
.search-kbd { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--chip); color: var(--text-2); font: 600 12px Aeonik, sans-serif; }
.search:has(input:not(:placeholder-shown)) .search-kbd { display: none; }
@media (hover: none), (max-width: 599px) { .search-kbd { display: none; } }
@media (max-width: 767px) {
  .toolbar { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .tabs { align-self: stretch; }
}

/* ===== Sections ===== */
#sections { display: flex; flex-direction: column; gap: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 20px; font-weight: 700; }
.section-title svg { width: 20px; height: 20px; fill: var(--violet-soft); stroke: none; }
.section-title svg.stroke { fill: none; stroke: var(--violet-soft); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.section:not([aria-labelledby^="s-search"]) .count { display: none; }   /* tabs already show these counts */
.count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: var(--radius-sm); background: var(--chip); color: var(--text-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.section-sub { margin: -8px 0 14px; color: var(--text-3); font-size: 13px; }
.section-nav { display: flex; align-items: center; gap: 6px; }
.empty { margin: 0; padding: 18px 20px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-2); font-size: 14px; }

/* Carousel rail */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: var(--tile-w); gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 6px 0 4px; margin-top: -6px; scrollbar-width: none; overscroll-behavior-x: contain; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
/* Grid (View all / search) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-w), 1fr)); gap: 16px 12px; padding-top: 6px; }
.section-title { white-space: nowrap; min-width: 0; }
@media (max-width: 599px) {
  :root { --tile-w: 128px; }
  .section-title { font-size: 18px; }
  .section-nav .icon-btn { display: none; }   /* swipe on touch; keep "View all" */
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
}

/* ===== Mirror card: dark panel, same design for every mirror ===== */
.tile { position: relative; min-width: 0; }
.tile-card {
  position: relative; display: flex; flex-direction: column; aspect-ratio: 3 / 4; overflow: hidden; padding: 10px;
  border-radius: 10px; border: 1px solid var(--border);
  background: radial-gradient(120% 55% at 50% 0%, rgba(119,23,255,.42), transparent 70%), linear-gradient(180deg, #17191f, #101216);
  container-type: inline-size; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.tile-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1.4px); background-size: 12px 12px; -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 55%); mask-image: linear-gradient(180deg, #000 0%, transparent 55%); }
.tile-card > * { position: relative; z-index: 1; }
.tile-card::before { content: ""; position: absolute; z-index: 2; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, transparent, var(--violet-soft), transparent); opacity: .8; }
.tile:hover .tile-card, .tile-card:focus-visible { transform: translateY(-4px); border-color: rgba(136,108,255,.6); box-shadow: 0 12px 28px -14px rgba(119,23,255,.8); }
.tile-card:focus-visible { outline: 2px solid var(--violet-soft); outline-offset: 2px; }
.tile-status { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; height: 24px; padding: 0 9px; border-radius: 999px; background: rgba(8,8,8,.6); color: var(--text-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile-status .dot { width: 7px; height: 7px; }
.tile-name { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; text-align: center; text-transform: uppercase; }
.tile-name b, .tile-name em { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: italic 800 var(--fs, 24cqw)/.9 var(--display); letter-spacing: .01em; }
.tile-name em { color: var(--violet-soft); }
.tile-cta { display: flex; align-items: center; justify-content: center; gap: 4px; height: 34px; border-radius: var(--radius-sm); background: var(--chip); font-size: 13px; font-weight: 700; transition: background-color .15s; }
.tile:hover .tile-cta, .tile-card:focus-visible .tile-cta { background: var(--violet); }
.tile-cta svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.tile:hover .tile-cta svg { transform: translateX(2px); }
.tile.is-offline .tile-cta svg { display: none; }
.tile-copy { position: absolute; top: 8px; right: 8px; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(8,8,8,.6); color: var(--text-2); cursor: pointer; transition: background-color .15s, color .15s, transform .15s var(--ease); }
.tile-copy:hover { background: var(--chip); color: #fff; }
.tile-copy[hidden] { display: none; }
.tile-card:not([href]) { cursor: default; }
.tile.is-pending .tile-cta { color: var(--text-3); }
.tile.is-pending:hover .tile-card { transform: none; box-shadow: none; border-color: var(--border); }
.tile.is-pending:hover .tile-cta { background: var(--chip); }
.tile-copy.copied { color: var(--green); }
.tile-copy:active { transform: scale(.92); }
.tile-copy svg { width: 12px; height: 12px; }
.tile.is-offline .tile-card { background: linear-gradient(180deg, #15161a, #0f1013); }
.tile.is-offline .tile-card::before { display: none; }
.tile.is-offline .tile-name { opacity: .45; }
.tile.is-offline .tile-name em { color: inherit; }
.tile.is-offline .tile-cta { color: var(--text-3); background: var(--panel-2); }
.tile.is-offline:hover .tile-card { transform: none; box-shadow: none; border-color: var(--border); }

/* Skeleton */
.sk { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--panel-2); }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent); transform: translateX(-100%); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-tile { aspect-ratio: 3 / 4; }
.sk-line { display: block; height: 22px; width: 180px; border-radius: var(--radius-sm); }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); background: #050505; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-top: 28px; padding-bottom: 28px; }
.footer-brand img { height: 20px; width: auto; opacity: .9; }
.footer-brand p { margin: 8px 0 0; max-width: 460px; color: var(--text-3); font-size: 13px; }
.footer-legal { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; }
.age { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--text-3); border-radius: 50%; color: var(--text-2); font-size: 12px; font-weight: 700; }
@media (max-width: 640px) { .footer-inner { flex-direction: column; text-align: center; } .footer-brand img { margin: 0 auto; } }

/* ===== Mobile & touch refinements (verified at 320–430px, landscape, tablet) ===== */
/* Touch devices: no sticky hover lift; buttons always look tappable; bigger hit areas */
@media (hover: none) {
  .tile:hover .tile-card { transform: none; box-shadow: none; border-color: var(--border); }
  .tile:not(.is-offline):not(.is-pending) .tile-cta { background: var(--violet); }
  .tile-copy { width: 36px; height: 36px; top: 6px; right: 6px; }
  .tile-copy svg { width: 14px; height: 14px; }
  a.board-row:hover { background: var(--panel-2); }
  /* touch sizing applies to tablets too, not just narrow screens */
  .tab { height: 40px; }
  .btn-ghost, .icon-btn { height: 40px; min-width: 40px; }
  .board-more { padding: 12px; }
}
@media (max-width: 767px) {
  /* search keeps its height when the toolbar stacks vertically (flex:1 collapsed it to 20px) */
  .search { flex: none; height: 46px; }
  .search input { font-size: 16px; }            /* ≥16px stops iOS auto-zoom on focus */
  /* tabs: taller, edge fade hints that the row scrolls */
  .tab { height: 40px; padding: 0 14px; }
  .tabs { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); scroll-padding: 0 28px; }
  .tabs.at-end { -webkit-mask-image: none; mask-image: none; }
  .btn-ghost { height: 40px; padding: 0 14px; }
  .footer-legal { flex-direction: column; text-align: center; gap: 8px; }
}
@media (max-width: 599px) {
  /* first screen should reach the mirror list: Top 3 lives in the sorted lists below */
  .hero-board { display: none; }
  .hero { padding: 22px 16px 20px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; padding: 0 12px; }
  .hero-actions .btn-primary { flex: 1.6; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .brand { padding: 10px 0; }
}
@media (max-width: 359px) {
  .hero h1 { font-size: 38px; }
  .hero-sub { display: none; }                  /* smallest phones: get to the list sooner */
  .hero-actions { flex-direction: column; }
  .hero-actions .btn, .hero-actions .btn-primary { flex: none; width: 100%; }   /* column + flex:1 flattened them */
  :root { --tile-w: 118px; }
}
/* phones in landscape: keep the hero short */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { grid-template-columns: 1fr; padding: 18px 20px; }
  .hero-board { display: none; }
  .hero h1 { font-size: 40px; }
  .hero h1 br { display: none; }
  .hero h1 em::before { content: " "; }
}

/* ===== Card fit on narrow screens (grid view: "View all" / tabs / search) ===== */
/* status chip never wraps and always leaves room for the copy button */
.tile-status { white-space: nowrap; max-width: calc(100% - 34px); overflow: hidden; }
@media (hover: none) { .tile-status { max-width: calc(100% - 42px); } }
@media (max-width: 599px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }   /* 3 cols made ~100px cards */
}
/* compact card internals whenever the card itself is narrow (container query on .tile-card) */
@container (max-width: 140px) {
  .tile-status { height: 22px; padding: 0 7px; gap: 5px; font-size: 10px; }
  .tile-status .dot { width: 6px; height: 6px; }
  .tile-cta { height: 30px; font-size: 12px; }
}

/* ===== Device features ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }          /* no iOS landscape font inflation */
body { min-height: 100dvh; -webkit-tap-highlight-color: transparent; }    /* dvh follows the mobile address bar */
/* notch / rounded-corner phones in landscape (viewport-fit=cover) */
.wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
@media (min-width: 768px) { .wrap { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); } }
.footer-inner { padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px)); }
/* first screen reaches the list on short phones */
@media (max-width: 359px) and (max-height: 600px) { .hero-kicker { display: none; } .hero { padding-top: 16px; } }
@media (max-height: 480px) and (orientation: landscape) {
  .hero-sub, .hero-status, .hero-kicker { display: none; }
  .hero { padding: 14px 20px; margin-bottom: 14px; }
  .hero-main { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
  .hero h1 { font-size: 34px; }
  .hero-actions { margin-top: 0; }
  .btn-lg { height: 42px; }
  .topbar-inner { height: 52px; }
  .toolbar { margin-bottom: 18px; flex-direction: row; align-items: center; }
  .toolbar .search { flex: 1; min-width: 160px; height: 44px; }
  .tabs { flex: none; max-width: 62%; }
}

/* no-JS fallback list (also readable by search crawlers) */
.noscript-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.noscript-list a { display: block; padding: 12px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); font-weight: 600; }
