.yt-panel,
.yt-card {
  min-width: 0;
  border: 1px solid var(--yt-color-border);
  background: var(--yt-color-surface);
  box-shadow: var(--yt-shadow-surface);
}

.yt-panel {
  padding: 1.375rem;
  border-radius: var(--yt-radius-lg);
}

.yt-panel + .yt-panel,
.yt-panel + .yt-metric-grid,
.yt-metric-grid + .yt-panel {
  margin-top: var(--yt-space-5);
}

.yt-panel--narrow {
  max-width: 45rem;
}

.yt-panel--onboarding {
  background: linear-gradient(145deg, var(--yt-color-surface) 65%, var(--yt-color-surface-brand));
}

.yt-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--yt-space-3);
  min-width: 0;
  margin-bottom: 1.125rem;
}

.yt-panel-header > div {
  min-width: 0;
}

.yt-panel-header h2 {
  margin: 0 0 var(--yt-space-1);
  font-size: 1.0625rem;
  line-height: var(--yt-line-height-tight);
}

.yt-panel-header p {
  margin: 0;
  color: var(--yt-color-text-muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.yt-card {
  padding: 1.125rem;
  border-radius: 0.8125rem;
}

.yt-card--subtle {
  background: var(--yt-color-surface-subtle);
}

.yt-card--warning {
  border-color: #ffe1ad;
  background: #fff8e8;
}

.yt-card--danger {
  border-color: #ffd8dc;
  background: #fff7f8;
}

.yt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--yt-control-height);
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--yt-color-border-control);
  border-radius: var(--yt-radius-sm);
  background: var(--yt-color-surface);
  color: var(--yt-color-text);
  cursor: pointer;
  font-size: var(--yt-font-size-xs);
  font-weight: var(--yt-font-weight-medium);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--yt-duration-fast), border-color var(--yt-duration-fast), color var(--yt-duration-fast), opacity var(--yt-duration-fast);
}

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

.yt-button--primary {
  border-color: var(--yt-color-brand);
  background: var(--yt-color-brand);
  color: var(--yt-color-text-inverse);
}

.yt-button--primary:hover {
  border-color: var(--yt-color-brand-strong);
  background: var(--yt-color-brand-strong);
  color: var(--yt-color-text-inverse);
}

.yt-button--danger {
  border-color: #e5a3ab;
  background: var(--yt-color-danger-surface);
  color: var(--yt-color-danger);
}

.yt-button--quiet {
  min-height: auto;
  padding: var(--yt-space-2);
  border: 0;
  background: transparent;
  color: var(--yt-color-navigation-text);
}

.yt-button--quiet:hover {
  border-color: transparent;
  background: rgb(255 255 255 / 8%);
  color: var(--yt-color-text-inverse);
}

.yt-button--text {
  min-height: auto;
  padding: var(--yt-space-2) 0;
  border: 0;
  background: transparent;
  color: var(--yt-color-brand-strong);
  justify-self: start;
}

.yt-button:disabled,
.yt-button[aria-disabled="true"],
[data-submit-active] {
  opacity: 0.62;
  cursor: not-allowed;
}

[data-submit-busy="true"] {
  cursor: progress;
}

.yt-field {
  display: grid;
  min-width: 0;
  gap: 0.4375rem;
  color: var(--yt-color-text);
  font-size: var(--yt-font-size-xs);
  font-weight: var(--yt-font-weight-medium);
}

.yt-field > input,
.yt-field > select,
.yt-field > textarea,
.yt-input,
.yt-select {
  width: 100%;
  min-height: var(--yt-control-height);
  padding: 0.625rem 0.6875rem;
  border: 1px solid var(--yt-color-border-control);
  border-radius: var(--yt-radius-sm);
  outline: 0;
  background: var(--yt-color-surface);
  color: var(--yt-color-text);
}

.yt-field > input:focus,
.yt-field > select:focus,
.yt-field > textarea:focus,
.yt-input:focus,
.yt-select:focus {
  border-color: var(--yt-color-brand);
  box-shadow: var(--yt-shadow-focus);
}

.yt-field > input:disabled,
.yt-field > select:disabled,
.yt-field > textarea:disabled,
.yt-field > input:read-only,
.yt-field > textarea:read-only,
.yt-input:disabled,
.yt-select:disabled {
  background: var(--yt-color-surface-subtle);
  color: var(--yt-color-text-muted);
  cursor: not-allowed;
}

.yt-field > textarea {
  line-height: var(--yt-line-height-normal);
  resize: vertical;
}

.yt-field-hint,
.yt-form-hint {
  margin: 0;
  color: var(--yt-color-text-muted);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: var(--yt-line-height-normal);
}

.yt-field-error {
  margin: var(--yt-space-1) 0 0;
  color: var(--yt-color-danger);
  font-size: var(--yt-font-size-xs);
  overflow-wrap: anywhere;
}

.yt-check {
  display: flex;
  align-items: flex-start;
  gap: var(--yt-space-2);
  color: var(--yt-color-text);
  font-size: var(--yt-font-size-xs);
  font-weight: 400;
}

.yt-check input {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0.125rem 0 0;
  accent-color: var(--yt-color-brand);
}

.yt-alert {
  padding: 0.75rem 0.875rem;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  margin: 0 0 1.125rem;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.yt-alert--success {
  border-color: #b9e8d4;
  background: var(--yt-color-success-surface);
  color: var(--yt-color-success);
}

.yt-alert--danger {
  border-color: #f2c3c9;
  background: var(--yt-color-danger-surface);
  color: var(--yt-color-danger);
}

.yt-alert--warning {
  border-color: #f0d994;
  background: var(--yt-color-warning-surface);
  color: var(--yt-color-warning);
}

.yt-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--yt-radius-pill);
  background: var(--yt-color-neutral-surface);
  color: var(--yt-color-neutral);
  font-size: 0.6875rem;
  font-weight: var(--yt-font-weight-semibold);
  line-height: 1.2;
  white-space: nowrap;
}

.yt-badge--success,
.yt-badge[data-status="running"],
.yt-badge[data-status="healthy"],
.yt-badge[data-status="ready"],
.yt-badge[data-status="succeeded"],
.yt-badge[data-status="success"] {
  background: var(--yt-color-success-surface);
  color: var(--yt-color-success);
}

.yt-badge--danger,
.yt-badge[data-status="failed"],
.yt-badge[data-status="error"],
.yt-badge[data-status="down"],
.yt-badge[data-status="recovery_required"] {
  background: var(--yt-color-danger-surface);
  color: var(--yt-color-danger);
}

.yt-badge--warning,
.yt-badge[data-status="accepted"],
.yt-badge[data-status="blocked"],
.yt-badge[data-status="degraded"],
.yt-badge[data-status="warning"],
.yt-badge[data-status="stale"],
.yt-badge[data-status="expired"],
.yt-badge[data-status="interrupted"],
.yt-badge[data-status="failed_restored"],
.yt-badge[data-status="cancelled"] {
  background: var(--yt-color-warning-surface);
  color: var(--yt-color-warning);
}

.yt-badge--brand,
.yt-badge[data-status="planned"],
.yt-badge[data-status="checking"] {
  background: var(--yt-color-brand-soft);
  color: var(--yt-color-brand-strong);
}

.yt-status-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: var(--yt-space-2);
}

.yt-status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--yt-color-neutral);
}

.yt-status-dot[data-status="running"],
.yt-status-dot[data-status="healthy"],
.yt-status-dot[data-status="ready"] {
  background: var(--yt-color-success);
  box-shadow: 0 0 0 4px rgb(15 169 104 / 9%);
}

.yt-status-dot[data-status="error"],
.yt-status-dot[data-status="failed"],
.yt-status-dot[data-status="down"] {
  background: var(--yt-color-danger);
  box-shadow: 0 0 0 4px rgb(216 68 85 / 9%);
}

.yt-status-dot[data-status="unknown"] {
	background: var(--yt-color-neutral);
	box-shadow: 0 0 0 4px rgb(100 116 139 / 9%);
}

.yt-status-dot[data-status="stale"] {
  background: var(--yt-color-warning);
  box-shadow: 0 0 0 4px rgb(200 137 9 / 9%);
}

.yt-status-dot[data-status="warning"],
.yt-status-dot[data-status="degraded"],
.yt-status-dot[data-status="blocked"] {
  background: var(--yt-color-warning);
  box-shadow: 0 0 0 4px rgb(200 137 9 / 9%);
}

.yt-status-dot[data-status="danger"] {
  background: var(--yt-color-danger);
  box-shadow: 0 0 0 4px rgb(216 68 85 / 9%);
}

.yt-status-dot[data-status="info"] {
  background: var(--yt-color-brand);
  box-shadow: 0 0 0 4px rgb(91 92 240 / 9%);
}

.yt-status-dot[data-status="initializing"],
.yt-status-dot[data-status="planned"],
.yt-status-dot[data-status="checking"] {
  background: var(--yt-color-brand);
  box-shadow: 0 0 0 4px rgb(91 92 240 / 9%);
}

.yt-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--yt-space-4);
}

.yt-metric {
  display: grid;
  min-width: 0;
  gap: var(--yt-space-2);
  padding: var(--yt-space-5);
  border: 1px solid var(--yt-color-border);
  border-radius: var(--yt-radius-lg);
  background: var(--yt-color-surface);
}

.yt-metric span,
.yt-metric small {
  color: var(--yt-color-text-muted);
  font-size: var(--yt-font-size-xs);
}

.yt-metric strong {
  font-size: var(--yt-font-size-xl);
  line-height: var(--yt-line-height-tight);
}

.yt-ops-overview .yt-panel-header {
  align-items: flex-end;
}

#needs-attention,
#recent-deployments {
  scroll-margin-top: var(--yt-space-4);
}

.yt-observation-time {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  color: var(--yt-color-text-muted);
  font-size: var(--yt-font-size-xs);
}

.yt-observation-time strong {
  color: var(--yt-color-text);
  font-size: var(--yt-font-size-sm);
}

.yt-readiness-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--yt-color-border);
  border-radius: var(--yt-radius-lg);
  overflow: hidden;
  background: var(--yt-color-surface-subtle);
}

.yt-readiness-axis {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--yt-space-3);
  min-width: 0;
  padding: var(--yt-space-5);
  color: var(--yt-color-text);
  text-decoration: none;
}

.yt-readiness-axis + .yt-readiness-axis {
  border-left: 1px solid var(--yt-color-border);
}

.yt-readiness-axis::after {
  position: absolute;
  inset: auto var(--yt-space-5) 0 var(--yt-space-5);
  height: 0.1875rem;
  border-radius: var(--yt-radius-pill) var(--yt-radius-pill) 0 0;
  background: var(--yt-color-neutral);
  content: "";
}

.yt-readiness-axis[data-state="healthy"]::after,
.yt-readiness-axis[data-state="ready"]::after { background: var(--yt-color-success); }
.yt-readiness-axis[data-state="warning"]::after,
.yt-readiness-axis[data-state="checking"]::after { background: var(--yt-color-warning); }
.yt-readiness-axis[data-state="error"]::after { background: var(--yt-color-danger); }

.yt-readiness-axis:hover {
  background: var(--yt-color-surface);
}

.yt-readiness-axis__index {
  color: var(--yt-color-text-muted);
  font-family: var(--yt-font-mono);
  font-size: var(--yt-font-size-xs);
}

.yt-readiness-axis > span:last-child {
  display: grid;
  min-width: 0;
  gap: var(--yt-space-1);
}

.yt-readiness-axis small,
.yt-readiness-axis em {
  color: var(--yt-color-text-muted);
  font-size: var(--yt-font-size-xs);
  font-style: normal;
  overflow-wrap: anywhere;
}

.yt-readiness-axis strong {
  font-size: var(--yt-font-size-lg);
  line-height: var(--yt-line-height-tight);
}

.yt-ops-secondary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--yt-space-2);
  margin-top: var(--yt-space-3);
}

.yt-ops-secondary a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--yt-space-2);
  padding: var(--yt-space-2) var(--yt-space-3);
  border-radius: var(--yt-radius-sm);
  background: var(--yt-color-surface-subtle);
  color: var(--yt-color-text-muted);
  font-size: var(--yt-font-size-xs);
  text-decoration: none;
}

.yt-ops-secondary strong {
  color: var(--yt-color-text);
  font-family: var(--yt-font-mono);
}

.yt-ops-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--yt-space-3);
}

.yt-ops-metric {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 9.5rem;
  padding: var(--yt-space-4);
  border: 1px solid var(--yt-color-border);
  border-radius: var(--yt-radius-md);
  overflow: hidden;
  background: var(--yt-color-surface-subtle);
  color: var(--yt-color-text);
  text-decoration: none;
  transition: border-color var(--yt-duration-fast), box-shadow var(--yt-duration-fast), transform var(--yt-duration-fast);
}

.yt-ops-metric::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.25rem;
  background: var(--yt-color-neutral);
  content: "";
}

.yt-ops-metric:hover {
  border-color: var(--yt-color-brand);
  box-shadow: var(--yt-shadow-surface);
  transform: translateY(-1px);
}

.yt-ops-metric > span:first-child,
.yt-ops-metric small {
  color: var(--yt-color-text-muted);
  font-size: var(--yt-font-size-xs);
}

.yt-ops-metric > strong {
  align-self: end;
  margin: var(--yt-space-2) 0;
  font-size: var(--yt-font-size-xl);
  line-height: var(--yt-line-height-tight);
}

.yt-ops-metric .yt-ops-metric__action {
  align-self: end;
  margin-top: var(--yt-space-3);
  color: var(--yt-color-brand-strong);
  font-size: var(--yt-font-size-xs);
  font-weight: var(--yt-font-weight-semibold);
}

.yt-ops-metric[data-tone="success"]::before { background: var(--yt-color-success); }
.yt-ops-metric[data-tone="danger"]::before { background: var(--yt-color-danger); }
.yt-ops-metric[data-tone="warning"]::before { background: var(--yt-color-warning); }
.yt-ops-metric[data-tone="info"]::before,
.yt-ops-metric[data-tone="brand"]::before { background: var(--yt-color-brand); }
.yt-ops-metric[data-empty="true"]::before { background: var(--yt-color-border-control); }

.yt-table-scroll {
  max-width: 100%;
  overflow: auto;
  border-radius: var(--yt-radius-sm);
  -webkit-overflow-scrolling: touch;
}

.yt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.yt-table th {
  color: var(--yt-color-text-muted);
  font-size: 0.6875rem;
  font-weight: var(--yt-font-weight-medium);
  letter-spacing: 0.03125rem;
  text-align: left;
  text-transform: uppercase;
}

.yt-table th,
.yt-table td {
  padding: 0.8125rem 0.6875rem;
  border-bottom: 1px solid var(--yt-color-border);
  vertical-align: middle;
}

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

.yt-table tbody tr:hover {
  background: var(--yt-color-surface-subtle);
}

.yt-empty {
  display: grid;
  min-height: 12rem;
  padding: 1.75rem;
  border: 1px dashed var(--yt-color-border-control);
  border-radius: var(--yt-radius-md);
  align-content: center;
  justify-items: start;
  gap: var(--yt-space-2);
}

.yt-empty--compact {
  min-height: 8.75rem;
}

.yt-empty p {
  margin: 0;
  color: var(--yt-color-text-muted);
  font-size: 0.8125rem;
}

.yt-error-symbol {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 50%;
  background: var(--yt-color-danger-surface);
  color: var(--yt-color-danger);
  font-size: var(--yt-font-size-lg);
  font-weight: var(--yt-font-weight-bold);
}

.yt-disclosure > summary {
  color: var(--yt-color-brand-strong);
  cursor: pointer;
  font-size: var(--yt-font-size-xs);
  font-weight: var(--yt-font-weight-semibold);
}

.yt-popover {
  position: relative;
}

.yt-popover[open] > .yt-popover-content {
  position: absolute;
  top: calc(100% + var(--yt-space-2));
  right: 0;
  z-index: var(--yt-z-overlay);
  width: min(20rem, calc(100vw - 2rem));
  padding: var(--yt-space-4);
  border: 1px solid var(--yt-color-border);
  border-radius: var(--yt-radius-md);
  background: var(--yt-color-surface);
  box-shadow: var(--yt-shadow-overlay);
}

.yt-summary-list {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.5625rem 0.875rem;
  margin: 0;
  padding: 0.9375rem 0;
  border-top: 1px solid var(--yt-color-border);
  border-bottom: 1px solid var(--yt-color-border);
  font-size: var(--yt-font-size-xs);
}

.yt-summary-list dt {
  color: var(--yt-color-text-muted);
}

.yt-summary-list dd {
  min-width: 0;
  margin: 0;
  font-weight: var(--yt-font-weight-medium);
  overflow-wrap: anywhere;
}

.yt-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem;
  gap: var(--yt-space-3);
  margin-top: var(--yt-space-4);
}

.yt-form-grid > .yt-field--wide,
.yt-form-grid > .yt-button,
.yt-form-grid > .yt-form-hint,
.yt-form-grid > .yt-check,
.yt-form-grid > .yt-disclosure {
  grid-column: 1 / -1;
}

.yt-data-pair {
  display: grid;
  gap: 0.4375rem;
  padding: var(--yt-space-3);
  border-radius: 0.625rem;
  background: var(--yt-color-surface-subtle);
  font-size: var(--yt-font-size-xs);
}

.yt-data-pair span {
  color: var(--yt-color-text-muted);
}

.yt-step {
  display: inline-grid;
  flex: 0 0 auto;
  width: 1.625rem;
  height: 1.625rem;
  margin-right: var(--yt-space-2);
  place-items: center;
  border-radius: var(--yt-radius-sm);
  background: var(--yt-color-brand-soft);
  color: var(--yt-color-brand-strong);
  font-size: 0.6875rem;
  font-weight: var(--yt-font-weight-bold);
}

.yt-brand-logo {
  display: block;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5625rem;
  background: var(--yt-color-surface);
  object-fit: contain;
}

.yt-brand-logo--login {
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: var(--yt-space-6);
  border-radius: var(--yt-radius-lg);
}

.yt-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--yt-space-1) var(--yt-space-2);
  margin-top: var(--yt-space-3);
  padding: var(--yt-space-3);
  border-radius: 0.625rem;
  background: #f5f5ff;
  color: var(--yt-color-brand-strong);
}

.yt-progress small {
  grid-column: 2;
  color: var(--yt-color-text-muted);
}

.yt-progress-pulse {
  grid-row: 1 / 3;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--yt-color-brand);
  box-shadow: 0 0 0 0 rgb(91 92 240 / 33%);
  animation: yt-pulse 1.8s infinite;
}

@keyframes yt-pulse {
  70% { box-shadow: 0 0 0 0.5rem rgb(91 92 240 / 0%); }
  100% { box-shadow: 0 0 0 0 rgb(91 92 240 / 0%); }
}

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

  .yt-ops-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yt-readiness-board {
    grid-template-columns: 1fr;
  }

  .yt-readiness-axis + .yt-readiness-axis {
    border-top: 1px solid var(--yt-color-border);
    border-left: 0;
  }

  .yt-panel-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .yt-table {
    min-width: 42rem;
  }

  .yt-panel {
    padding: var(--yt-space-4);
    border-radius: var(--yt-radius-md);
  }

  .yt-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .yt-panel-header > :is(.yt-button, a.yt-button) {
    width: 100%;
  }

  .yt-panel-header > .yt-badge {
    align-self: flex-start;
  }

  .yt-button {
    min-height: 2.75rem;
  }

  .yt-field > :is(input, select, textarea),
  .yt-input,
  .yt-select {
    min-height: 2.75rem;
    font-size: 1rem;
  }

  .yt-metric-grid,
  .yt-form-grid {
    grid-template-columns: 1fr;
  }

  .yt-ops-overview .yt-panel-header {
    align-items: stretch;
  }

  .yt-observation-time {
    grid-template-columns: auto auto;
    justify-content: space-between;
    justify-items: start;
    gap: var(--yt-space-1) var(--yt-space-3);
  }

  .yt-observation-time small {
    grid-column: 1 / -1;
  }

  .yt-ops-metric {
    min-height: 8.75rem;
    padding: var(--yt-space-3);
  }

  .yt-ops-secondary {
    grid-template-columns: 1fr;
  }

  .yt-metric {
    padding: var(--yt-space-4);
  }

  .yt-summary-list {
    grid-template-columns: 1fr;
    gap: var(--yt-space-1);
  }

  .yt-summary-list dd {
    margin-bottom: var(--yt-space-2);
  }

  .yt-popover[open] > .yt-popover-content {
    position: static;
    width: 100%;
    margin-top: var(--yt-space-2);
    box-shadow: none;
  }
}
