:root {
  color-scheme: dark;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  background-color: #020617;
  color: #e2e8f0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #020617;
}

button {
  font-family: inherit;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #0f172a;
  color: #e2e8f0;
  padding: 1.5rem;
  gap: 1.5rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  padding-bottom: 0.75rem;
}

.title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
}

.subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(148, 163, 184, 0.85);
}

.badge {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
}

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

.banner-host {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.banner {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.banner.info {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.35);
  color: #bfdbfe;
}

.banner.warning {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(250, 204, 21, 0.35);
  color: #fef08a;
}

.banner.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.main {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 1.5rem;
  flex: 1;
}

.sidebar {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

/* Advanced settings removed */

.statusRow {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.statusLabel {
  font-size: 0.95rem;
  color: rgba(148, 163, 184, 0.9);
}

.statusValue {
  font-weight: 600;
}

.buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.buttons.single {
  flex-direction: column;
}

.button {
  flex: 1 1 140px;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.button:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.2);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button.secondary {
  background: transparent;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.8);
}

.meta dt {
  font-weight: 500;
  color: rgba(148, 163, 184, 0.85);
}

.meta dd {
  margin: 0;
  font-weight: 600;
}

.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  border-radius: 0.75rem;
  padding: 0.75rem;
  font-size: 0.9rem;
}

.devHelp {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.7);
  line-height: 1.4;
}

.devHelp-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #60a5fa;
  text-decoration: underline;
  cursor: pointer;
}

.devHelp-link:hover {
  color: #93c5fd;
}

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

.card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.card h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.tag {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
}

.stage-summary {
  margin: 0;
  color: rgba(148, 163, 184, 0.85);
}

.stage-checklist {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: rgba(148, 163, 184, 0.8);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart .subtitle {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.8);
}

.canvasWrapper {
  position: relative;
  width: 100%;
  height: 300px;
}

.canvasWrapper canvas {
  width: 100%;
  height: 100%;
}

.canvasWrapper .empty {
  margin: 0;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(148, 163, 184, 0.7);
}

.results .result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.results .label {
  display: block;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.75);
}

.results .value {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
}

.helper {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.8);
}

.log {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.log .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tableWrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

th {
  color: rgba(148, 163, 184, 0.9);
  font-weight: 500;
}

tbody tr:hover {
  background: rgba(148, 163, 184, 0.1);
}

.supported-dialog {
  display: none;
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 1000;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 0.75rem;
  padding: 0;
  background: rgba(15, 23, 42, 0.95);
  color: #e2e8f0;
  width: min(420px, 90vw);
  max-height: 90vh;
}

.supported-dialog[open],
.supported-dialog.dialog-polyfill-open {
  display: block;
}

.supported-dialog::backdrop {
  background: rgba(2, 6, 23, 0.75);
}

.dialog-polyfill-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  display: none;
  z-index: 999;
  pointer-events: none;
}

.dialog-polyfill-backdrop-open {
  display: block;
  pointer-events: auto;
}

.supported-dialog__content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
}

.supported-dialog__content h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.supported-dialog__content ul {
  margin: 0 0 0.25rem 1.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.supported-dialog__content li {
  list-style: disc;
}

.button.small {
  align-self: flex-end;
  flex: 0 0 auto;
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
}

@media (max-width: 960px) {
  .main {
    grid-template-columns: 1fr;
  }

  .button {
    flex: 1 1 120px;
  }
}

@media (max-width: 600px) {
  .app {
    padding: 1rem;
  }

  .canvasWrapper {
    height: 220px;
  }
}
