@font-face {
  font-family: "Pinar";
  src: url("/static/fonts/Pinar-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Pinar";
  src: url("/static/fonts/Pinar-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #16191f;
  --muted: #69717d;
  --line: #dfe3e8;
  --line-soft: #edf0f3;
  --blue: #1467e9;
  --blue-soft: #eef5ff;
  --green: #138a49;
  --red: #df3344;
  --radius: 11px;
  --font: "Pinar", Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.7; }
button, input { font: inherit; }
button { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar { height: 72px; padding: 0 28px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.97); }
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 750; font-size: 22px; }
.brand-mark { color: var(--blue); display: inline-flex; }
.brand-mark svg { width: 29px; height: 29px; stroke-width: 2.2; }
.main-nav { display: flex; align-items: stretch; height: 72px; gap: 38px; }
.nav-item { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 5px; display: inline-flex; gap: 8px; align-items: center; color: #4b535f; font-weight: 600; cursor: pointer; }
.nav-item.active { color: var(--blue); border-bottom-color: var(--blue); }
.topbar form { justify-self: end; margin: 0; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; transition: border-color .18s, background .18s; }
.icon-button:hover { border-color: #b8c1cd; background: #fafbfc; }
.icon-button:focus-visible, .nav-item:focus-visible, .primary-button:focus-visible, tr:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid rgba(20,103,233,.18); outline-offset: 2px; }
.user-button { border-radius: 50%; }
.app-shell { max-width: 1560px; margin: 0 auto; padding: 36px 28px 60px; }
.overview { display: grid; grid-template-columns: minmax(270px,1fr) auto auto; grid-template-areas: "title summary button"; gap: 36px; align-items: center; margin-bottom: 32px; }
.overview-title { grid-area: title; }
.overview-title h1 { margin: 0 0 4px; font-size: clamp(25px, 2.3vw, 36px); line-height: 1.35; letter-spacing: -.5px; }
.overview-title p { margin: 0; color: var(--muted); max-width: 600px; }
.summary-strip { grid-area: summary; display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.summary-item { min-width: 145px; padding: 13px 18px; display: flex; flex-direction: column; gap: 3px; border-left: 1px solid var(--line); }
.summary-item:last-child { border-left: 0; }
.summary-item span { font-size: 12px; color: var(--muted); }
.summary-item strong { font-size: 16px; white-space: nowrap; }
.primary-button { grid-area: button; border: 1px solid var(--blue); border-radius: 9px; color: #fff; background: var(--blue); min-height: 46px; padding: 0 19px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 10px rgba(20,103,233,.16); }
.primary-button:hover { background: #0d5dd7; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.status-message { min-height: 0; color: var(--blue); margin: -16px 0 18px; font-size: 13px; }
.status-message:not(:empty) { min-height: 24px; }
.workspace { display: grid; grid-template-columns: minmax(620px, 1.45fr) minmax(370px, .95fr); gap: 20px; align-items: start; direction: ltr; }
.market-list, .detail-panel { direction: rtl; }
.market-list, .detail-panel { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.table-toolbar { min-height: 66px; padding: 12px 15px 12px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.table-toolbar h2 { margin: 0; font-size: 17px; }
.table-toolbar span { color: var(--muted); font-size: 12px; }
.table-wrap { overflow: auto; max-height: 660px; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
thead { position: sticky; top: 0; z-index: 2; background: #fafbfc; }
th { color: var(--muted); font-size: 12px; font-weight: 600; text-align: right; padding: 11px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); height: 57px; white-space: nowrap; }
tbody tr { cursor: pointer; transition: background .15s; }
tbody tr:hover { background: #fafcff; }
tbody tr.selected { background: var(--blue-soft); box-shadow: inset -3px 0 var(--blue); }
.asset-cell { display: flex; align-items: center; gap: 11px; }
.asset-glyph { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: #454d58; font-size: 11px; font-weight: 800; direction: ltr; background: #fff; }
.asset-meta { display: flex; flex-direction: column; line-height: 1.45; }
.asset-meta small { direction: ltr; text-align: right; color: var(--muted); font-size: 11px; }
.price { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.positive { color: var(--green); direction: ltr; }
.negative { color: var(--red); direction: ltr; }
.signal { font-size: 12px; font-weight: 700; }
.signal.bullish { color: var(--green); }
.signal.bearish { color: var(--red); }
.signal.neutral { color: #5f6874; }
.confidence-cell { min-width: 130px; }
.confidence-value { display: inline-block; min-width: 38px; direction: ltr; }
.confidence-track { display: inline-block; width: 64px; height: 4px; background: #e5e9ee; border-radius: 9px; overflow: hidden; vertical-align: middle; margin-right: 7px; }
.confidence-track i { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.loading-cell { text-align: center; color: var(--muted); height: 180px; }
.detail-panel { padding: 17px; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); padding: 0 2px 14px; }
.detail-heading > div { display: flex; align-items: baseline; gap: 8px; }
.detail-heading h2 { margin: 0; font-size: 20px; }
.detail-heading #detail-symbol { color: var(--muted); direction: ltr; }
.outlook { margin: 14px 0; padding: 15px; border: 1px solid var(--line); border-radius: 9px; }
.outlook h3, .chart-section h3 { margin: 0 0 5px; font-size: 14px; }
.outlook p { margin: 0; color: #4d5560; }
.chart-section { border: 1px solid var(--line); border-radius: 9px; padding: 14px; }
.section-title { display: flex; justify-content: space-between; align-items: center; }
.section-title span { color: var(--muted); font-size: 11px; }
.chart-placeholder { height: 240px; display: grid; place-items: center; color: var(--muted); font-size: 12px; overflow: hidden; }
.chart-placeholder svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: #edf0f3; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.chart-area { fill: rgba(20,103,233,.06); stroke: none; }
.chart-label { font-family: var(--font); font-size: 10px; fill: #7a828d; stroke: none; }
.analysis-accordions { margin-top: 14px; display: grid; gap: 9px; }
details { border: 1px solid var(--line); border-radius: 9px; padding: 0 14px; }
summary { list-style: none; min-height: 48px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 700; }
summary::-webkit-details-marker { display: none; }
summary svg { width: 17px; transition: transform .15s; }
details[open] summary svg { transform: rotate(180deg); }
details p { margin: -2px 0 12px; color: #535b66; }
details small { display: block; direction: ltr; text-align: right; color: var(--muted); margin: -5px 0 12px; }
.secondary-view { max-width: 920px; margin: 20px auto; }
.secondary-view h2 { font-size: 28px; }
.report-surface { border-top: 1px solid var(--line); padding: 25px 0; }
.report-surface h3 { font-size: 21px; }
.report-surface p { font-size: 16px; line-height: 2; color: #48505b; }
.settings-list { border-top: 1px solid var(--line); }
.settings-list > div { display: flex; justify-content: space-between; gap: 25px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.settings-list span { color: var(--muted); }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-shell { width: min(430px, 100%); }
.brand-auth { justify-content: center; margin-bottom: 30px; }
.login-panel { border: 1px solid var(--line); border-radius: 14px; padding: 34px; }
.login-panel h1 { margin: 0; font-size: 28px; }
.login-panel > p { margin: 4px 0 25px; color: var(--muted); }
.login-form { display: grid; gap: 8px; }
.login-form label { font-weight: 650; margin-top: 7px; }
.login-form input { width: 100%; height: 47px; border: 1px solid #cfd5dc; border-radius: 8px; padding: 0 12px; background: #fff; }
.login-form input:focus { border-color: var(--blue); outline: 3px solid rgba(20,103,233,.12); }
.full-button { width: 100%; margin-top: 14px; }
.form-error { color: var(--red); background: #fff5f6; border: 1px solid #ffd4d9; border-radius: 8px; padding: 9px 11px; margin-bottom: 10px; }
.legal-note { font-size: 12px; text-align: center; margin: 20px 0 0 !important; }
@media (max-width: 1150px) {
  .overview { grid-template-columns: 1fr auto; grid-template-areas: "title button" "summary summary"; }
  .summary-strip { justify-self: stretch; }
  .summary-item { flex: 1; }
  .workspace { grid-template-columns: minmax(540px, 1.25fr) minmax(330px, .8fr); }
}
@media (max-width: 900px) {
  .topbar { padding: 0 18px; grid-template-columns: 1fr auto; }
  .main-nav { position: fixed; bottom: 0; right: 0; left: 0; height: 64px; background: #fff; border-top: 1px solid var(--line); justify-content: space-around; gap: 0; z-index: 20; }
  .nav-item { flex: 1; justify-content: center; border-bottom: 0; border-top: 2px solid transparent; }
  .nav-item.active { border-top-color: var(--blue); }
  .app-shell { padding: 25px 18px 90px; }
  .workspace { grid-template-columns: 1fr; }
  .detail-panel { order: -1; }
}
@media (max-width: 640px) {
  body { font-size: 13px; }
  .topbar { height: 62px; }
  .brand { font-size: 18px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .overview { grid-template-columns: 1fr; grid-template-areas: "title" "summary" "button"; gap: 17px; }
  .overview-title h1 { font-size: 26px; }
  .summary-strip { width: 100%; overflow-x: auto; }
  .summary-item { min-width: 130px; padding: 10px 13px; }
  .primary-button { width: 100%; }
  .detail-panel { padding: 12px; }
  .chart-placeholder { height: 190px; }
  .nav-item { flex-direction: column; gap: 0; font-size: 11px; padding: 5px; }
  .nav-item svg { width: 18px; height: 18px; }
  .settings-list > div { flex-direction: column; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* Analysis-only workspace */
.analysis-header { height: 72px; padding: 0 clamp(22px,4vw,58px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: #fff; position: sticky; top: 0; z-index: 20; }
.analysis-header form { margin: 0; }
.logout-button { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; }
.logout-button:hover { color: var(--text); }
.logout-button:focus-visible { outline: 3px solid rgba(20,103,233,.16); outline-offset: 2px; border-radius: 7px; }
.analysis-shell { max-width: 1420px; margin: 0 auto; padding: 32px clamp(22px,4vw,58px) 40px; }
.analysis-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 20px; }
.analysis-intro h1 { margin: 0; font-size: clamp(30px,3vw,43px); line-height: 1.3; }
.analysis-intro p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.analysis-actions { display: flex; align-items: end; gap: 12px; }
.asset-select-label { display: grid; gap: 5px; min-width: 310px; }
.asset-select-label > span:first-child { color: var(--muted); font-size: 12px; font-weight: 600; }
.select-wrap { position: relative; display: block; }
.select-wrap select { width: 100%; height: 50px; appearance: none; border: 1px solid #ccd3dc; border-radius: 9px; background: #fff; padding: 0 16px 0 44px; color: var(--text); font-family: var(--font); font-weight: 650; cursor: pointer; }
.select-wrap svg { position: absolute; left: 14px; top: 15px; width: 19px; pointer-events: none; color: var(--muted); }
.select-wrap select:focus { border-color: var(--blue); outline: 3px solid rgba(20,103,233,.12); }
.analysis-actions .primary-button { grid-area: auto; width: auto; min-width: 156px; height: 50px; }
.signal-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4,1fr); min-height: 96px; }
.signal-strip > div { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; position: relative; }
.signal-strip > div:not(:last-child)::after { content: ""; position: absolute; left: 0; height: 35%; width: 1px; background: var(--line); }
.signal-strip span { color: var(--muted); font-size: 12px; }
.signal-strip strong { font-size: 18px; font-weight: 700; }
.signal-strip .signal { font-size: 19px; }
.outlook-band { padding: 20px 0; border-bottom: 1px solid var(--line); }
.outlook-band h2, .analysis-section-heading h2, .alternatives h2 { margin: 0 0 7px; font-size: 19px; }
.outlook-band p { margin: 0; color: #4c5561; font-size: 15px; line-height: 2; }
.outlook-band .report-copy { color: var(--muted); font-size: 13px; margin-top: 4px; }
.price-analysis { padding: 17px 0 12px; border-bottom: 1px solid var(--line); }
.analysis-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 8px; }
.timeframe-tabs { display: flex; direction: rtl; gap: 8px; }
.timeframe { height: 34px; min-width: 86px; padding: 0 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #4f5864; font-family: var(--font); font-size: 12px; font-weight: 650; cursor: pointer; }
.timeframe:hover { border-color: #b6c0cc; }
.timeframe.active { color: #fff; border-color: var(--blue); background: var(--blue); }
.timeframe:focus-visible { outline: 3px solid rgba(20,103,233,.15); outline-offset: 2px; }
.analysis-chart { height: 260px; display: grid; place-items: center; color: var(--muted); font-size: 12px; overflow: hidden; }
.analysis-chart svg { width: 100%; height: 100%; }
.analysis-disclosures { border-bottom: 1px solid var(--line); }
.analysis-disclosures details { padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.analysis-disclosures details:last-child { border-bottom: 0; }
.analysis-disclosures summary { min-height: 54px; padding: 0 2px; gap: 16px; }
.summary-title { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; }
.summary-title > svg { color: var(--muted); width: 22px; height: 22px; }
.analysis-disclosures .chevron { margin-right: auto; color: var(--muted); }
.disclosure-content { display: flex; align-items: baseline; justify-content: space-between; gap: 25px; padding: 0 35px 14px 35px; }
.disclosure-content p { margin: 0; color: #505965; line-height: 1.9; }
.disclosure-content small { direction: ltr; color: var(--muted); }
.alternatives { padding: 20px 0 8px; }
.alternatives-heading { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.alternatives-heading span { color: var(--muted); font-size: 12px; }
.alternatives-list { display: grid; }
.alternative-row { min-height: 58px; display: grid; grid-template-columns: minmax(190px,1fr) 130px 120px 130px; align-items: center; gap: 18px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.alternative-row:hover { background: #fafcff; }
.alternative-asset { display: flex; align-items: center; gap: 11px; }
.alternative-asset .asset-glyph { flex: 0 0 auto; }
.alternative-asset strong { display: block; }
.alternative-asset small { direction: ltr; color: var(--muted); }
.alternative-price, .alternative-return { direction: ltr; text-align: right; }
.alternative-action { justify-self: end; color: var(--blue); background: transparent; border: 1px solid var(--line); border-radius: 7px; min-height: 34px; padding: 0 14px; cursor: pointer; }
.analysis-disclaimer { text-align: center; margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.analysis-shell .status-message { margin: 0; }
.risk-audit { padding: 0 35px 24px; display: grid; gap: 18px; }
.risk-audit h3 { margin: 0; font-size: 16px; }
.risk-note { border-right: 3px solid #f0b24b; padding: 2px 13px 2px 0; }
.risk-note p { margin: 5px 0 0; color: #535d69; line-height: 1.9; }
.model-audit, .gemini-audit { border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: #fff; }
.audit-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 15px; }
.audit-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.audit-status { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.audit-stats { display: grid; grid-template-columns: repeat(4,1fr); margin: 0 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.audit-stats > div { padding: 12px; }
.audit-stats > div:not(:last-child) { border-left: 1px solid var(--line); }
.audit-stats dt { color: var(--muted); font-size: 11px; }
.audit-stats dd { margin: 3px 0 0; font-size: 15px; font-weight: 700; }
.model-results-wrap { overflow-x: auto; }
.model-results { width: 100%; border-collapse: collapse; min-width: 520px; }
.model-results th, .model-results td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); text-align: right; height: auto; }
.model-results th { color: var(--muted); font-size: 11px; background: #fafbfc; }
.model-results td:nth-child(2) { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.gemini-reasoning { margin: 0 0 15px; color: #4f5965; line-height: 1.9; }
.trace-disclosures { display: grid; gap: 8px; }
.trace-disclosures details { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.trace-disclosures summary { min-height: 44px; font-size: 13px; }
.trace-disclosures summary svg { width: 16px; color: var(--muted); }
.trace-disclosures pre { direction: ltr; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 380px; overflow: auto; margin: 0 0 12px; padding: 12px; border-radius: 7px; background: #f7f9fb; color: #28313c; font-family: Consolas, "Courier New", monospace; font-size: 11px; line-height: 1.7; }
.trace-error { margin: 12px 0 0; color: var(--red); font-size: 12px; }

/* Complete login form */
.login-page { min-height: 100vh; position: relative; overflow-x: hidden; background: #fff; display: flex; flex-direction: column; }
.login-header { height: 82px; padding: 0 clamp(24px,5vw,72px); display: flex; align-items: center; position: relative; z-index: 3; }
.login-chart { position: absolute; inset: 180px 0 auto; height: 430px; z-index: 0; opacity: .9; pointer-events: none; }
.login-chart svg { width: 100%; height: 100%; stroke: #dce8f8; fill: none; stroke-width: 1.5; }
.login-chart circle { fill: #fff; stroke: #cfdff3; }
.login-main { flex: 1; display: grid; place-items: center; padding: 30px 20px 45px; position: relative; z-index: 2; }
.login-page .login-panel { width: min(440px,100%); border: 1px solid #cfd8e5; border-radius: 16px; padding: 36px 36px 32px; background: rgba(255,255,255,.96); box-shadow: 0 12px 40px rgba(38,63,95,.04); }
.login-heading { text-align: center; margin-bottom: 27px; }
.login-heading h1 { margin: 0; font-size: 32px; line-height: 1.4; }
.login-heading p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.login-page .login-form { display: grid; gap: 18px; }
.form-field { display: grid; gap: 7px; }
.form-field label { font-weight: 700; font-size: 14px; }
.input-wrap { position: relative; }
.login-page .input-wrap input { width: 100%; height: 52px; border: 1px solid #cbd4df; border-radius: 9px; padding: 0 47px 0 47px; background: #fff; font-family: var(--font); color: var(--text); font-size: 14px; }
.login-page .input-wrap input::placeholder { color: #98a1ad; }
.login-page .input-wrap input:focus { border-color: var(--blue); outline: 3px solid rgba(20,103,233,.12); }
.input-wrap > svg, .input-wrap .field-icon { position: absolute; right: 15px; top: 15px; width: 21px; color: #768397; pointer-events: none; }
.password-toggle { position: absolute; left: 7px; top: 7px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #768397; cursor: pointer; }
.password-toggle:hover { background: #f3f6fa; }
.password-toggle:focus-visible { outline: 3px solid rgba(20,103,233,.14); }
.password-toggle svg { width: 20px; }
.password-toggle .eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.login-page .form-error { margin: -5px 0 0; display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 0; color: var(--red); font-size: 13px; }
.login-page .form-error[hidden] { display: none; }
.login-page .form-error svg { width: 19px; flex: 0 0 auto; }
.remember-row { display: inline-flex; align-items: center; gap: 9px; width: fit-content; cursor: pointer; font-size: 13px; }
.remember-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.login-page .login-submit { grid-area: auto; width: 100%; margin: 0; height: 52px; font-size: 16px; }
.login-footer { min-height: 66px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12px; position: relative; z-index: 2; padding: 14px 20px; }
.login-footer svg { width: 19px; color: #758398; }

@media (max-width: 820px) {
  .analysis-header { height: 64px; }
  .analysis-shell { padding-top: 23px; }
  .analysis-intro { align-items: stretch; flex-direction: column; gap: 18px; }
  .analysis-actions { align-items: stretch; }
  .asset-select-label { min-width: 0; flex: 1; }
  .signal-strip { margin-top: 21px; grid-template-columns: repeat(2,1fr); }
  .signal-strip > div { min-height: 78px; border-bottom: 1px solid var(--line-soft); }
  .signal-strip > div:nth-child(2)::after { display: none; }
  .alternative-row { grid-template-columns: minmax(150px,1fr) 100px 90px; }
  .alternative-action { display: none; }
}
@media (max-width: 560px) {
  .analysis-header .brand { font-size: 18px; }
  .logout-button { font-size: 0; }
  .analysis-intro h1 { font-size: 31px; }
  .analysis-actions { flex-direction: column; }
  .analysis-actions .primary-button { width: 100%; }
  .signal-strip { grid-template-columns: 1fr 1fr; }
  .signal-strip strong, .signal-strip .signal { font-size: 16px; }
  .analysis-section-heading { align-items: stretch; flex-direction: column; }
  .timeframe-tabs { display: grid; grid-template-columns: repeat(3,1fr); }
  .timeframe { min-width: 0; padding: 0 7px; }
  .analysis-chart { height: 210px; }
  .disclosure-content { display: block; padding-right: 33px; padding-left: 8px; }
  .disclosure-content small { margin-top: 7px; }
  .risk-audit { padding: 0 0 18px; }
  .model-audit, .gemini-audit { padding: 14px; }
  .audit-heading { align-items: stretch; flex-direction: column; gap: 9px; }
  .audit-status { width: fit-content; }
  .audit-stats { grid-template-columns: 1fr 1fr; }
  .audit-stats > div:nth-child(2)::after { display: none; }
  .audit-stats > div { border-bottom: 1px solid var(--line-soft); }
  .alternative-row { grid-template-columns: 1fr auto; gap: 10px; }
  .alternative-return { display: none; }
  .login-header { height: 68px; justify-content: center; }
  .login-chart { display: none; }
  .login-main { place-items: start center; padding-top: 25px; }
  .login-page .login-panel { padding: 28px 21px 24px; border-radius: 13px; }
  .login-heading h1 { font-size: 28px; }
  .login-heading p { font-size: 13px; }
  .login-footer { text-align: center; }
}

/* Separate market dashboard */
.analysis-header { display: grid; grid-template-columns: 1fr auto 1fr; }
.analysis-header .main-nav { position: static; inset: auto; justify-self: center; border-top: 0; background: transparent; }
.analysis-header form { justify-self: end; }
.main-nav a { min-width: 74px; height: 100%; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; border-bottom: 2px solid transparent; color: #4b535f; text-decoration: none; font-weight: 700; }
.main-nav a:hover { color: var(--blue); }
.main-nav a.active { color: var(--blue); border-bottom-color: var(--blue); }
.dashboard-timeframe { height: 34px; min-width: 86px; padding: 0 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #4f5864; font-family: var(--font); font-size: 12px; font-weight: 650; cursor: pointer; }
.dashboard-timeframe:hover { border-color: #b6c0cc; }
.dashboard-timeframe.active { color: #fff; border-color: var(--blue); background: var(--blue); }
.dashboard-timeframe:focus-visible { outline: 3px solid rgba(20,103,233,.15); outline-offset: 2px; }
.dashboard-shell { width: min(1540px, calc(100% - 56px)); margin: 0 auto; padding: 34px 0 60px; }
.dashboard-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 22px; }
.dashboard-intro h1 { margin: 0; font-size: clamp(29px, 2.4vw, 38px); line-height: 1.35; }
.dashboard-intro p { margin: 6px 0 0; color: var(--muted); }
.dashboard-updated { white-space: nowrap; font-size: 12px; }
.dashboard-updated strong { color: var(--blue); margin-right: 4px; }
.market-chart-panel, .market-table-panel, .scheduler-panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.market-chart-panel { padding: 18px 22px 14px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.panel-heading h2 { margin: 0; font-size: 18px; }
.panel-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.panel-heading.compact { min-height: 68px; margin: 0; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.market-overview-chart { height: 300px; overflow: hidden; }
.market-overview-chart svg { width: 100%; height: 100%; }
.chart-waiting-line { fill: none; stroke: #9bbce8; stroke-width: 2; stroke-dasharray: 7 7; }
.chart-empty-label, .chart-axis-label, .chart-value-label { font-family: var(--font); fill: #6f7884; stroke: none; }
.chart-empty-label { font-size: 14px; }
.chart-axis-label { font-size: 10px; }
.chart-value-label { font-size: 11px; fill: var(--blue); }
.chart-last-point { fill: var(--blue); stroke: #fff; stroke-width: 2; }
.chart-jalali-range { min-height: 23px; color: var(--muted); font-size: 11px; text-align: center; }
.dashboard-summary { display: grid; grid-template-columns: repeat(3,1fr); margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.dashboard-summary > div { min-height: 86px; padding: 14px 26px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label value" "small value"; align-items: center; }
.dashboard-summary > div:not(:last-child) { border-left: 1px solid var(--line); }
.dashboard-summary span { grid-area: label; color: var(--muted); font-size: 12px; }
.dashboard-summary strong { grid-area: value; font-size: 20px; }
.dashboard-summary small { grid-area: small; color: var(--muted); }
.dashboard-content { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; direction: ltr; }
.market-table-panel, .scheduler-panel { direction: rtl; }
.market-table-scroll { max-height: 570px; overflow: auto; }
.market-table { min-width: 790px; }
.market-table tbody tr { cursor: default; }
.market-table td { height: 58px; }
.table-asset { display: flex; flex-direction: column; line-height: 1.4; }
.table-asset small { color: var(--muted); direction: ltr; text-align: right; }
.table-analysis-link { display: inline-flex; align-items: center; justify-content: center; min-width: 62px; height: 32px; border: 1px solid var(--line); border-radius: 7px; color: var(--blue); text-decoration: none; font-weight: 700; }
.table-analysis-link:hover { border-color: var(--blue); background: var(--blue-soft); }
.scheduler-panel { padding: 18px; }
.scheduler-panel h2 { margin: 0 0 15px; font-size: 17px; }
.scheduler-panel dl { margin: 0; }
.scheduler-panel dl > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.scheduler-panel dt { color: var(--muted); font-size: 12px; }
.scheduler-panel dd { margin: 0; font-weight: 700; font-size: 13px; }
.scheduler-help { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.scheduler-help h3 { margin: 0; font-size: 15px; }
.scheduler-help p { margin: 5px 0 15px; color: var(--muted); font-size: 12px; }
.scheduler-help .primary-button { width: 100%; }

@media (max-width: 980px) {
  .analysis-header { grid-template-columns: auto 1fr auto; }
  .analysis-header .main-nav { gap: 12px; }
  .dashboard-content { grid-template-columns: 1fr; }
  .scheduler-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .scheduler-panel h2 { grid-column: 1 / -1; }
  .scheduler-help { margin: 0; padding: 0 20px 0 0; border-top: 0; border-right: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .analysis-header { padding: 0 14px; }
  .analysis-header .brand span:last-child { display: none; }
  .analysis-header .main-nav { height: 64px; gap: 4px; }
  .main-nav a { min-width: 64px; padding: 0 6px; }
  .dashboard-shell { width: min(100% - 28px, 1540px); padding-top: 24px; }
  .dashboard-intro { align-items: start; flex-direction: column; gap: 8px; }
  .dashboard-updated { margin: 0 !important; }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .panel-heading .timeframe-tabs { display: grid; grid-template-columns: repeat(3,1fr); }
  .dashboard-timeframe { min-width: 0; }
  .market-chart-panel { padding: 15px 12px 10px; }
  .market-overview-chart { height: 250px; }
  .dashboard-summary { grid-template-columns: 1fr; }
  .dashboard-summary > div:not(:last-child) { border-left: 0; border-bottom: 1px solid var(--line); }
  .scheduler-panel { display: block; }
  .scheduler-help { margin-top: 20px; padding: 17px 0 0; border-right: 0; border-top: 1px solid var(--line); }
}
