/* ============================================================
   LuxDev App Directory
   shadcn/ui design tokens (dark, neutral) + Agnamo accents
   ============================================================ */

:root {
  /* shadcn neutral dark palette (HSL) */
  --background: 0 0% 3.9%;
  --foreground: 0 0% 98%;
  --card: 0 0% 5.5%;
  --card-foreground: 0 0% 98%;
  --popover: 0 0% 6%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 0 0% 9%;
  --secondary: 0 0% 14.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 0 0% 14.9%;
  --muted-foreground: 0 0% 63.9%;
  --accent: 0 0% 14.9%;
  --accent-foreground: 0 0% 98%;
  --border: 0 0% 14.9%;
  --input: 0 0% 14.9%;
  --ring: 0 0% 83.1%;

  --radius: 0.75rem;

  /* Agnamo accents - tile gradients */
  --accent-violet: 270 70% 55%;
  --accent-cyan: 190 80% 50%;
  --accent-emerald: 160 70% 45%;
  --accent-amber: 35 90% 55%;
  --accent-rose: 340 75% 55%;
  --accent-indigo: 230 70% 60%;

  /* status colors */
  --status-active: 142 71% 45%;
  --status-syncing: 200 90% 55%;
  --status-idle: 35 85% 55%;
  --status-locked: 0 0% 65%;

  --font-heading: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --shell-max-width: 1520px;
  --shell-gutter: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle ambient grid in the background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(
      circle at 20% 0%,
      hsl(var(--accent-violet) / 0.08) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 10%,
      hsl(var(--accent-cyan) / 0.06) 0%,
      transparent 45%
    );
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ============================================================
   Top navigation
   ============================================================ */

/* Theme variables — set on .topbar via data-theme attribute */
.topbar,
.topbar[data-theme="default"] {
  --header-bg: #0e0e0e;
  --header-brand: #e5e2e1;
  --header-link: #c3c7c7;
  --header-utility: #737373;
}

.topbar[data-theme="gradient"] {
  --header-bg: linear-gradient(90deg, #0e0e0e 0%, #747474 100%);
  --header-brand: #1a1a1a;
  --header-link: #c3c7c7;
  --header-utility: #888;
}

.topbar[data-theme="mimosa"] {
  --header-bg: linear-gradient(90deg, #c12a62 0%, #d38361 97.6%);
  --header-brand: #eae8e7;
  --header-link: rgba(255, 121, 175, 0.85);
  --header-utility: #4a2030;
}

.topbar[data-theme="tropical"] {
  --header-bg: #1a3f00;
  --header-brand: #e5e2e1;
  --header-link: rgba(204, 238, 163, 0.69);
  --header-utility: #e3c97f;
}

.topbar[data-theme="blues"] {
  --header-bg: #08101e;
  --header-brand: #5b9ef4;
  --header-link: #c3c7c7;
  --header-utility: #a1a1a1;
}

.topbar[data-theme="beach"] {
  --header-bg: linear-gradient(90deg, #005974 0%, #8b9e7e 100%);
  --header-brand: #e5e2e1;
  --header-link: rgba(220, 230, 220, 0.75);
  --header-utility: rgba(115, 115, 115, 0.55);
}

.topbar {
  position: relative;
  z-index: 50;
  flex: 0 0 87px;
  width: min(var(--shell-max-width), calc(100% - (var(--shell-gutter) * 2)));
  margin: 20px auto 0;
  height: 87px;
  background: var(--header-bg, #0e0e0e);
  border: 1px solid hsl(var(--border) / 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px hsl(0 0% 0% / 0.22);
  overflow: hidden;
}

.topbar-inner {
  width: 100%;
  padding: 0 24px 0 18px;
  height: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.036em;
  color: var(--header-brand, #e5e2e1);
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity 120ms ease;
}

.brand:hover {
  opacity: 0.8;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.55rem;
  min-width: 0;
}

.topbar-cluster {
  min-width: 0;
  display: flex;
  align-items: center;
}

.topbar-cluster-apps {
  justify-content: center;
}

.topbar-cluster-utility {
  justify-content: flex-end;
  gap: 1rem;
  flex-shrink: 0;
}

.nav-links-apps {
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-links a {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.04em;
  color: var(--header-link, #c3c7c7);
  white-space: nowrap;
  transition: color 120ms ease, opacity 120ms ease;
}

.nav-links a:hover {
  color: hsl(var(--foreground));
}

.nav-links a.nav-utility {
  color: var(--header-utility, #737373);
}

.nav-divider {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--header-link, #c3c7c7);
  opacity: 0.5;
  flex-shrink: 0;
  margin: 0;
  -webkit-user-select: none;
  user-select: none;
}

/* ============================================================
   Main + Banner
   ============================================================ */

.main {
  position: relative;
  z-index: 1;
  max-width: var(--shell-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
  flex: 1;
}

.banner {
  position: relative;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: linear-gradient(
      180deg,
      hsl(var(--card)) 0%,
      hsl(var(--background)) 100%
    );
  padding: 3rem 2rem;
  overflow: hidden;
  margin-bottom: 2rem;
}

.banner-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.banner-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.kbd {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 0.5rem;
  border-radius: 4px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: hsl(var(--foreground));
}

.muted {
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.banner-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: hsl(var(--foreground));
}

.banner-accent {
  display: block;
  background: linear-gradient(
    90deg,
    hsl(var(--accent-violet)) 0%,
    hsl(var(--accent-cyan)) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.banner-sub {
  margin-top: 0.875rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.95rem;
  max-width: 560px;
}

/* Bauhaus-ish faint grid in the banner */
.banner-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(hsl(var(--border) / 0.5) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.5) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at top right, black 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at top right, black 0%, transparent 70%);
  opacity: 0.6;
}

/* ============================================================
   Tiles grid
   ============================================================ */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  padding: 1.25rem 1.25rem 1.5rem;
  min-height: 168px;
  overflow: hidden;
  transition: border-color 160ms ease, transform 160ms ease,
    box-shadow 160ms ease;
  isolation: isolate;
}

.tile-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--radius);
}

/* gradient accent bloom - inspired by Agnamo reference */
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  background: radial-gradient(
    120% 100% at 0% 0%,
    hsl(var(--tile-accent) / 0.35) 0%,
    transparent 55%
  );
  transition: opacity 200ms ease;
}

.tile[data-accent="violet"] { --tile-accent: var(--accent-violet); }
.tile[data-accent="cyan"]   { --tile-accent: var(--accent-cyan); }
.tile[data-accent="emerald"]{ --tile-accent: var(--accent-emerald); }
.tile[data-accent="amber"]  { --tile-accent: var(--accent-amber); }
.tile[data-accent="rose"]   { --tile-accent: var(--accent-rose); }
.tile[data-accent="indigo"] { --tile-accent: var(--accent-indigo); }

.tile:hover {
  border-color: hsl(var(--tile-accent) / 0.45);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px hsl(0 0% 0% / 0.4),
    0 0 0 1px hsl(var(--tile-accent) / 0.15);
}

.tile:hover::before {
  opacity: 0.85;
}

.tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tile-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
}

.tile-status {
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary) / 0.42);
}

.tile-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.tile-status svg {
  width: 0.9rem;
  height: 0.9rem;
}

.tile-status-active {
  color: hsl(var(--status-active));
  border-color: hsl(var(--status-active) / 0.35);
  background: hsl(var(--status-active) / 0.12);
}

.tile-status-syncing {
  color: hsl(var(--status-syncing));
  border-color: hsl(var(--status-syncing) / 0.35);
  background: hsl(var(--status-syncing) / 0.12);
}

.tile-status-idle {
  color: hsl(var(--status-idle));
  border-color: hsl(var(--status-idle) / 0.35);
  background: hsl(var(--status-idle) / 0.12);
}

.tile-status-locked {
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--border));
  background: hsl(var(--muted));
}

.tile-version {
  margin-top: auto;
  padding-right: 3.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-active {
  background: hsl(var(--status-active) / 0.12);
  border-color: hsl(var(--status-active) / 0.35);
  color: hsl(var(--status-active));
}

.badge-syncing {
  background: hsl(var(--status-syncing) / 0.12);
  border-color: hsl(var(--status-syncing) / 0.35);
  color: hsl(var(--status-syncing));
}

.badge-idle {
  background: hsl(var(--status-idle) / 0.12);
  border-color: hsl(var(--status-idle) / 0.35);
  color: hsl(var(--status-idle));
}

.badge-locked {
  background: hsl(var(--muted));
  border-color: hsl(var(--border));
  color: hsl(var(--muted-foreground));
}

.tile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
}

.tile-route-diff {
  flex: 1 1 100%;
  font-size: 0.625rem;
  text-transform: none;
  letter-spacing: 0.02em;
}

.banner-drift {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
}

.tile-bars {
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  right: 3rem;
  display: flex;
  gap: 6px;
}

.tile-bars span {
  height: 3px;
  border-radius: 2px;
  background: hsl(var(--tile-accent) / 0.55);
}

.tile-bars span:nth-child(1) { flex: 2; }
.tile-bars span:nth-child(2) { flex: 1.5; opacity: 0.6; }
.tile-bars span:nth-child(3) { flex: 3; opacity: 0.35; }

.tile-link {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 3;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: hsl(var(--muted-foreground));
  transition: color 120ms ease, background-color 120ms ease;
}

.tile-link:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--secondary));
}

.tile-link svg {
  transition: transform 140ms ease;
}

.tile:hover .tile-link svg {
  transform: translate(1px, -1px);
}

.nav-links a[aria-current="page"] {
  color: hsl(var(--foreground));
}

.tile-desc {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  max-width: 92%;
}

.tiles-loading,
.tiles-empty {
  grid-column: 1 / -1;
  padding: 2rem 0;
  text-align: center;
}

/* ============================================================
   Secondary pages (downloads, connections)
   ============================================================ */

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  padding: 1.25rem 1.5rem 1.5rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.panel-body,
.panel-foot {
  font-size: 0.9rem;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}

.panel-foot {
  margin-top: 0.75rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1.25rem;
  margin-top: 0.75rem;
}

.meta-grid dt {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.2rem;
}

.meta-grid dd {
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}

.download-list,
.endpoint-list,
.resource-list,
.callout-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid hsl(var(--border));
}

.download-row:first-child {
  border-top: none;
  padding-top: 0;
}

.download-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.download-platform {
  font-weight: 600;
  font-size: 0.9375rem;
}

.download-filename,
.download-note {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.download-cta {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 0.875rem;
  border-radius: 6px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.download-cta:hover {
  border-color: hsl(var(--accent-cyan) / 0.45);
  background: hsl(var(--accent-cyan) / 0.12);
  color: hsl(var(--foreground));
}

.callout {
  margin-top: 1.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  padding: 1.25rem 1.5rem;
}

.callout-warn {
  border-color: hsl(var(--status-idle) / 0.35);
  background: hsl(var(--status-idle) / 0.06);
}

.callout-title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.625rem;
}

.callout-list {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.6;
}

.callout-list li {
  padding-left: 1rem;
  position: relative;
}

.callout-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: hsl(var(--muted-foreground));
}

.inline-code {
  font-family: var(--font-mono);
  font-size: 0.8125em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
}

.code-block {
  margin-top: 0.5rem;
  padding: 1rem 1.125rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  overflow-x: auto;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  color: hsl(var(--foreground));
  white-space: pre;
}

.resource-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid hsl(var(--border));
}

.resource-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.resource-name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
}

.endpoint-list li {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  padding-left: 0.75rem;
  border-left: 2px solid hsl(var(--border));
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
}

/* full-tile click target */
.tile {
  cursor: pointer;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.5);
}

.footer-inner {
  max-width: var(--shell-max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
}

.footer-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: hsl(var(--status-active));
}

.footer-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--status-active));
  box-shadow: 0 0 8px hsl(var(--status-active) / 0.7);
}

.footer-spacer { flex: 1; }

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-link {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 120ms ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: hsl(var(--foreground));
}

.footer-sep {
  color: hsl(var(--border));
}

/* ============================================================
   Admin (tile registry editor)
   ============================================================ */

.admin-stack {
  gap: 1rem;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.admin-tile-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.field-group-wide {
  grid-column: 1 / -1;
}

.field-group-check {
  display: flex;
  align-items: flex-end;
}

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.field-input {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--input));
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 0.875rem;
}

.field-input:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 1px;
}

.field-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.field-row .field-input {
  flex: 1;
}

.field-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.admin-auth-form {
  margin-top: 0.5rem;
}

.admin-drift-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-drift-row {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--secondary) / 0.4);
}

.admin-drift-row strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.admin-drift-registry {
  color: hsl(var(--status-active));
}

.admin-drift-bundled {
  color: hsl(var(--accent-amber));
}

.admin-message {
  font-size: 0.875rem;
}

.admin-message-ok {
  color: hsl(var(--status-active));
}

.admin-message-error {
  color: hsl(var(--accent-rose));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 0.875rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 120ms ease, background 120ms ease;
}

.btn:hover,
.btn:focus-visible {
  border-color: hsl(var(--muted-foreground));
}

.btn-primary {
  background: hsl(var(--accent-violet) / 0.2);
  border-color: hsl(var(--accent-violet) / 0.45);
}

.btn-secondary {
  background: hsl(var(--card));
}

.btn-danger {
  background: hsl(var(--accent-rose) / 0.12);
  border-color: hsl(var(--accent-rose) / 0.35);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: hsl(var(--muted-foreground));
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  :root {
    --shell-gutter: 12px;
  }

  .topbar {
    flex-basis: 72px;
    min-height: 72px;
    margin-top: 12px;
    height: 72px;
  }

  .topbar-inner {
    grid-template-columns: auto auto;
    grid-template-areas: "brand utility";
    height: 100%;
    justify-content: space-between;
    padding: 0 16px;
    gap: 1rem;
    padding-top: 0;
    padding-bottom: 0;
  }

  .brand {
    font-size: 34px;
  }

  .topbar-cluster-apps,
  .nav-links-apps {
    display: none;
  }

  .topbar-cluster-utility {
    gap: 0.75rem;
  }

  .banner {
    padding: 2rem 1.25rem;
  }
  .banner-grid {
    background-size: 40px 40px;
  }
}

@media (max-width: 1180px) {
  .topbar {
    flex-basis: auto;
    height: auto;
    min-height: 126px;
  }

  .topbar-inner {
    grid-template-columns: auto auto;
    grid-template-areas:
      "brand utility"
      "apps apps";
    height: auto;
    padding-top: 16px;
    padding-bottom: 16px;
    row-gap: 0.875rem;
  }

  .brand {
    grid-area: brand;
  }

  .topbar-cluster-apps {
    grid-area: apps;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topbar-cluster-apps::-webkit-scrollbar {
    display: none;
  }

  .topbar-cluster-utility {
    grid-area: utility;
  }

  .nav-links-apps {
    justify-content: flex-start;
    width: max-content;
    padding-bottom: 2px;
  }
}

@media (max-width: 480px) {
  .topbar-inner {
    padding: 0 0.875rem;
  }
  .main {
    padding: 1.5rem 1rem 3rem;
  }

  .brand {
    font-size: 30px;
  }

  .topbar-cluster-utility {
    gap: 0.625rem;
  }

  .nav-links {
    gap: 0.75rem;
  }

  .nav-links a {
    font-size: 14px;
  }

  .footer-inner {
    align-items: flex-start;
    gap: 0.625rem 0.875rem;
  }

  .footer-spacer {
    display: none;
  }

  .footer-links {
    flex-wrap: wrap;
  }
}
