:root {
  --fg: #0f172a;
  --muted: #475569;
  --bg: #f8fafc;
  --card: #ffffff;
  --over: #b8860b;
  --delay: #ff9800;
  --intrej: #dc2626;
  --backrej: #000000;
}
*, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui, Segoe UI, Roboto, Ubuntu, Arial;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
}

/* Layout & Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 10px;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 0;
}
.header-flex {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
}
.header-title-block {
  display: flex;
  align-items: center;
  gap: 16px;
}
.fabric-logo {
  width: 36px;
  height: 36px;
  margin-right: 8px;
  vertical-align: middle;
}
.main-title {
  font-size: 1.5em;
  font-weight: 600;
  margin: 0;
  color: var(--fg);
}

/* Description Section */
.description-section {
  background: var(--card);
  border-bottom: 1px solid #e2e8f0;
}
.description-section p {
  color: var(--muted);
}

/* Parameters Section */
#parameters-section {
  margin-bottom: 10px;
}
.parameters-grid-horizontal {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  align-items: stretch;
  justify-content: space-between;
  flex-wrap: nowrap;
}
.parameters-col-horizontal {
  flex: 1 1 0;
  min-width: 0;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 18px 12px 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.01);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-bottom: 0;
  color: var(--fg);
}

.parameters-col-horizontal:first-child {
  flex-basis: 33%;
  max-width: 33%;
}
.parameters-col-horizontal:last-child {
  flex-basis: 67%;
  max-width: 67%;
}
.parameters-title-row h4 {
  margin: 0 0 8px 0;
  color: var(--fg);
  font-weight: 600;
  white-space: nowrap;
}
.display-inline-controls {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.control-block label,
.cap-info-label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 2px;
}
.control-block select,
.control-block input{
  padding: 3px;
  font-size: 13px;
  color: var(--muted);
}
.cap-dot {
  color: #bdbdbd;
  margin: 0 2px;
  vertical-align: middle;
}

/* Table & Chart */
#table-container {
  overflow: auto;
  max-height: 50vh;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding-bottom: 10px;
}
table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  margin-top: 10px;
}
th,
td {
  padding: 4px 6px;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  text-align: center;
}
thead th {
  background: #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 2;
}
tbody tr:nth-child(odd) {
  background: #f8fafc;
}
.input-small {
  width: 50px;
  text-align: center;
}
.percent-high {
  background: #fecaca;
}
#chart-container {
  margin-top: 10px;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
}
#chart {
  height: 280px !important;
}

/* Policies Summary */
.policies-row {
  display: flex;
  gap: 4px;
  justify-content: space-between;
  margin: 12px 0 0 0;
  flex-wrap: wrap;
}
.policy-col {
  flex: 1 1 160px;
  min-width: 120px;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.policy-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}
.policy-impact {
  font-size: 12px;
}

/* Footer */
footer {
  font-size: 11px;
  text-align: center;
  color: var(--muted);
  background: white;
  padding: 4px;
  position: sticky;
  bottom: 0;
}


/* Policy text colors */
.pol-over {
  color: var(--over);
  font-weight: 600;
}
.pol-delay {
  color: var(--delay);
  font-weight: 600;
}
.pol-intrej {
  color: var(--intrej);
  font-weight: 600;
}
.pol-backrej {
  color: var(--backrej);
  font-weight: 600;
}
