:root {
  --p14-surface: #19261f;
  --p14-soft: #202e24;
  --p14-text: #eef1e5;
  --p14-muted: #a9b8a6;
  --p14-chart-grid: #c1d0b522;
  --p14-gold: #d1b174;
}
.analysis-board[data-kind="population14"] {
  width: min(1110px, calc(100vw - 172px));
  max-width: none;
  max-height: calc(100vh - 225px);
  overflow: auto;
  color: var(--p14-text);
  background: var(--panel);
  border-radius: 16px;
}
.analysis-board[data-kind="population14"] > .panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
}
.p14-shell {
  padding: 0 20px 20px;
  line-height: 1.65;
}
.p14-intro,
.p14-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.p14-intro {
  margin: 6px 0 14px;
}
.p14-status {
  color: var(--p14-gold);
  font-size: 11px;
  padding: 6px 11px;
  border: 1px solid #bb9e653d;
  border-radius: 20px;
}
.p14-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.p14-controls label,
.p14-sector-inputs label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--p14-muted);
  min-width: 0;
}
.p14-controls select,
.p14-controls input,
.p14-sector-inputs input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font: inherit;
  line-height: 1.6;
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--p14-text);
  background: var(--p14-soft);
  text-align: center;
}
.p14-controls input:disabled {
  opacity: 0.45;
}
.p14-time-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 15px 0;
  font-size: 12px;
}
.p14-time-row input {
  flex: 1;
  min-width: 60px;
  accent-color: #b69758;
  direction: ltr;
}
.p14-time-row output {
  font-size: 21px;
  font-weight: 600;
  color: var(--p14-gold);
  min-width: 56px;
  text-align: center;
  direction: ltr;
}
.p14-assumptions {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 14px;
  background: var(--p14-soft);
}
.p14-assumptions summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--p14-text);
}
.p14-assumptions summary span {
  color: var(--p14-muted);
  font-size: 10px;
  margin-inline-start: 10px;
}
.p14-assumption-inputs {
  margin-top: 12px;
  align-items: end;
}
.p14-assumption-inputs .p14-note {
  font-size: 10px;
  margin: 0;
}
.p14-assumption-inputs > .btn {
  align-self: end;
  min-height: 38px;
}
.p14-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.p14-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 14px;
  color: var(--p14-muted);
  border-radius: 8px;
  font-size: 12px;
}
.p14-tabs button.active {
  color: var(--p14-gold);
  background: #c2a66b18;
  box-shadow: inset 0 0 0 1px #c5a96d55;
}
.p14-tabs .icon {
  width: 17px;
  height: 17px;
}
.p14-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.p14-kpis > div {
  background: var(--p14-surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  min-height: 94px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 11px 6px;
  text-align: center;
  min-width: 0;
}
.p14-kpis small {
  font-size: 10px;
  color: var(--p14-muted);
}
.p14-kpis strong {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--p14-text);
  font-variant-numeric: tabular-nums;
}
.p14-kpis .p14-range {
  font-size: 16px;
}
.p14-kpis span {
  font-size: 10px;
  color: var(--p14-muted);
}
.p14-forecast-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(250px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.p14-card {
  background: var(--p14-surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
  margin-bottom: 14px;
}
.p14-forecast-grid > .p14-card {
  margin-bottom: 0;
}
.p14-card h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 10px;
  color: var(--p14-text);
}
.p14-card p {
  font-size: 11px;
  color: var(--p14-muted);
  line-height: 1.9;
  margin: 8px 0;
}
.p14-card-title h3 {
  margin-bottom: 0;
}
.p14-card-title > span,
.p14-card-title > small {
  font-size: 10px;
  color: var(--p14-muted);
}
#popChart14 {
  width: 100%;
  height: auto;
  display: block;
  min-height: 170px;
  margin-top: 12px;
  direction: ltr;
}
#popChart14 text,
.p14-pyramid text {
  fill: var(--p14-muted);
  font:
    11px "IBM Plex Sans Arabic",
    sans-serif;
}
#popChart14 .p14-grid line {
  stroke: var(--p14-chart-grid);
  stroke-width: 1;
}
.p14-chart-key {
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--p14-muted);
}
.p14-chart-key i {
  width: 17px;
  height: 3px;
  background: var(--p14-gold);
}
.p14-chart-key em {
  width: 17px;
  height: 10px;
  background: #9da87166;
}
.p14-chart-key small {
  flex-basis: 100%;
  text-align: center;
  font-size: 9px;
  margin-top: 5px;
}
.p14-eyebrow {
  font-size: 10px;
  color: var(--p14-gold);
}
.p14-reading h3 {
  margin-top: 8px;
}
.p14-rate {
  font-size: 32px;
  color: var(--p14-gold);
  font-weight: 500;
  margin: 8px 0;
}
.p14-rate small {
  display: block;
  font-size: 10px;
  color: var(--p14-muted);
  font-weight: 400;
}
.p14-note {
  border-inline-start: 2px solid #b6996255;
  padding-inline-start: 10px;
  font-size: 10px !important;
  line-height: 1.9;
}
.p14-table-wrap {
  overflow: auto;
  margin-top: 12px;
}
.p14-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
  white-space: nowrap;
  text-align: center;
}
.p14-table th {
  font-size: 10px;
  font-weight: 500;
  color: var(--p14-muted);
  background: var(--p14-soft);
  padding: 10px;
}
.p14-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--p14-text);
  font-variant-numeric: tabular-nums;
}
.p14-table th:first-child,
.p14-table td:first-child {
  text-align: right;
}
.p14-table tr:hover td {
  background: var(--p14-soft);
}
.p14-table button {
  color: var(--p14-gold);
}
.p14-table input {
  width: 62px;
  min-height: 30px;
  background: var(--p14-soft);
  color: var(--p14-text);
  border: 1px solid var(--line);
  border-radius: 5px;
  text-align: center;
  font: inherit;
  direction: ltr;
}
.p14-pyramid {
  display: block;
  width: 100%;
  max-height: 450px;
  direction: ltr;
}
.p14-age-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 11px;
}
.p14-age-item strong {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.4;
}
.p14-age-item small {
  font-size: 10px;
  color: var(--p14-muted);
}
.p14-sector-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.p14-source-list {
  padding: 0;
  list-style: none;
  margin: 0;
}
.p14-source-list li {
  margin-top: 14px;
}
.p14-source-list a {
  color: var(--p14-gold);
  font-size: 12px;
}
.p14-methods {
  margin: 0;
}
.p14-methods dt {
  font-size: 12px;
  color: var(--p14-gold);
  margin-top: 12px;
}
.p14-methods dd {
  font-size: 11px;
  line-height: 1.9;
  margin: 4px 0;
  color: var(--p14-muted);
}
.p14-footer {
  text-align: center;
  color: var(--p14-muted);
  font-size: 9px;
  margin-top: 18px;
}
.p14-legend {
  border-top: 1px solid var(--line);
  padding-top: 7px;
}
.p14-legend .legend-item i {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex: none;
}
.p14-legend > small {
  font-size: 9px;
  color: var(--muted);
}
@media (max-width: 1000px) {
  .p14-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .p14-forecast-grid {
    grid-template-columns: 1fr;
  }
  .p14-kpis strong {
    font-size: 21px;
  }
  .p14-kpis .p14-range {
    font-size: 13px;
  }
  .p14-rate {
    font-size: 25px;
  }
  .p14-reading {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
  }
  .p14-reading p {
    grid-column: span 2;
  }
  .p14-shell {
    padding: 0 14px 16px;
  }
}
@media (max-width: 650px) {
  .analysis-board[data-kind="population14"]:not(.wm16-sized) {
    width: calc(100vw - 26px) !important;
    max-height: calc(100vh - 190px);
    right: 13px !important;
    left: 13px !important;
    top: 165px !important;
    transform: none !important;
  }
  .p14-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .p14-controls,
  .p14-sector-inputs {
    grid-template-columns: 1fr 1fr;
  }
  .p14-controls .p14-scope {
    grid-column: span 2;
  }
  .p14-tabs {
    gap: 4px;
  }
  .p14-tabs button {
    flex: 1;
    min-width: 42%;
    padding: 8px 5px;
  }
  .p14-time-row {
    gap: 9px;
    flex-wrap: wrap;
  }
  .p14-time-row .btn {
    width: 100%;
  }
  .p14-intro {
    justify-content: center;
  }
  .p14-card {
    padding: 12px;
  }
  .p14-card-title {
    gap: 6px;
  }
  .p14-table td {
    padding: 8px;
  }
  .p14-sector-inputs label:last-child {
    grid-column: span 2;
  }
}
@media print {
  .p14-shell {
    display: none !important;
  }
}
