:root {
  color-scheme: dark;
  --background: #0d1016;
  --panel: #151922;
  --panel-strong: #1c222d;
  --line: rgba(255, 255, 255, 0.11);
  --muted: #858d9b;
  --text: #f4f1e9;
  --accent: #b9ff66;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 15% -15%, rgba(133, 112, 255, 0.16), transparent 32rem),
    var(--background);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.toolbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 22, 0.88);
  backdrop-filter: blur(18px);
}

.toolbar__brand,
.toolbar__actions,
.toolbar__button,
.site-panel__bar,
.site-panel__bar > div,
.site-panel__actions {
  display: flex;
  align-items: center;
}

.toolbar__brand {
  gap: 12px;
}

.toolbar__mark {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(185, 255, 102, 0.62);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 47%, var(--accent) 48% 52%, transparent 53%),
    linear-gradient(transparent 47%, var(--accent) 48% 52%, transparent 53%);
  box-shadow: 0 0 28px rgba(185, 255, 102, 0.13);
}

.toolbar__brand div {
  display: grid;
  gap: 3px;
}

.toolbar__brand strong {
  letter-spacing: 0.17em;
  font-size: 12px;
}

.toolbar__brand span:last-child {
  color: var(--muted);
  font-size: 10px;
}

.toolbar__actions {
  gap: 8px;
}

.toolbar__button,
.site-panel__actions button,
.site-panel__actions a {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #c7ccd5;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.toolbar__button {
  gap: 8px;
  padding: 0 13px;
  font-size: 11px;
}

.toolbar__button:hover,
.site-panel__actions button:hover,
.site-panel__actions a:hover {
  border-color: rgba(185, 255, 102, 0.55);
  color: var(--text);
}

.toolbar__button[aria-pressed="true"] {
  border-color: rgba(185, 255, 102, 0.65);
  background: rgba(185, 255, 102, 0.1);
  color: var(--accent);
}

.toolbar__button:disabled {
  cursor: default;
  opacity: 0.42;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
}

.site-panel {
  min-width: 0;
  height: calc(50vh - 49px);
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.site-panel.is-hidden {
  display: none;
}

.comparison-grid.is-focused {
  grid-template-columns: 1fr;
}

.comparison-grid.is-focused .site-panel.is-focused {
  height: calc(100vh - 88px);
  min-height: 520px;
}

.site-panel__bar {
  height: 42px;
  justify-content: space-between;
  gap: 14px;
  padding: 0 10px 0 13px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
}

.site-panel__bar > div:first-child {
  min-width: 0;
  gap: 9px;
}

.site-panel__index {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
}

.site-panel__bar strong {
  overflow: hidden;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.site-panel__bar small {
  color: var(--muted);
  letter-spacing: 0.12em;
  font-size: 8px;
}

.site-panel__actions {
  flex: 0 0 auto;
  gap: 6px;
}

.site-panel__actions button,
.site-panel__actions a {
  min-height: 26px;
  padding: 0 9px;
  font-size: 9px;
}

.site-panel iframe {
  display: block;
  width: 100%;
  height: calc(100% - 42px);
  border: 0;
  background: #090b10;
}

.keyboard-hint {
  margin: 3px 0 13px;
  color: #656d79;
  text-align: center;
  font-size: 9px;
}

kbd {
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: #aeb4be;
  font: inherit;
}

@media (max-width: 820px) {
  .toolbar {
    align-items: flex-start;
  }

  .toolbar__brand span:last-child,
  .toolbar__button[data-grid] {
    display: none;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .site-panel {
    height: 72vh;
    min-height: 540px;
  }

  .comparison-grid.is-focused .site-panel.is-focused {
    height: calc(100vh - 88px);
  }
}

@media (max-width: 470px) {
  .site-panel__bar small {
    display: none;
  }

  .site-panel__actions button,
  .site-panel__actions a {
    padding-inline: 7px;
  }
}

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