/* Economy Desk — Visual System V1
   Authority layer loaded after legacy styles. */
:root{
  --vs-space-1:4px;--vs-space-2:8px;--vs-space-3:12px;--vs-space-4:16px;
  --vs-space-5:24px;--vs-space-6:32px;--vs-space-7:48px;
  --vs-radius-sm:8px;--vs-radius-md:12px;--vs-radius-lg:16px;
  --vs-body:15px;--vs-meta:12px;--vs-card:14px;--vs-table:13px;
  --vs-control:36px;--vs-touch:44px;--vs-line:1.55;
}
html{font-size:16px}
body{font-size:var(--vs-body);line-height:var(--vs-line);text-rendering:optimizeLegibility}
html[lang="ar"] body{font-size:16px}
.topbar{height:64px;padding-inline:24px;gap:18px}
.brand{gap:10px}.brand img{width:38px;height:38px}.brand b{font-size:14px}.brand small{font-size:12px}
.top-actions{gap:8px}.top-actions:before{display:none}
.top-actions .icon-btn,.top-actions .chip{min-width:var(--vs-control);height:var(--vs-control);min-height:var(--vs-control)}
.top-actions .icon-btn{width:var(--vs-control)}.top-actions .chip{padding-inline:10px;font-size:12px}
.theme-toggle{width:58px;height:36px}.theme-toggle span{height:28px}
.live-state{font-size:12px;gap:7px}.live-state i{width:8px;height:8px}

.desk-tabs{top:64px;min-height:46px;padding:6px 24px;gap:4px;justify-content:center}
.desk-tabs button{font-size:13px;padding:9px 12px;border-radius:var(--vs-radius-sm);font-weight:700}
.market-ticker{display:grid;grid-template-columns:36px minmax(0,1fr) 36px 34px;gap:4px;align-items:center;padding:8px 16px;overflow:hidden}
.ticker-nav,.ticker-customize-btn{width:36px;height:36px;min-width:36px;border:0;background:transparent;box-shadow:none;border-radius:50%;color:var(--muted)}
.ticker-nav:hover,.ticker-customize-btn:hover{background:var(--panel2);color:var(--text);border:0}
.ticker-nav .ui-icon,.ticker-customize-btn .ui-icon{width:15px;height:15px}
.ticker-nav-prev{grid-column:1}.ticker-track{grid-column:2}.ticker-nav-next{grid-column:3}.ticker-customize-btn{grid-column:4;grid-row:1}
.ticker-track{width:100%;max-width:none;margin:0;padding:0;display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x proximity}
.ticker-item{flex:0 0 clamp(180px,15vw,220px);min-width:180px;min-height:76px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--vs-radius-md);background:var(--panel);grid-template-columns:minmax(0,1fr) 78px}
.ticker-item.up,.ticker-item.down{background:var(--panel);border-color:var(--line)}
.ticker-item>div{gap:4px}.ticker-item span{font-size:12px;line-height:1.35;white-space:normal;overflow:visible;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.ticker-item strong{font-size:18px}.ticker-item small{font-size:12px;color:var(--muted)}
.ticker-item.up small,.ticker-item.up strong{color:var(--good)}.ticker-item.down small,.ticker-item.down strong{color:var(--bad)}
.shell{padding-top:24px}
.hero-pro{min-height:0;margin-top:0;padding:24px;border-radius:var(--vs-radius-lg);display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,.9fr);grid-template-areas:"copy media" "side side";gap:20px 24px}
.hero-copy{grid-area:copy;align-self:center}.hero-media{grid-area:media;min-height:220px;max-height:280px}
.hero-side{grid-area:side;grid-template-columns:170px minmax(0,1fr);gap:12px;min-width:0}
.hero-signal-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.hero-signal:first-child{grid-column:auto}
.hero-copy h1,html[data-theme="light"] .hero h1{font-size:clamp(34px,3vw,46px);line-height:1.18;margin-block:8px 12px}
.hero-copy .lead{font-size:15px;line-height:1.8;max-width:720px}
.hero-status>span,.hero-status>small,.hero-signal.compact header>span,.hero-signal.compact header>span b,.hero-signal.compact header em,.hero-signal-unit,.hero-signal.compact footer span,.hero-signal.compact footer small{font-size:12px;white-space:normal}
.hero-status>strong{font-size:16px}
.section-head{gap:18px;margin-bottom:16px}.section-head h2,.visual-head h2{font-size:22px;line-height:1.3}
.eyebrow,.visual-kicker{font-size:12px}.micro,.section-head .micro{font-size:13px;line-height:1.65}
.priority-market-grid,.geo-watch-grid,.indicator-grid,.sources-grid{gap:12px}
.priority-card,.geo-card,.indicator-card,.source-card,.official-rate-card,.tool-card,.visual-panel{border-radius:var(--vs-radius-md);padding:16px}
.priority-card header b,.geo-card header b,.source-card strong{font-size:14px}
.priority-card header small,.priority-cadence,.priority-unit,.priority-card footer,.priority-quality,.geo-metric>small,.geo-metric>span,.geo-card footer span,.geo-card footer em{font-size:12px}
.priority-card>strong,.geo-metric>strong{font-size:24px}
.country-head,.news-head{font-size:12px;padding:11px 14px}
.country-row,.news-row,.official-rate-row{font-size:var(--vs-table);padding:12px 14px;min-height:58px}
.country-row>span,.news-row>span,.official-rate-row>span{font-size:13px;line-height:1.55}
.country-row strong,.news-title strong{font-size:14px}.country-row small,.news-title small,.news-date{font-size:12px}
.source-pill,.source-tag,.card-meta,.fx-card span,.fx-card small,.pulse-card>div small,.pulse-card em,.editor-alert,.tool-note,.feed-footer{font-size:12px}
.analysis-status,.analysis-status b,.analysis-status small{font-size:12px}
.analysis-kpis span,.analysis-kpis small{font-size:12px}.analysis-kpis strong{font-size:26px}
.analysis-rule-card header small,.analysis-rule-card header b,.analysis-rule-card header em,.analysis-rule-card p,.analysis-rule-meta span,.analysis-rule-meta span>b,.analysis-truth-card header small,.analysis-truth-card header b,.analysis-truth-card li{font-size:12px}
.analysis-rule-card h3,.analysis-audit-head h3{font-size:16px}
.analysis-audit-head small,.analysis-audit-head>span,.analysis-audit-row b,.analysis-audit-row small,.analysis-audit-row>span,.analysis-audit-row bdi{font-size:12px}
.settings-panel{width:min(420px,calc(100vw - 32px));padding:16px;border-radius:var(--vs-radius-md)}
.settings-head{margin-bottom:12px}.settings-head strong{font-size:15px}
.settings-panel label,.type-settings>label{font-size:13px;grid-template-columns:130px minmax(0,1fr);gap:12px}
.settings-panel select{min-height:38px;font-size:13px}
.type-settings{padding:12px;gap:10px}.type-settings-head strong{font-size:13px}.type-settings-head button{font-size:12px}
.type-settings output{font-size:12px}
.spark-wrap{position:relative;min-width:0;width:100%;height:58px;padding:7px 4px 13px;outline:none;cursor:crosshair}
.sparkline{width:100%;height:38px;overflow:visible}.sparkline polyline{stroke-width:2;fill:none}
.spark-point{fill:transparent;stroke:transparent;stroke-width:8;vector-effect:non-scaling-stroke}
.spark-wrap:hover .spark-point,.spark-wrap:focus .spark-point{fill:var(--panel);stroke:currentColor;stroke-width:1.5}
.spark-x,.spark-y{position:absolute;font-size:10px;color:var(--muted);line-height:1;pointer-events:none}
.spark-start{inset-inline-start:4px;bottom:0}.spark-end{inset-inline-end:4px;bottom:0}
.spark-max{inset-inline-end:4px;top:0}.spark-min{inset-inline-end:4px;bottom:14px}
.movement-card .spark-wrap{height:82px}.movement-card .sparkline{height:58px}
html[data-density="compact"] .country-row,html[data-density="compact"] .news-row,html[data-density="compact"] .official-rate-row{min-height:52px;padding-block:9px}
html[data-density="compact"] .indicator-card,html[data-density="compact"] .priority-card,html[data-density="compact"] .geo-card{padding:13px}
html[data-density="comfortable"] .country-row,html[data-density="comfortable"] .news-row,html[data-density="comfortable"] .official-rate-row{min-height:60px;padding-block:13px}
html[data-density="comfortable"] .indicator-card,html[data-density="comfortable"] .priority-card,html[data-density="comfortable"] .geo-card{padding:17px}
@media(max-width:1100px){
  .topbar{padding-inline:16px}.brand small{display:none}.desk-tabs{justify-content:flex-start}
  .hero-pro{grid-template-columns:1fr 1fr}.hero-side{grid-template-columns:150px minmax(0,1fr)}
  .hero-signal-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .priority-market-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .geo-watch-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  :root{--vs-body:15px;--vs-table:13px}
  .topbar{height:60px;padding-inline:10px;gap:8px}.brand img{width:34px;height:34px}.brand b{font-size:13px}
  .top-actions{gap:4px}.top-actions .icon-btn,.top-actions .chip,.theme-toggle{min-width:44px;height:44px;min-height:44px}
  .top-actions .icon-btn{width:44px}.theme-toggle{width:52px}.live-state span{display:none}
  .desk-tabs{top:60px;min-height:44px;padding:5px 8px;gap:4px}.desk-tabs button{font-size:12px;padding:9px 10px}
  .market-ticker{grid-template-columns:44px minmax(0,1fr) 44px 44px;padding:6px 4px;gap:0}
  .ticker-nav,.ticker-customize-btn{width:44px;height:44px;min-width:44px}
  .ticker-item{flex-basis:178px;min-width:178px;min-height:74px}
  .shell{padding:16px 12px 52px}
  .hero-pro{grid-template-columns:1fr;grid-template-areas:"copy" "media" "side";padding:18px;gap:16px}
  .hero-media{min-height:190px;max-height:220px}.hero-side{grid-template-columns:1fr}.hero-signal-grid{grid-template-columns:1fr}
  .hero-copy h1,html[data-theme="light"] .hero h1{font-size:30px}.hero-copy .lead{font-size:15px}
  .section-head{display:grid;gap:6px}.section-head h2,.visual-head h2{font-size:20px}
  .priority-market-grid{display:flex;overflow-x:auto;scroll-snap-type:x proximity}.priority-card{flex:0 0 78vw;max-width:300px;scroll-snap-align:start}
  .geo-watch-grid,.sources-grid,.analysis-kpis,.analysis-workbench{grid-template-columns:1fr}
  .country-head,.news-head{display:none}.country-table,.news-table{border:0;overflow:visible}
  .country-row,.news-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;border:1px solid var(--line);border-radius:var(--vs-radius-md);margin-bottom:10px;padding:14px}
  .country-row .country-name,.news-row .news-title{grid-column:1/-1}.country-row>span,.news-row>span{font-size:13px}
  .settings-panel{top:66px;inset-inline:8px;width:auto;max-height:calc(100vh - 78px);overflow:auto}
  .settings-panel label,.type-settings>label{grid-template-columns:1fr;gap:6px}
}
@media(max-width:430px){
  .brand span small{display:none}.brand{gap:7px}
  .top-actions .chip{padding-inline:7px}.theme-toggle{width:48px}
  .desk-tabs button{font-size:12px}
  .market-ticker{grid-template-columns:44px minmax(0,1fr) 44px}
  .ticker-customize-btn{position:absolute;inset-inline-end:6px;top:calc(100% + 6px);z-index:4;background:var(--panel);border:1px solid var(--line)}
  .ticker-track{padding-inline:2px}.ticker-item{flex-basis:168px;min-width:168px}
  .hero-copy h1,html[data-theme="light"] .hero h1{font-size:28px}
  .hero-media{min-height:170px}.priority-card{flex-basis:84vw}
  .country-row,.news-row{grid-template-columns:1fr}.country-row .country-name,.news-row .news-title{grid-column:auto}
  .analysis-audit-row{grid-template-columns:1fr}.analysis-audit-row>div:last-child{grid-column:auto}
}
/* Legacy override quarantine — only where old !important rules violate V1 standards. */
@media(max-width:760px){
  .top-actions{gap:4px!important}
  .top-actions .icon-btn{width:44px!important;height:44px!important;min-height:44px!important}
  .top-actions .chip{height:44px!important;min-height:44px!important;padding-inline:8px!important;font-size:12px!important}
  .desk-tabs{top:60px!important;padding-inline:8px!important;gap:4px!important}
  .desk-tabs button{font-size:12px!important;padding-inline:10px!important}
  .settings-panel{top:66px!important;inset-inline:8px!important;width:auto!important;padding:14px!important;border-radius:12px!important;max-height:calc(100vh - 78px)!important}
  .type-settings{padding:12px!important;gap:10px!important}
  .type-settings>label,.settings-panel>label:not(.accent-setting){grid-template-columns:1fr!important;gap:6px!important;font-size:13px!important}
  .type-settings>label>div{grid-template-columns:minmax(120px,1fr) 48px!important;gap:8px!important}
}
