:root {
  --demo-bg: #f4efe6;
  --demo-surface: rgba(255, 255, 255, 0.9);
  --demo-line: rgba(17, 40, 64, 0.12);
  --demo-text: #102033;
  --demo-muted: #5d6c7d;
  --demo-primary: #123c73;
  --demo-accent: #e3b25c;
  --demo-success: #2f8b66;
  --demo-warning: #a36c12;
  --demo-shadow: 0 28px 70px rgba(12, 28, 46, 0.12);
  --demo-radius: 26px;
}

* {
  box-sizing: border-box;
}

body.demo-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--demo-text);
  background:
    radial-gradient(circle at top left, rgba(18, 60, 115, 0.12), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(227, 178, 92, 0.18), transparent 22%),
    linear-gradient(180deg, #f8f3ea 0%, #eef4fb 48%, #f6f1e8 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.demo-shell {
  width: min(100% - 1.25rem, 1120px);
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.wide-shell {
  width: min(100% - 1.25rem, 1320px);
}

.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0 1.15rem;
}

.demo-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.demo-brand img {
  width: 124px;
  height: auto;
}

.demo-brand span {
  display: grid;
  gap: 0.1rem;
}

.demo-brand strong {
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.03em;
}

.demo-brand small,
.support-text,
.demo-card p,
.hero-card p,
.notes-card p,
.history-meta {
  color: var(--demo-muted);
  line-height: 1.65;
}

.demo-link {
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--demo-line);
  font-weight: 700;
}

.demo-main {
  display: grid;
  gap: 1.1rem;
}

.hero-card,
.demo-card,
.notes-card,
.map-card {
  background: var(--demo-surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--demo-radius);
  box-shadow: var(--demo-shadow);
  backdrop-filter: blur(18px);
}

.hero-card,
.notes-card,
.map-card,
.demo-card {
  padding: 1.4rem;
}

.hero-kicker,
.card-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: rgba(18, 60, 115, 0.08);
  border: 1px solid rgba(18, 60, 115, 0.12);
  color: var(--demo-primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card h1,
.demo-card h2,
.map-card h1 {
  margin: 0.65rem 0;
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.04em;
}

.hero-card h1 {
  font-size: clamp(2.2rem, 6vw, 4.3rem);
  line-height: 0.98;
}

.demo-card h2,
.map-card h1 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  line-height: 1.05;
}

.device-row {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.55rem;
  max-width: 28rem;
}

.device-row label {
  font-weight: 700;
}

.device-row input,
.link-input {
  width: 100%;
  min-height: 52px;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--demo-line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--demo-text);
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.mobile-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.demo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.95rem 1.25rem;
  border-radius: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.demo-button:hover {
  transform: translateY(-2px);
}

.demo-button-primary {
  color: #112033;
  background: linear-gradient(135deg, var(--demo-accent), #c88b24);
  box-shadow: 0 16px 40px rgba(200, 139, 36, 0.22);
}

.demo-button-secondary {
  color: var(--demo-text);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--demo-line);
}

.steps-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--demo-text);
  line-height: 1.7;
}

.steps-list li + li {
  margin-top: 0.3rem;
}

.compact-card {
  max-width: 54rem;
}

.action-row,
.link-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.metric-card {
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 60, 115, 0.08), rgba(18, 60, 115, 0.03));
  border: 1px solid rgba(18, 60, 115, 0.08);
}

.metric-card span {
  display: block;
  color: var(--demo-muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.metric-card strong {
  font-size: 1.15rem;
  line-height: 1.15;
}

.detail-list,
.history-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.detail-list li,
.history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--demo-line);
}

.detail-list span {
  color: var(--demo-muted);
}

.inline-notice {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  font-weight: 600;
}

.inline-notice.is-warning {
  color: var(--demo-warning);
  background: rgba(227, 178, 92, 0.16);
  border: 1px solid rgba(227, 178, 92, 0.26);
}

.monitor-layout {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.75fr);
  align-items: start;
}

.map-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.signal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 800;
}

.signal-badge.is-online {
  color: var(--demo-success);
  background: rgba(47, 139, 102, 0.12);
}

.signal-badge.is-stale,
.signal-badge.is-waiting {
  color: var(--demo-warning);
  background: rgba(227, 178, 92, 0.16);
}

.demo-map {
  width: 100%;
  min-height: 500px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--demo-line);
}

.side-panel {
  display: grid;
  gap: 1rem;
}

.history-list {
  max-height: 420px;
  overflow: auto;
}

.history-item {
  display: grid;
  gap: 0.18rem;
}

.history-item strong {
  font-size: 0.95rem;
}

.history-empty {
  color: var(--demo-muted);
}

@media (max-width: 960px) {
  .demo-grid,
  .mobile-stack,
  .monitor-layout {
    grid-template-columns: 1fr;
  }

  .demo-header,
  .map-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .demo-map {
    min-height: 340px;
  }
}

@media (max-width: 640px) {
  .demo-shell,
  .wide-shell {
    width: min(100% - 0.8rem, 100%);
  }

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

  .action-row,
  .link-panel {
    flex-direction: column;
  }

  .demo-button,
  .demo-link {
    width: 100%;
  }
}
