/* XESUNFX shared visual roles. Page-specific geometry and data colors stay local. */
:root {
  --ds-paper: #f6f5f0;
  --ds-surface: #fff;
  --ds-ink: #13213b;
  --ds-muted: #58657b;
  --ds-accent: #2146d8;
  --ds-accent-hover: #153194;
  --ds-accent-soft: #edf1ff;
  --ds-rule: #d9dddf;
  --ds-field-border: #7b879b;
  --ds-danger: #ad2d25;
  --ds-positive: #17624b;
  --ds-font-family: Manrope, NotoThai, sans-serif;
  --ds-weight-body: 400;
  --ds-weight-label: 600;
  --ds-weight-heading: 600;
  --ds-weight-display: 500;
  --ds-text-support: 12px;
  --ds-text-label: 14px;
  --ds-text-body: 16px;
  --ds-leading-support: 1.65;
  --ds-leading-body: 1.8;
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-space-7: 28px;
  --ds-space-8: 32px;
  --ds-radius-control: 8px;
  --ds-radius-field: 8px;
  --ds-target: 44px;
  --ds-target-primary: 48px;
  --ds-focus-width: 3px;
  --ds-focus-offset: 4px;
  --ds-z-header: 20;
  --ds-z-signup: 40;
  --ds-z-skip: 100;
  --ds-motion-fast: 150ms;
  --ds-ease: ease;
}

/* XESUNFX / shared component system / 2026-11-10
   Direction: ivory paper, dark ink, XESUNFX cobalt; existing 3D and real figures.
   Adapted using unslop by Damir Sokolovsky (@heydamir), CC BY 4.0.
   Replaces the November 9 polish stylesheet; accepted geometry and artwork retained. */

/* 1. Spacing: align the working surfaces to a consistent four-pixel rhythm. */
body.unslop .tool-top{padding:var(--ds-space-7) var(--ds-space-8)}
body.unslop .calculator-grid form{padding:var(--ds-space-8)}
body.unslop .fields{gap:var(--ds-space-6)}
body.unslop .field small{margin-top:var(--ds-space-2)}
body.unslop .ux-field-error{margin-top:var(--ds-space-2)}
body.unslop .result-number{margin:var(--ds-space-3) 0 var(--ds-space-2)}
body.unslop .guide-reader-intro{gap:var(--ds-space-5) var(--ds-space-8)}
body.unslop .guide-reader-intro-copy p,body.unslop .guide-reader-body p{margin-bottom:var(--ds-space-4)}
body.unslop .guide-reader-body section{margin-top:var(--ds-space-8)}
body.unslop .ux-account-summary{padding-block:var(--ds-space-5)}
body.unslop .account-evidence-item{padding:var(--ds-space-6) 0}
body.unslop .account-table :is(th,td){padding-inline:var(--ds-space-6)}
body.unslop .gm-quote{padding:var(--ds-space-8) var(--ds-space-7)}
body.unslop .gm-chart-panel,body.unslop .gm-chart-section{padding:var(--ds-space-6)}
body.unslop .gm-news-featured{padding:var(--ds-space-6)}

/* 2. Color: reserve the strongest cobalt for actions and meaningful numbers. */
body.unslop .gm-quote{background:var(--ds-surface);color:var(--ds-ink);border:1px solid var(--ds-rule)}
body.unslop .gm-quote-value{color:var(--ds-accent)}
body.unslop .gm-quote-label{color:var(--ds-ink)}
body.unslop :is(.gm-quote-clock,.gm-quote .gm-small,.result-label,.result-caption,.result-explanation,.gm-source-line){color:var(--ds-muted)}
body.unslop .gm-quote a{color:var(--ds-accent-hover)}
body.unslop .gm-quote :is(a,button):focus-visible{outline:var(--ds-focus-width) solid var(--ds-accent);outline-offset:var(--ds-focus-offset)}
body.unslop .gm-news-featured{background:var(--ds-surface);border:1px solid var(--ds-rule)}

/* 3. Icons: ordinary navigation shares one scale; logos, charts and source marks stay intact. */
body.unslop .button svg,body.unslop .nav-scroll svg{width:18px;height:18px;flex-shrink:0;stroke-width:1.5}

/* 4. Copy: existing verified Thai wording, disclosures, units and clocks are retained. */

/* 5. Type: use weight and space for hierarchy instead of heavy headings everywhere. */
body.unslop :is(h1,h2,h3,h4),body.unslop.showcase-page main :is(h1,h2,h3,h4){font-weight:var(--ds-weight-heading)}
body.unslop h1,body.unslop.showcase-page main h1{font-weight:var(--ds-weight-display)}
body.unslop h1 :is(strong,b){font-weight:inherit}
body.unslop :is(.result-number,.gm-quote-value,.gm-cot-summary dd,.gm-cot-deltas dd){font-weight:var(--ds-weight-display);font-variant-numeric:tabular-nums}
body.unslop .gold-market .gm-cot-mobile-value{font-weight:var(--ds-weight-display)}
body.unslop .gold-market .gm-cot-mobile-details>summary{font-weight:var(--ds-weight-heading)}
body.unslop :is(.gm-tabs a[aria-current],.gm-data-table>summary,.ux-cot-glossary summary,.ux-cot-glossary dt,.ux-guide-toc summary,.ga-source-library>summary){font-weight:var(--ds-weight-heading)}
body.unslop :is(.field small,.input-wrap span){font-size:var(--ds-text-support);line-height:var(--ds-leading-support)}
body.unslop .field small{color:var(--ds-muted)}
body.unslop .gm-quote-state{font-weight:var(--ds-weight-display)}

/* 6. Layout: preserve the accepted order, responsive navigation and working charts. */
body.unslop :is(.calculator-grid form,.result-panel,.gm-quote,.gm-chart-panel,.gm-chart-section){min-width:0}

/* 7. Details: one quiet button treatment, with visible keyboard focus and stable hit areas. */
body.unslop .button,body.unslop.showcase-page main .button,
body.unslop.ux-shared-shell :is(.site-header,.mobile-signup) .button{border-radius:var(--ds-radius-control);font-weight:var(--ds-weight-heading);min-height:var(--ds-target);transform:none;box-shadow:none;transition:background-color var(--ds-motion-fast) var(--ds-ease),color var(--ds-motion-fast) var(--ds-ease),border-color var(--ds-motion-fast) var(--ds-ease)}
body.unslop .button:hover,body.unslop.showcase-page main .button:hover,
body.unslop.ux-shared-shell :is(.site-header,.mobile-signup) .button:hover{transform:none;box-shadow:none}
body.unslop .button:focus-visible{outline:var(--ds-focus-width) solid var(--ds-accent);outline-offset:var(--ds-focus-offset)}
body.unslop .mobile-signup .button,body.unslop.ux-shared-shell .mobile-signup .button{min-height:var(--ds-target-primary)}
body.unslop .analytics-choice{border-radius:var(--ds-radius-control)}

/* 8. Visuals: retain the approved contextual 3D images, sizes and responsive sources. */
body.unslop .showcase-image{transform:none;transition:none;will-change:auto}

/* 9. Motion: remove layout interpolation and decorative parallax, keep control feedback. */
body.unslop .cost-bar span{transition:none}

@media(max-width:760px){
  body.unslop .tool-top{padding:var(--ds-space-6) var(--ds-space-5)}
  body.unslop .calculator-grid form,body.unslop .result-panel{padding:var(--ds-space-6) var(--ds-space-5)}
  body.unslop .fields{gap:var(--ds-space-5) var(--ds-space-4)}
  body.unslop .guide-reader-intro{padding-block:var(--ds-space-6) var(--ds-space-7)}
  body.unslop .account-evidence-item{padding:var(--ds-space-5) 0}
  body.unslop .gm-quote{padding:var(--ds-space-6) var(--ds-space-5)}
  body.unslop .gm-chart-panel,body.unslop .gm-chart-section{padding:var(--ds-space-6) var(--ds-space-4) var(--ds-space-4)}
  body.unslop .gm-news-featured{padding:var(--ds-space-6) var(--ds-space-5)}
}
@media(prefers-reduced-motion:reduce){
  body.unslop .button{transition:none}
}

/* Shared state contracts. Production aliases and local gallery use identical rules. */
body.unslop :is(.button,.quiet-button,.analytics-choice,.gm-mode-controls button,.gm-window-controls button,.gm-filter-row button,.ux-news-jumps button,.ux-news-jumps a,.ux-news-pagination button),
.ds-button {
  border-radius:var(--ds-radius-control);
  min-height:var(--ds-target);
  font-weight:var(--ds-weight-label);
  transition:background-color var(--ds-motion-fast) var(--ds-ease),color var(--ds-motion-fast) var(--ds-ease),border-color var(--ds-motion-fast) var(--ds-ease);
}
.ds-button {
  display:inline-flex;align-items:center;justify-content:center;gap:var(--ds-space-2);
  padding:var(--ds-space-3) var(--ds-space-5);border:1px solid transparent;
  background:var(--ds-accent);color:var(--ds-surface);font-family:var(--ds-font-family);
  font-size:var(--ds-text-label);line-height:var(--ds-leading-support);text-decoration:none;cursor:pointer;
}
.ds-button:hover:not(:disabled){background:var(--ds-accent-hover)}
.ds-button--secondary{background:transparent;color:var(--ds-ink);border-color:var(--ds-field-border)}
.ds-button--secondary:hover:not(:disabled){background:var(--ds-accent-soft);color:var(--ds-accent-hover)}
body.unslop :is(button,.button):disabled,.ds-button:disabled{cursor:not-allowed;opacity:.55;transform:none;box-shadow:none}
body.unslop :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible,
.ds-button:focus-visible,.ds-nav a:focus-visible,.ds-disclosure>summary:focus-visible {
  outline:var(--ds-focus-width) solid var(--ds-accent);outline-offset:var(--ds-focus-offset);
}
body.unslop :is(.site-header){z-index:var(--ds-z-header)}
body.unslop .mobile-signup{z-index:var(--ds-z-signup)}
body.unslop :is(.skip,.skip-link){z-index:var(--ds-z-skip)}
body.unslop :is(.skip,.skip-link):focus {
  position:fixed;top:var(--ds-space-3);left:var(--ds-space-4);
  max-width:calc(100vw - 32px);min-height:var(--ds-target);
  padding:var(--ds-space-3) var(--ds-space-4);border-radius:var(--ds-radius-control);
  background:var(--ds-surface);color:var(--ds-accent-hover);
  outline:var(--ds-focus-width) solid var(--ds-accent);outline-offset:var(--ds-focus-offset);
}

/* Borders identify editable controls; quiet separators retain their lighter role. */
body.unslop .input-wrap,
body.unslop :is(.field select,textarea,.lab-workspace input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),.lab-workspace select),
body.unslop :is(#gm-news-search,#gm-source-select,#source-search,#source-platform,#source-bias,#result-currency),
.ds-input-wrap {
  border-color:var(--ds-field-border);border-radius:var(--ds-radius-field);
}
body.unslop :is(input,textarea),.ds-input-wrap input{caret-color:var(--ds-accent)}
body.unslop :is(input,textarea)::placeholder,.ds-input-wrap input::placeholder{color:var(--ds-muted);opacity:1}
.ds-field{min-width:0}
.ds-field>label{display:block;margin-bottom:var(--ds-space-2);font-weight:var(--ds-weight-label);font-size:var(--ds-text-label)}
.ds-input-wrap{display:flex;align-items:center;min-height:var(--ds-target-primary);border:1px solid var(--ds-field-border);background:var(--ds-surface);overflow:hidden}
.ds-input-wrap input{width:100%;min-width:0;border:0;padding:var(--ds-space-3);font:inherit;color:var(--ds-ink);background:transparent}
.ds-input-wrap span{padding-inline-end:var(--ds-space-3);font-size:var(--ds-text-support);color:var(--ds-muted);white-space:nowrap}
body.unslop .input-wrap:focus-within,.ds-input-wrap:focus-within {
  outline:var(--ds-focus-width) solid var(--ds-accent);outline-offset:var(--ds-focus-offset);
}
body.unslop .input-wrap input:focus-visible,.ds-input-wrap input:focus-visible{outline:none}
body.unslop .input-wrap:has([aria-invalid="true"]),.ds-input-wrap:has([aria-invalid="true"]){border-color:var(--ds-danger)}
body.unslop :is(.tool-footnote,.footer-disclosure,.footer-meta,.source-meta,.market-attribution,.market-ohlc),
body.unslop.ux-shared-shell :is(.site-footer .footer-meta,.mobile-signup small),
body.unslop .mobile-signup small,.ds-field>small {
  font-size:var(--ds-text-support);line-height:var(--ds-leading-support);
}
.ds-field>small{display:block;margin-top:var(--ds-space-2);color:var(--ds-muted)}
.ds-field>small[data-error]{color:var(--ds-danger)}

/* The gallery aliases document the same navigation/disclosure/status vocabulary. */
.ds-nav{display:flex;gap:var(--ds-space-6);overflow-x:auto;align-items:center}
.ds-nav a{display:inline-flex;align-items:center;min-height:var(--ds-target);color:var(--ds-muted);text-decoration:none;white-space:nowrap}
.ds-nav a[aria-current]{color:var(--ds-accent);text-decoration:underline;text-underline-offset:var(--ds-space-2)}
.ds-disclosure{border-block:1px solid var(--ds-rule)}
.ds-disclosure>summary{min-height:var(--ds-target);padding-block:var(--ds-space-3);font-weight:var(--ds-weight-label);cursor:pointer}
.ds-status{padding:var(--ds-space-4) 0;border-block:1px solid var(--ds-rule);color:var(--ds-muted);line-height:var(--ds-leading-body)}
.ds-status[data-state="error"]{color:var(--ds-danger)}
.ds-signup{display:flex;align-items:center;justify-content:space-between;gap:var(--ds-space-3);padding:var(--ds-space-4);border-top:1px solid var(--ds-rule);background:var(--ds-surface)}
.ds-signup>div{min-width:0}.ds-signup small{display:block;font-size:var(--ds-text-support);line-height:var(--ds-leading-support);color:var(--ds-muted)}
.ds-signup .ds-button{min-height:var(--ds-target-primary);flex-shrink:0}

@media(max-width:760px){
  body.unslop :is(select,textarea,#gm-news-search,#source-search){font-size:var(--ds-text-body);min-height:var(--ds-target)}
  body.unslop #result-currency{width:auto;min-width:76px}
  body.unslop .mobile-signup small{max-width:16em}
}
@media(prefers-reduced-motion:reduce){
  body.unslop :is(.button,.quiet-button,.analytics-choice,.gm-mode-controls button,.gm-window-controls button,.gm-filter-row button,.ux-news-jumps button,.ux-news-jumps a,.ux-news-pagination button),.ds-button{transition:none}
}
@media(forced-colors:active){
  body.unslop :is(.input-wrap,.field select,textarea,.gm-filters input,.gm-filters select),.ds-input-wrap{border-color:ButtonText}
  body.unslop :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible,.ds-button:focus-visible,.ds-input-wrap:focus-within{outline-color:Highlight}
}
