/* The Spotty admin dashboard: the app's dark, glassy, weather-instrument look
   for the web (docs/design/README.md). The custom properties copy the app's
   tokens by name (lib/core/theme/); test/guards/design_tokens_test.dart keeps
   them equal. Inter is the app's bundled font, copied in by the image build. */

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* AppColors */
  --background: #0b0f1a;
  --surface: #151a2e;
  --surface-muted: #1a2038;
  --surface-light: #1e2440;
  --surface-border: #252d4a;
  --text-primary: #f0f2f5;
  --text-secondary: #a0a9bc;
  --text-tertiary: #828da1;
  --primary: #00e5cc;
  --secondary: #5b8def;
  --success: #4ade80;
  --warning: #ffbb5c;
  --danger: #ff6b6b;
  --on-brand: #0b0f1a;

  /* AppSpacing */
  --space-xxs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-xxl: 24px;
  --space-xxxl: 32px;

  /* AppRadius */
  --radius-chip: 8px;
  --radius-icon: 10px;
  --radius-badge: 12px;
  --radius-button: 14px;
  --radius-card: 16px;
  --radius-dialog: 20px;
  --radius-pill: 999px;

  /* AppMotion */
  --motion-fast: 150ms;
  --motion-medium: 250ms;
  --motion-shimmer: 1400ms;
  --curve-emphasized: cubic-bezier(0.2, 0, 0, 1);

  /* The dashboard's own layout */
  --sidebar-width: 248px;
  --content-max-width: 1200px;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
  color: var(--text-primary);
  font: 14px/1.5 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 0% -20%, rgb(0 229 204 / 7%), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgb(91 141 239 / 9%), transparent 60%),
    var(--background);
}

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

h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 12px;
}

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

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

.icon {
  flex: none;
  width: 18px;
  height: 18px;
}

kbd {
  padding: var(--space-xxs) var(--space-xs);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-chip);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font: 600 11px/1.4 "Inter", system-ui, sans-serif;
}

/* The frame: navigation on the left, the area on the right */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  height: 100vh;
  padding: var(--space-xl) var(--space-lg);
  border-right: 1px solid var(--surface-border);
  background: rgb(21 26 46 / 72%);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-primary);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-icon);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--on-brand);
  box-shadow: 0 6px 18px rgb(0 229 204 / 35%);
}

.brand-mark .icon {
  width: 20px;
  height: 20px;
}

.brand-large .brand-mark {
  width: 44px;
  height: 44px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
}

.brand-sub {
  font-size: 12px;
}

/* Every area by its group; the list scrolls on its own on a short screen,
   so the footer's buttons stay in reach. */
.nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-xxs);
  min-height: 0;
  margin: 0 calc(-1 * var(--space-xs));
  padding: 0 var(--space-xs);
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-group {
  margin: var(--space-md) 0 var(--space-xs);
  padding: 0 var(--space-md);
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-group:first-child {
  margin-top: 0;
}

/* What waits in an area, by its worst: only where something waits. */
.nav-count {
  min-width: 20px;
  margin-left: auto;
  padding: 0 var(--space-xs);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.nav-count-critical {
  background: var(--danger);
  color: var(--on-brand);
}

.nav-count-warning {
  background: var(--warning);
  color: var(--on-brand);
}

.nav-count-info {
  background: var(--surface-border);
  color: var(--text-primary);
}

.nav-link {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-button);
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--motion-fast) var(--curve-emphasized),
    color var(--motion-fast) var(--curve-emphasized);
}

.nav-link:hover {
  background: rgb(30 36 64 / 70%);
  color: var(--text-primary);
}

.nav-link.active {
  background: linear-gradient(135deg, rgb(0 229 204 / 16%), rgb(91 141 239 / 10%));
  box-shadow: inset 0 0 0 1px rgb(0 229 204 / 24%);
  color: var(--primary);
}

.sidebar-footer {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--surface-border);
}

.sidebar-footer .button {
  justify-content: flex-start;
}

/* Whether the page is live: green while its stream brings the news,
   amber while it connects again, red once it tries in vain. */
.live {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.live .dot,
.freshness .dot,
.verdict .dot,
.status-pill .dot,
.strip-progress .dot,
.step .dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.live-live .dot {
  color: var(--success);
  box-shadow: 0 0 0 3px rgb(74 222 128 / 20%);
}

.live-connecting .dot,
.live-reconnecting .dot {
  color: var(--warning);
}

.live-offline {
  color: var(--danger);
}

.unlock p {
  margin: 0;
  font-size: 12px;
}

.palette-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-button);
  background: rgb(11 15 26 / 50%);
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--curve-emphasized);
}

.palette-trigger:hover {
  border-color: rgb(0 229 204 / 40%);
}

.palette-trigger kbd {
  margin-left: auto;
}

.operator {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  min-width: 0;
}

.operator .mono {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  width: 100%;
  max-width: var(--content-max-width);
  padding: var(--space-xxxl);
}

section {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
}

.page-header p {
  margin: var(--space-xs) 0 0;
}

/* How old what a page shows is: green while live, amber once late. */
.freshness {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-tertiary);
  font-size: 12px;
}

.freshness .dot {
  width: 6px;
  height: 6px;
  color: var(--text-tertiary);
}

.freshness-live .dot {
  color: var(--success);
}

.freshness-late {
  color: var(--warning);
}

.freshness-late .dot {
  color: var(--warning);
}

/* What production runs, on every page: one quiet line that links to
   Releases; amber where a part is behind main, and a deploy that runs. */
.strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-lg);
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-button);
  background: rgb(11 15 26 / 50%);
  color: var(--text-primary);
  font-size: 12px;
  text-decoration: none;
  transition: border-color var(--motion-fast) var(--curve-emphasized);
}

.strip:hover {
  border-color: rgb(0 229 204 / 40%);
}

.strip-part {
  white-space: nowrap;
}

.strip-behind .mono {
  color: var(--warning);
}

.strip-deploying {
  border-color: rgb(255 187 92 / 40%);
}

.strip-progress {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--warning);
  font-weight: 600;
}

.strip-progress .dot {
  animation: breathe var(--motion-shimmer) var(--curve-emphasized) infinite alternate;
}

/* An area's tabs, under its name */
.area-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  border-bottom: 1px solid var(--surface-border);
}

.area-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
  color: var(--text-secondary);
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

/* A heading over a group of cards */
.section-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Cards */

.card {
  padding: var(--space-xl);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 3%), transparent 40%),
    rgb(21 26 46 / 82%);
  box-shadow: 0 4px 12px rgb(0 0 0 / 18%);
  backdrop-filter: blur(20px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.summary {
  margin: 0;
  font-weight: 600;
}

.summary-ok {
  color: var(--success);
}

.summary-down {
  color: var(--danger);
}

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xxs) var(--space-sm);
  border: 1px solid;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.badge-ok {
  border-color: rgb(74 222 128 / 28%);
  background: rgb(74 222 128 / 10%);
  color: var(--success);
}

.badge-down {
  border-color: rgb(255 107 107 / 28%);
  background: rgb(255 107 107 / 10%);
  color: var(--danger);
}

.badge-warning {
  border-color: rgb(255 187 92 / 28%);
  background: rgb(255 187 92 / 10%);
  color: var(--warning);
}

.badge-neutral {
  border-color: var(--surface-border);
  background: rgb(30 36 64 / 60%);
  color: var(--text-secondary);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-button);
  background: var(--surface-light);
  color: var(--text-primary);
  font: 600 14px/1.4 "Inter", system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform var(--motion-fast) var(--curve-emphasized),
    border-color var(--motion-fast) var(--curve-emphasized);
}

.button:hover:not(:disabled) {
  border-color: rgb(0 229 204 / 40%);
}

.button:active:not(:disabled) {
  transform: scale(0.98);
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
}

.button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 6px 18px rgb(0 229 204 / 25%);
  color: var(--on-brand);
}

/* One that reaches every user or cannot be undone */
.button-danger {
  border-color: rgb(255 107 107 / 45%);
  background: rgb(255 107 107 / 12%);
  color: var(--danger);
}

.button-danger:hover:not(:disabled) {
  border-color: var(--danger);
}

.button-danger[type="submit"] {
  background: var(--danger);
  color: var(--on-brand);
}

/* Messages */

.problem,
.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  margin: 0;
  padding: var(--space-md) var(--space-lg);
  border: 1px solid;
  border-radius: var(--radius-badge);
}

.problem {
  border-color: rgb(255 107 107 / 32%);
  background: rgb(255 107 107 / 8%);
}

.notice {
  border-color: rgb(255 187 92 / 32%);
  background: rgb(255 187 92 / 8%);
}

.problem p,
.notice p {
  margin: 0;
}

/* The notification area: what actions came to, bottom right, wherever the
   operator goes; green when done, amber when partly, red when not. */
.notices {
  position: fixed;
  right: var(--space-xxl);
  bottom: var(--space-xxl);
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: min(420px, calc(100vw - 2 * var(--space-lg)));
}

.notice-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid;
  border-left-width: 4px;
  border-radius: var(--radius-badge);
  background: var(--surface);
  box-shadow: 0 10px 24px rgb(0 0 0 / 32%);
  animation: rise var(--motion-medium) var(--curve-emphasized);
}

.notice-card p {
  margin: 0;
}

.notice-card .page-actions {
  margin-top: var(--space-xs);
}

.notice-title {
  font-weight: 600;
}

.notice-done {
  border-color: rgb(74 222 128 / 40%);
}

.notice-done .notice-title {
  color: var(--success);
}

.notice-partly {
  border-color: rgb(255 187 92 / 40%);
}

.notice-partly .notice-title {
  color: var(--warning);
}

.notice-failed {
  border-color: rgb(255 107 107 / 40%);
}

.notice-failed .notice-title {
  color: var(--danger);
}

/* This session's actions, in a drawer on the right */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  width: min(420px, 100vw);
  padding: var(--space-xl);
  overflow-y: auto;
  border-left: 1px solid var(--surface-border);
  background: rgb(21 26 46 / 96%);
  box-shadow: 0 10px 24px rgb(0 0 0 / 32%);
  animation: fade var(--motion-fast) var(--curve-emphasized);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  padding-left: var(--space-md);
  border-left: 3px solid var(--success);
}

.history-list li.history-partly {
  border-left-color: var(--warning);
}

.history-list li.history-failed {
  border-left-color: var(--danger);
}

.history-list p {
  margin: var(--space-xxs) 0 0;
}

.empty {
  padding: var(--space-xxxl);
  border: 1px dashed var(--surface-border);
  border-radius: var(--radius-card);
  text-align: center;
}

.skeleton {
  min-height: 160px;
  background: linear-gradient(90deg, rgb(26 32 56 / 60%), rgb(30 36 64 / 90%), rgb(26 32 56 / 60%));
  background-size: 200% 100%;
  animation: shimmer var(--motion-shimmer) linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

/* Tables */

.table-card {
  padding: 0;
  overflow-x: auto;
}

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

.table th {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid rgb(37 45 74 / 60%);
  vertical-align: middle;
}

/* Every table starts with when; it stays on one line. */
.table td:first-child {
  white-space: nowrap;
}

/* A row across the table under another, such as what an action showed or
   its confirmation, wraps. */
.table td[colspan] {
  white-space: normal;
}

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

.table tbody tr:hover {
  background: rgb(30 36 64 / 50%);
}

.load-more {
  display: flex;
  justify-content: center;
}

.numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Facts: a card's short name-and-value lines */

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-xs) var(--space-lg);
  margin: 0;
}

.facts dt {
  color: var(--text-tertiary);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* An account's actions, below what it holds */

.facts + .page-actions {
  margin-top: var(--space-lg);
}

/* Filters */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.chip {
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font: 600 12px/1.5 "Inter", system-ui, sans-serif;
  cursor: pointer;
  transition:
    color var(--motion-fast) var(--curve-emphasized),
    border-color var(--motion-fast) var(--curve-emphasized);
}

.chip:hover {
  color: var(--text-primary);
}

.chip[aria-pressed="true"] {
  border-color: rgb(0 229 204 / 40%);
  background: rgb(0 229 204 / 10%);
  color: var(--primary);
}

/* Jobs */

.job {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.job p {
  margin: 0;
}

.job > .page-actions {
  margin-top: auto;
}

.card.selected {
  border-color: rgb(0 229 204 / 40%);
}

.runs {
  gap: var(--space-md);
}

/* Numbers: a value, its change, and its last days as a line */

.metric-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.stat p {
  margin: 0;
}

.metric-change {
  font-size: 12px;
}

.metric-unit {
  font-size: 14px;
}

.sparkline-range {
  font-size: 11px;
}

.sparkline {
  display: block;
  width: 100%;
  height: 36px;
  margin-top: var(--space-sm);
  overflow: visible;
}

.sparkline polyline {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.sparkline-empty {
  display: block;
  height: 36px;
  margin-top: var(--space-sm);
}

/* In a table: a short line above its change */

.trend {
  min-width: 120px;
}

.trend .sparkline,
.trend .sparkline-empty {
  height: 24px;
  margin-top: 0;
}

.trend .muted {
  font-size: 12px;
  white-space: nowrap;
}

/* Breakdowns: a total's parts, each a bar against the largest */

.breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.breakdown p {
  margin: 0;
}

.breakdown-rows {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(80px, 1fr) max-content;
  align-items: center;
  gap: var(--space-sm) var(--space-md);
}

/* Each row's label, bar, and count line up in the columns above. */
.breakdown-row {
  display: contents;
}

.breakdown-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-neutral .usage-fill {
  fill: var(--primary);
}

/* Quotas */

.quota {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.quota .metric {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  margin: 0;
}

.usage-bar {
  display: block;
  width: 100%;
  height: 8px;
}

.usage-track {
  fill: var(--surface-border);
}

.usage-ok .usage-fill {
  fill: var(--success);
}

.usage-warning .usage-fill {
  fill: var(--warning);
}

.usage-down .usage-fill {
  fill: var(--danger);
}

/* The overview: one verdict, the checks in a row, and what waits */

.verdict {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  border: 1px solid;
  border-radius: var(--radius-card);
}

.verdict .dot {
  width: 12px;
  height: 12px;
}

.verdict-text {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.verdict-ok {
  border-color: rgb(74 222 128 / 32%);
  background: rgb(74 222 128 / 8%);
  color: var(--success);
}

.verdict-warning {
  border-color: rgb(255 187 92 / 32%);
  background: rgb(255 187 92 / 8%);
  color: var(--warning);
}

.verdict-down {
  border-color: rgb(255 107 107 / 32%);
  background: rgb(255 107 107 / 8%);
  color: var(--danger);
}

.verdict-neutral {
  border-color: var(--surface-border);
  color: var(--text-secondary);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.status-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  background: rgb(21 26 46 / 82%);
  color: var(--success);
}

.status-name {
  color: var(--text-primary);
  font-weight: 600;
}

.status-pill-down {
  border-color: rgb(255 107 107 / 45%);
  color: var(--danger);
}

.status-detail {
  flex-basis: 100%;
  color: var(--text-secondary);
  font-size: 12px;
}

.inbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.inbox-group-title {
  margin: 0;
  font-weight: 600;
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.inbox-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  border-left-width: 4px;
}

.inbox-item p {
  margin: 0;
}

.inbox-critical {
  border-left-color: var(--danger);
}

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

.inbox-info {
  border-left-color: var(--secondary);
}

.inbox-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
}

.inbox-head h3 {
  margin: 0;
  font-size: 15px;
}

.snoozed summary {
  color: var(--text-secondary);
  cursor: pointer;
}

.snoozed .inbox-list {
  margin-top: var(--space-md);
  opacity: 0.75;
}

/* A deploy that runs, step by step */

.deploy-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border-color: rgb(255 187 92 / 40%);
}

.deploy-progress p {
  margin: 0;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.step-done .dot {
  color: var(--success);
}

.step-running {
  font-weight: 600;
}

.step-running .dot {
  color: var(--warning);
  animation: breathe var(--motion-shimmer) var(--curve-emphasized) infinite alternate;
}

.step-waiting {
  color: var(--text-tertiary);
}

.step-skipped {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.step-failed {
  color: var(--danger);
}

/* A card whose action is the next step, such as Deploy */
.card-act {
  border-color: rgb(0 229 204 / 32%);
}

.card > .page-actions,
.card > .confirm {
  margin-top: var(--space-md);
}

/* An action's buttons inside a row of buttons line up with the rest. */
.page-actions .page-actions {
  display: contents;
}

.table-foot {
  display: flex;
  justify-content: center;
  padding: var(--space-md);
  border-top: 1px solid rgb(37 45 74 / 60%);
}

/* Activity: one card a day, one line an entry */

.activity-day {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.activity-card {
  padding: var(--space-xs) 0;
}

.activity-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  border-bottom: 1px solid rgb(37 45 74 / 60%);
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-text {
  overflow-wrap: anywhere;
}

.activity-open {
  display: inline-flex;
  color: var(--text-secondary);
}

.activity-open:hover {
  color: var(--primary);
}

/* The map */

.map {
  width: 100%;
  height: 70vh;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-popup {
  color: var(--background);
  font: 13px/1.4 "Inter", system-ui, sans-serif;
}

.map-popup p {
  margin: var(--space-xs) 0 0;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  color: var(--text-secondary);
  font-size: 12px;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.legend::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
}

.legend-spot::before {
  background: var(--primary);
}

.legend-reported::before {
  background: var(--warning);
}

.legend-area::before {
  border: 1px solid var(--secondary);
  background: rgb(91 141 239 / 35%);
}

/* Alerts */

.alert-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.alert {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.alert p {
  margin: 0;
}

.alert-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.alert-time {
  margin-left: auto;
}

.alert-fields summary {
  color: var(--text-secondary);
  cursor: pointer;
}

.alert-fields .facts {
  margin-top: var(--space-sm);
}

/* The command palette (Ctrl+K) */

.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh var(--space-lg) var(--space-lg);
  background: rgb(11 15 26 / 60%);
  backdrop-filter: blur(6px);
  animation: fade var(--motion-fast) var(--curve-emphasized);
}

.palette {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-dialog);
  background: rgb(21 26 46 / 96%);
  box-shadow: 0 10px 24px rgb(0 0 0 / 32%);
  animation: rise var(--motion-medium) var(--curve-emphasized);
}

.palette-search {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-secondary);
}

.palette-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font: 500 16px/1.4 "Inter", system-ui, sans-serif;
}

.palette-list {
  max-height: 50vh;
  margin: 0;
  padding: var(--space-sm);
  overflow-y: auto;
  list-style: none;
}

.palette-list li {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-button);
  color: var(--text-secondary);
  cursor: pointer;
}

.palette-list li.selected {
  background: linear-gradient(135deg, rgb(0 229 204 / 14%), rgb(91 141 239 / 8%));
  color: var(--text-primary);
}

.palette-title {
  font-weight: 600;
  white-space: nowrap;
}

.palette-hint {
  max-width: 55%;
  margin-left: auto;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-empty {
  margin: 0;
  padding: var(--space-xl);
  text-align: center;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* Loading: index.html shows it while the script downloads; the first page
   the script draws replaces it. */

.boot {
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-xl);
  min-height: 100vh;
}

.boot-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-icon);
  box-shadow: 0 6px 18px rgb(0 229 204 / 35%);
  animation: breathe var(--motion-shimmer) var(--curve-emphasized) infinite alternate;
}

.boot-bar {
  width: 120px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--surface-border), var(--primary), var(--surface-border));
  background-size: 200% 100%;
  animation: shimmer var(--motion-shimmer) linear infinite;
}

@keyframes breathe {
  from {
    opacity: 0.6;
    transform: scale(0.94);
  }
}

/* Sign-in */

.sign-in {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: var(--space-lg);
}

.sign-in-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  width: min(440px, 100%);
  padding: var(--space-xxxl);
}

.sign-in-methods,
.sign-in-google,
.sign-in-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.sign-in-methods {
  gap: var(--space-xl);
}

.sign-in-google > p {
  margin: 0;
}

.sign-in-form label {
  font-weight: 600;
}

.sign-in-form > p {
  margin: 0;
}

textarea,
.field input,
.field select {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-button);
  background: rgb(11 15 26 / 60%);
  color: var(--text-primary);
  font: 12px/1.5 var(--mono);
  resize: vertical;
}

/* A form on a page: its fields, each labelled, and its button in a row */

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.field {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-xs);
}

.field label {
  color: var(--text-tertiary);
}

/* What a change does, and its confirmation */

.confirm {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  padding: var(--space-lg);
  border: 1px solid rgb(255 187 92 / 32%);
  border-radius: var(--radius-card);
}

.confirm p {
  margin: 0;
}

.confirm label {
  color: var(--text-tertiary);
}

.confirm-danger {
  border-color: rgb(255 107 107 / 45%);
  background: rgb(255 107 107 / 6%);
}

.confirm-sign-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-badge);
  background: rgb(255 187 92 / 8%);
}

textarea:focus,
.field input:focus,
.field select:focus {
  border-color: rgb(0 229 204 / 50%);
  outline: none;
  box-shadow: 0 0 0 3px rgb(0 229 204 / 16%);
}

.not-found {
  padding: var(--space-xxxl);
  text-align: center;
}

/* Lists without bullets, and a button that reads as a link */

.plain-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.link-button.selected {
  color: var(--text-primary);
  font-weight: 600;
}

/* Docs: the list of documents beside the open one */

.docs-layout {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 3fr);
  gap: var(--space-lg);
  align-items: start;
}

.docs-list h3 {
  margin: var(--space-lg) 0 var(--space-sm);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc {
  min-width: 0;
  line-height: 1.6;
}

.doc h1,
.doc h2,
.doc h3,
.doc h4 {
  margin: var(--space-xl) 0 var(--space-sm);
}

.doc pre {
  overflow-x: auto;
  padding: var(--space-md);
  border-radius: var(--radius-chip);
  background: var(--background);
}

.doc table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}

.doc th,
.doc td {
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--surface-border);
  text-align: left;
  vertical-align: top;
}

.doc blockquote {
  margin: 0;
  padding-left: var(--space-lg);
  border-left: 2px solid var(--surface-border);
  color: var(--text-secondary);
}

/* Narrow screens: the navigation becomes a bar at the top */

@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .sidebar {
    z-index: 5;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-md);
    height: auto;
    padding: var(--space-md) var(--space-lg);
    border-right: 0;
    border-bottom: 1px solid var(--surface-border);
  }

  /* Every area in one row that scrolls sideways, without a scroll bar. */
  .nav {
    order: 3;
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: none;
    white-space: nowrap;
  }

  .sidebar-footer {
    flex-direction: row;
    align-items: center;
    margin: 0 0 0 auto;
  }

  .operator,
  .palette-trigger span,
  .palette-trigger kbd,
  .sidebar-footer .button span {
    display: none;
  }

  .content {
    padding: var(--space-xl) var(--space-lg);
  }

  .nav-group,
  .live,
  .unlock {
    display: none;
  }

  .nav {
    flex: none;
    margin: 0;
    padding: 0;
    overflow-y: visible;
  }

  .sidebar-footer {
    padding-top: 0;
    border-top: 0;
  }

  .notices {
    right: var(--space-lg);
    bottom: var(--space-lg);
    left: var(--space-lg);
    width: auto;
  }

  .verdict-text {
    font-size: 16px;
  }

  .page-header {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
