:root {
  color-scheme: dark;
  --bg: #0b100d;
  --bg-2: #0f1712;
  --panel: #131d16;
  --panel-2: #18241b;
  --panel-3: #1d2a20;
  --border: #2a3a2e;
  --border-strong: #3e5544;
  --text: #f2f7f3;
  --muted: #9aac9e;
  --subtle: #718078;
  --green: #78d36f;
  --green-strong: #4fb85a;
  --green-dark: #18351d;
  --amber: #e2b45f;
  --red: #ed7c72;
  --blue: #76a9e8;
  --purple: #b398ef;
  --shadow: 0 22px 55px rgba(0, 0, 0, .28);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% -10%, rgba(89, 174, 90, .13), transparent 28rem),
    radial-gradient(circle at 95% 18%, rgba(74, 114, 82, .10), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  padding: .7rem 1rem;
  border-radius: 8px;
  background: var(--green);
  color: #0b100d;
  font-weight: 800;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: .9rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid rgba(83, 111, 88, .36);
  background: rgba(11, 16, 13, .84);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: .85rem; }
.brand > span:last-child { display: grid; }
.brand strong { font-size: 1.05rem; letter-spacing: .01em; }
.brand small { color: var(--muted); font-size: .75rem; }

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 2px;
  padding: 7px;
  border: 1px solid #446049;
  border-radius: 9px;
  background: #17231a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}
.brand-mark span { background: var(--green); }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { opacity: .45; }

.top-actions { display: flex; align-items: center; gap: .65rem; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .8rem;
  white-space: nowrap;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(120, 211, 111, .1);
}
.live-pill.offline .status-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(226, 180, 95, .1); }

.page-shell {
  width: min(1450px, calc(100% - 2rem));
  margin: 1.25rem auto 4rem;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(24, 36, 27, .96), rgba(18, 27, 21, .96));
  box-shadow: 0 1px 0 rgba(255,255,255,.025), var(--shadow);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: 420px;
  padding: clamp(2rem, 5vw, 4.5rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: auto -7rem -9rem auto;
  width: 30rem;
  aspect-ratio: 1;
  border: 1px solid rgba(120, 211, 111, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 3rem rgba(120, 211, 111, .025), 0 0 0 7rem rgba(120, 211, 111, .018);
}
.hero-copy { position: relative; z-index: 1; }
.eyebrow {
  margin: 0 0 .5rem;
  color: var(--green);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 850px;
  margin-bottom: 1.15rem;
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  line-height: .98;
  letter-spacing: -.055em;
}
h1 span { color: var(--green); }
h2 { margin-bottom: .45rem; font-size: clamp(1.35rem, 2vw, 2rem); letter-spacing: -.025em; }
h3 { margin-bottom: .4rem; font-size: 1rem; }
.hero-lede { max-width: 760px; margin-bottom: 1.65rem; color: var(--muted); font-size: 1.02rem; }
.hero-actions, .heading-actions { display: flex; flex-wrap: wrap; gap: .7rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 40px;
  padding: .62rem .95rem;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 760;
  font-size: .86rem;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .tab:focus-visible, .chip:focus-visible, .platform-option:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(120, 211, 111, .24);
  outline-offset: 2px;
}
.button.primary { background: var(--green); color: #0d160f; }
.button.primary:hover { background: #8ae181; }
.button.secondary { border-color: #4b674f; background: #223126; color: #e8f2e9; }
.button.secondary:hover { border-color: var(--green); }
.button.ghost { border-color: var(--border); background: transparent; color: var(--muted); }
.button.ghost:hover { border-color: var(--border-strong); color: var(--text); background: rgba(255,255,255,.025); }
.button.danger { border-color: rgba(237, 124, 114, .34); color: var(--red); background: rgba(237, 124, 114, .06); }
.button.large { min-height: 48px; padding: .78rem 1.15rem; }
.button.small { min-height: 34px; padding: .42rem .7rem; font-size: .77rem; }
.button.full { width: 100%; }

.hero-terminal {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid #34483a;
  border-radius: 14px;
  background: #090e0b;
  box-shadow: 0 24px 60px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.035);
  transform: rotate(1.5deg);
}
.terminal-top {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .75rem .9rem;
  border-bottom: 1px solid #253329;
  background: #111914;
  color: #78877d;
  font-size: .7rem;
}
.terminal-top span { width: 9px; height: 9px; border-radius: 50%; background: #445249; }
.terminal-top span:first-child { background: #bf625b; }
.terminal-top span:nth-child(2) { background: #b99349; }
.terminal-top span:nth-child(3) { background: #5fa667; }
.terminal-top b { margin-left: auto; font-weight: 600; }
.hero-terminal pre { margin: 0; padding: 2rem; overflow: auto; color: #e5eee7; font-size: clamp(.86rem, 1.5vw, 1rem); line-height: 1.9; }
.term-muted { color: #829087; }
.term-green { color: var(--green); }
.term-amber { color: var(--amber); }

.setup-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .7fr); gap: 1rem; margin-top: 1rem; }
.setup-panel, .version-panel { padding: clamp(1.25rem, 2.5vw, 2rem); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.4rem; }
.section-heading p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); }
.section-heading.compact { margin-bottom: 1rem; }
.selection-badge {
  padding: .4rem .65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: .72rem;
  white-space: nowrap;
}
.platform-picker { display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)); gap: .55rem; }
.platform-option {
  display: grid;
  justify-items: center;
  gap: .35rem;
  min-height: 86px;
  padding: .85rem .5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #111a14;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.platform-option:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.platform-option.active { border-color: var(--green); background: rgba(120, 211, 111, .08); color: var(--text); box-shadow: inset 0 0 0 1px rgba(120, 211, 111, .18); }
.platform-glyph { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #233128; color: var(--green); font-weight: 900; }
.platform-option.active .platform-glyph { background: var(--green); color: #0d160f; }
.platform-option strong { font-size: .78rem; }

.version-panel { display: flex; flex-direction: column; }
.field-label { display: block; margin: .9rem 0 .4rem; color: #d7e1d8; font-size: .8rem; font-weight: 740; }
.select-control, .text-control {
  width: 100%;
  min-height: 46px;
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f1712;
  color: var(--text);
}
.select-control.small { width: auto; min-width: 175px; min-height: 44px; }
textarea.text-control { resize: vertical; }
.toggle-row { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; color: var(--muted); font-size: .8rem; cursor: pointer; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { position: relative; width: 36px; height: 20px; border-radius: 999px; background: #29362d; box-shadow: inset 0 0 0 1px #3a4a3e; transition: background .16s ease; }
.toggle-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #8c9a90; transition: transform .16s ease, background .16s ease; }
.toggle-row input:checked + .toggle-ui { background: var(--green-dark); }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(16px); background: var(--green); }
.compatibility-note { margin-top: auto; padding: .9rem; border-left: 3px solid var(--amber); border-radius: 0 9px 9px 0; background: rgba(226, 180, 95, .06); color: #b9c5bc; font-size: .77rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1rem; }
.stat-card { display: flex; align-items: center; gap: .9rem; min-height: 96px; padding: 1.1rem 1.25rem; box-shadow: none; }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #39513e; border-radius: 12px; background: #1b2a20; color: var(--green); font-size: 1.1rem; }
.stat-card div { display: grid; }
.stat-card strong { font-size: 1.45rem; line-height: 1.1; }
.stat-card span:last-child { color: var(--muted); font-size: .76rem; }
.warning-stat .stat-icon { color: var(--amber); border-color: rgba(226,180,95,.35); background: rgba(226,180,95,.07); }

.workspace { margin-top: 1rem; overflow: hidden; }
.workspace-tabs { display: flex; gap: .25rem; padding: .65rem .75rem 0; border-bottom: 1px solid var(--border); background: rgba(10,16,12,.35); overflow-x: auto; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 47px;
  padding: .65rem .95rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 760;
  font-size: .83rem;
}
.tab:hover { color: var(--text); }
.tab.active { border-bottom-color: var(--green); color: var(--text); }
.tab span { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 .35rem; border-radius: 999px; background: #28362d; font-size: .68rem; }
.tab-panel { padding: clamp(1rem, 2.5vw, 2rem); }

.catalogue-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: .65rem; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box > span:first-child { position: absolute; left: .9rem; color: var(--subtle); font-size: 1.1rem; }
.search-box input {
  width: 100%;
  min-height: 46px;
  padding: .65rem .9rem .65rem 2.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f1712;
  color: var(--text);
}
.search-box input::placeholder { color: #69766e; }
.filter-row { display: flex; gap: .5rem; margin-top: .9rem; overflow-x: auto; padding-bottom: .2rem; }
.chip { min-height: 34px; padding: .38rem .75rem; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; font-size: .75rem; font-weight: 700; }
.chip:hover, .chip.active { border-color: #527059; background: rgba(120,211,111,.07); color: var(--text); }
.catalogue-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.3rem 0 .85rem; }
.catalogue-meta p { margin: 0; font-weight: 760; font-size: .88rem; }
.source-note { color: var(--subtle); font-size: .7rem; text-align: right; }

.results-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 280px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #101813;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.project-card:hover { transform: translateY(-3px); border-color: #405744; background: #121c16; }
.project-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: .75rem; align-items: start; }
.project-icon { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #35473a; border-radius: 11px; background: #1b2820; overflow: hidden; color: var(--green); font-weight: 900; }
.project-icon img { width: 100%; height: 100%; object-fit: cover; }
.project-title { min-width: 0; }
.project-title h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-title p { margin: 0; color: var(--muted); font-size: .72rem; }
.project-card > p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; min-height: 3.75rem; margin: .85rem 0; overflow: hidden; color: #a9b7ad; font-size: .79rem; }
.project-badge { padding: .25rem .45rem; border: 1px solid #405743; border-radius: 999px; color: var(--green); font-size: .61rem; font-weight: 850; text-transform: uppercase; }
.project-tags { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 25px; }
.project-tags span { padding: .25rem .45rem; border-radius: 6px; background: #1d2821; color: #91a097; font-size: .62rem; }
.project-meta { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem; margin-top: auto; padding-top: .85rem; border-top: 1px solid #233027; }
.project-meta div { display: grid; }
.project-meta small { color: var(--subtle); font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; }
.project-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.project-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .85rem; }

.skeleton { position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.045) 50%, transparent 80%); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
.skeleton-line { height: 12px; margin: .7rem 0; border-radius: 5px; background: #1d2921; }
.skeleton-line.short { width: 45%; }
@keyframes shimmer { to { transform: translateX(100%); } }

.empty-state { grid-column: 1 / -1; display: grid; justify-items: center; padding: 4rem 1rem; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: 16px; background: #172219; color: var(--green); font-size: 1.5rem; }
.empty-state p { max-width: 550px; color: var(--muted); }
.error-box { grid-column: 1/-1; padding: 1rem; border: 1px solid rgba(226,180,95,.3); border-radius: 12px; background: rgba(226,180,95,.05); color: #d9c59f; }
.pagination { display: flex; justify-content: center; gap: .5rem; margin-top: 1.2rem; }

.watch-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.watch-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.watch-table th, .watch-table td { padding: .85rem; border-bottom: 1px solid #26342a; text-align: left; font-size: .78rem; }
.watch-table th { background: #111a14; color: var(--muted); font-size: .67rem; text-transform: uppercase; letter-spacing: .06em; }
.watch-table tr:last-child td { border-bottom: 0; }
.watch-project { display: flex; align-items: center; gap: .65rem; min-width: 220px; }
.watch-project .project-icon { width: 36px; height: 36px; border-radius: 8px; }
.watch-project div { display: grid; }
.watch-project small { color: var(--muted); }
.version-input { width: 145px; min-height: 36px; padding: .35rem .55rem; border: 1px solid var(--border); border-radius: 8px; background: #0e1510; color: var(--text); }
.status-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .5rem; border-radius: 999px; font-size: .67rem; font-weight: 800; white-space: nowrap; }
.status-current { background: rgba(120,211,111,.09); color: var(--green); }
.status-review { background: rgba(226,180,95,.09); color: var(--amber); }
.status-bookmark { background: rgba(118,169,232,.09); color: var(--blue); }
.row-actions { display: flex; gap: .4rem; }

.stack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.stack-card { padding: 1.1rem; border: 1px solid var(--border); border-radius: 14px; background: #101813; }
.stack-card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.stack-card-top span { color: var(--green); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.stack-card > p { color: var(--muted); font-size: .78rem; }
.stack-list { display: grid; gap: .45rem; }
.stack-link { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .58rem .65rem; border: 1px solid #26352b; border-radius: 9px; background: #141e17; text-decoration: none; font-size: .77rem; }
.stack-link:hover { border-color: var(--green); }
.stack-link small { color: var(--subtle); }

.directory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.directory-card { display: flex; flex-direction: column; min-height: 210px; padding: 1.1rem; border: 1px solid var(--border); border-radius: 14px; background: #101813; }
.directory-card header { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.directory-card p { color: var(--muted); font-size: .78rem; }
.directory-card footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; }
.platform-type { padding: .25rem .45rem; border-radius: 6px; background: #1e2a22; color: #a9b8ad; font-size: .62rem; }
.platform-state { font-size: .65rem; font-weight: 800; color: var(--green); }
.platform-state.legacy { color: var(--amber); }

.safety-banner { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1rem; margin-top: 1rem; padding: 1.3rem 1.5rem; box-shadow: none; }
.safety-icon { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(226,180,95,.35); border-radius: 13px; background: rgba(226,180,95,.08); color: var(--amber); font-weight: 900; }
.safety-banner h2 { margin-bottom: .2rem; font-size: 1.05rem; }
.safety-banner p { margin: 0; color: var(--muted); font-size: .78rem; }

.footer { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; width: min(1450px, calc(100% - 2rem)); margin: 0 auto 2rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .72rem; }
.footer > div:first-child { display: grid; }
.footer strong { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer a:hover { color: var(--green); }

.modal {
  width: min(560px, calc(100% - 2rem));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: #121b15;
  color: var(--text);
  box-shadow: 0 40px 110px rgba(0,0,0,.7);
}
.modal::backdrop { background: rgba(2, 6, 3, .76); backdrop-filter: blur(5px); }
.modal form { position: relative; padding: 1.5rem; }
.modal-close { position: absolute; right: 1rem; top: .8rem; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.4rem; }
.modal-description { color: var(--muted); font-size: .82rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1.2rem; }
.field-help { margin-top: .35rem; color: var(--subtle); font-size: .68rem; }
.import-drop { display: grid; justify-items: center; gap: .55rem; padding: 2rem 1rem; border: 1px dashed #48604e; border-radius: 13px; background: #0e1611; text-align: center; cursor: pointer; }
.import-drop:hover { border-color: var(--green); background: rgba(120,211,111,.035); }
.import-drop small { max-width: 430px; color: var(--muted); }
.import-icon { font-size: 2rem; color: var(--green); }
.import-divider { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; color: var(--subtle); font-size: .7rem; }
.import-divider::before, .import-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; max-width: 420px; padding: .8rem 1rem; border: 1px solid #45604a; border-radius: 10px; background: #18231b; color: var(--text); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; font-size: .8rem; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1150px) {
  .platform-picker { grid-template-columns: repeat(4, 1fr); }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack-grid, .directory-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 850px) {
  .topbar { position: static; align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .live-pill { width: 100%; justify-content: flex-end; }
  .hero { grid-template-columns: 1fr; }
  .hero-terminal { transform: none; }
  .setup-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .platform-picker { grid-template-columns: repeat(3, 1fr); }
  .catalogue-toolbar { grid-template-columns: 1fr 1fr; }
  .catalogue-toolbar .search-box { grid-column: 1 / -1; }
  .source-note { display: none; }
}

@media (max-width: 620px) {
  .topbar { padding: .85rem 1rem; }
  .brand small, .live-pill, #refreshButton { display: none; }
  .top-actions .button { padding-inline: .7rem; }
  .page-shell { width: min(100% - 1rem, 1450px); margin-top: .5rem; }
  .hero { min-height: auto; padding: 1.4rem; }
  h1 { font-size: clamp(2.4rem, 14vw, 4rem); }
  .hero-actions .button { width: 100%; }
  .hero-terminal pre { padding: 1.2rem; }
  .setup-panel, .version-panel, .tab-panel { padding: 1rem; }
  .platform-picker { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { gap: .5rem; }
  .stat-card { min-height: 84px; padding: .8rem; }
  .stat-icon { width: 36px; height: 36px; }
  .results-grid, .stack-grid, .directory-grid { grid-template-columns: 1fr; }
  .catalogue-toolbar { grid-template-columns: 1fr; }
  .catalogue-toolbar .search-box { grid-column: auto; }
  .select-control.small { width: 100%; }
  .catalogue-meta { align-items: flex-start; }
  .section-heading { display: grid; }
  .heading-actions .button { flex: 1; }
  .footer { display: grid; }
  .safety-banner { align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.version-source-status {
  margin-top: .65rem;
  color: var(--muted);
  font-size: .82rem;
}
.version-source-status.live { color: var(--green); }
.version-source-status.loading { color: var(--amber); }
.version-source-status.cached { color: var(--amber); }
.version-latest-button { margin-top: .75rem; }


.latest-platform-panel { margin-top: 1rem; padding: clamp(1.1rem, 2.5vw, 1.6rem); }
.latest-platform-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.platform-latest-card {
  display: grid;
  gap: .55rem;
  min-height: 126px;
  padding: .95rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #101813;
}
.platform-latest-card.current { border-color: var(--green); box-shadow: inset 0 0 0 1px rgba(120,211,111,.16); }
.platform-latest-card.error { border-color: rgba(226,180,95,.28); }
.platform-latest-top { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.platform-latest-name { display: flex; align-items: center; gap: .45rem; font-weight: 850; }
.platform-latest-version { font-size: 1.15rem; font-weight: 900; color: var(--green); }
.platform-latest-meta { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.platform-latest-actions { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; }
.platform-latest-actions button { min-height: 34px; padding: .45rem .65rem; font-size: .68rem; }
.platform-latest-source { color: var(--subtle); font-size: .65rem; }
.skeleton-card { min-height: 126px; background: linear-gradient(90deg, #101813, #18231b, #101813); background-size: 200% 100%; animation: pulse 1.4s infinite linear; }

@media (max-width: 1100px) {
  .latest-platform-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
  .latest-platform-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .latest-platform-grid { grid-template-columns: 1fr; }
}

.discord-modal { width: min(640px, calc(100% - 2rem)); }
.modal-toggle { margin: 1rem 0 .75rem; }
.discord-test-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: 1rem;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0e1611;
}
.discord-test-row .field-help { margin: 0; }
#discordStatusBadge { align-self: center; }
@media (max-width: 620px) {
  .discord-test-row { display: grid; }
  #discordStatusBadge { width: 100%; justify-content: center; }
}
