:root {
  --ink: #27312f;
  --muted: #6c7470;
  --rose: #b84f6a;
  --rose-soft: #f6dce3;
  --sage: #6c9a82;
  --teal: #487f78;
  --pearl: #fffaf8;
  --paper: #fff6f1;
  --line: rgba(84, 70, 68, 0.14);
  --shadow: 0 18px 50px rgba(73, 43, 44, 0.11);
}

html,
body,
.bslib-page-fill {
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(248, 204, 213, 0.38), transparent 28%),
    linear-gradient(135deg, #fffaf8 0%, #fff4ee 42%, #eef8f3 100%);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

.app-shell {
  width: calc(100% - 28px);
  max-width: 100%;
  padding-inline: 0;
  margin: 14px auto 28px;
}

.hero-band {
  min-height: 248px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(39, 49, 47, 0.62), rgba(39, 49, 47, 0.12) 58%, rgba(255, 250, 248, 0.04)),
    url("hero-meta.png") center / cover no-repeat;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-end;
  margin-bottom: 18px;
}

.hero-copy {
  padding: 30px clamp(22px, 5vw, 56px);
  color: #fffaf8;
  max-width: 780px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 250, 248, 0.62);
  border-radius: 999px;
  background: rgba(255, 250, 248, 0.14);
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 12px;
  backdrop-filter: blur(8px);
}

.hero-copy h1 {
  font-size: clamp(2.15rem, 5vw, 4.9rem);
  line-height: 0.95;
  margin: 0 0 12px;
  letter-spacing: 0;
}

.hero-copy p {
  font-size: clamp(1rem, 2vw, 1.22rem);
  margin: 0;
  max-width: 660px;
  color: rgba(255, 250, 248, 0.9);
}

.bslib-sidebar-layout {
  gap: 18px;
  align-items: stretch;
  max-width: 100%;
}

.side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 248, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.side-panel h2 {
  font-size: 1.35rem;
  margin: 0 0 12px;
}

.main-panel {
  min-width: 0;
  max-width: 100%;
}

.form-label,
.control-label {
  color: var(--ink);
  font-weight: 650;
}

.form-control,
.form-select,
.selectize-input {
  border-color: rgba(72, 127, 120, 0.24);
  border-radius: 8px;
  min-height: 42px;
  background-color: rgba(255, 255, 255, 0.92);
}

.form-control:focus,
.form-select:focus,
.selectize-input.focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 0.2rem rgba(184, 79, 106, 0.14);
}

.download-btn,
.btn-default {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(184, 79, 106, 0.28);
  background: linear-gradient(135deg, #b84f6a, #d9828b);
  color: white;
  font-weight: 700;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 100px;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 32px rgba(73, 43, 44, 0.08);
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1;
  letter-spacing: 0;
}

.metric-label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  font-weight: 780;
  letter-spacing: 0.04em;
}

.metric-card.rose {
  background: linear-gradient(145deg, #fff7f6, #f8dfe5);
}

.metric-card.sage {
  background: linear-gradient(145deg, #f8fff9, #dfeee5);
}

.metric-card.teal {
  background: linear-gradient(145deg, #f6fffd, #d7ebe7);
}

.metric-card.gold {
  background: linear-gradient(145deg, #fffaf0, #f5e8c6);
}

.metric-card.pearl {
  background: linear-gradient(145deg, #ffffff, #fff0eb);
}

.nav-tabs {
  border-bottom: 1px solid var(--line);
  gap: 6px;
}

.nav-tabs .nav-link {
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.nav-tabs .nav-link.active {
  color: var(--rose);
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--line) var(--line) rgba(255, 255, 255, 0.76);
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
  margin-top: 14px;
}

.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 38px rgba(73, 43, 44, 0.08);
  overflow: auto;
  max-width: 100%;
}

.result-panel.wide,
.plot-panel {
  margin-top: 14px;
}

.result-panel h3 {
  margin: 0 0 12px;
  font-size: 1.12rem;
  letter-spacing: 0;
}

pre {
  border: 0;
  border-radius: 8px;
  background: #fff9f5;
  color: var(--ink);
  padding: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dataTables_wrapper {
  color: var(--ink);
}

table.dataTable {
  border-collapse: collapse !important;
  width: 100% !important;
}

table.dataTable thead th {
  border-bottom: 1px solid var(--line) !important;
  color: var(--teal);
}

table.dataTable tbody td {
  border-top: 1px solid rgba(84, 70, 68, 0.08);
  white-space: normal;
  overflow-wrap: anywhere;
}

.dataTables_wrapper {
  max-width: 100%;
  overflow-x: auto;
}

#coef_table .dataTables_wrapper {
  overflow-x: hidden;
}

#coef_table table.dataTable {
  min-width: 0 !important;
  table-layout: fixed;
}

#coef_table table.dataTable th,
#coef_table table.dataTable td {
  padding: 0.45rem 0.32rem;
  white-space: normal !important;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}

@media (max-width: 1100px) {
  .metric-row,
  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: calc(100vw - 16px);
    margin-top: 8px;
  }

  .hero-band {
    min-height: 214px;
  }

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

  .metric-card {
    min-height: 84px;
  }
}
