:root {
  --bg: #f6f1e7;
  --paper: rgba(255, 252, 246, 0.92);
  --paper-strong: #fffdf9;
  --text: #17323a;
  --muted: #61727a;
  --line: rgba(23, 50, 58, 0.12);
  --accent: #bb5a2a;
  --accent-soft: rgba(187, 90, 42, 0.12);
  --cool: #1f6c72;
  --shadow: 0 18px 46px rgba(62, 44, 26, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(31, 108, 114, 0.14), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(187, 90, 42, 0.14), transparent 24%),
    linear-gradient(180deg, #fbf7f0 0%, #f2e9dd 100%);
}

.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 22px 34px;
}

.hero,
.panel {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
  gap: 20px;
  padding: 28px;
  border-radius: var(--radius-xl);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.03em;
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 0.98;
}

.intro {
  margin: 16px 0 0;
  max-width: 58ch;
  line-height: 1.65;
  color: var(--muted);
}

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

.stat-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 248, 241, 0.9));
  border: 1px solid var(--line);
}

.stat-card span {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 1.35rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(330px, 0.85fr);
  gap: 22px;
  margin-top: 22px;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 18px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.search {
  display: grid;
  gap: 8px;
  min-width: min(560px, 100%);
  flex: 1 1 420px;
}

.search label,
.toggle span {
  font-size: 0.9rem;
  color: var(--muted);
}

.search-row {
  display: flex;
  gap: 10px;
}

input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
}

input[type="search"],
button {
  font: inherit;
  border-radius: var(--radius-md);
  border: 1px solid rgba(23, 50, 58, 0.14);
  padding: 12px 14px;
}

input[type="search"] {
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
}

input[type="search"]:focus {
  outline: none;
  border-color: rgba(31, 108, 114, 0.35);
  box-shadow: 0 0 0 4px rgba(31, 108, 114, 0.12);
}

button {
  cursor: pointer;
  color: #fff9f3;
  background: linear-gradient(135deg, var(--accent), #d37c4b);
  box-shadow: 0 10px 20px rgba(187, 90, 42, 0.2);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(31, 108, 114, 0.07);
  border: 1px solid rgba(31, 108, 114, 0.12);
}

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: rgba(31, 108, 114, 0.06);
  border: 1px solid rgba(31, 108, 114, 0.08);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-badge.loading {
  background: rgba(31, 108, 114, 0.12);
  color: var(--cool);
}

.status-badge.ready {
  background: rgba(63, 122, 56, 0.12);
  color: #42753f;
}

.status-badge.alert {
  background: var(--accent-soft);
  color: #94441c;
}

.plot {
  min-height: 72vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(23, 50, 58, 0.08);
  background: linear-gradient(180deg, rgba(255, 254, 251, 0.9), rgba(250, 245, 238, 0.96));
}

.detail-header {
  margin-bottom: 14px;
}

.subtitle {
  margin: 10px 0 0;
  line-height: 1.5;
  color: var(--muted);
}

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

.detail-item {
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
}

.detail-item dt {
  margin: 0 0 6px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-item dd {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.note-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 248, 239, 0.92);
  border: 1px solid rgba(187, 90, 42, 0.12);
  color: #475a63;
  line-height: 1.65;
}

@media (max-width: 1120px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page {
    padding: 16px 12px 24px;
  }

  .hero,
  .panel {
    padding: 16px;
  }

  .stats,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .search-row {
    flex-direction: column;
  }

  .plot {
    min-height: 62vh;
  }
}
