/* grab UI console stylesheet — compact, professional, no decoration.
   See issue #292 section D for the token/component spec this implements. */

[x-cloak] {
  display: none !important;
}
* {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", monospace;
  --fs: 13px;
  --fs-sm: 12px;
  --lh: 1.4;
  --bg: #fff;
  --bg-alt: #f6f8fa;
  --fg: #1f2328;
  --fg-muted: #656d76;
  --border: #d0d7de;
  --border-strong: #8c959f;
  --accent: #0969da;
  --accent-bg: #ddf4ff;
  --ok: #1a7f37;
  --ok-bg: #dafbe1;
  --warn: #9a6700;
  --warn-bg: #fff8c5;
  --err: #cf222e;
  --err-bg: #ffebe9;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --radius: 4px;
  --row-h: 32px;

  /* Compatibility aliases: pages not yet migrated to the compact classes
     below still reference these legacy token names in per-element inline
     styles. Aliasing them onto the compact palette keeps every page
     visually consistent, and dropping the old --shadow-*/--transition-*
     names (not aliased here) turns every remaining `var(--shadow-md)` /
     `var(--transition-base)` reference into a no-op, which is how the
     unmigrated pages lose their shadows and hover motion without each
     call site being edited individually. */
  --color-bg: var(--bg);
  --color-bg-alt: var(--bg-alt);
  --color-surface: var(--bg);
  --color-border: var(--border);
  --color-text: var(--fg);
  --color-text-light: var(--fg-muted);
  --color-text-lighter: var(--fg-muted);
  --color-primary: var(--accent);
  --color-primary-hover: var(--accent);
  --color-primary-light: var(--accent-bg);
  --color-secondary: var(--fg-muted);
  --color-secondary-hover: var(--fg);
  --color-success: var(--ok);
  --color-success-light: var(--ok-bg);
  --color-warning: var(--warn);
  --color-warning-light: var(--warn-bg);
  --color-danger: var(--err);
  --color-danger-hover: var(--err);
  --color-danger-light: var(--err-bg);
  --color-info: var(--accent);
  --color-info-light: var(--accent-bg);
  --color-header-bg: var(--bg);
  --color-header-text: var(--fg);
  --color-nav-hover: var(--bg-alt);
  --radius-sm: var(--radius);
  --radius-md: var(--radius);
  --radius-lg: var(--radius);
  --radius-xl: var(--radius);
  --radius-full: 9999px;
  --spacing-xs: var(--sp-1);
  --spacing-sm: var(--sp-2);
  --spacing-md: var(--sp-3);
  --spacing-lg: var(--sp-4);
  --spacing-xl: var(--sp-6);
  --spacing-2xl: 32px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0d1117;
    --bg-alt: #161b22;
    --fg: #e6edf3;
    --fg-muted: #8b949e;
    --border: #30363d;
    --border-strong: #6e7681;
    --accent: #4493f8;
    --accent-bg: #0c2d6b;
    --ok: #3fb950;
    --ok-bg: #0d2818;
    --warn: #d29922;
    --warn-bg: #3b2900;
    --err: #f85149;
    --err-bg: #3c1618;
  }
}

/* An explicit choice always wins over the operating-system preference. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fff;
  --bg-alt: #f6f8fa;
  --fg: #1f2328;
  --fg-muted: #656d76;
  --border: #d0d7de;
  --border-strong: #8c959f;
  --accent: #0969da;
  --accent-bg: #ddf4ff;
  --ok: #1a7f37;
  --ok-bg: #dafbe1;
  --warn: #9a6700;
  --warn-bg: #fff8c5;
  --err: #cf222e;
  --err-bg: #ffebe9;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-alt: #161b22;
  --fg: #e6edf3;
  --fg-muted: #8b949e;
  --border: #30363d;
  --border-strong: #6e7681;
  --accent: #4493f8;
  --accent-bg: #0c2d6b;
  --ok: #3fb950;
  --ok-bg: #0d2818;
  --warn: #d29922;
  --warn-bg: #3b2900;
  --err: #f85149;
  --err-bg: #3c1618;
}

html,
body {
  margin: 0;
}
body {
  font-family: var(--font);
  font-size: var(--fs);
  line-height: var(--lh);
  background: var(--bg);
  color: var(--fg);
}
a {
  color: var(--accent);
}
code,
pre {
  font-family: var(--mono);
}
/* Component display rules (.btn is inline-flex) would otherwise beat the
   user-agent [hidden] rule, leaving JS-hidden controls on screen. */
[hidden] {
  display: none !important;
}

/* Header: one 40px flat row — wordmark, primary nav, user menu, version. */
.header {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-4);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-logo {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: var(--radius);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--mono);
  font-weight: 600;
  font-size: var(--fs);
  color: var(--fg);
  text-decoration: none;
}
.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.nav > a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: var(--fs);
  padding: var(--sp-1) 0;
  border-bottom: 2px solid transparent;
}
.nav > a:hover {
  color: var(--fg);
}
.nav > a.active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}
.version-tag {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  flex: 0 0 auto;
}

/* Menus: user menu and the admin nav menu share this pattern. */
.menu {
  position: relative;
}
.menu-button {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--fg);
  padding: var(--sp-1) var(--sp-2);
  font: inherit;
  font-size: var(--fs);
  cursor: pointer;
}
.menu-button:hover,
.menu-button[aria-expanded="true"],
.menu-button.active {
  background: var(--bg-alt);
  border-color: var(--border);
}
.menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: var(--sp-1);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
  max-width: calc(100vw - var(--sp-4));
  padding: var(--sp-1);
  z-index: 50;
}
.menu-info {
  padding: var(--sp-2) var(--sp-3);
}
.menu-label {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
.menu-value {
  font-size: var(--fs);
  color: var(--fg);
  margin-top: var(--sp-1);
}
.menu-divider {
  margin: 0;
  border: none;
  border-top: 1px solid var(--border);
}
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 32px;
  padding: var(--sp-2) var(--sp-3);
  background: none;
  border: none;
  color: var(--fg);
  text-decoration: none;
  font: inherit;
  font-size: var(--fs);
  cursor: pointer;
  border-radius: var(--radius);
}
.menu-item:hover {
  background: var(--bg-alt);
}
.menu-form {
  margin: 0;
}
.theme-picker {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
}
.theme-picker .menu-label {
  flex: 1;
}
.theme-select {
  min-width: 110px;
  width: auto;
  height: 28px;
}
.login-theme-picker {
  justify-content: center;
  margin-top: var(--sp-3);
  padding: 0;
}
.admin-badge {
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  padding: 0 var(--sp-1);
}

.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--sp-4);
}
.narrow {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4);
}

footer.page-footer {
  text-align: center;
  padding: var(--sp-4);
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  border-top: 1px solid var(--border);
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-3);
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.card-header h2,
.card-header h3 {
  margin: 0;
  font-size: var(--fs);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
.card-header > * {
  min-width: 0;
}
.card-body {
  padding: var(--sp-4);
}
.card-body p {
  margin: 0;
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
th,
td {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs);
  white-space: normal;
  overflow-wrap: break-word;
  min-width: 0;
}
th {
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  font-weight: 600;
  color: var(--fg-muted);
}
th a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
tbody tr {
  height: var(--row-h);
}
tr.row-link {
  cursor: pointer;
}
.truncate {
  max-width: none;
  overflow-wrap: break-word;
  white-space: normal;
}
code {
  overflow-wrap: break-word;
  white-space: normal;
}
.package-table th:nth-child(5),
.package-table td:nth-child(5) {
  width: 20%;
}
.version-table th:nth-child(4),
.version-table td:nth-child(4),
.audit-table th:last-child,
.audit-table td:last-child {
  width: 22%;
}
.registry-table th:last-child,
.registry-table td:last-child,
.version-table th:last-child,
.version-table td:last-child {
  width: 160px;
  white-space: nowrap;
}
.registry-table td:last-child {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: var(--sp-1);
  white-space: normal;
}
.registry-table td:last-child .btn {
  flex: 1 1 100%;
}
.version-table th:first-child,
.version-table td:first-child {
  width: 190px;
}
.version-cell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-1);
  min-width: 0;
}
.version-cell a {
  min-width: 0;
  overflow-wrap: anywhere;
}
.row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--fg-muted);
  cursor: pointer;
  flex: 0 0 24px;
}
.btn-icon:hover {
  background: var(--bg-alt);
  color: var(--fg);
}
.btn-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.btn-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.small {
  font-size: var(--fs-sm);
}
.version-actions {
  min-width: 112px;
}
.registry-table th:nth-child(4),
.registry-table td:nth-child(4),
.version-table th:nth-child(8),
.version-table td:nth-child(8) {
  white-space: nowrap;
}
.muted {
  color: var(--fg-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 28px;
  height: auto;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-sm);
  text-decoration: none;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}
.btn:hover {
  background: var(--bg-alt);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent);
  filter: brightness(0.92);
}
.btn-secondary {
  color: var(--fg-muted);
}
.btn-danger {
  color: var(--err);
  border-color: var(--err);
}
.btn-danger:hover {
  background: var(--err-bg);
}
.btn-success {
  color: var(--ok);
  border-color: var(--ok);
}

.form-group {
  margin-bottom: var(--sp-3);
}
.form-label {
  display: block;
  font-size: var(--fs);
  font-weight: 600;
  margin-bottom: var(--sp-1);
  color: var(--fg);
}
.form-input,
.form-select,
.form-textarea,
select {
  width: 100%;
  height: 28px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--fs);
  background: var(--bg);
  color: var(--fg);
}
select {
  appearance: auto;
}
.form-textarea {
  height: auto;
  min-height: 100px;
  padding: var(--sp-2);
  font-family: var(--mono);
}
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible,
.btn:focus-visible,
.menu-button:focus-visible,
.menu-item:focus-visible,
.nav > a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Tags — compact status labels (issue #292 B6): validated, not validated,
   pending, not configured, prod, staging, and audit-log action labels. */
.tag {
  display: inline-block;
  height: 18px;
  line-height: 18px;
  padding: 0 var(--sp-1);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
.tag-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.tag-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.tag-err {
  background: var(--err-bg);
  color: var(--err);
}
.tag-accent {
  background: var(--accent-bg);
  color: var(--accent);
}
.tag-muted {
  background: var(--bg-alt);
  color: var(--fg-muted);
}

/* Banners — one bordered strip for errors/warnings/notices (issue #292 A5),
   replacing the old ad hoc inline-styled colored boxes. */
.banner {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
  font-size: var(--fs);
  color: var(--fg);
}
.banner-title {
  font-weight: 600;
  margin: 0 0 var(--sp-1);
}
.banner p {
  margin: 0;
}
.banner-ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}
.banner-warn {
  border-color: var(--warn);
  background: var(--warn-bg);
}
.banner-err {
  border-color: var(--err);
  background: var(--err-bg);
}
.banner-ok .banner-title {
  color: var(--ok);
}
.banner-warn .banner-title {
  color: var(--warn);
}
.banner-err .banner-title {
  color: var(--err);
}

/* Empty state — one bordered block for "nothing to show" pages. */
.empty-state {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  color: var(--fg-muted);
}
.empty-state strong {
  display: block;
  color: var(--fg);
  font-size: var(--fs);
  margin-bottom: var(--sp-1);
}
.empty-state p {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-sm);
}
.empty-state .form-actions {
  justify-content: center;
  margin-top: var(--sp-3);
}

/* Title/action row — 48px compact header for a page's title + controls. */
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-3);
  min-height: 48px;
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}
.title-row h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
.title-row .subtitle {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  margin: 2px 0 0;
}
.title-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
}

/* Forms — two-column label/control grid at >=900px (issue #292 B5). */
.form-card {
  max-width: 720px;
}
.form-grid {
  display: grid;
  gap: var(--sp-3);
}
@media (min-width: 900px) {
  .form-grid {
    grid-template-columns: 160px 1fr;
    align-items: start;
  }
  .form-grid > .form-label {
    padding-top: 6px;
    margin-bottom: 0;
  }
}
.form-help {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  margin-top: var(--sp-1);
}
.form-actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
  margin-top: var(--sp-3);
  flex-wrap: wrap;
}
.form-row {
  display: flex;
  gap: var(--sp-2);
  align-items: stretch;
  flex-wrap: wrap;
}
.form-row .form-input {
  flex: 1 1 180px;
  min-width: 0;
}
.form-grid > .form-input,
.form-grid > .form-select,
.form-grid > .form-group,
.form-grid > .form-actions,
.form-grid > select {
  width: 100%;
  min-width: 0;
}
.browse-filter-form {
  min-width: 0;
}
.browse-filter-form select[name="registry"] {
  flex: 0 1 150px;
  width: 150px;
}
.browse-filter-form input[name="q"] {
  flex: 1 1 220px;
  min-width: 140px;
}
/* .title-actions sizes to its content, so the search box needs a definite
   width to keep it on the same row as the registry select. */
@media (min-width: 900px) {
  .browse-filter-form {
    flex-wrap: nowrap;
  }
  .browse-filter-form input[name="q"] {
    width: 260px;
  }
}

@media (max-width: 899px) {
  .title-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .browse-filter-form {
    flex-direction: column;
    width: 100%;
  }
  .browse-filter-form select[name="registry"],
  .browse-filter-form input[name="q"] {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .admin-menu .menu-dropdown {
    left: 0;
    right: auto;
  }

  .header {
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    flex-wrap: wrap;
  }
  .header > .nav {
    order: 3;
    flex-basis: 100%;
    padding-top: var(--sp-1);
    border-top: 1px solid var(--border);
  }
  .header > .menu {
    margin-left: auto;
  }
  .main {
    padding: var(--sp-3);
  }
  .card {
    padding: var(--sp-3);
  }
  .card-header {
    align-items: flex-start;
  }
  .card-header > .btn,
  .card-header > .title-actions {
    width: 100%;
  }
  .form-row {
    flex-direction: column;
  }
  .form-row .form-input {
    flex: 0 1 auto;
  }
  .form-row .btn {
    width: 100%;
  }
  .form-actions {
    justify-content: stretch;
  }
  .form-actions .btn {
    flex: 1 1 120px;
  }
  .registry-table th:last-child,
  .registry-table td:last-child,
  .version-table th:last-child,
  .version-table td:last-child {
    width: 132px;
  }
  .registry-table td:last-child {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: var(--sp-1);
    white-space: normal;
  }
  .registry-table td:last-child .btn {
    flex: 1 1 100%;
  }
  .pager {
    flex-wrap: wrap;
    gap: var(--sp-2);
  }
}

/* Modal — plain bordered panel, no shadow/animation. Visibility is toggled
   either via the native `hidden` attribute (plain JS) or Alpine's x-show
   (inline style, which always wins over the class default below). */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 31, 36, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay[hidden] {
  display: none;
}
.modal-card {
  max-width: 600px;
  width: 90%;
  margin: var(--sp-4);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--fg-muted);
}

/* Pager — compact prev/next + page count row. */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}

/* CF status detail inside the registry edit modal (issue #292 B6). */
.cf-status-detail {
  margin-top: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
.cf-instructions {
  margin-top: var(--sp-2);
}
.cf-instructions summary {
  cursor: pointer;
  font-size: var(--fs-sm);
}
.cf-instructions pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: var(--sp-2);
  border-radius: var(--radius);
  max-height: 300px;
  overflow: auto;
  font-size: var(--fs-sm);
  white-space: pre-wrap;
}

/* Numeric/size/date table columns align right (issue #292 D "Tables"). */
.num {
  text-align: right;
  font-family: var(--mono);
}
th.num {
  font-family: inherit;
}

/* Artifact detail page */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 28px;
  padding: 0 var(--sp-3);
  background: var(--ok);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-sm);
}
.download-btn:hover {
  filter: brightness(0.92);
}
.download-btn-disabled {
  background: var(--fg-muted);
  cursor: not-allowed;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
  padding: var(--sp-4);
}
.info-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.info-label {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
.info-value {
  font-size: var(--fs);
  color: var(--fg);
}
.pre-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: var(--sp-3);
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

/* Small layout utilities, used sparingly to avoid inline style="" attributes. */
.mt-2 {
  margin-top: var(--sp-2);
}
.flex-1 {
  flex: 1;
}
.text-center {
  text-align: center;
}

/* Login page */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}
.login-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-logo {
  display: block;
  width: 160px;
  height: 48px;
  margin: 0 auto var(--sp-3);
}
.login-card .wordmark {
  display: block;
  font-size: 20px;
  margin-bottom: var(--sp-1);
}
.login-subtitle {
  color: var(--fg-muted);
  font-size: var(--fs);
  margin-bottom: var(--sp-4);
}
.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  font-size: var(--fs);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: var(--sp-2);
}
.login-btn:hover {
  filter: brightness(1.15);
}
.login-btn-debug {
  background: var(--bg);
  color: var(--fg);
}
.login-version {
  margin-top: var(--sp-4);
  color: var(--fg-muted);
  font-size: var(--fs-sm);
}
.cf-badge {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.cf-badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* CloudFront column: one row per channel, label then status. */
.cf-channel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-1, 4px);
}
.cf-channel-list li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  white-space: nowrap;
}
.cf-channel-name {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  min-width: 5.5em;
}
.cf-help-dialog {
  width: min(560px, calc(100% - 32px));
  max-width: 560px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
}
.cf-help-dialog::backdrop {
  background: rgba(27, 31, 36, 0.5);
}
.cf-help-dialog .card {
  margin: 0;
  border: 0;
}
.app-notice {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
}
.app-notice::backdrop {
  background: rgba(27, 31, 36, 0.5);
}
.app-notice .card {
  margin: 0;
  border: 0;
}
/* Messages carry newlines from the server; render them as written. */
.app-notice-message {
  margin: var(--sp-3) 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.app-notice-actions {
  display: flex;
  justify-content: flex-end;
}
.cf-help-definitions {
  margin: var(--sp-3) 0;
}
.cf-help-definitions dt {
  font-weight: 600;
  margin-top: var(--sp-2);
}
.cf-help-definitions dd {
  margin: 0;
  color: var(--fg-muted);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
