/* ===== Base ===== */
body { background: #f8f9fa; font-size: 16px; line-height: 1.7; color: #444; }
.section-title { font-weight: 700; font-size: 22px; color: #1E3A5F; padding-bottom: 10px; margin: 0 0 16px 0; }
.subsection-title { font-weight: 700; font-size: 16px; color: #1E3A5F; margin: 24px 0 8px 0; }

.navbar-default { background-color: #ffffff; border: none; border-bottom: 1px solid #e6edf5;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.05); }
.navbar-default .navbar-brand { color: #1E3A5F; font-weight: 700; font-size: 20px; }
.navbar-default .navbar-nav > li > a { color: #5f6b7a; font-weight: 600; font-size: 15px;
  padding-top: 18px; padding-bottom: 16px; border-bottom: 3px solid transparent; }
.navbar-default .navbar-nav > li > a:hover { color: #1E3A5F; background-color: transparent; }
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus { color: #1E3A5F; background-color: transparent;
  border-bottom: 3px solid #1E3A5F; box-shadow: none; }
.nav-tabs { border-bottom: 2px solid #dee2e6; margin-bottom: 20px; }

.run-btn { min-width: 200px; font-size: 16px; padding: 10px 32px;
  background: #1E3A5F; border-color: #1E3A5F; border-radius: 6px; }
.run-btn:hover { background: #16304f; border-color: #16304f; }

/* ===== Home / About pages ===== */
.page-card { background-color: #ffffff; border-radius: 12px; padding: 40px 48px; border: 1px solid #eeeeee;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); max-width: 1100px; margin: 32px auto 24px auto; }
.page-card p { margin-bottom: 12px; }
.page-card .page-title { margin-top: 0; text-align: center; }
.home-figure { text-align: center; margin: 28px 0; }
.home-figure img { max-width: 100%; height: auto; }
.home-cta { text-align: center; margin-top: 32px; }

/* Dimension colours, shared by the Home cards and the input form groups */
.dim-card { padding: 16px 18px; border-radius: 6px; height: 100%; }
.dim-card h4 { margin-top: 0; font-weight: 700; }
.dim-card p { margin: 0; }
.dim-E { background: #fff3e0; border-left: 4px solid #e67e22; }
.dim-S { background: #fffde7; border-left: 4px solid #f1c40f; }
.dim-M { background: #e0f7ef; border-left: 4px solid #00b894; }
.dim-E .dim-title { color: #c0392b; }
.dim-S .dim-title { color: #7d6608; }
.dim-M .dim-title { color: #006651; }

.feature-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.feature-table th, .feature-table td { border: 1px solid #ddd; padding: 6px; text-align: left; }
.feature-table th { background-color: #f2f2f2; }
.feature-table .center { text-align: center; }
.feature-table tr.dim-E td { background: #fff3e0; }
.feature-table tr.dim-S td { background: #fffde7; }
.feature-table tr.dim-M td { background: #e0f7ef; }

/* ===== Prediction page: two columns ===== */
.pred-page-head { text-align: center; margin: 4px auto 14px auto; padding: 0 16px; }
.pred-page-head .section-title { margin: 0; padding: 0; }
.pred-page-head p { margin: 2px 0 0 0; font-size: 14px; color: #666; }

.pred-layout { display: grid; grid-template-columns: minmax(420px, 5fr) 7fr; gap: 16px; align-items: start;
  max-width: 1680px; margin: 0 auto 12px auto; padding: 0 16px; }
.pred-card { background: #fff; border: 1px solid #eeeeee; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); padding: 14px 18px; }
.pred-right { display: flex; flex-direction: column; gap: 12px; }
.pred-intro { font-size: 13px; line-height: 1.5; color: #666; margin: 6px 0 8px 0; }

/* Left card: model choice, inputs, run button */
.pred-left-head { padding-bottom: 8px; border-bottom: 1px solid #eee; margin-bottom: 4px; }
.pred-left-head .subsection-title { margin: 0; padding: 0; }
.pred-left-head .form-group { margin: 8px 0 0 0; }
.pred-left-head .control-label { font-weight: 400; font-size: 13px; color: #444; margin-bottom: 2px; }
.pred-left-head .radio-inline { font-size: 15px; margin-right: 18px; }
.pred-scroll { max-height: calc(100vh - 350px); overflow-y: auto; padding-right: 6px; }
.pred-scroll .nav-tabs { margin-bottom: 10px; position: sticky; top: 0; background: #fff; z-index: 2; }
.batch-header { background: #f0f4ff; border: 1px solid #c8d8f8; border-radius: 5px; padding: 8px 12px;
  margin-bottom: 8px; font-family: monospace; font-size: 12px; color: #333; word-break: break-word; line-height: 1.8; }
.pred-run { padding-top: 10px; border-top: 1px solid #eee; margin-top: 6px; }
.pred-run .run-btn { padding: 8px 16px; }

/* Input form */
.form-group-panel { border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; }
.form-group-panel .dim-title { display: block; margin: 0 0 6px 0; font-size: 15px; font-weight: 700; }
.prediction-input-panel label { font-weight: 400 !important; }
.prediction-input-panel .control-label { font-size: 12px !important; color: #444; line-height: 1.3; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.prediction-input-panel .row { margin-left: -5px; margin-right: -5px; }
.prediction-input-panel .row > [class*='col-'] { padding-left: 5px; padding-right: 5px; }
.prediction-input-panel .col-sm-4 { margin-bottom: 4px; }
.prediction-input-panel .radio-inline { font-size: 13px !important; color: #444; }
.prediction-input-panel .form-group { margin-bottom: 6px; }
.prediction-input-panel input[type='text'],
.prediction-input-panel input[type='number'] { font-size: 13px; height: 30px; padding: 3px 8px; }
.form-binary .form-group { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.form-binary .control-label { margin: 0 !important; min-width: 150px; }
.form-binary .radio-inline { margin-top: 0; padding-top: 0; }
.form-binary + .row { margin-top: 6px; }

/* Results card */
.pred-output-card { max-height: 32vh; overflow-y: auto; padding: 10px 16px; }
.pred-output-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 0 14px; margin-bottom: 6px; }
.pred-output-head .subsection-title { margin: 0; }
.pred-empty { color: #888; padding: 12px 0; }
.pred-error { color: #b42318; padding: 12px 0; }
.pred-disclaimer { font-size: 11.5px; color: #888; margin: 6px 0 0 0; line-height: 1.4; }
.pred-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.pred-table th { position: sticky; top: 0; background: #fff; color: #888; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #e1e7ef; padding: 4px 8px; }
.pred-table td { padding: 4px 8px; border-bottom: 1px solid #f1f3f6; color: #333; }
.pred-badge { padding: 1px 9px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.pred-badge-pd { background: #fdecea; color: #b42318; }
.pred-badge-non { background: #eaf4ea; color: #1b7f3a; }

/* Map card: title, one toolbar row (all controls share one font size), plot */
.pred-map { padding: 10px 14px; }
.pred-map .subsection-title { display: block; margin: 0; }
.pred-map-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 24px; margin: 4px 0 2px 0;
  font-size: 13px; color: #444; }
.pred-map-tools .form-group, .pred-map-tools .checkbox { margin: 0; }
.pred-map-tools label, .pred-map-tools .checkbox-inline, .pred-map-tools .control-label {
  font-size: 13px !important; font-weight: 400 !important; }
.pred-map-tools .control-label { display: inline; margin: 0 8px 0 0; }
.pred-map-tools .shiny-options-group { display: inline-block; }
.pred-map-tools .checkbox-inline { margin-top: 0; padding-top: 0; }
.pred-plot-wrap { height: min(600px, calc(100vh - 240px)); min-height: 420px; }

@media (max-width: 991px) {
  .pred-layout { display: block; }
  .pred-card { margin-bottom: 12px; }
  .pred-scroll { overflow: visible; }
  .pred-output-card { max-height: none; }
  .pred-plot-wrap { height: 520px; }
}

/* About: reporting and compliance sections start collapsed. */
.about-disclosure { margin-bottom: 16px; }
.about-disclosure > summary.section-title { display: flex; align-items: baseline; gap: 10px; list-style: none; cursor: pointer; margin-bottom: 0; }
.about-disclosure[open] > summary.section-title { margin-bottom: 16px; }
.about-disclosure > summary:focus-visible { outline: 2px solid #1E3A5F; outline-offset: 4px; }

.about-disclosure > summary::-webkit-details-marker { display: none; }

.about-disclosure .disclosure-arrow { display: inline-block; flex: none; font-size: 0.7em; transition: transform 0.15s; }
.about-disclosure[open] > summary .disclosure-arrow { transform: rotate(90deg); }
.reporting-table-wrap { overflow-x: auto; }
.reporting-table { min-width: 640px; margin: 12px 0 20px; }
.reporting-table caption { color: #444; }
.reporting-table th[scope="row"] { width: 20%; vertical-align: top; }
.reporting-table td { vertical-align: top; }
.reporting-table td:last-child { width: 22%; }
.reporting-table ul { padding-left: 18px; margin-bottom: 0; }
.reporting-table li + li { margin-top: 8px; }
