@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-muted: #f7faf8;
  --border: #d8e1dc;
  --border-strong: #c0cec7;
  --text: #17231e;
  --muted: #66776f;
  --brand: #0b7a55;
  --brand-strong: #075f43;
  --brand-soft: #edf7f2;
  --brand-muted: #d9eee5;
  --brand-border: #b7d9cc;
  --blue: var(--brand);
  --cyan: #0d8c99;
  --green: #138a5b;
  --red: #cc3f3f;
  --amber: #d69614;
  --navy: #243b53;
  --shadow: 0 1px 2px rgba(20, 31, 42, 0.05);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button, input, select { font: inherit; letter-spacing: 0; }

button { color: inherit; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-top: 3px solid var(--brand);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(7, 95, 67, 0.06);
}

.header-inner {
  max-width: 1600px;
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-block {
  min-width: 250px;
  display: grid;
  justify-items: start;
  gap: 1px;
}

.brand-lockup {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  direction: ltr;
  color: var(--brand);
}

.brand-symbol {
  width: 48px;
  height: 48px;
  display: block;
  flex: 0 0 auto;
}

.brand-wordmark {
  direction: rtl;
  font-size: 29px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.brand-context { width: 200px; }
.brand-block p {
  max-width: 100%;
  margin: 1px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-nav-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.primary-nav {
  max-width: 1600px;
  height: 42px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
}

.primary-nav-button {
  position: relative;
  align-self: stretch;
  padding: 0 2px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.primary-nav-button svg { width: 15px; height: 15px; }
.primary-nav-button:hover { color: var(--text); }
.primary-nav-button.active { border-bottom-color: var(--blue); color: var(--blue); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.notification-center { position: relative; flex: 0 0 auto; }
.notification-button { position: relative; }
.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  direction: ltr;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: 47px;
  left: 0;
  z-index: 45;
  width: min(430px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(20, 31, 42, 0.18);
}

.notification-heading {
  min-height: 66px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.notification-heading span { color: var(--blue); font-size: 9px; font-weight: 800; }
.notification-heading h2 { margin: 3px 0 0; font-size: 14px; }
.notification-period { padding: 8px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; border-bottom: 1px solid var(--border); background: var(--surface-muted); }
.notification-period-button { height: 31px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.notification-period-button:hover { color: var(--text); }
.notification-period-button.active { background: var(--surface); color: var(--blue); box-shadow: var(--shadow); }
.notification-type-filter { padding: 8px 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; border-bottom: 1px solid var(--border); background: var(--surface); }
.notification-type-button { min-width: 0; height: 34px; padding: 0 7px; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); font-family: inherit; font-size: 9px; font-weight: 700; cursor: pointer; }
.notification-type-button:hover { border-color: var(--border); color: var(--text); }
.notification-type-button.active { border-color: var(--brand-border); background: var(--brand-soft); color: var(--blue); }
.notification-type-button strong { min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-muted); color: inherit; direction: ltr; font-size: 8px; line-height: 1; }
.notification-type-button.active strong { background: var(--brand-muted); }
.notification-summary { min-height: 38px; padding: 0 13px; display: flex; align-items: center; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 10px; }
.notification-list { max-height: min(510px, calc(100vh - 279px)); overflow-y: auto; }
.notification-date-label { position: sticky; top: 0; z-index: 1; min-height: 29px; padding: 6px 13px; border-bottom: 1px solid var(--border); background: #f4f7f9; color: var(--muted); font-size: 9px; font-weight: 700; }
.notification-item {
  width: 100%;
  min-height: 82px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 18px;
  gap: 5px 9px;
  align-items: start;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: right;
  cursor: pointer;
}
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover, .notification-item:focus-visible { background: var(--brand-soft); outline: none; }
.notification-item[disabled] { cursor: default; opacity: 0.62; }
.notification-item[disabled]:hover { background: transparent; }
.notification-kind { align-self: start; padding: 3px 5px; border-radius: 3px; background: var(--brand-soft); color: var(--blue); font-size: 8px; font-weight: 800; text-align: center; white-space: nowrap; }
.notification-kind.monthly { background: #e8f5ef; color: var(--green); }
.notification-kind.yearly { background: #fff4dc; color: #966300; }
.notification-content { min-width: 0; }
.notification-symbol-line { display: flex; align-items: baseline; gap: 7px; }
.notification-symbol-line strong { color: var(--text); font-size: 11px; }
.notification-symbol-line span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.notification-content p { margin: 4px 0 0; display: -webkit-box; overflow: hidden; color: #455564; font-size: 9px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notification-meta { margin-top: 5px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 8px; }
.notification-open-icon { grid-column: 3; grid-row: 1 / span 2; align-self: center; color: var(--muted); }
.notification-open-icon svg { width: 15px; height: 15px; }
.notification-item:hover .notification-open-icon { color: var(--blue); }
.notification-empty { min-height: 190px; place-items: center; padding: 20px; color: var(--muted); font-size: 11px; text-align: center; }
.notification-empty:not([hidden]) { display: grid; }

.symbol-picker {
  position: relative;
  width: min(420px, 48vw);
}

.symbol-picker > svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
  z-index: 2;
}

.symbol-picker input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  outline: none;
  background: var(--surface-muted);
  color: var(--text);
}

.symbol-picker input:focus { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px rgba(11, 122, 85, 0.1); }

.symbol-results {
  display: none;
  position: absolute;
  top: 45px;
  right: 0;
  left: 0;
  max-height: 330px;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(20, 31, 42, 0.14);
}

.symbol-results.open { display: block; }

.symbol-option {
  width: 100%;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  text-decoration: none;
  text-align: right;
  cursor: pointer;
}

.symbol-option:last-child { border-bottom: 0; }
.symbol-option:hover, .symbol-option:focus { background: var(--brand-soft); outline: none; }
.symbol-option strong { color: var(--blue); }
.symbol-option span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button:hover { border-color: var(--blue); color: var(--blue); }
.icon-button svg { width: 18px; height: 18px; }
.icon-button.spinning svg { animation: spin 0.8s linear infinite; }
.icon-button.compact { width: 34px; height: 34px; }
.icon-button.compact svg { width: 16px; height: 16px; }

.screener-shell { max-width: 1600px; margin: 0 auto; padding: 18px 22px 40px; }

.screener-heading {
  min-height: 92px;
  padding: 8px 2px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.section-kicker { display: block; margin-bottom: 3px; color: var(--blue); font-size: 10px; font-weight: 800; }
.screener-heading h2 { margin: 0; font-size: 23px; line-height: 1.5; }
.screener-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.screener-freshness { min-width: 170px; text-align: left; }
.screener-freshness span { display: block; color: var(--muted); font-size: 10px; }
.screener-freshness strong { display: block; margin-top: 5px; direction: ltr; font-size: 12px; }

.screener-toolbar {
  min-height: 74px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(240px, 1.25fr) 170px minmax(190px, 0.9fr) minmax(240px, 1fr);
  align-items: end;
  gap: 10px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: var(--surface);
}

.screener-control { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.screener-control select,
.screener-search-field {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--text);
  outline: none;
}
.screener-control select { padding: 0 10px; }
.screener-control select:focus,
.screener-search-field:focus-within { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px rgba(11, 122, 85, 0.1); }

.screener-search-field { position: relative; display: block; }
.screener-search-field svg { position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; }
.screener-search-field input { width: 100%; height: 100%; padding: 0 34px 0 9px; border: 0; outline: 0; background: transparent; color: var(--text); }

.sort-direction-button {
  height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.sort-direction-button:hover { border-color: var(--blue); color: var(--blue); }
.sort-direction-button svg { width: 16px; height: 16px; }

.screener-table-section { min-width: 0; border: 1px solid var(--border); border-radius: 0 0 6px 6px; background: var(--surface); box-shadow: var(--shadow); }
.screener-table-heading { min-height: 58px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.screener-table-heading h3 { margin: 0; font-size: 13px; }
.screener-table-heading span { color: var(--muted); font-size: 10px; }
.screener-table-heading div > span { display: block; margin-top: 4px; }
.screener-table-wrap { max-height: calc(100vh - 284px); min-height: 360px; overflow: auto; }
.screener-table { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.screener-table th { position: sticky; top: 0; z-index: 2; height: 40px; padding: 0 10px; border-bottom: 1px solid var(--border-strong); background: #f4f7f9; color: var(--muted); text-align: right; font-size: 9px; font-weight: 800; white-space: nowrap; }
.screener-table td { height: 52px; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.screener-table tbody tr { cursor: pointer; }
.screener-table tbody tr:hover { background: #f0f6fa; }
.screener-table tbody tr:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.screener-table tbody tr:last-child td { border-bottom: 0; }
.screener-table .rank-column { width: 54px; text-align: center; }
.screener-table .company-column { width: 250px; }
.screener-table .row-action-column { width: 42px; }
.screener-rank { direction: ltr; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.screener-company { min-width: 0; display: grid; grid-template-columns: 68px minmax(0, 1fr); align-items: center; gap: 8px; }
.screener-company strong { color: var(--blue); font-size: 12px; }
.screener-company span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.screener-sector { max-width: 190px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.screener-value { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.screener-value.selected { color: var(--blue); font-size: 12px; font-weight: 800; }
.screener-row-action { color: var(--muted); text-align: center; }
.screener-row-action svg { width: 16px; height: 16px; }
.screener-table tbody tr:hover .screener-row-action { color: var(--blue); }
.screener-empty { min-height: 220px; place-items: center; color: var(--muted); font-size: 12px; }
.screener-empty:not([hidden]) { display: grid; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.dashboard-shell { max-width: 1600px; margin: 0 auto; padding: 18px 22px 40px; }

.company-strip {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 2px 16px;
}

.symbol-line { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.symbol-code { color: var(--blue); font-size: 16px; font-weight: 800; }
.market-label { padding-right: 9px; border-right: 1px solid var(--border-strong); color: var(--muted); font-size: 11px; }
.company-strip h2 { margin: 0; font-size: 21px; line-height: 1.5; }
.company-strip p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.freshness-block { min-width: 180px; text-align: left; }
.freshness-block span, .freshness-block small { display: block; color: var(--muted); font-size: 11px; }
.freshness-block strong { display: block; margin: 4px 0; font-size: 16px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(118px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.kpi-card {
  min-width: 0;
  min-height: 94px;
  padding: 12px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--kpi-color, var(--blue));
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.kpi-title svg { width: 16px; height: 16px; color: var(--kpi-color, var(--blue)); flex: 0 0 auto; }
.kpi-value { display: block; margin-top: 12px; direction: ltr; text-align: right; font: 700 19px "Vazirmatn", Tahoma, Arial, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-change { display: flex; align-items: center; gap: 4px; margin-top: 5px; direction: rtl; font-size: 10px; font-weight: 700; white-space: nowrap; }
.kpi-change svg { width: 13px; height: 13px; flex: 0 0 auto; }
.kpi-change + .kpi-detail { margin-top: 3px; }
.kpi-detail { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 14px;
}

.tab-button {
  min-width: max-content;
  padding: 11px 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tab-button:hover { color: var(--text); }
.tab-button.active { color: var(--blue); border-bottom-color: var(--blue); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chart-panel, .table-panel, .products-panel, .scenario-band {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chart-panel.wide { grid-column: 1 / -1; }
.quarterly-grid { grid-template-columns: 1fr; }
.quarterly-grid .chart-panel { grid-column: 1; }
.quarterly-grid .quarterly-chart { height: 330px; }
.composition-chart { height: 430px; }

.panel-heading {
  min-height: 45px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h3 { margin: 0; font-size: 13px; }
.panel-heading span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.chart-mode-heading { min-height: 58px; flex-wrap: wrap; }
.panel-heading-copy { min-width: 0; display: grid; gap: 4px; }
.chart-mode-control { flex: 0 0 auto; direction: rtl; }
.chart-mode-control .segment-button {
  min-width: 64px;
  height: 30px;
  padding: 0 12px;
  font: 700 10px "Vazirmatn", Tahoma, Arial, sans-serif;
}
.chart-mode-control .segment-button[data-raw-material-mode="sales-percent"] { min-width: 102px; }
.regression-window-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.regression-window-control input {
  width: 58px;
  height: 28px;
  padding: 2px 5px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  direction: ltr;
  text-align: center;
  font: 700 12px "Vazirmatn", Tahoma, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
.regression-window-control input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(11, 122, 85, 0.12); }
.regression-window-control input:disabled { background: var(--surface-muted); color: var(--muted); cursor: not-allowed; }
.regression-model-strip {
  min-height: 48px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px 24px;
  flex-wrap: wrap;
  direction: rtl;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}
.regression-model-strip[hidden] { display: none; }
.regression-model {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}
.regression-model-line {
  width: 21px;
  flex: 0 0 21px;
  border-top: 3px solid var(--model-color);
}
.regression-model-line.dashed { border-top-style: dashed; }
.regression-model strong { color: var(--model-color); white-space: nowrap; }
.regression-stat { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.regression-stat b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.chart { width: 100%; height: 330px; direction: ltr; }
.chart-panel.wide .chart { height: 370px; }

.working-capital-summary-band {
  margin-bottom: 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.working-capital-summary-heading {
  min-height: 58px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.working-capital-summary-heading span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.working-capital-summary-heading h3 {
  margin: 4px 0 0;
  font-size: 14px;
}
.working-capital-quality {
  padding: 5px 9px;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.working-capital-quality[data-quality="estimated"] {
  background: #e8f5ef;
  color: var(--green);
}
.working-capital-quality[data-quality="partial"] {
  background: #fff5df;
  color: #9b6500;
}
.working-capital-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.working-capital-kpi {
  min-width: 0;
  min-height: 88px;
  padding: 13px 15px;
  border-left: 1px solid var(--border);
}
.working-capital-kpi:last-child { border-left: 0; }
.working-capital-kpi span,
.working-capital-kpi small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.working-capital-kpi strong {
  display: block;
  margin: 8px 0 5px;
  direction: rtl;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}
.working-capital-detail-panel { margin-top: 10px; }
.working-capital-table { min-width: 900px; }
.working-capital-table td { font-variant-numeric: tabular-nums; }
.working-capital-row-quality {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.working-capital-row-quality[data-quality="estimated"] {
  background: #e8f5ef;
  color: var(--green);
}
.working-capital-row-quality[data-quality="partial"] {
  background: #fff5df;
  color: #9b6500;
}

.symbol-market-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .65fr);
  gap: 10px;
}
.symbol-market-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.symbol-market-price-panel { grid-row: span 2; }
.symbol-market-heading {
  min-height: 55px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.symbol-market-heading span { display: block; color: var(--muted); font-size: 9px; }
.symbol-market-heading h3 { margin: 4px 0 0; font-size: 13px; }
.symbol-market-heading .symbol-market-source {
  direction: ltr;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}
.symbol-market-chart { width: 100%; height: 565px; direction: ltr; }
.symbol-market-chart.compact { height: 250px; }
.symbol-market-detail-list {
  margin: 0;
  padding: 6px 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.symbol-market-detail-list div {
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.symbol-market-detail-list dt { color: var(--muted); font-size: 9px; white-space: nowrap; }
.symbol-market-detail-list dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  direction: ltr;
  color: var(--text);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.scenario-band { margin: 10px 0; }
.section-heading { min-height: 68px; padding: 13px 15px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); }
.section-heading h3 { margin: 0 0 5px; font-size: 14px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.model-stats { display: flex; gap: 14px; direction: ltr; font-size: 11px; color: var(--muted); }
.model-stats strong { color: var(--text); }

.table-wrap { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.data-table th { background: var(--surface-muted); color: var(--muted); font-size: 11px; font-weight: 700; }
.data-table td { font-size: 12px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.numeric { direction: ltr; text-align: right; font-family: "Vazirmatn", Tahoma, Arial, sans-serif; font-variant-numeric: tabular-nums; }

.report-matrix-panel { margin-top: 10px; overflow: hidden; }
.report-matrix-wrap { width: 100%; overflow-x: auto; }
.report-matrix-table {
  width: 100%;
  min-width: 1060px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  direction: rtl;
}
.report-matrix-table.quarterly { min-width: 520px; }
.report-matrix-table th,
.report-matrix-table td {
  height: 45px;
  padding: 5px 7px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  text-align: center;
  font-size: 10px;
  white-space: nowrap;
}
.report-matrix-table th {
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 800;
}
.report-matrix-table thead th { height: 39px; }
.report-matrix-table tbody th {
  position: sticky;
  right: 0;
  z-index: 1;
  width: 74px;
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.report-matrix-table thead th:first-child {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 74px;
}
.report-matrix-table th:last-child,
.report-matrix-table td:last-child { border-left: 0; }
.report-matrix-table tbody tr:last-child th,
.report-matrix-table tbody tr:last-child td { border-bottom: 0; }
.report-matrix-table tbody tr:hover td,
.report-matrix-table tbody tr:hover th { background: #f4f8fb; }
.report-matrix-link {
  width: 29px;
  height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--blue);
  background: var(--surface);
  transition: border-color 120ms ease, background-color 120ms ease;
}
.report-matrix-link:hover { border-color: var(--blue); background: var(--brand-soft); }
.report-matrix-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.report-matrix-link svg { width: 15px; height: 15px; }
.report-matrix-missing { color: #b7c0c8; }
.report-matrix-empty { min-height: 82px; display: grid; place-items: center; color: var(--muted); font-size: 11px; }

.ownership-grid { grid-template-columns: minmax(0, 1.4fr) minmax(310px, 0.6fr); }
.ownership-grid .wide { grid-column: 1 / -1; }
.ownership-workspace {
  margin-bottom: 12px;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface);
}
.ownership-heading {
  min-height: 58px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}
.ownership-heading h3 { margin: 0; font-size: 15px; }
.ownership-heading span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.ownership-heading-actions { display: flex; gap: 6px; }
.ownership-toolbar {
  min-height: 74px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}
.control-group { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.segment-button {
  min-width: 72px;
  height: 34px;
  padding: 0 11px;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.segment-button:last-child { border-left: 0; }
.segment-button:hover { color: var(--blue); }
.segment-button.active { background: var(--blue); color: #fff; }
.icon-segments .segment-button { min-width: 38px; padding: 0; display: grid; place-items: center; }
.icon-segments svg { width: 16px; height: 16px; }
.range-control, .select-control {
  min-width: 136px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}
.range-control span, .select-control span { display: flex; justify-content: space-between; gap: 8px; }
.range-control output { color: var(--text); font-weight: 700; }
.range-control input { width: 150px; accent-color: var(--blue); }
.ownership-threshold-control input { width: 170px; }
.select-control select {
  min-width: 145px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  outline: none;
  background: var(--surface);
  color: var(--text);
}
.select-control select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 122, 85, 0.1); }
.toggle-control { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--muted); font-size: 11px; }
.toggle-control input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-control > span {
  width: 36px;
  height: 20px;
  padding: 2px;
  display: flex;
  justify-content: flex-end;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #e7ebee;
  transition: 0.15s ease;
}
.toggle-control > span::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(20,31,42,.2); }
.toggle-control input:checked + span { justify-content: flex-start; border-color: var(--green); background: var(--green); }
.toggle-control input:focus-visible + span { outline: 3px solid rgba(11, 122, 85, 0.2); }
.toggle-control b { font-weight: 600; }
.ownership-summary {
  min-height: 48px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.ownership-summary-item { display: inline-flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 10px; }
.ownership-summary-item strong { color: var(--text); direction: ltr; font-size: 13px; font-variant-numeric: tabular-nums; }
.ownership-summary-item.warning strong { color: var(--amber); }
.ownership-summary-item.low-confidence strong { color: var(--red); }
.ownership-view-tabs { padding: 0 14px; display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.ownership-view-button {
  min-width: max-content;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.ownership-view-button.active { color: var(--blue); border-bottom-color: var(--blue); }
.ownership-view { display: none; }
.ownership-view.active { display: block; }
.ownership-graph-stage {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  grid-template-rows: 640px;
  direction: ltr;
  background: #fbfcfd;
}
.ownership-graph { min-width: 0; grid-column: 1; grid-row: 1; direction: ltr; }
.ownership-legend {
  z-index: 4;
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  justify-self: start;
  margin: 12px;
  padding: 7px 9px;
  display: flex;
  gap: 8px 12px;
  flex-wrap: wrap;
  max-width: calc(100% - 24px);
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255,255,255,.92);
  direction: rtl;
  pointer-events: none;
}
.ownership-legend-item { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
.ownership-legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--legend-color); }
.ownership-graph-status {
  z-index: 5;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: center;
  margin-top: 12px;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 4px;
  background: rgba(23,33,43,.84);
  color: #fff;
  direction: rtl;
  font-size: 9px;
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
.ownership-graph-status.active { opacity: 1; }
.ownership-inspector {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
  direction: rtl;
}
.inspector-heading { min-height: 70px; padding: 12px 13px; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.inspector-heading span { color: var(--blue); font-size: 10px; }
.inspector-heading h4 { margin: 5px 0 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.inspector-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.inspector-metrics { margin: 0; padding: 7px 13px; }
.inspector-metrics div { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); }
.inspector-metrics div:last-child { border-bottom: 0; }
.inspector-metrics dt { color: var(--muted); font-size: 10px; }
.inspector-metrics dd { margin: 0; direction: ltr; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.inspector-relations { padding: 0 13px 14px; }
.inspector-relations section { padding-top: 10px; border-top: 1px solid var(--border); }
.inspector-relations h5 { margin: 0 0 6px; font-size: 11px; }
.inspector-relations ul { margin: 0; padding: 0; list-style: none; }
.inspector-relations li { min-height: 29px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.inspector-relations li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspector-relations li strong { direction: ltr; color: var(--text); font-weight: 700; white-space: nowrap; }
.ownership-support-chart { width: 100%; height: 640px; direction: ltr; }
.ownership-analytics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.ownership-analysis-section { min-width: 0; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ownership-analysis-section:last-child { border-left: 0; }
.ownership-analysis-section.wide-analysis { grid-column: 1 / -1; border-left: 0; }
.ownership-history-chart { width: 100%; height: 360px; direction: ltr; }
.ownership-analysis-list { max-height: 420px; overflow: auto; }
.ownership-analysis-row { min-height: 54px; padding: 9px 13px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: center; border-bottom: 1px solid var(--border); }
.ownership-analysis-row:last-child { border-bottom: 0; }
.ownership-analysis-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.ownership-analysis-row span { color: var(--muted); font-size: 9px; }
.ownership-analysis-row b { grid-column: 2; grid-row: 1 / span 2; direction: ltr; color: var(--blue); font-size: 11px; }
.shareholder-wrap { max-height: 430px; }
.shareholder-wrap .data-table { min-width: 620px; }
.products-panel { align-self: start; }
.product-list { margin: 0; padding: 8px 16px 12px; list-style: none; }
.product-list li { padding: 9px 0; border-bottom: 1px solid var(--border); }
.product-list li:last-child { border-bottom: 0; }

.commodity-shell { max-width: 1600px; margin: 0 auto; padding: 18px 22px 40px; }
.commodity-heading {
  min-height: 104px;
  padding: 8px 2px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.commodity-heading h2 { margin: 0; font-size: 23px; line-height: 1.5; }
.commodity-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.commodity-freshness { min-width: 280px; text-align: left; }
.commodity-freshness .source-state { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-size: 10px; font-weight: 700; }
.commodity-freshness .source-state svg { width: 14px; height: 14px; }
.commodity-freshness strong { display: block; margin-top: 5px; direction: ltr; font-size: 12px; }
.commodity-freshness small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }

.commodity-quote-grid {
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 8px;
}
.commodity-quote-card {
  min-width: 0;
  min-height: 145px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid var(--border);
  border-top: 3px solid var(--commodity-color);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  text-align: right;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.commodity-quote-card:hover { border-color: var(--commodity-color); }
.commodity-quote-card.selected { outline: 2px solid color-mix(in srgb, var(--commodity-color) 45%, transparent); outline-offset: -2px; }
.commodity-quote-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.commodity-quote-heading strong { font-size: 11px; }
.commodity-quote-heading small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.commodity-quote-card > b { margin-top: 15px; direction: ltr; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.commodity-quote-change { margin-top: 11px; display: flex; align-items: center; gap: 4px; direction: rtl; font-size: 9px; }
.commodity-quote-change svg { width: 13px; height: 13px; }
.commodity-quote-meta { margin-top: 4px; color: var(--muted); direction: ltr; text-align: right; font-size: 8px; }
.commodity-quote-meta.volume { direction: rtl; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.neutral { color: var(--muted) !important; }

.commodity-scenario,
.commodity-chart-panel,
.commodity-detail-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.commodity-scenario { margin-bottom: 10px; }
.commodity-section-heading {
  min-height: 55px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.commodity-section-heading span { display: block; color: var(--muted); font-size: 9px; }
.commodity-section-heading h3 { margin: 4px 0 0; font-size: 13px; }
.text-command-button {
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.text-command-button:hover { border-color: var(--blue); color: var(--blue); }
.text-command-button svg { width: 15px; height: 15px; }
.commodity-assumption-grid {
  padding: 10px 13px;
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}
.commodity-assumption { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 9px; }
.commodity-assumption-input {
  height: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
}
.commodity-assumption-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,122,85,.1); }
.commodity-assumption-input input { min-width: 0; height: 100%; padding: 0 9px; border: 0; outline: 0; background: transparent; direction: ltr; color: var(--text); font: 700 11px "Vazirmatn", Tahoma, sans-serif; }
.commodity-assumption-input small { padding: 0 9px; border-right: 1px solid var(--border); color: var(--muted); font-size: 8px; white-space: nowrap; }
.commodity-table-wrap { width: 100%; overflow: auto; }
.commodity-table { width: 100%; min-width: 1120px; border-collapse: collapse; }
.commodity-table th { height: 38px; padding: 0 10px; background: #f4f7f9; color: var(--muted); text-align: right; font-size: 9px; white-space: nowrap; }
.commodity-table td { height: 47px; padding: 7px 10px; border-top: 1px solid var(--border); font-size: 10px; white-space: nowrap; }
.commodity-table td.numeric { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.commodity-table .forecast-value { color: var(--blue); font-weight: 800; }
.commodity-name-cell { display: inline-flex; align-items: center; gap: 7px; }
.commodity-name-cell i { width: 9px; height: 9px; border-radius: 2px; background: var(--commodity-color); }
.commodity-formula { max-width: 330px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }

.commodity-analysis-grid { margin-bottom: 10px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .65fr); gap: 10px; }
.commodity-price-panel { grid-row: span 2; }
.commodity-chart { width: 100%; height: 450px; direction: ltr; }
.commodity-chart.compact-chart { height: 250px; }
.commodity-instrument-tabs { max-width: 720px; display: flex; gap: 2px; overflow-x: auto; direction: rtl; }
.commodity-instrument-tabs button {
  min-width: max-content;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}
.commodity-instrument-tabs button.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.commodity-detail-list { margin: 0; padding: 6px 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.commodity-detail-list div { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); }
.commodity-detail-list dt { color: var(--muted); font-size: 9px; }
.commodity-detail-list dd { margin: 0; direction: ltr; text-align: left; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }

.copper-outlook {
  min-width: 0;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.copper-outlook-heading { min-height: 66px; }
.copper-outlook-source-date {
  direction: ltr;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.copper-outlook-kpis {
  padding: 10px 13px;
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}
.copper-outlook-kpi {
  min-width: 0;
  min-height: 78px;
  padding: 10px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}
.copper-outlook-kpi span { color: var(--muted); font-size: 8px; }
.copper-outlook-kpi strong {
  direction: ltr;
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.copper-outlook-kpi small { color: var(--muted); font-size: 8px; }
.copper-outlook-kpi.accent strong { color: #a8552d; }
.copper-outlook-kpi.surplus strong { color: var(--green); }
.copper-outlook-kpi.deficit strong { color: var(--red); }
.copper-outlook-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}
.copper-outlook-chart-block { min-width: 0; }
.copper-outlook-chart-block + .copper-outlook-chart-block { border-right: 1px solid var(--border); }
.copper-outlook-block-heading {
  min-height: 52px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.copper-outlook-block-heading strong { display: block; font-size: 11px; }
.copper-outlook-block-heading span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.copper-outlook-chart { width: 100%; height: 330px; direction: ltr; }
.copper-outlook-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  border-bottom: 1px solid var(--border);
}
.copper-outlook-analysis-block { min-width: 0; }
.copper-outlook-analysis-block + .copper-outlook-analysis-block { border-right: 1px solid var(--border); }
.copper-driver-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.copper-driver {
  min-width: 0;
  min-height: 92px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--border);
}
.copper-driver:nth-child(odd) { border-left: 1px solid var(--border); }
.copper-driver:nth-last-child(-n + 2) { border-bottom: 0; }
.copper-driver-heading { display: flex; align-items: center; gap: 7px; }
.copper-driver-heading i { width: 8px; height: 8px; border-radius: 2px; background: var(--muted); }
.copper-driver.upside .copper-driver-heading i { background: var(--green); }
.copper-driver.downside .copper-driver-heading i { background: var(--red); }
.copper-driver.two-sided .copper-driver-heading i { background: #b98518; }
.copper-driver strong { font-size: 10px; }
.copper-driver p,
.copper-scenario p,
.copper-methodology p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.9;
}
.copper-scenario-list { padding: 0 13px; }
.copper-scenario { padding: 12px 0; border-bottom: 1px solid var(--border); }
.copper-scenario:last-child { border-bottom: 0; }
.copper-scenario strong { font-size: 10px; }
.copper-scenario.base strong { color: var(--blue); }
.copper-scenario.upside strong { color: var(--green); }
.copper-scenario.downside strong { color: var(--red); }
.copper-outlook-notes {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
}
.copper-outlook-notes > * { min-width: 0; }
.copper-outlook-notes > aside { border-right: 1px solid var(--border); }
.copper-research-timeline {
  max-height: 355px;
  margin: 0;
  padding: 4px 13px 8px;
  overflow: auto;
  list-style: none;
}
.copper-research-timeline li {
  min-height: 56px;
  padding: 9px 0;
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid var(--border);
}
.copper-research-timeline li:last-child { border-bottom: 0; }
.copper-research-timeline time { direction: ltr; color: var(--blue); font-size: 9px; font-weight: 700; }
.copper-research-timeline p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.8; }
.copper-research-timeline a { color: var(--text); font-weight: 700; text-decoration: none; }
.copper-research-timeline a:hover { color: var(--blue); }
.copper-methodology { padding: 5px 13px 12px; }
.copper-methodology .limitation {
  padding-right: 9px;
  border-right: 2px solid #b98518;
  color: #6f5c2b;
}
.copper-source-links {
  padding: 0 13px 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.copper-source-link {
  min-height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--text);
  font-size: 8px;
  font-weight: 700;
  text-decoration: none;
}
.copper-source-link:hover { border-color: var(--blue); color: var(--blue); }
.copper-source-link svg { width: 13px; height: 13px; }

.commodity-research-library {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.commodity-research-heading { min-height: 62px; }
.commodity-research-summary { color: var(--muted); font-size: 10px; white-space: nowrap; }
.commodity-research-toolbar {
  padding: 10px 13px;
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(150px, .8fr) minmax(170px, .9fr) minmax(240px, 1.6fr) 34px;
  align-items: end;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}
.research-filter-field,
.research-search-field {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}
.research-filter-field select,
.research-search-input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font: 600 10px "Vazirmatn", Tahoma, sans-serif;
}
.research-filter-field select { padding: 0 9px; outline: 0; }
.research-filter-field select:focus,
.research-search-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,122,85,.1); }
.research-search-input {
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.research-search-input svg { width: 14px; height: 14px; flex: 0 0 auto; }
.research-search-input input {
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 600 10px "Vazirmatn", Tahoma, sans-serif;
}
.commodity-research-sources {
  padding: 8px 13px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.research-source-chip {
  min-width: max-content;
  height: 29px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 8px;
}
.research-source-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.research-source-chip[data-status="blocked_or_unavailable"] i,
.research-source-chip[data-status="failed"] i { background: var(--red); }
.research-source-chip[data-status="pending"] i,
.research-source-chip[data-status=""] i { background: var(--amber); }
.research-source-chip b { color: var(--text); font-size: 9px; }
.commodity-report-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.commodity-report-card {
  min-width: 0;
  min-height: 190px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.commodity-report-card:nth-child(2n) { border-left: 0; }
.commodity-report-card:hover { background: #fbfcfd; }
.commodity-report-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 8px;
}
.commodity-report-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commodity-report-meta time { direction: ltr; white-space: nowrap; }
.commodity-report-card h4 {
  min-height: 39px;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.8;
}
.commodity-report-card h4 a { color: inherit; text-decoration: none; }
.commodity-report-card h4 a:hover { color: var(--blue); }
.commodity-report-authors {
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
}
.commodity-report-authors svg { width: 13px; height: 13px; }
.commodity-report-summary {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: #526273;
  font-size: 9px;
  line-height: 1.85;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.commodity-report-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.commodity-report-tag {
  min-height: 21px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  background: #eef4f7;
  color: #456171;
  font-size: 7px;
}
.commodity-report-insight {
  margin-top: auto;
  padding: 8px 9px;
  border-right: 3px solid var(--amber);
  background: #fffaf0;
  color: #5d5140;
  font-size: 8px;
  line-height: 1.8;
}
.commodity-report-actions { display: flex; align-items: center; gap: 7px; }
.commodity-report-link {
  height: 29px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--blue);
  font-size: 8px;
  font-weight: 700;
  text-decoration: none;
}
.commodity-report-link svg { width: 13px; height: 13px; }
.commodity-report-link:hover { border-color: var(--blue); }
.commodity-report-status { color: var(--muted); font-size: 8px; }
.commodity-research-empty { min-height: 120px; padding: 35px; color: var(--muted); text-align: center; font-size: 10px; }
.commodity-research-pagination {
  min-height: 0;
  display: flex;
  justify-content: center;
}
.commodity-research-load-more {
  min-width: 190px;
  margin: 12px;
  justify-content: center;
}
.commodity-research-load-more svg { width: 14px; height: 14px; }

.status-message { min-height: 20px; margin-top: 10px; color: var(--red); font-size: 12px; }

.loading-layer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: rgba(243, 245, 247, 0.84);
  backdrop-filter: blur(3px);
}

.loading-layer.active { display: flex; }
.loading-layer strong { font-size: 13px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border-strong); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }

.empty-state { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1250px) {
  .screener-toolbar { grid-template-columns: minmax(220px, 1fr) 160px minmax(180px, 0.8fr); }
  .screener-search-control { grid-column: 1 / -1; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .commodity-quote-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .commodity-research-toolbar { grid-template-columns: repeat(3, minmax(150px, 1fr)) 34px; }
  .research-search-field { grid-column: 1 / -2; grid-row: 2; }
  #commodityResearchRefresh { grid-column: -2; grid-row: 2; }
}

@media (max-width: 820px) {
  .header-inner { flex-wrap: wrap; align-items: flex-start; padding: 10px 14px; }
  .brand-block { min-width: 0; }
  .brand-block p { display: none; }
  .brand-symbol { width: 42px; height: 42px; }
  .brand-wordmark { font-size: 26px; }
  .brand-context { display: none; }
  .header-actions { flex: 1; justify-content: flex-end; }
  .primary-nav { padding: 0 14px; gap: 24px; overflow-x: auto; scrollbar-width: none; }
  .primary-nav::-webkit-scrollbar { display: none; }
  .primary-nav-button { flex: 0 0 auto; }
  .notification-panel { position: fixed; top: 116px; right: 12px; left: 12px; width: auto; }
  .symbol-picker { width: min(100%, 360px); }
  .screener-shell { padding: 12px 12px 30px; }
  .screener-heading { align-items: flex-start; }
  .screener-heading h2 { font-size: 19px; }
  .screener-toolbar { grid-template-columns: 1fr 1fr; }
  .metric-control, .screener-search-control { grid-column: 1 / -1; }
  .screener-table-wrap { max-height: calc(100vh - 390px); }
  .dashboard-shell { padding: 12px 12px 30px; }
  .commodity-shell { padding: 12px 12px 30px; }
  .commodity-heading { align-items: flex-start; }
  .commodity-heading h2 { font-size: 19px; }
  .commodity-quote-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commodity-assumption-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commodity-analysis-grid { grid-template-columns: 1fr; }
  .commodity-price-panel { grid-row: auto; }
  .commodity-chart { height: 360px; }
  .copper-outlook-kpis { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .copper-outlook-chart-grid,
  .copper-outlook-analysis-grid,
  .copper-outlook-notes { grid-template-columns: 1fr; }
  .copper-outlook-chart-block + .copper-outlook-chart-block,
  .copper-outlook-analysis-block + .copper-outlook-analysis-block,
  .copper-outlook-notes > aside { border-top: 1px solid var(--border); border-right: 0; }
  .commodity-research-toolbar { grid-template-columns: 1fr 1fr 34px; }
  .research-search-field { grid-column: 1 / -2; grid-row: auto; }
  #commodityResearchRefresh { grid-column: -2; grid-row: auto; }
  .commodity-report-list { grid-template-columns: 1fr; }
  .commodity-report-card { border-left: 0; }
  .company-strip { align-items: flex-start; }
  .company-strip h2 { font-size: 17px; }
  .freshness-block { min-width: 130px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .working-capital-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .working-capital-kpi { border-bottom: 1px solid var(--border); }
  .working-capital-kpi:nth-child(even) { border-left: 0; }
  .working-capital-kpi:last-child { border-bottom: 0; }
  .symbol-market-grid { grid-template-columns: 1fr; }
  .symbol-market-price-panel { grid-row: auto; }
  .symbol-market-chart { height: 380px; }
  .chart-grid, .ownership-grid { grid-template-columns: 1fr; }
  .chart-panel.wide, .ownership-grid .wide { grid-column: auto; }
  .chart, .chart-panel.wide .chart { height: 320px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .ownership-toolbar { align-items: flex-end; }
  .ownership-graph-stage { grid-template-columns: 1fr; grid-template-rows: 520px auto; }
  .ownership-graph, .ownership-legend, .ownership-graph-status { grid-column: 1; grid-row: 1; }
  .ownership-inspector { grid-column: 1; grid-row: 2; max-height: 430px; border-top: 1px solid var(--border); border-right: 0; }
  .ownership-support-chart { height: 520px; }
}

@media (max-width: 540px) {
  .header-inner { flex-wrap: wrap; }
  .brand-block { width: 100%; justify-items: end; }
  .brand-symbol { width: 38px; height: 38px; }
  .brand-wordmark { font-size: 24px; }
  .header-actions { width: 100%; }
  .symbol-picker { width: 100%; }
  .notification-panel { top: 160px; }
  .notification-list { max-height: calc(100vh - 389px); }
  .screener-heading { display: block; }
  .screener-freshness { margin-top: 11px; text-align: right; }
  .screener-toolbar { grid-template-columns: 1fr; }
  .metric-control, .screener-search-control { grid-column: auto; }
  .screener-note { display: none; }
  .screener-table-wrap { max-height: calc(100vh - 510px); min-height: 320px; }
  .company-strip { display: block; }
  .working-capital-summary-heading { align-items: flex-start; flex-direction: column; }
  .working-capital-quality { white-space: normal; }
  .working-capital-kpi-grid { grid-template-columns: 1fr; }
  .working-capital-kpi,
  .working-capital-kpi:nth-child(even) { border-left: 0; }
  .commodity-heading { display: block; }
  .commodity-freshness { min-width: 0; margin-top: 12px; text-align: right; }
  .commodity-quote-grid { grid-template-columns: 1fr; }
  .commodity-quote-card { min-height: 120px; }
  .commodity-assumption-grid { grid-template-columns: 1fr; }
  .commodity-section-heading.chart-heading { align-items: flex-start; flex-direction: column; }
  .commodity-instrument-tabs { width: 100%; }
  .commodity-chart { height: 310px; }
  .symbol-market-heading { align-items: flex-start; flex-direction: column; }
  .symbol-market-chart { height: 320px; }
  .symbol-market-chart.compact { height: 250px; }
  .symbol-market-detail-list { grid-template-columns: 1fr; }
  .copper-outlook-heading { align-items: flex-start; flex-direction: column; }
  .copper-outlook-source-date { direction: rtl; white-space: normal; }
  .copper-outlook-kpis { grid-template-columns: 1fr 1fr; }
  .copper-outlook-chart { height: 300px; }
  .copper-driver-list { grid-template-columns: 1fr; }
  .copper-driver,
  .copper-driver:nth-child(odd),
  .copper-driver:nth-last-child(-n + 2) { border-bottom: 1px solid var(--border); border-left: 0; }
  .copper-driver:last-child { border-bottom: 0; }
  .copper-research-timeline li { grid-template-columns: 1fr; gap: 4px; }
  .commodity-detail-list { grid-template-columns: 1fr; }
  .commodity-research-heading { align-items: flex-start; flex-direction: column; }
  .commodity-research-summary { white-space: normal; }
  .commodity-research-toolbar { grid-template-columns: 1fr 34px; }
  .research-filter-field { grid-column: 1 / -1; }
  .research-search-field { grid-column: 1; }
  #commodityResearchRefresh { grid-column: 2; grid-row: 4; }
  .commodity-report-card h4 { min-height: 0; }
  .freshness-block { margin-top: 12px; text-align: right; }
  .kpi-card { min-height: 88px; }
  .kpi-value { font-size: 17px; }
  .tab-button { padding: 10px 12px; }
  .chart-mode-heading { align-items: flex-start; }
  .chart-mode-control { width: 100%; }
  .chart-mode-control .segment-button,
  .chart-mode-control .segment-button[data-raw-material-mode="sales-percent"] {
    min-width: 0;
    flex: 1;
  }
  .regression-heading { flex-wrap: wrap; }
  .regression-window-control { margin-inline-start: auto; }
  .regression-model-strip { align-items: stretch; gap: 9px; }
  .regression-model {
    width: 100%;
    display: grid;
    grid-template-columns: 21px minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 3px;
  }
  .regression-model-line { grid-column: 1; grid-row: 1; align-self: center; }
  .regression-model strong, .regression-stat { grid-column: 2; }
  .chart, .chart-panel.wide .chart { height: 290px; }
  .ownership-heading { align-items: flex-start; }
  .ownership-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .direction-control { grid-column: 1 / -1; }
  .direction-control .segment-button { flex: 1; }
  .range-control, .select-control { min-width: 0; }
  .range-control input, .ownership-threshold-control input, .select-control select { width: 100%; min-width: 0; }
  .ownership-graph-stage { grid-template-rows: 430px auto; }
  .ownership-support-chart { height: 430px; }
  .ownership-analytics-grid { grid-template-columns: 1fr; }
  .ownership-analysis-section, .ownership-analysis-section.wide-analysis { grid-column: auto; border-left: 0; }
}
