/*
 * The release page in the NourishGenie Console theme. Every size is the Console's own token, written in rem, so the
 * page scales from the one root rule below. Type, colours and control sizes: Console sources
 * (components/_variables.custom.scss, _control-size.scss, core/components/_variables.scss, _variables-dark.scss) and
 * docs/frontend/README.md "Control sizes". No inline styles anywhere (CSP style-src 'self').
 */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/inter-latin-wght-normal.woff2) format('woff2');
}

/* ---- root size ------------------------------------------------------------------------------------------------------
 * The one rule that sizes the page. The Console renders at 80 % (rule 7.4): 14px x 0.8 = 11.2px on desktop and
 * 13px x 0.8 = 10.4px below its scaled lg breakpoint (991.98px x 0.8 = 793.58px). For 100 %: 14px, 13px and 991.98px.
 */
html {
  font-size: 11.2px;
}

@media (max-width: 793.58px) {
  html {
    font-size: 10.4px;
  }
}

/* ---- tokens ------------------------------------------------------------------------------------------------------ */

:root {
  --primary: #f47b0a;
  --primary-active: #d96a05;
  --primary-light: #fef1e5;
  --primary-clarity: rgba(244, 123, 10, 0.2);
  --primary-inverse: #ffffff;

  --page: #f3f4f6;
  --surface: #ffffff;
  --header: #ffffff;
  --gray-100: #f9f9f9;
  --gray-200: #f1f1f4;
  --gray-300: #dbdfe9;
  --gray-400: #c4cada;
  --gray-500: #99a1b7;
  /* Text that must still be read (help, subtitles, notes, table headers, placeholders): 4.5:1 or more. */
  --text-quiet: #4b5675;
  --gray-600: #78829d;
  --gray-700: #4b5675;
  --gray-800: #252f4a;
  --gray-900: #071437;
  --light: #f1f1f4;
  --light-active: #dbdfe9;
  --border: #f1f1f4;
  --border-strong: #dbdfe9;

  --success: #17c653;
  --success-light: #dfffea;
  --success-text: #0a7f35;
  --warning: #f6c000;
  --warning-light: #fff8dd;
  --warning-text: #7a5b00;
  --danger: #f8285a;
  --danger-light: #ffeef3;
  --danger-text: #d81a48;
  --info: #7239ea;
  --info-light: #f8f5ff;
  --info-text: #5014d0;

  --surface-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --header-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.05);
  --auth-shadow: 0 0.1rem 1rem 0.25rem rgba(0, 0, 0, 0.05);
  --bar-shadow: 0 0.5rem 1.5rem 0.5rem rgba(0, 0, 0, 0.075);
  --dropdown-shadow: 0 0 50px 0 rgba(82, 63, 105, 0.15);
  --segment-track: #f1f1f4;
  --segment-thumb: #ffffff;
  --segment-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.06);
  --auth-bg: url(/auth-bg.jpg);

  /* Console control scale ($ng-* tokens) */
  --control-h: calc(2.525rem + 1.6px);
  --control-font: 0.95rem;
  --control-py: 0.55rem;
  --control-px: 0.75rem;
  --control-btn-px: 1rem;
  --compact-h: calc(2rem + 1.6px);
  --compact-font: 0.9rem;
  --compact-px: 0.6rem;
  --compact-btn-px: 0.75rem;
  --mini: 1.75rem;
  --control-radius: 0.425rem;
  --check: 1.4rem;
  --glyph-text: 1.25rem;
  --glyph-text-compact: 1rem;
  --glyph-adornment: 1.25rem;
  --glyph-icon: 1.35rem;
  --glyph-icon-compact: 1.15rem;
  --glyph-mini: 0.95rem;

  /* Metronic and Console layout */
  --radius: 0.475rem;
  --radius-lg: 0.625rem;
  --card-px: 2.25rem;
  --card-py: 2rem;
  --card-header-h: 5rem;
  --cell-p: 0.75rem;
  --strip-h: 2.25rem;
  --header-h: 5.2857rem;
  --gutter: 2.1429rem;

  --sans: 'Inter Variable', Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-active: #ff8b2b;
    --primary-light: #2b1e12;

    --page: #0f1014;
    --surface: #15171c;
    --header: #0d0e12;
    --gray-100: #1b1c22;
    --gray-200: #26272f;
    --gray-300: #363843;
    --gray-400: #464852;
    --gray-500: #636674;
    --text-quiet: #9a9cae;
    --gray-600: #808290;
    --gray-700: #9a9cae;
    --gray-800: #b5b7c8;
    --gray-900: #f5f5f5;
    --light: #26272f;
    --light-active: #363843;
    --border: #26272f;
    --border-strong: #363843;

    --success: #00a261;
    --success-light: #1f212a;
    --success-text: #01bf73;
    --warning: #c59a00;
    --warning-light: #242320;
    --warning-text: #d9aa00;
    --danger: #e42855;
    --danger-light: #302024;
    --danger-text: #ff3767;
    --info: #883fff;
    --info-light: #272134;
    --info-text: #9e63ff;

    --surface-shadow: none;
    --header-shadow: none;
    --auth-shadow: none;
    --bar-shadow: 0 0.5rem 1.5rem 0.5rem rgba(0, 0, 0, 0.4);
    --dropdown-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    --segment-track: #1b1c22;
    --segment-thumb: #363843;
    --segment-shadow: none;
    --auth-bg: url(/auth-bg-dark.jpg);
    color-scheme: dark;
  }
}

@media (max-width: 793.58px) {
  :root {
    --header-h: 4.2857rem;
    --gutter: 1.4286rem;
    --card-px: 1.5rem;
    --card-py: 1.5rem;
  }
}

/* ---- base -------------------------------------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--gray-700);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--gray-900);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

h3 {
  font-size: 1.075rem;
}

p {
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-active);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--mono);
  font-size: 0.95em;
}

.muted {
  color: var(--text-quiet);
}

.small {
  font-size: 0.95rem;
}

.icon {
  flex: none;
  width: 1em;
  height: 1em;
}

/* ---- header ------------------------------------------------------------------------------------------------------
 * The Console header (app-header, container-fluid): full width, 74px high (60px below lg), white with a soft shadow in
 * light, coal-500 without shadow in dark; logo 30px; menu links as the Console's header menu; icon control buttons; the
 * profile as a 35px initials symbol opening a 300px menu.
 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header);
  box-shadow: var(--header-shadow);
}

.topbar-inner {
  display: flex;
  align-items: stretch;
  height: var(--header-h);
  padding: 0 var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: none;
  margin-right: 3.75rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

.brand img {
  width: 2.1429rem;
  height: 2.1429rem;
}

.brand-name {
  color: var(--gray-900);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
  padding: 0.675rem 1rem;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--gray-700);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link[aria-current='page'] {
  background: var(--gray-100);
  color: var(--primary);
}

.who {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: none;
  margin-left: auto;
}

.navbar-item {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-h);
  height: var(--control-h);
  padding: 0;
  border: 0;
  border-radius: var(--control-radius);
  background: none;
  color: var(--gray-600);
  cursor: pointer;
}

.btn-header .icon {
  font-size: var(--glyph-icon);
}

.btn-header:hover,
.btn-header[aria-expanded='true'] {
  background: var(--light);
  color: var(--primary);
}

.nav-toggle {
  display: none;
}

.symbol-btn {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius);
}

.symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.075rem;
  font-weight: 600;
}

.symbol-lg {
  width: 3.5714rem;
  height: 3.5714rem;
  font-size: 1.35rem;
}

.symbol-dot {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  width: 0.7143rem;
  height: 0.7143rem;
  border: 2px solid var(--header);
  border-radius: 50%;
  background: var(--warning);
}

.dropdown {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  z-index: 107;
  width: 21.4286rem;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 1rem 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--dropdown-shadow);
  color: var(--gray-600);
  font-size: 1.075rem;
  font-weight: 600;
}

.dropdown-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.75rem;
}

.dropdown-who {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.dropdown-name {
  overflow: hidden;
  color: var(--gray-900);
  font-size: 1.15rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-sub {
  color: var(--text-quiet);
  font-size: 0.95rem;
  font-weight: 500;
}

.dropdown-sep {
  height: 0;
  margin: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.dropdown-info {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 1.75rem;
}

.dropdown-info > .icon {
  margin-top: 0.1rem;
  font-size: 1.35rem;
  color: var(--text-quiet);
}

.dropdown-info-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dropdown-info-title {
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
}

.dropdown-info.is-low > .icon,
.dropdown-info.is-low .dropdown-info-title {
  color: var(--warning-text);
}

.dropdown-info.is-off > .icon {
  color: var(--warning-text);
}

.dropdown-item {
  padding: 0.15rem 1.25rem;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.5rem 0.65rem 0.5rem;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--gray-600);
  font-size: 1.075rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.dropdown-link .icon {
  font-size: 1.35rem;
}

.dropdown-link:hover,
.dropdown-link:focus-visible,
.dropdown-link[aria-current='page'] {
  background: var(--gray-100);
  color: var(--primary);
}

.dropdown-nav {
  width: 17rem;
}

/* ---- page -------------------------------------------------------------------------------------------------------- */

.main {
  padding: 2rem var(--gutter) 3rem;
}

.banner-slot {
  position: sticky;
  top: calc(var(--header-h) + var(--strip-h));
  z-index: 98;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem var(--gutter);
  background: var(--page);
}

.banner-slot:empty {
  display: none;
}

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

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.page-title {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.page-sub {
  color: var(--text-quiet);
  font-size: 0.95rem;
  max-width: 64rem;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 5rem 0;
  color: var(--text-quiet);
}

.spinner {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- card -------------------------------------------------------------------------------------------------------- */

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--surface-shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  min-height: var(--card-header-h);
  padding: 0.5rem var(--card-px);
  border-bottom: 1px solid var(--border);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.card-title .mono {
  color: var(--text-quiet);
  font-size: 0.95rem;
  font-weight: 400;
}

.card-body {
  padding: var(--card-py) var(--card-px);
}

.card-body-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 1.25rem var(--card-px);
  border-top: 1px solid var(--border);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--mini);
  height: var(--mini);
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-inverse);
  font-size: 0.95rem;
  font-weight: 600;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 3rem var(--card-px);
  color: var(--text-quiet);
  text-align: center;
}

.empty .icon {
  font-size: 2.5rem;
  color: var(--gray-400);
}

.empty-title {
  color: var(--gray-800);
  font-weight: 600;
}

/* ---- summary ----------------------------------------------------------------------------------------------------- */

.headline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-700);
  font-size: 1.075rem;
  font-weight: 500;
}

.headline .icon {
  font-size: var(--glyph-text);
}

.headline.tone-ok .icon {
  color: var(--success-text);
}

.headline.tone-warn .icon {
  color: var(--warning-text);
}

.headline.tone-bad .icon {
  color: var(--danger-text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem 1.75rem;
  color: inherit;
  text-align: left;
}

button.stat {
  cursor: pointer;
  transition: border-color 0.15s ease;
}

button.stat:hover {
  border-color: var(--border-strong);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-quiet);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  color: var(--gray-900);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.stat-sub {
  color: var(--text-quiet);
  font-size: 0.95rem;
}

.dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--gray-400);
}

.dot.tone-ok {
  background: var(--success);
}

.dot.tone-warn {
  background: var(--warning);
}

.dot.tone-bad {
  background: var(--danger);
}

.dot.tone-info {
  background: var(--info);
}

.dot.tone-primary {
  background: var(--primary);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.facts {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem 3rem;
  flex-wrap: wrap;
}

.fact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.fact-label {
  color: var(--text-quiet);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---- buttons (control scale)------------------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--control-h);
  padding: 0 var(--control-btn-px);
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: var(--light);
  color: var(--gray-700);
  font-size: var(--control-font);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn .icon {
  font-size: var(--glyph-text);
}

.btn:hover:not(:disabled) {
  background: var(--light-active);
  color: var(--gray-800);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-inverse);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-active);
  color: var(--primary-inverse);
}

.btn-light-danger {
  background: var(--danger-light);
  color: var(--danger-text);
}

.btn-light-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #ffffff;
}

.btn-light-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-light-primary:hover:not(:disabled) {
  background: var(--primary);
  color: var(--primary-inverse);
}

.btn-compact {
  height: var(--compact-h);
  padding: 0 var(--compact-btn-px);
  font-size: var(--compact-font);
}

.btn-compact .icon {
  font-size: var(--glyph-text-compact);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: var(--control-h);
  padding: 0;
}

.btn-icon .icon {
  font-size: var(--glyph-icon);
}

.btn-mini {
  width: var(--mini);
  height: var(--mini);
  padding: 0;
  background: transparent;
  color: var(--text-quiet);
}

.btn-mini .icon {
  font-size: var(--glyph-mini);
}

.btn-mini:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--primary);
}

.btn-mini.is-done {
  color: var(--success-text);
}

.btn-link {
  height: auto;
  padding: 0;
  background: none;
  color: var(--primary);
}

.btn-link:hover:not(:disabled) {
  background: none;
  color: var(--primary-active);
}

.btn .spinner {
  width: 1rem;
  height: 1rem;
  border-color: rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
}

.reason {
  color: var(--warning-text);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ---- badges ------------------------------------------------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.325rem 0.5rem;
  border-radius: 0.425rem;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge .icon {
  font-size: 0.95rem;
}

.badge.tone-ok {
  background: var(--success-light);
  color: var(--success-text);
}

.badge.tone-warn {
  background: var(--warning-light);
  color: var(--warning-text);
}

.badge.tone-bad {
  background: var(--danger-light);
  color: var(--danger-text);
}

.badge.tone-info {
  background: var(--info-light);
  color: var(--info-text);
}

.badge.tone-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge.tone-idle {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge-lg {
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
}

.badges {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

/* ---- forms ------------------------------------------------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
}

.form-label {
  color: var(--gray-800);
  font-size: 1.075rem;
  font-weight: 500;
}

.help {
  color: var(--text-quiet);
  font-size: 0.95rem;
}

.input,
.select {
  width: 100%;
  height: var(--control-h);
  padding: var(--control-py) var(--control-px);
  border: 1px solid var(--gray-300);
  border-radius: var(--control-radius);
  background-color: var(--surface);
  color: var(--gray-700);
  font-size: var(--control-font);
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--text-quiet);
}

.input:focus,
.select:focus {
  border-color: var(--gray-400);
  outline: none;
  box-shadow: 0 0 0 0.25rem var(--primary-clarity);
}

.input.is-invalid {
  border-color: var(--danger);
}

.select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--gray-500) 50%), linear-gradient(135deg, var(--gray-500) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 50%, calc(100% - 0.75rem) 50%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
}

.select-compact {
  width: auto;
  min-width: 10rem;
  height: var(--compact-h);
  padding: 0 2rem 0 var(--compact-px);
  font-size: var(--compact-font);
  background-position: calc(100% - 0.95rem) 50%, calc(100% - 0.6rem) 50%;
}

.code-input {
  color: var(--gray-900);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5em;
  text-align: center;
  text-indent: 0.5em;
}

.code-input::placeholder {
  color: var(--gray-600);
  font-weight: 500;
}

.code-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.code-row .code-input {
  width: 16rem;
}

.check {
  appearance: none;
  position: relative;
  flex: none;
  width: var(--check);
  height: var(--check);
  margin: 0;
  border: 1px solid var(--gray-300);
  border-radius: var(--control-radius);
  background: var(--surface);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.check::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 0.35rem;
  height: 0.65rem;
  border: solid var(--primary-inverse);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  transition: transform 0.12s ease;
}

.check:checked {
  border-color: var(--primary);
  background: var(--primary);
}

.check:checked::after {
  transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

.check:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.segmented {
  display: inline-flex;
  gap: 0.25rem;
  height: var(--control-h);
  padding: 0.25rem;
  border-radius: var(--control-radius);
  background: var(--segment-track);
}

.segment {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.875rem;
  border: 0;
  border-radius: 0.325rem;
  background: none;
  color: var(--gray-600);
  font-size: var(--control-font);
  font-weight: 500;
  cursor: pointer;
}

.segment[aria-pressed='true'] {
  background: var(--segment-thumb);
  box-shadow: var(--segment-shadow);
  color: var(--gray-900);
  font-weight: 600;
}

/* ---- countdown --------------------------------------------------------------------------------------------------- */

.countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  font-size: 0.95rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.countdown svg {
  flex: none;
  width: var(--glyph-adornment);
  height: var(--glyph-adornment);
}

.ring-track {
  fill: none;
  stroke: var(--gray-200);
  stroke-width: 3;
}

.ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear;
}

.countdown.is-low {
  color: var(--warning-text);
}

.countdown.is-low .ring-fill {
  stroke: var(--warning);
}

/* ---- alerts ------------------------------------------------------------------------------------------------------ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--gray-100);
  color: var(--gray-700);
}

.alert > .icon {
  font-size: var(--glyph-icon);
}

.alert-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.alert-title {
  color: var(--gray-900);
  font-weight: 600;
}

.alert-text {
  font-size: 0.95rem;
}

.alert-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.alert.tone-bad {
  border-color: var(--danger);
  background: var(--danger-light);
}

.alert.tone-bad > .icon {
  color: var(--danger-text);
}

.alert.tone-warn {
  border-color: var(--warning);
  background: var(--warning-light);
}

.alert.tone-warn > .icon {
  color: var(--warning-text);
}

.alert.tone-ok {
  border-color: var(--success);
  background: var(--success-light);
}

.alert.tone-ok > .icon {
  color: var(--success-text);
}

.alert.tone-info {
  border-color: var(--info);
  background: var(--info-light);
}

.alert.tone-info > .icon {
  color: var(--info-text);
}

.alert.tone-info > .spinner {
  border-color: var(--info-light);
  border-top-color: var(--info);
}

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

.alert-list li {
  display: flex;
  gap: 0.625rem;
  font-size: 0.95rem;
}

.alert-list li::before {
  content: '';
  flex: none;
  width: 0.375rem;
  height: 0.375rem;
  margin-top: 0.55rem;
  border-radius: 50%;
  background: var(--warning-text);
}

.alert-list strong {
  color: var(--gray-900);
  font-weight: 600;
}

.ack {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--warning);
  color: var(--gray-900);
  font-weight: 600;
}

/* ---- tables ------------------------------------------------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: var(--cell-p);
  color: var(--text-quiet);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px dashed var(--border-strong);
}

.table td {
  padding: var(--cell-p);
  color: var(--gray-800);
  vertical-align: middle;
  border-bottom: 1px dashed var(--border-strong);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table th:first-child,
.table td:first-child {
  padding-left: var(--card-px);
}

.table th:last-child,
.table td:last-child {
  padding-right: var(--card-px);
}

.table-fixed {
  table-layout: fixed;
}

.table-fixed .w-check {
  width: 5.25rem;
}

.table-fixed .w-service {
  width: 28%;
}

.table-fixed .w-running {
  width: 22%;
}

.table-fixed .w-latest {
  width: 14%;
}

.table-fixed .w-replicas {
  width: 13%;
}

.table-fixed .w-target {
  width: 24%;
}

.table-fixed td {
  overflow-wrap: anywhere;
}

label.service-name {
  cursor: pointer;
}

.table .end {
  text-align: right;
}

.table .narrow {
  width: 1%;
}

.table tr.is-clickable {
  cursor: pointer;
}

.table tr.is-clickable:hover td,
.table tr.is-clickable:focus-visible td {
  background: var(--gray-100);
}

.table tr.is-clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.table tr.is-off td {
  color: var(--text-quiet);
}

.table tr.is-picked td {
  background: var(--primary-light);
}

.service {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.service-name {
  color: var(--gray-900);
  font-weight: 600;
  white-space: nowrap;
  min-width: 6rem;
}

.version {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.version-main {
  color: var(--gray-900);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.version-old {
  color: var(--gray-600);
  font-weight: 500;
}

.version-new {
  color: var(--primary);
}

.digest {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  white-space: nowrap;
  color: var(--text-quiet);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.change {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.change > .icon {
  color: var(--gray-400);
  font-size: 1rem;
}

.replicas {
  font-variant-numeric: tabular-nums;
}

.replicas.is-short {
  color: var(--warning-text);
  font-weight: 600;
}

/* The latest task state and error under a health badge (status and Replicas tables). */
.health-note {
  margin-top: 0.375rem;
  max-width: 32rem;
  overflow-wrap: anywhere;
}

.table-services .health-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.links .icon {
  font-size: 0.85rem;
}

/* ---- stepper ----------------------------------------------------------------------------------------------------- */

.stepper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
}

.stepper li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  color: var(--text-quiet);
  font-weight: 500;
  white-space: nowrap;
}

.stepper li + li::before {
  content: '';
  width: 2.5rem;
  height: 1px;
  margin-right: 0.25rem;
  background: var(--border-strong);
}

.stepper-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--mini);
  height: var(--mini);
  border: 1px solid var(--gray-300);
  border-radius: 50%;
  color: var(--text-quiet);
  font-size: 0.9rem;
  font-weight: 600;
}

.stepper .is-current {
  color: var(--gray-900);
  font-weight: 600;
}

.stepper .is-current .stepper-mark {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-inverse);
}

.stepper .is-done {
  color: var(--gray-700);
}

.stepper .is-done .stepper-mark {
  border-color: var(--success-light);
  background: var(--success-light);
  color: var(--success-text);
}

.stepper .is-done .stepper-mark .icon {
  font-size: 0.95rem;
}

/* ---- action bar -------------------------------------------------------------------------------------------------- */

.action-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--bar-shadow);
}

.action-bar-text {
  color: var(--gray-700);
  font-weight: 500;
}

.action-bar-text strong {
  color: var(--gray-900);
  font-weight: 600;
}

/* ---- timeline ---------------------------------------------------------------------------------------------------- */

.timeline {
  margin: 0;
  padding: var(--card-py) var(--card-px);
  list-style: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 1.25rem;
  top: 2.75rem;
  bottom: 0.25rem;
  width: 1px;
  background: var(--border-strong);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-item.is-done::before {
  background: var(--success);
}

.timeline-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-quiet);
  font-size: 0.95rem;
  font-weight: 600;
}

.timeline-mark .icon {
  font-size: var(--glyph-icon-compact);
}

.is-done .timeline-mark {
  border-color: var(--success-light);
  background: var(--success-light);
  color: var(--success-text);
}

.is-running .timeline-mark {
  border-color: var(--info-light);
  background: var(--info-light);
}

.is-running .timeline-mark .spinner {
  border-color: var(--surface);
  border-top-color: var(--info);
}

.is-failed .timeline-mark {
  border-color: var(--danger-light);
  background: var(--danger-light);
  color: var(--danger-text);
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  padding-top: 0.5rem;
}

.timeline-head {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
}

.timeline-time {
  margin-left: auto;
  color: var(--text-quiet);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.service-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-line {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--gray-100);
  font-size: 0.95rem;
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 0.5rem 1.5rem;
  flex-wrap: wrap;
  color: var(--text-quiet);
  font-size: 0.95rem;
}

.meta-line strong {
  color: var(--gray-800);
  font-weight: 600;
}

/* ---- two columns ------------------------------------------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.pick-list {
  display: flex;
  flex-direction: column;
  max-height: 60rem;
  overflow-y: auto;
  padding: 0.5rem 0 1rem;
}

.pick-group {
  padding: 1rem var(--card-px) 0.25rem;
  color: var(--text-quiet);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem var(--card-px);
  border: 0;
  background: none;
  color: var(--gray-800);
  text-align: left;
  cursor: pointer;
}

.pick:hover {
  background: var(--gray-100);
}

.pick[aria-pressed='true'] {
  background: var(--primary-light);
  box-shadow: inset 3px 0 0 var(--primary);
}

.pick[aria-pressed='true'] .service-name {
  color: var(--primary);
}

.pick-version {
  color: var(--text-quiet);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.search {
  padding: 1rem var(--card-px) 0;
}

/* ---- sign in ----------------------------------------------------------------------------------------------------- */

body.is-signin .main {
  padding: 0;
}

.auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 2.5rem;
  background: var(--page) var(--auth-bg) center / cover no-repeat;
}

.auth-mark {
  width: 4.2857rem;
  height: 4.2857rem;
  margin-bottom: 2.5rem;
}

.auth-card {
  width: 100%;
  max-width: 32.1429rem;
  padding: 3rem;
  border: 0;
  box-shadow: var(--auth-shadow);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.auth-head h1 {
  font-size: 2rem;
}

.auth-head p {
  color: var(--text-quiet);
  font-size: 1.075rem;
}

.auth-foot {
  margin-top: 2.5rem;
  color: var(--gray-600);
  font-size: 0.95rem;
}

/* ---- responsive -------------------------------------------------------------------------------------------------- */

@media (max-width: 1199.98px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stack-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 793.58px) {
  .brand {
    flex: 1;
    min-width: 0;
    margin-right: 1rem;
  }

  .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .who {
    gap: 0.25rem;
  }

  .stack-grid,
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth {
    padding: 2rem 1.5rem;
  }

  .auth-card {
    padding: 2.5rem;
  }
}

@media (max-width: 614px) {
  .main {
    padding-top: 1.5rem;
  }

  .stats {
    gap: 1rem;
  }

  .stat {
    padding: 1.25rem;
  }

  .page-head {
    align-items: stretch;
  }

  .page-head > .toolbar {
    width: 100%;
  }

  .page-head > .toolbar > .btn {
    flex: 1;
  }

  .table-stack thead {
    display: none;
  }

  .table-stack,
  .table-stack tbody,
  .table-stack tr,
  .table-stack td {
    display: block;
    width: 100%;
  }

  .table-stack tr {
    padding: 0.75rem var(--card-px);
    border-bottom: 1px dashed var(--border-strong);
  }

  .table-stack tbody tr:last-child {
    border-bottom: 0;
  }

  .table-stack td,
  .table-stack td:first-child,
  .table-stack td:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.375rem 0;
    border: 0;
    text-align: right;
  }

  .table-stack td::before {
    content: attr(data-label);
    flex: none;
    color: var(--text-quiet);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
  }

  .table-stack td[data-label='']::before {
    display: none;
  }

  .table-stack td[data-label=''] {
    justify-content: flex-end;
  }

  .table-stack td.cell-head {
    justify-content: flex-start;
    text-align: left;
  }

  .table-stack td.cell-head::before {
    display: none;
  }

  .table-stack .version {
    align-items: flex-end;
  }

  .table-stack td.cell-head .version {
    align-items: flex-start;
  }

  .table-services tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem 1rem;
  }

  .table-services td,
  .table-services td:first-child,
  .table-services td:last-child {
    padding: 0;
  }

  .table-services td.c-service {
    grid-column: 1;
    grid-row: 1;
  }

  .table-services td.c-state {
    grid-column: 2;
    grid-row: 1;
  }

  .table-services td.c-running {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .table-services td.c-running .version {
    align-items: flex-start;
  }

  .table-services td.c-replicas {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .table-services td.c-state::before,
  .table-services td.c-running::before {
    display: none;
  }

  .table-services td.c-latest {
    display: none;
  }

  .stepper li:not(.is-current) > span:last-child {
    display: none;
  }

  .stepper li + li::before {
    width: 1.25rem;
  }

  .table-stack .badges {
    justify-content: flex-end;
  }

  .table-stack .narrow {
    width: 100%;
  }

  .service-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .service-line .change {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .timeline-time {
    margin-left: 0;
    flex-basis: 100%;
  }

  .action-bar {
    bottom: 0.5rem;
  }

  .action-bar > .toolbar {
    width: 100%;
  }

  .action-bar > .toolbar > .btn {
    flex: 1;
  }

  .code-row .code-input {
    width: 100%;
  }

  .card-foot > .toolbar {
    width: 100%;
  }

  .card-foot > .toolbar > .btn {
    flex: 1;
  }
}

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

  .spinner {
    animation: none;
    border-top-color: var(--gray-300);
    border-right-color: var(--primary);
  }
}

/* ---- environment identity ---------------------------------------------------------------------------------------- *
 * Production in the Console danger red, staging in a calm teal: the pill next to the brand, on the sign-in card, the
 * loading screen and every confirm card, and a full-width strip under the header. White on both pill colours is
 * above 4.5:1 in light and dark.
 */
:root {
  --env-bg: #c8102e;
  --env-strip-bg: var(--danger-light);
  --env-strip-text: var(--danger-text);
}

body[data-environment='staging'] {
  --env-bg: #0e7490;
  --env-strip-bg: #e3f4f8;
  --env-strip-text: #0b5c70;
}

@media (prefers-color-scheme: dark) {
  body[data-environment='staging'] {
    --env-strip-bg: #10292f;
    --env-strip-text: #67d3e6;
  }
}

.env-pill {
  display: inline-flex;
  align-items: center;
  align-self: center;
  flex: none;
  height: 1.75rem;
  padding: 0 0.6rem;
  border-radius: 0.375rem;
  background: var(--env-bg);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}

.topbar .env-pill {
  margin: 0 2.5rem 0 -2.75rem;
}

.env-strip {
  position: sticky;
  top: var(--header-h);
  z-index: 99;
  display: flex;
  align-items: center;
  min-height: var(--strip-h);
  padding: 0.25rem var(--gutter);
  border-bottom: 2px solid var(--env-bg);
  background: var(--env-strip-bg);
  color: var(--env-strip-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.changing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--env-bg);
  border-radius: var(--radius);
  background: var(--env-strip-bg);
  color: var(--env-strip-text);
  font-weight: 500;
}

.changing strong {
  font-weight: 700;
}

/* ---- loading ----------------------------------------------------------------------------------------------------- */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skeleton .loading {
  justify-content: flex-start;
  padding: 0;
}

.skeleton-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.skeleton-block,
.skeleton-card {
  height: 6.5rem;
  border-radius: var(--radius-lg);
  background: var(--gray-200);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-card {
  height: 18rem;
}

@keyframes skeleton-pulse {
  50% {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-block,
  .skeleton-card {
    animation: none;
  }
}

/* ---- health severity --------------------------------------------------------------------------------------------- */
.stat-bad,
.stat-warn {
  border-left: 4px solid var(--danger);
}

.stat-warn {
  border-left-color: var(--warning);
}

.stat-value.tone-bad {
  color: var(--danger-text);
}

.stat-value.tone-warn {
  color: var(--warning-text);
}

.table tr.is-down td {
  background: var(--danger-light);
}

.health-last {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  margin-top: 0.375rem;
}

.health-note {
  max-width: 32rem;
  margin-top: 0;
  color: var(--text-quiet);
  font-size: 0.9rem;
  text-align: left;
  overflow-wrap: anywhere;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.health-note.is-open {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.health-more {
  padding: 0;
  font-size: 0.9rem;
}

.replica-pick {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.replica-effect {
  display: inline-flex;
  flex-direction: column;
  gap: 0.125rem;
}

.text-danger {
  color: var(--danger-text);
  font-weight: 600;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-text);
}

.error-code {
  padding: 0.05rem 0.35rem;
  border-radius: 0.25rem;
  background: var(--gray-200);
  color: var(--gray-700);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.replica-lead {
  margin: 0.25rem 0 0;
  color: var(--gray-900);
  font-weight: 500;
}

.details {
  padding: 1rem var(--card-px);
}

.details summary {
  color: var(--gray-700);
  font-weight: 600;
  cursor: pointer;
}

.details-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  color: var(--text-quiet);
}

.row-end {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.row-chevron {
  color: var(--gray-400);
  font-size: 1rem;
  transition: transform 0.15s ease, color 0.15s ease;
}

.table tr.is-clickable:hover .row-chevron,
.table tr.is-clickable:focus-visible .row-chevron {
  color: var(--primary);
  transform: translateX(2px);
}

/* ---- phone: stacked service rows --------------------------------------------------------------------------------- *
 * Name and replicas on the first line, the version on the second, health and state on their own full-width line
 * (badges wrap, the task note below them), so a service name never breaks letter by letter.
 */
@media (max-width: 614px) {
  .topbar .env-pill {
    margin: 0 0.75rem 0 -0.5rem;
  }

  .skeleton-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-services td.c-service {
    grid-column: 1;
    grid-row: 1;
  }

  .table-services td.c-replicas {
    grid-column: 2;
    grid-row: 1;
  }

  .table-services td.c-running {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .table-services td.c-state {
    grid-column: 1 / -1;
    grid-row: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .table-stack .badges,
  .table-services td.c-state .badges {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .table-stack td .health-last {
    width: 100%;
  }

  .table-stack td:has(.health-last) {
    flex-direction: column;
    align-items: flex-start;
  }
}

.env-strip[hidden],
.banner-slot:not(:has(.alert)) {
  display: none;
}

@media (max-width: 614px) {
  .table-stack tr.is-down {
    background: var(--danger-light);
  }

  .table-stack tr.is-down td {
    background: transparent;
  }
}
