/*
 * Atlas — the design system of the "Level Server — Atlas redesign" Penpot file (Mother
 * project, linked to the "Atlas — design system" library).
 *
 * Four parts, in this order:
 *
 *   1. IBM Plex, self-hosted from public/fonts/ (the @fontsource 5.3.0 woff2 files, OFL —
 *      public/fonts/LICENSE). Latin, Latin Extended and Cyrillic: the popups carry Russian
 *      texts. No CDN, so the app still names no host but its API and the game CDNs.
 *   2. Tokens. Values are Atlas core + theme-light, as the Solstamp admin UI took them
 *      (solstamp-server frontend/src/styles/atlas.css); a name here is the design's token
 *      name, so a value seen in Penpot maps 1:1 to a variable.
 *   3. `.a-*` primitives for what Element Plus had no component for: the page header, the
 *      card, badges, the environment strip, plain tables, tabs and chips.
 *   4. The shell: the sidebar, the mobile top bar and its drawer (layout/default.rs,
 *      components/sidebar.rs).
 *
 * The Element Plus look-alike kit (src/ui) is restyled onto these tokens in ui.css, whose
 * `--el-*` variables now point here. This file is linked before ui.css so those
 * references resolve and the kit's own rules keep their precedence over the primitives.
 */

/* ---- 1. Fonts ---------------------------------------------------------------------- */

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/ibm-plex-sans-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* ---- 2. Tokens --------------------------------------------------------------------- */

:root {
  /* Type */
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-2xs: 10.5px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 24px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Space */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;

  /* Radius */
  --radius-sm: 3px;
  --radius-base: 5px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-dialog: 10px;
  --radius-xl: 12px;
  --radius-pill: 999px;

  /* Sizing (compact density) */
  --btn-h: 28px;
  --input-h: 30px;
  --row-h: 36px;
  --sidebar-w: 240px;

  /* Status */
  --success: #0e9f6e;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #2563eb;

  /* Grays */
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;

  /* Theme — light */
  --bg: #ffffff;
  --bg-subtle: #fafafb;
  --card: #ffffff;
  --side: #fbfbfd;
  --fg: #111827;
  --fg-muted: #6b7280;
  --fg-subtle: #9ca3af;
  --muted: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --border-row: #f0f1f4;
  --hover: #f5f6f8;
  --active: #e5e7eb;
  --accent: #5b4bff;
  --accent-hover: #4636e0;
  --accent-ink: #4636e0;
  --accent-soft: #f1efff;
  --accent-fg: #ffffff;
  /* "Publish to prod": the one high-stakes action, near-black. */
  --ink: #111827;
  --ink-hover: #1f2937;
  --success-soft: #ecfdf5;
  --warning-soft: #fffbeb;
  --danger-soft: #fef2f2;
  --info-soft: #eff6ff;
  --ring: 0 0 0 3px rgba(91, 75, 255, 0.2);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 4px 12px rgba(17, 24, 39, 0.08), 0 2px 4px rgba(17, 24, 39, 0.05);
  --shadow-lg: 0 12px 32px rgba(17, 24, 39, 0.12), 0 4px 8px rgba(17, 24, 39, 0.06);
  --scrim: rgba(17, 24, 39, 0.4);
}

/* ---- 3. Primitives ----------------------------------------------------------------- */
/*
 *   Page      .a-page, .a-page-header (+ __breadcrumb/__title/__subtitle/__actions)
 *   Surfaces  .a-card (+ __header/__titles/__title/__description/__actions/__footer),
 *             .a-card--flush (a table edge to edge)
 *   Strip     .a-env-strip — Halva project · Environment select · hint
 *   Feedback  .a-badge (+ --neutral/--outline/--success/--warning/--danger/--info/
 *             --accent/--mono), .a-alert (+ tones), .a-empty
 *   Data      .a-table-wrap/.a-table (+ .a-num, .a-table__actions), .a-dot
 *   Controls  .a-tabs/.a-tab (+ __count), .a-chips/.a-chip, .a-icon-btn, .a-link
 *   Text      .a-mono, .a-muted, .a-subtle, .a-strong, .a-nowrap
 */

.a-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

.a-page-header {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  min-width: 0;
}

.a-page-header__titles {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

.a-page-header__breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 16px;
  color: var(--fg-muted);
}

.a-page-header__breadcrumb a,
.a-page-header__breadcrumb a:visited {
  color: var(--fg-muted);
}

.a-page-header__breadcrumb a:hover {
  color: var(--fg);
}

.a-page-header__title {
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  line-height: 32px;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.a-page-header__subtitle {
  margin: 0;
  font-size: var(--text-base);
  line-height: 17px;
  color: var(--fg-muted);
}

.a-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.a-page-header__actions .el-button + .el-button,
.a-card__actions .el-button + .el-button,
.a-actions .el-button + .el-button {
  margin-left: 0;
}

.a-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.a-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 0;
}

.a-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.a-card__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.a-card__title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: 20px;
  color: var(--fg);
}

.a-card__description {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 17px;
  color: var(--fg-muted);
}

.a-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.a-card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* The environment strip under a Flags & experiments header. */
.a-env-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  min-height: 30px;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.a-env-strip__label {
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.a-env-strip__project {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--fg);
}

.a-env-strip__sep {
  width: 1px;
  height: 16px;
  background: var(--border);
}

.a-env-strip__env {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.a-env-strip__hint {
  margin-left: auto;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* A native <select> that reads as the kit's select. */
.a-select {
  height: var(--input-h);
  min-width: 120px;
  padding: 0 28px 0 10px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  font: inherit;
  font-size: var(--text-base);
  color: var(--fg);
  appearance: none;
  cursor: pointer;
}

.a-select:hover {
  border-color: var(--border-strong);
}

.a-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

/* Badges. */
.a-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 18px;
  padding: 0 var(--space-2);
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 14px;
  color: var(--fg);
  white-space: nowrap;
  vertical-align: middle;
}

.a-badge--outline {
  background: var(--bg);
  border-color: var(--border-strong);
}

.a-badge--success,
.a-badge--warning,
.a-badge--danger,
.a-badge--info,
.a-badge--accent {
  border-color: transparent;
}

.a-badge--success { background: var(--success-soft); color: var(--success); }
.a-badge--warning { background: var(--warning-soft); color: var(--warning); }
.a-badge--danger { background: var(--danger-soft); color: var(--danger); }
.a-badge--info { background: var(--info-soft); color: var(--info); }
.a-badge--accent { background: var(--accent-soft); color: var(--accent-ink); }

/* A value chip: `boolean`, `"grid"`, a version. */
.a-badge--mono {
  border-color: transparent;
  border-radius: var(--radius-sm);
  background: var(--muted);
  font-family: var(--font-mono);
  font-weight: var(--weight-regular);
}

.a-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

/* Alerts. */
.a-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: var(--space-3) 14px;
  border-radius: var(--radius-md);
  background: var(--muted);
  font-size: var(--text-sm);
  line-height: 17px;
  color: var(--fg-muted);
}

.a-alert__icon { flex: none; margin-top: 1px; }
.a-alert__content { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.a-alert__title { margin: 0; font-size: var(--text-base); font-weight: var(--weight-semibold); line-height: 19px; color: var(--fg); }
.a-alert--info { background: var(--info-soft); }
.a-alert--info .a-alert__icon { color: var(--info); }
.a-alert--success { background: var(--success-soft); }
.a-alert--success .a-alert__icon { color: var(--success); }
.a-alert--warning { background: var(--warning-soft); }
.a-alert--warning .a-alert__icon { color: var(--warning); }
.a-alert--danger { background: var(--danger-soft); color: var(--danger); }
.a-alert--danger .a-alert__icon { color: var(--danger); }

.a-empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  font-size: var(--text-base);
  color: var(--fg-muted);
}

/* Plain tables (the pages' own <table>s; `.el-table` is ui.css's). */
.a-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  background: var(--card);
}

.a-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-base);
  color: var(--fg);
}

.a-table th {
  height: 32px;
  padding: 0 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  line-height: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  color: var(--fg-muted);
  white-space: nowrap;
}

.a-table td {
  height: var(--row-h);
  padding: 6px 12px;
  box-sizing: border-box;
  line-height: 19px;
  vertical-align: middle;
}

.a-table tbody tr + tr td {
  border-top: 1px solid var(--border-row);
}

.a-table tbody tr:hover td {
  background: var(--bg-subtle);
}

.a-table tbody tr.is-selected td {
  background: var(--accent-soft);
}

.a-table .a-num,
.a-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.a-table .a-table__actions {
  text-align: right;
  white-space: nowrap;
}

/* A category colour in front of a label: event kinds. */
.a-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, var(--fg-subtle));
  vertical-align: middle;
}

/* Underline tabs with an optional count. */
.a-tabs {
  display: flex;
  gap: var(--space-5);
  overflow-x: auto;
  scrollbar-width: none;
}

.a-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 0 0 var(--space-2);
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: var(--text-base);
  line-height: 19px;
  color: var(--fg-muted);
  cursor: pointer;
}

.a-tab:hover { color: var(--fg); }

.a-tab:focus-visible {
  outline: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--ring);
}

.a-tab--active,
.a-tab[aria-selected='true'],
.a-tab[aria-current='page'] {
  color: var(--fg);
  font-weight: var(--weight-semibold);
  border-bottom-color: var(--accent);
}

.a-tab__count {
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 16px;
  color: var(--fg-muted);
}

.a-tab--active .a-tab__count,
.a-tab[aria-selected='true'] .a-tab__count {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* Segmented control. */
.a-chips {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-md);
  background: var(--muted);
}

.a-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-base);
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  cursor: pointer;
  white-space: nowrap;
}

.a-chip:hover { color: var(--fg); }

.a-chip--active,
.a-chip[aria-pressed='true'],
.a-chip[aria-checked='true'] {
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow-sm);
}

/* Square icon-only button; give it an aria-label. */
.a-icon-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
}

.a-icon-btn:hover {
  background: var(--hover);
  color: var(--fg);
}

.a-icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.a-icon-btn--outline {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}

/* Accent text link for a row's main action ("Publish…", an event's name). */
.a-link,
.a-link:visited {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: var(--weight-medium);
  color: var(--accent-ink);
  cursor: pointer;
}

.a-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.a-icon {
  flex: none;
  display: block;
}

.a-mono { font-family: var(--font-mono); font-size: 0.95em; }
.a-muted { color: var(--fg-muted); }
.a-subtle { color: var(--fg-subtle); }
.a-strong { font-weight: var(--weight-semibold); color: var(--fg); }
.a-nowrap { white-space: nowrap; }

/* ---- 4. Shell ---------------------------------------------------------------------- */

.shell {
  min-height: 100vh;
  background: var(--bg-subtle);
}

.shell__sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-w);
  box-sizing: border-box;
  overflow-y: auto;
  background: var(--side);
  border-right: 1px solid var(--border);
}

.shell__main {
  margin-left: var(--sidebar-w);
  padding: var(--space-7) var(--space-8) var(--space-8);
  min-width: 0;
  min-height: 100vh;
  box-sizing: border-box;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 100%;
  padding: var(--space-4) var(--space-3) var(--space-3);
  box-sizing: border-box;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--space-1);
}

.logo-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  line-height: 1;
}

.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.sidebar__product {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: 18px;
  color: var(--fg);
}

.sidebar__tagline {
  font-size: var(--text-xs);
  line-height: 14px;
  color: var(--fg-muted);
}

/* The project switcher opens the project list (Home). */
.project-switcher,
.project-switcher:visited {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
}

.project-switcher:hover {
  border-color: var(--border-strong);
  color: var(--fg);
}

.project-switcher:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.project-switcher__text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.project-switcher__caption,
.sidebar__caption {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  line-height: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.project-switcher__name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 17px;
  white-space: nowrap;
}

.project-switcher__name > span:first-child {
  overflow: hidden;
  font-weight: inherit;
  text-overflow: ellipsis;
}

.project-switcher__id {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--fg-subtle);
}

.project-switcher .a-icon {
  color: var(--gray-500);
}

/* A project's letter on its tint: the switcher, the project list. */
.project-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-base);
  background: var(--avatar-bg, var(--accent-soft));
  color: var(--avatar-fg, var(--accent-ink));
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  line-height: 1;
}

.project-avatar--lg {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  font-size: var(--text-md);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar__group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar__caption {
  padding: 0 10px 6px;
}

.nav-item,
.nav-item:visited {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 29px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: 17px;
  color: var(--gray-700);
  text-decoration: none;
}

.nav-item .a-icon {
  color: var(--gray-500);
}

.nav-item:hover {
  background: var(--hover);
  color: var(--fg);
}

.nav-item:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.nav-item[aria-current='page'],
.nav-item[aria-current='page']:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: var(--weight-semibold);
}

.nav-item[aria-current='page'] .a-icon {
  color: var(--accent-ink);
}

.nav-item__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__spacer {
  flex: 1;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-2) 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.account__avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.account__who {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.account__name {
  overflow: hidden;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 17px;
  color: var(--fg);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A link; `:visited` too, or base.css's `a:visited` would out-rank the colour. */
.account__profile,
.account__profile:visited {
  align-self: flex-start;
  font-size: var(--text-xs);
  line-height: 14px;
  color: var(--fg-muted);
  text-decoration: none;
}

.account__profile:hover,
.account__profile[aria-current='page'] {
  color: var(--accent-ink);
  text-decoration: underline;
}

/* Mobile: a top bar with the menu button; the sidebar becomes a drawer over a scrim. */
.topbar,
.drawer-layer {
  display: none;
}

@media (max-width: 899px) {
  .shell__sidebar {
    display: none;
  }

  .shell__main {
    margin-left: 0;
    padding: var(--space-5) var(--space-4);
    min-height: calc(100vh - 56px);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 56px;
    padding: 0 var(--space-4);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .drawer-layer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
  }

  .a-page {
    gap: var(--space-4);
  }

  .a-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .a-page-header__breadcrumb {
    display: none;
  }

  .a-page-header__title {
    font-size: var(--text-2xl);
    line-height: 26px;
  }

  .a-page-header__actions {
    justify-content: flex-start;
  }

  .a-env-strip__hint {
    margin-left: 0;
    flex-basis: 100%;
  }

  .a-card__header {
    flex-wrap: wrap;
  }

  .a-card__actions {
    flex-basis: 100%;
  }
}

.topbar__menu {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}

.topbar__menu:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.topbar__titles {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.topbar__section {
  overflow: hidden;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: 19px;
  color: var(--fg);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__project {
  overflow: hidden;
  font-size: var(--text-xs);
  line-height: 14px;
  color: var(--fg-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-layer__scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  animation: a-fade-in 0.18s ease;
}

.drawer {
  position: absolute;
  inset: 0 auto 0 0;
  width: min(300px, 85vw);
  box-sizing: border-box;
  overflow-y: auto;
  background: var(--side);
  box-shadow: var(--shadow-lg);
  animation: a-drawer-in 0.18s ease;
}

@keyframes a-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes a-drawer-in { from { transform: translateX(-100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .drawer-layer__scrim {
    animation: none;
  }
}
