:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: rgba(18, 20, 27, 0.88);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f6f7f9;
  --muted: #aeb5c2;
  --accent: #49c6a0;
  --warn: #f0b650;
  --error: #ee6464;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, Pretendard, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.waiting,
.map-shell {
  background: #111318;
}

.map-shell iframe {
  opacity: 0;
  transition: opacity 180ms ease;
}

.map-shell iframe[src] {
  opacity: 1;
}

.map-shell {
  position: fixed;
  inset: 0;
}

.waiting {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(73, 198, 160, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(240, 182, 80, 0.12), transparent 38%),
    #111318;
}

.waiting-panel {
  width: min(420px, calc(100vw - 40px));
  padding: 26px 28px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(17, 19, 24, 0.74);
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

.waiting-panel h1 {
  margin: 14px 0 8px;
  font-size: 22px;
  letter-spacing: 0;
}

.waiting-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.pulse {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(73, 198, 160, 0.26);
  position: relative;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(73, 198, 160, 0.7);
}

.map-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #171a21;
}

.browser-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #111318;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.browser-cover.hidden {
  opacity: 0;
}

.browser-cover > div {
  width: min(360px, calc(100vw - 40px));
  padding: 22px 24px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
}

.browser-cover strong,
.browser-cover span {
  display: block;
}

.browser-cover strong {
  font-size: 18px;
}

.browser-cover span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-card {
  position: fixed;
  top: 50%;
  right: 22px;
  z-index: 20;
  width: 245px;
  transform: translateY(-50%);
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  font-size: 13px;
}

.status-row span,
dt {
  color: var(--muted);
}

.status-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.divider {
  height: 1px;
  margin: 12px 0;
  background: var(--panel-border);
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl > div {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: baseline;
  gap: 10px;
  min-height: 20px;
}

dt,
dd {
  margin: 0;
  font-size: 13px;
}

dd {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.last-message {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ok {
  color: var(--accent);
}

.warn {
  color: var(--warn);
}

.error {
  color: var(--error);
}

@media (max-width: 760px) {
  .status-card {
    top: auto;
    right: 12px;
    bottom: 12px;
    width: min(300px, calc(100vw - 24px));
    transform: none;
  }
}
