:root {
  color-scheme: light;
  --bg: #f3efe6;
  --panel: rgba(252, 249, 242, 0.95);
  --ink: #1b2430;
  --muted: #5d6b7c;
  --line: rgba(27, 36, 48, 0.12);
  --accent: #0f6c5c;
  --shadow: 0 18px 50px rgba(15, 28, 45, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family:
    Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 108, 92, 0.16), transparent 28%),
    linear-gradient(135deg, #ece5d7, #f8f6ef 45%, #edf3f5);
}

body {
  min-height: 100vh;
}

.shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
  width: 100%;
  height: 100%;
  padding: 18px;
}

.panel,
.map-wrap {
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px;
  background: var(--panel);
  backdrop-filter: blur(14px);
}

.panel h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}

.range-value {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(27, 36, 48, 0.06);
  color: #183849;
  font-size: 0.86rem;
  line-height: 1.35;
}

.timeline-actions {
  display: grid;
  grid-template-columns: 1fr;
}

select,
input[type='range'],
button {
  width: 100%;
}

select,
button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

button {
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  border-color: rgba(15, 108, 92, 0.35);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.status code {
  display: block;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(27, 36, 48, 0.06);
  color: #183849;
}

.status ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.map-wrap {
  position: relative;
  min-height: 540px;
}

#map {
  width: 100%;
  height: 100%;
}

.render-monitor {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(360px, calc(100% - 36px));
  max-height: calc(100% - 36px);
  padding: 16px;
  border: 1px solid rgba(27, 36, 48, 0.14);
  border-radius: 22px;
  background: rgba(249, 246, 239, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(15, 28, 45, 0.16);
}

.render-monitor h2 {
  margin: 2px 0 0;
  font-size: 1rem;
}

.render-monitor__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.render-monitor__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.render-monitor__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.render-monitor__stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.monitor-stat {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(27, 36, 48, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.monitor-stat__label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.monitor-stat__value {
  margin-top: 4px;
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 700;
  color: #183849;
}

.render-monitor__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #183849;
}

.monitor-chip,
.monitor-count,
.monitor-item__state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.monitor-chip {
  border: 1px solid rgba(15, 108, 92, 0.18);
  background: rgba(15, 108, 92, 0.1);
  color: #0c5b4d;
}

.monitor-chip.is-live {
  background: rgba(15, 108, 92, 0.16);
  color: #0a5b4c;
}

.monitor-chip.is-warn {
  background: rgba(190, 127, 24, 0.12);
  color: #8b5a0d;
  border-color: rgba(190, 127, 24, 0.2);
}

.monitor-count {
  min-width: 28px;
  background: rgba(27, 36, 48, 0.08);
  color: var(--ink);
}

.monitor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}

.monitor-list--recent {
  max-height: 320px;
}

.monitor-item,
.monitor-empty {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(27, 36, 48, 0.08);
}

.monitor-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.monitor-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.monitor-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.monitor-item__name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #183849;
  overflow-wrap: anywhere;
}

.monitor-item__meta {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.monitor-item__state {
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.monitor-item__state.is-active {
  background: rgba(15, 108, 92, 0.14);
  color: #0d6455;
}

.monitor-item__state.is-rendered {
  background: rgba(33, 123, 87, 0.14);
  color: #1c6b4d;
}

.monitor-item__state.is-cache-hit {
  background: rgba(48, 95, 167, 0.12);
  color: #244f90;
}

.monitor-item__state.is-failed {
  background: rgba(179, 63, 63, 0.14);
  color: #953232;
}

.monitor-item.is-active {
  border-color: rgba(15, 108, 92, 0.18);
  box-shadow: inset 0 0 0 1px rgba(15, 108, 92, 0.06);
}

.monitor-item.is-failed {
  border-color: rgba(179, 63, 63, 0.16);
}

.leaflet-container {
  font-family:
    Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, serif;
}

.leaflet-control-velocity {
  border: 1px solid rgba(27, 36, 48, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(252, 249, 242, 0.92);
  box-shadow: 0 12px 28px rgba(15, 28, 45, 0.12);
  color: #183849;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(480px, 1fr);
  }

  .render-monitor {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100% - 24px);
  }

  .monitor-list--recent {
    max-height: 220px;
  }
}
