.app-header {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.header-kicker-row,
.header-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-kicker-row .eyebrow {
  margin-bottom: 0;
  letter-spacing: 0;
}

.header-title-row h1 {
  min-width: 0;
  margin: 0;
  font-size: 2.05rem;
  letter-spacing: 0;
  line-height: 1.05;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0;
  color: var(--text);
  background: var(--panel-soft);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-button:active:not(:disabled) {
  transform: scale(0.96);
}

.settings-button {
  color: var(--accent);
}

.settings-button:disabled {
  opacity: 0.72;
  cursor: default;
}

.refresh-button.is-loading svg {
  animation: refresh-spin 800ms linear infinite;
}

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

.component-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.component-status-card {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 9px 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
}

.component-status-card[role="button"] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.component-status-card[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.component-status-card[role="button"]:active {
  transform: scale(0.98);
}

.component-status-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.component-status-visual svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.component-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.component-status-title {
  display: block;
  width: 100%;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.component-status-value {
  display: block;
  width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.component-status-card.is-ok {
  color: var(--accent);
}

.component-status-card.is-warn {
  color: var(--warn);
}

.component-status-card.is-error {
  color: var(--danger);
}

.component-status-card.is-neutral {
  color: var(--muted);
}

.pc-readiness-backdrop {
  position: fixed;
  inset: 0;
  z-index: 920;
  display: block;
  border: 0;
  padding: 0;
  opacity: 0;
  background: rgba(1, 6, 14, 0.68);
  backdrop-filter: blur(7px);
  transition: opacity 180ms ease;
  pointer-events: none;
}

.pc-readiness-backdrop[hidden],
.pc-readiness-panel[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.pc-readiness-backdrop:not(.is-open),
.pc-readiness-panel:not(.is-open) {
  pointer-events: none;
}

.pc-readiness-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pc-readiness-panel {
  --pc-readiness-drag-y: 0px;
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 921;
  display: grid;
  gap: 12px;
  width: min(430px, calc(100vw - 28px));
  max-height: min(76vh, 640px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 14px 14px;
  color: var(--text);
  background: #101d31;
  box-shadow: var(--shadow);
  overscroll-behavior-y: contain;
  transform: translate(-50%, calc(105% + var(--pc-readiness-drag-y)));
  transition: transform 180ms ease;
}

.pc-readiness-panel.is-open {
  transform: translate(-50%, var(--pc-readiness-drag-y));
  pointer-events: auto;
}

.pc-readiness-panel.is-dragging {
  transition: none;
  user-select: none;
  will-change: transform;
}

.pc-readiness-handle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.46);
  touch-action: none;
}

.pc-readiness-handle span {
  display: block;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.46);
}

.pc-readiness-header,
.pc-readiness-summary,
.pc-readiness-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pc-readiness-header {
  justify-content: space-between;
  touch-action: none;
  cursor: grab;
}

.pc-readiness-panel.is-dragging .pc-readiness-header {
  cursor: grabbing;
}

.pc-readiness-header .pc-readiness-icon-button {
  touch-action: manipulation;
}

.pc-readiness-header p,
.pc-readiness-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.pc-readiness-header p {
  color: var(--muted);
  font-size: 0.7rem;
}

.pc-readiness-header h2 {
  font-size: 1.08rem;
  line-height: 1.15;
}

.pc-readiness-icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0;
  color: var(--text);
  background: var(--panel-soft);
  cursor: pointer;
}

.pc-readiness-summary {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
}

.pc-readiness-rows {
  display: grid;
  gap: 8px;
}

.pc-readiness-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
  background: var(--panel-soft);
}

.pc-readiness-row-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(7, 16, 29, 0.36);
}

.pc-readiness-row.is-ok .pc-readiness-row-icon { color: var(--accent); }
.pc-readiness-row.is-warn .pc-readiness-row-icon { color: var(--warn); }
.pc-readiness-row.is-error .pc-readiness-row-icon { color: var(--danger); }

.pc-readiness-row-copy {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.pc-readiness-row-copy strong {
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.pc-readiness-row-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.pc-readiness-icon-button svg,
.pc-readiness-row-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 520px) {
  .app-header {
    gap: 8px;
    margin-bottom: 9px;
  }

  .dashboard-header .header-kicker-row .eyebrow,
  .dashboard-header .header-title-row h1 {
    margin-inline-start: 1px;
  }

  .dashboard-header .header-title-row h1 {
    transform: translateY(-10px);
  }

  .header-title-row h1 {
    font-size: 1.8rem;
  }

  .icon-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .component-status-grid {
    gap: 6px;
  }

  .component-status-card {
    min-height: 80px;
    border-radius: 13px;
    padding: 8px 5px;
  }

  .component-status-title {
    font-size: 0.68rem;
  }

  .component-status-value {
    font-size: 0.61rem;
  }

  .pc-readiness-panel {
    width: calc(100vw - 22px);
    padding: 8px 12px 12px;
    border-radius: 16px;
  }
}

@media (max-width: 360px) {
  .component-status-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .component-status-card {
    min-height: 75px;
    padding: 7px 4px;
  }

  .component-status-visual {
    gap: 5px;
  }

  .component-status-visual svg {
    width: 19px;
    height: 19px;
  }

  .component-status-dot {
    width: 7px;
    height: 7px;
  }

  .component-status-title {
    font-size: 0.61rem;
  }

  .component-status-value {
    font-size: 0.57rem;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .refresh-button.is-loading svg {
    animation: none;
  }
}
