:root {
  color-scheme: light;
  --paper: #f6f1e8;
  --shell: rgba(255, 251, 245, 0.82);
  --surface: rgba(255, 253, 249, 0.9);
  --surface-strong: #fffdfa;
  --ink: #1d2a28;
  --muted: #63706b;
  --accent: #c8642a;
  --accent-strong: #9e4a1d;
  --forest: #1c5b53;
  --forest-deep: #143d39;
  --line: rgba(29, 42, 40, 0.1);
  --line-strong: rgba(29, 42, 40, 0.16);
  --shadow: 0 28px 90px rgba(36, 27, 17, 0.12);
  --shadow-soft: 0 18px 48px rgba(36, 27, 17, 0.08);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-pill: 999px;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(200, 100, 42, 0.18), transparent 24%),
    radial-gradient(circle at 88% 9%, rgba(28, 91, 83, 0.18), transparent 28%),
    radial-gradient(circle at 84% 78%, rgba(200, 100, 42, 0.1), transparent 22%),
    linear-gradient(180deg, #f8f3ea 0%, #f1eadf 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.65;
}

body::before {
  top: 120px;
  left: -120px;
  width: 300px;
  height: 300px;
  background: rgba(200, 100, 42, 0.12);
}

body::after {
  right: -100px;
  bottom: 60px;
  width: 260px;
  height: 260px;
  background: rgba(28, 91, 83, 0.12);
}

.page {
  position: relative;
  width: min(1180px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 24px 0 80px;
}

.masthead {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 26px;
  background: rgba(255, 251, 246, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--accent), var(--forest));
  color: white;
  font-weight: 800;
  box-shadow: 0 18px 28px rgba(28, 91, 83, 0.18);
}

.brand-text {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.mastnav,
.mast-actions,
.auth-switch,
.app-tabs,
.system-footer,
.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.mastnav {
  justify-content: center;
}

.mastnav a,
.hero-link,
.nav-button {
  color: var(--forest-deep);
  text-decoration: none;
  font-weight: 700;
}

.nav-button {
  min-height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: -0.02em;
}

h1 {
  max-width: 760px;
  font-size: clamp(3rem, 5vw, 5.4rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 0.98;
}

h3 {
  font-size: 1.65rem;
  line-height: 1.02;
}

p {
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 16px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(28, 91, 83, 0.12);
  background: rgba(28, 91, 83, 0.08);
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro,
.view-intro,
.subtle,
.status-card p,
.hero-card p,
.journey-card p,
.rail-card p {
  color: var(--muted);
  line-height: 1.68;
}

.intro {
  max-width: 720px;
  margin-top: 18px;
  font-size: 1.06rem;
}

.view-intro {
  margin-top: 12px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.88fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-rail {
  min-width: 0;
}

.hero-copy {
  position: relative;
  padding: 42px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 252, 248, 0.88), rgba(255, 248, 240, 0.78)),
    radial-gradient(circle at top right, rgba(200, 100, 42, 0.16), transparent 28%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -40px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 100, 42, 0.22), transparent 70%);
  pointer-events: none;
}

.hero-notes {
  margin-top: 24px;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(29, 42, 40, 0.08);
  background: rgba(255, 255, 255, 0.66);
  color: var(--forest-deep);
  font-size: 0.92rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-grid,
.journey-grid,
.status-grid,
.provider-grid,
.profile-grid,
.metrics {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-top: 34px;
}

.hero-rail {
  display: grid;
  gap: 18px;
}

.hero-card,
.journey-card,
.rail-card,
.panel,
.metric-card,
.subpanel,
.status-card,
.system-card,
.provider-card,
.modal-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-card,
.journey-card,
.rail-card,
.provider-card,
.metric-card,
.subpanel,
.status-card {
  border-radius: 24px;
}

.hero-card,
.journey-card,
.rail-card {
  padding: 22px;
}

.hero-card {
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(10px);
}

.hero-card strong,
.status-card strong,
.metric-card strong,
.provider-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.12rem;
  line-height: 1.3;
}

.hero-card-label,
.rail-label,
.status-card-label,
.metric-label,
.journey-step {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.journey-step {
  margin-bottom: 14px;
  color: var(--forest);
}

.rail-card {
  padding: 26px 24px;
}

.rail-card-accent {
  background:
    linear-gradient(180deg, rgba(28, 91, 83, 0.98), rgba(20, 61, 57, 0.98)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent);
  color: white;
}

.rail-card-accent .rail-label,
.rail-card-accent p {
  color: rgba(255, 255, 255, 0.86);
}

.signal-list {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.panel {
  margin-top: 24px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 251, 245, 0.88)),
    var(--surface);
  backdrop-filter: blur(14px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}

.panel-header-compact {
  align-items: center;
}

.app-shell {
  display: grid;
  gap: 22px;
}

.app-tabs {
  width: fit-content;
  padding: 8px;
  margin-top: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(29, 42, 40, 0.08);
  box-shadow: var(--shadow-soft);
}

.app-view {
  margin-top: 0;
}

.empty-state,
.system-empty {
  padding: 24px;
  border-radius: 26px;
  border: 1px dashed rgba(28, 91, 83, 0.2);
  background: linear-gradient(180deg, rgba(28, 91, 83, 0.05), rgba(28, 91, 83, 0.03));
}

.empty-state p,
.system-empty p {
  margin-top: 12px;
}

.empty-state button {
  margin-top: 18px;
}

.status-grid,
.metrics,
.profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.status-grid {
  margin-top: 22px;
}

.metrics {
  margin-top: 20px;
}

.status-card,
.metric-card,
.provider-card,
.subpanel {
  padding: 20px;
}

.status-card,
.provider-card {
  background: rgba(255, 255, 255, 0.8);
}

.status-card strong {
  font-size: 1.18rem;
}

.subpanel h3 {
  margin-bottom: 10px;
}

.forecast-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.forecast-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.forecast-card p {
  margin-top: 6px;
  color: var(--muted);
}

.forecast-card[data-state="negative"] {
  border-color: rgba(200, 100, 42, 0.2);
  background: rgba(200, 100, 42, 0.09);
}

.systems-list {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.system-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 249, 242, 0.84)),
    var(--surface);
}

.provider-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.provider-pill {
  background: rgba(28, 91, 83, 0.1);
  color: var(--forest-deep);
}

.password-panel {
  margin-top: 22px;
}

.stack {
  display: grid;
  gap: 12px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
select:focus {
  border-color: rgba(28, 91, 83, 0.42);
  box-shadow: 0 0 0 4px rgba(28, 91, 83, 0.09);
}

button {
  min-height: 52px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease, background 120ms ease;
  box-shadow: 0 12px 24px rgba(200, 100, 42, 0.2);
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(1.04);
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button[data-active="true"] {
  background: linear-gradient(180deg, var(--forest), var(--forest-deep));
}

.ghost-button {
  background: rgba(28, 91, 83, 0.08);
  color: var(--forest);
  box-shadow: none;
}

.ghost-button[data-active="true"] {
  background: linear-gradient(180deg, var(--forest), var(--forest-deep));
  color: white;
}

.nav-button:hover,
.mastnav a:hover,
.hero-link:hover {
  color: var(--ink);
}

.notice {
  margin-top: 22px;
  padding: 20px 22px;
  border-radius: 24px;
  border: 1px solid rgba(28, 91, 83, 0.14);
  background: rgba(28, 91, 83, 0.08);
}

.notice-warning {
  border-color: rgba(200, 100, 42, 0.2);
  background: rgba(200, 100, 42, 0.08);
}

.notice-warning p {
  margin-bottom: 14px;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: rgba(28, 91, 83, 0.08);
  border: 1px solid rgba(28, 91, 83, 0.12);
  color: var(--forest-deep);
  font-size: 0.94rem;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 700;
}

#status-panel {
  position: sticky;
  bottom: 18px;
  z-index: 6;
  margin-top: 28px;
  padding: 18px 22px;
  border-radius: 22px;
  background: rgba(255, 252, 247, 0.9);
  backdrop-filter: blur(16px);
}

#status-message[data-state="error"] {
  color: #a0442c;
}

#status-message[data-state="ok"] {
  color: var(--forest-deep);
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-shell[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 28, 28, 0.52);
  backdrop-filter: blur(14px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 28px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 251, 246, 0.98)),
    var(--surface-strong);
  box-shadow: 0 34px 90px rgba(13, 18, 18, 0.28);
}

.modal-header {
  margin-bottom: 22px;
}

.modal-view[hidden] {
  display: none;
}

.modal-close-button {
  flex-shrink: 0;
}

@media (max-width: 920px) {
  .masthead {
    position: static;
  }

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

@media (max-width: 720px) {
  .page {
    width: min(100vw - 20px, 1180px);
    padding-top: 18px;
  }

  .masthead,
  .hero-actions,
  .panel-header {
    flex-direction: column;
    align-items: start;
  }

  .mastnav,
  .mast-actions,
  .auth-switch {
    width: 100%;
  }

  .session-chip {
    width: 100%;
    justify-content: center;
  }

  .hero-copy,
  .panel,
  .system-card,
  .modal-card {
    padding: 22px;
  }

  .app-tabs {
    width: 100%;
  }

  .app-tab-button,
  .ghost-button,
  button {
    width: 100%;
    justify-content: center;
  }

  .system-footer {
    width: 100%;
    flex-direction: column;
  }

  .modal-shell {
    padding: 12px;
  }

  .modal-card {
    width: 100%;
    max-height: calc(100vh - 12px);
  }
}
