/* UI theme tokens are separate from all resume content and template colors. */
:root[data-theme="light"] {color-scheme:light;--ui-bg:#faf8ff;--ui-surface:#fff;--ui-raised:#f4effa;--ui-hover:#eee5fb;--ui-line:#e4dced;--ui-text:#2a2038;--ui-muted:#756680;--ui-accent:#7145bd;}
:root[data-theme="dark"] {color-scheme:dark;--ui-bg:#0d0c15;--ui-surface:#171321;--ui-raised:#221a31;--ui-hover:#30223f;--ui-line:#372b49;--ui-text:#f1ebf8;--ui-muted:#baaccb;--ui-accent:#c1a3ff;}
.theme-toggle {font:600 calc(12px * var(--ui-font-scale,1)) var(--arabic);display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:38px;min-height:38px;padding:8px 10px;border:1px solid var(--ui-line);border-radius:8px;background:var(--ui-raised);color:var(--ui-accent);white-space:nowrap;cursor:pointer;}
.theme-toggle:hover {background:var(--ui-hover);}
.theme-toggle svg {display:block;flex:none;}
.theme-toggle:focus-visible {outline:2px solid var(--ui-accent);outline-offset:3px;}
@media screen {
  html[data-theme] body {background:var(--ui-bg);color:var(--ui-text);}
  html[data-theme] .button-primary {background:linear-gradient(115deg,#8242e5,#5639c9);color:#fff;box-shadow:0 8px 25px #6122b52b;}
  html[data-theme] .site-header {border-color:var(--ui-line);}
  html[data-theme] .brand .brand-symbol {background:transparent;}
  html[data-theme] :is(.resume-page,.cv-sheet,.mock-paper,.catalog-paper-frame,.detail-paper,.catalog-detail-preview,.import-fit-preview) {color-scheme:light;}

  /* Light mode includes the landing page, header, final section and footer. */
  html[data-theme="light"] .site-header {background:#faf8fff0;color:var(--ui-text);}
  html[data-theme="light"] :is(.site-header nav,.site-header .locale-button,.hero-link) {color:#665478;}
  html[data-theme="light"] .site-header nav a:hover {color:#6c31b1;}
  html[data-theme="light"] :is(.site-header .brand-wordmark,.platform-footer .brand-wordmark) {filter:none;}
  html[data-theme="light"] :is(.site-header .button-small,.catalog-route .site-header .button-small) {background:#2d1c43;color:white;}
  html[data-theme="light"] .hero-v2 {color:var(--ui-text);}
  html[data-theme="light"] :is(.hero-copy-v2>p,.hero-points,.hero-bottom,.floating-chip small) {color:#79668a;}
  html[data-theme="light"] .hero-brand-backdrop {opacity:.12;}
  html[data-theme="light"] .pill {background:#fff9;border-color:#dcd1ec;color:#77598f;}
  html[data-theme="light"] :is(.hero-copy-v2 h1 .gradient-word,.final-cta h2 span) {background:linear-gradient(110deg,#7336bf,#5751c4);background-clip:text;-webkit-background-clip:text;color:transparent;}
  html[data-theme="light"] :is(.pill i,.section-kicker i) {background:#8850cf;box-shadow:0 0 12px #8950cf35;}
  html[data-theme="light"] .hero-points b {color:#8253b3;}
  html[data-theme="light"] .play-ring {border-color:#b9a0ce;color:#774bb0;}
  html[data-theme="light"] :is(.floating-chip,.app-window,.app-top,.mock-side,.mock-work) {background:var(--ui-surface);border-color:var(--ui-line);color:var(--ui-text);}
  html[data-theme="light"] :is(.window-title,.mock-side-title,.mock-work-head) {color:#45305a;}
  html[data-theme="light"] :is(.mock-step,.mock-step b,.top-status,.window-title small,.mock-quality small,.mock-work-head small) {color:#8a789b;}
  html[data-theme="light"] .mock-step.active {background:#eee6fb;border-color:#d7c2f0;color:#644287;}
  html[data-theme="light"] :is(.mock-add,.mock-quality,.mock-template) {background:#f4effa;border-color:#dfd2ec;color:#806195;}
  html[data-theme="light"] .mock-quality>div:first-child {color:#867091;}
  html[data-theme="light"] .mock-quality b {color:#7447ac;}
  html[data-theme="light"] .final-cta {color:var(--ui-text);}
  html[data-theme="light"] .final-cta .section-kicker {color:#846c98;}
  html[data-theme="light"] .platform-footer {color:#7d648f;}
  html[data-theme="light"] :is(.footer-top>div>b,.footer-top .brand-word) {color:#533568;}
  html[data-theme="light"] :is(.footer-top>div:first-child>p,.footer-top>div:first-child>small,.footer-top a:not(.brand),.footer-top button,.footer-bottom) {color:#806b90;}
  html[data-theme="light"] .footer-bottom {border-color:var(--ui-line);}
  html[data-theme="light"] :is(.site-header .locale-button) {border-color:#dcd1e7;}

  /* Dark surfaces: marketing, collection, account library and editor. */
  html[data-theme="dark"] :is(.builder-view,.catalog-route,.catalog-page,.library-screen,.setup-screen,#faqSection) {background:var(--ui-bg);color:var(--ui-text);}
  html[data-theme="dark"] :is(.site-header,.catalog-route .site-header,.builder-topbar) {background:#13101dee;color:var(--ui-text);border-color:var(--ui-line);}
  html[data-theme="dark"] :is(.site-header nav,.site-header .locale-button,.catalog-route .site-header .locale-button,.builder-topbar .locale-button,.back-home,.builder-brand,.save-status) {color:var(--ui-muted);}
  html[data-theme="dark"] .site-header nav a:hover {color:#eadbff;}
  html[data-theme="dark"] :is(.catalog-route .site-header .brand-wordmark,.builder-brand .brand-wordmark) {filter:brightness(0) invert(1);}
  html[data-theme="dark"] :is(.site-header .button-small,.catalog-route .site-header .button-small) {background:#f0e8fc;color:#38204f;border-color:#f0e8fc;}
  html[data-theme="dark"] :is(.feature-band,.templates-v2,#saudiFeatures,.how-v2) {color:var(--ui-text);}
  html[data-theme="dark"] :is(.platform-section-heading h2,.feature-heading h2,.templates-heading h2,.how-v2 h2,.catalog-intro h1,.catalog-category-heading h2,.catalog-detail-description h1,.catalog-faq h2,.library-heading h1,.setup-intro h1) {color:var(--ui-text);}
  html[data-theme="dark"] :is(.platform-section-heading h2>span,.feature-heading h2>span,.templates-heading h2>span,.how-v2 h2>span,.catalog-detail-description h1>span) {color:var(--ui-accent);}
  html[data-theme="dark"] :is(.feature-list h3,.how-steps h3,.feature-workshop-grid>article>h3,.saudi-stage-banner b,.plan-card h3,.plan-price,.experience-demo>b) {color:#e2d3f0;}
  html[data-theme="dark"] :is(.feature-list p,.templates-heading p,.how-steps p,.platform-section-heading>p,.feature-workshop-grid>article>p,.saudi-stage-banner p,.catalog-intro p,.catalog-benefits,.catalog-category-heading p,.catalog-faq details p,.catalog-detail-description>p,.catalog-detail-description li,.library-heading p,.setup-intro p,.plan-card>p,.plan-card li,.experience-demo>p) {color:var(--ui-muted);}
  html[data-theme="dark"] :is(.section-kicker,.catalog-intro>.section-kicker,.catalog-breadcrumb,.catalog-section-number,.catalog-category-heading>span,.catalog-category-heading>a,.catalog-page-options>span,.sample-disclosure,.all-templates-link,.catalog-card-title small,.catalog-language>span,.catalog-badges>span) {color:#b8a3d0;}
  html[data-theme="dark"] :is(.feature-list article,.how-steps article,.faq-list,.faq-list details,.catalog-faq,.catalog-faq details,.sample-disclosure) {border-color:var(--ui-line);}
  html[data-theme="dark"] :is(.faq-list summary,.catalog-faq summary) {color:#e4d6f1;}
  html[data-theme="dark"] .faq-list p {color:var(--ui-muted);}
  html[data-theme="dark"] :is(.workshop-demo,.saudi-stage-banner,.plan-card,.library-plan,.saved-resume-card,.setup-card,.catalog-card) {background:var(--ui-surface);border-color:var(--ui-line);color:var(--ui-text);}
  html[data-theme="dark"] .premium-plan {background:linear-gradient(145deg,#291940,#191426);border-color:#6a4593;}
  html[data-theme="dark"] :is(.experience-demo>small,.experience-demo>span,.design-demo label,.demo-swatches>span,.match-demo>span,.match-demo>small,.plan-eyebrow,.library-plan span,.saved-card-meta>small) {color:#b5a1ca;}
  html[data-theme="dark"] :is(.catalog-filters button,.catalog-language button,.category-more button,.library-button,.saved-card-meta button,.import-library,.import-setup-button,.browse-template-button,.plain-setting-button,.match-job-button,.optional-chips button,.saudi-editor-tools>div button,.browser-own-toggle) {background:var(--ui-raised);border-color:var(--ui-line);color:var(--ui-accent);}
  html[data-theme="dark"] :is(.catalog-filters button.active,.catalog-language button.active,.catalog-sticky-nav a:first-child) {background:#6e43ac;border-color:#8354c6;color:white;}
  html[data-theme="dark"] .catalog-sticky-nav {background:#0d0c15ee;border-color:var(--ui-line);}
  html[data-theme="dark"] .catalog-sticky-nav a {border-color:#59446c;color:#d1bedf;}
  html[data-theme="dark"] .catalog-sticky-nav a:hover {background:#2d203e;color:white;}
  html[data-theme="dark"] .catalog-page-card {background:transparent;}
  html[data-theme="dark"] :is(.catalog-card-title b,.saved-card-meta>b,.library-plan b,.new-resume-card strong) {color:#e9def4;}
  html[data-theme="dark"] :is(.catalog-card-title>span:not(.catalog-access),.new-resume-card,.library-notice,.checkout-status) {background:var(--ui-raised);border-color:#59446c;color:#c6addf;}
  html[data-theme="dark"] .new-resume-card:hover {background:#2a1c3b;}
  html[data-theme="dark"] :is(.catalog-badges .free,.catalog-card-title>.is-free) {background:#1c342c;color:#a9dcc4;}
  html[data-theme="dark"] :is(.catalog-badges .premium,.catalog-card-title>.is-pro) {background:#382e21;color:#e4c88f;}

  /* Forms, readable guided steps, toolbars and the preview surround. */
  html[data-theme="dark"] :is(.editor-sidebar,.quality-rail,.canvas-toolbar,.canvas-bottom,.editor-step-footer) {background:var(--ui-surface);border-color:var(--ui-line);color:var(--ui-text);}
  html[data-theme="dark"] :is(.canvas-area,.resume-canvas) {background:#100e19;}
  html[data-theme="dark"] :is(.personal-links,.advanced-group,.optional-group,.extra-editor-tools,.guided-editor .section-card,.guided-editor .entry-card,.guided-editor .section-card-head,.design-group,.choice,.choice-system,.start-option) {background:var(--ui-surface);border-color:var(--ui-line);color:var(--ui-muted);}
  html[data-theme="dark"] :is(.editor-steps button,.guided-editor .section-tools button,.guided-editor .entry-tools button,.editor-step-footer [data-editor-prev],.design-choices button,.font-choices button,.section-picker,.section-picker button,.add-section-button,.add-entry) {background:var(--ui-raised);border-color:var(--ui-line);color:#c9b5df;}
  html[data-theme="dark"] :is(.editor-steps button[aria-current="step"],.choice.selected,.choice-system.selected,.start-option.selected,.design-choices button.active,.font-choices button.active) {background:#302044;border-color:#9b6cda;color:#efe0ff;}
  html[data-theme="dark"] .editor-steps button>span {background:#3b2a50;color:#d8c4eb;}
  html[data-theme="dark"] .editor-steps button[aria-current="step"]>span {background:#8750d1;color:#fff;}
  html[data-theme="dark"] :is(.editor-step-intro h2,.guided-editor .section-card-head>b,.guided-editor .entry-heading>b,.sidebar-heading b,.setup-card-top>b,.choice b,.choice-system>b,.start-option b,.score-card b,.review-item>b,.canvas-label b,.design-group>b) {color:#e6d9f1;}
  html[data-theme="dark"] :is(.edit-field>span,.guided-editor .edit-field>span,.optional-select>span,.advanced-select,.advanced-range,.advanced-check,.advanced-note,.optional-row,.optional-group>p,.personal-links>summary,.optional-group>summary,.extra-editor-tools>summary,.advanced-group>summary,.section-options>summary,.entry-options>summary,.saudi-editor-tools>b,.canvas-label,.quality-title) {color:#c2aed5;}
  html[data-theme="dark"] :is(.editor-step-intro p,.editor-step-intro>small,.editor-step-footer>small,.sidebar-heading small,.entry-heading>span,.guided-editor .section-card-head>span,.choice small,.choice-system>small,.start-option small,.setup-footer>span,.save-status,.canvas-label small,.canvas-bottom,.quality-disclaimer,.review-item small,.score-card>div>small,.photo-input) {color:#ab99c0;}
  html[data-theme="dark"] :is(.edit-field input,.edit-field textarea,.optional-select select,.advanced-select select,.optional-row input,.platform-dialog textarea,.platform-dialog select) {background:#100d18;border-color:#463455;color:#f0e7f9;caret-color:#bd95ff;}
  html[data-theme="dark"] :is(.edit-field input,.edit-field textarea,.platform-dialog textarea)::placeholder {color:#927da7;opacity:1;}
  html[data-theme="dark"] :is(.edit-field input,.edit-field textarea,.optional-select select,.advanced-select select,.optional-row input,.platform-dialog textarea):focus {border-color:#bd8df6;outline-color:#bd8df6;}
  html[data-theme="dark"] :is(.optional-select select,.advanced-select select) option {background:#171321;color:#f0e7f9;}
  html[data-theme="dark"] :is(.design-tip,.score-card,.review-item,.selected-template-banner) {background:#22192f;border-color:var(--ui-line);color:#c3add9;}
  html[data-theme="dark"] :is(.design-tip p,.advanced-range output,.sections-title,.completeHint) {color:#bda7d3;}
  html[data-theme="dark"] :is(.section-progress,.sidebar-heading,.editor-step-footer,.saudi-editor-tools) {border-color:var(--ui-line);}
  html[data-theme="dark"] :is(.progress-rail,.progress-rail i,.score-ring) {border-color:var(--ui-line);}
  html[data-theme="dark"] .color-choices button.active {outline-color:#caa8ff;box-shadow:0 0 0 3px #b48be640;}
  html[data-theme="dark"] .resume-page {box-shadow:0 10px 40px #0008;}
  html[data-theme="dark"] :is(.canvas-controls button,.quality-title button,.icon-button,.optional-row button) {background:transparent;color:#c9b0df;border-color:#59416e;}

  /* Every dialog, including templates, support copy, import and upgrades. */
  html[data-theme="dark"] .platform-dialog {background:#171321;border-color:#483456;color:var(--ui-text);}
  html[data-theme="dark"] .platform-dialog::backdrop {background:#06040cc7;}
  html[data-theme="dark"] :is(.dialog-close,.dialog-template-grid>button,.upgrade-comparison>div,.template-browser-filters button,.import-drop,.import-counts>div,.import-analysis,.import-mode,.import-result-notice button) {background:var(--ui-raised);border-color:var(--ui-line);color:var(--ui-accent);}
  html[data-theme="dark"] :is(.template-detail-copy h2,.info-copy h2,.upgrade-content h2,.browser-title h2,.job-match-panel h2,.import-panel h2,.import-mode legend,.import-mode label b,.browser-card-title b,.upgrade-comparison b) {color:#eadcf6;}
  html[data-theme="dark"] :is(.template-detail-copy p,.template-detail-copy li,.template-detail-copy>small,.info-copy p,.upgrade-content p,.upgrade-comparison ul,.browser-title p,.browser-results-count,.browser-card-title small,.import-panel p,.import-panel>small,.import-mode label small,.import-text-meta,.import-primary-action>small,.import-file-options,.import-file-options>small,.import-drop>small,.job-match-panel p) {color:var(--ui-muted);}
  html[data-theme="dark"] :is(.template-browser-filters button.active,.template-browser-filters button:hover,.browser-own-toggle:hover) {background:#352047;border-color:#8655b4;color:#ecd9ff;}
  html[data-theme="dark"] .upgrade-comparison>div:last-child {background:#2c2231;border-color:#856344;}
  html[data-theme="dark"] :is(.import-panel-v2 .import-new-note,.import-result-notice) {background:#211b30;border-color:#4e3e60;color:#ccbadc;}
  html[data-theme="dark"] .import-result-notice ul {color:#dbc394;}
  html[data-theme="dark"] .keyword-chips .matched {background:#193b31;border-color:#2e5c4c;color:#a2dbc3;}
  html[data-theme="dark"] .keyword-chips .unmatched {background:#3a2e23;border-color:#665037;color:#e1c497;}
  html[data-theme="dark"] :is(.footer-top a:not(.brand),.footer-top button) {color:#c4b0d7;}
}
@media(max-width:600px) {
  .theme-toggle {padding:7px;min-width:35px;min-height:35px;}
  .theme-toggle>span {display:none;}
  .header-actions {gap:6px;}
}
@media print {
  html[data-theme] {color-scheme:light!important;}
  [data-theme-toggle] {display:none!important;}
}
@media screen {
 html[data-theme="dark"] :is(.template-browser-filters,.score-ring:before) {background:var(--ui-surface);border-color:var(--ui-line);}
 html[data-theme="dark"] :is(.sections-title span:last-child,.setup-card-top>span,.review-item>i) {background:#362348;color:#d4b7f2;}
 html[data-theme="dark"] :is(.import-analysis-head,.import-panel-v2 .import-person,.import-counts b,.import-panel-v2 .import-text-label) {color:#eadcf6;}
 html[data-theme="dark"] :is(.import-analysis-head>span,.import-person>span,.import-counts span,.import-live-preview>summary,.template-browser-filters button small) {color:#bca6cf;}
 html[data-theme="dark"] :is(.import-detected-sections,.review-item.good>i) {color:#abdbbf;}
 html[data-theme="dark"] .import-review-notes {color:#dbbe8d;}
 html[data-theme="dark"] .review-item.good>i {background:#244136;}
 html[data-theme="dark"] .import-preview-paper {color-scheme:light;}
 html[data-theme="dark"] .guided-editor .edit-field input:-webkit-autofill {-webkit-box-shadow:0 0 0 1000px #100d18 inset;-webkit-text-fill-color:#f0e7f9;caret-color:#bd95ff;}
 html[data-theme] .download-wide {background:linear-gradient(115deg,#8242e5,#5639c9);color:white;}
}
@media screen {
 html[data-theme="dark"] :is(.account-row a:not(.button),.account-row button,.library-notice>button) {color:var(--ui-accent);}
 html[data-theme="dark"] :is(.guided-editor .section-tools button,.guided-editor .entry-tools button,.add-entry,.add-section-button):hover {background:#38244a;border-color:#80549e;color:#efddff;}
}

/* One continuous brand canvas, with no section-by-section color bands. */
@media screen {
 html[data-theme] #siteView {background-color:var(--ui-bg);background-image:radial-gradient(ellipse 900px 580px at 16% 150px,#8249e00c,transparent 80%);}
 html[data-theme] #siteView #top>section {background:transparent;}
 html[data-theme] #siteView>.platform-footer {background:transparent;border-top:1px solid var(--ui-line);}
 html[data-theme] #siteView>.site-header {background:transparent;border-color:var(--ui-line);}
 html[data-theme] .catalog-route #siteView {background-image:none;}
 html[data-theme] #siteView .hero-v2::after,
 html[data-theme] #siteView .final-cta::after {content:"";display:block;position:absolute;inset:auto 0 0;width:auto;height:150px;border:0;border-radius:0;box-shadow:none;background:linear-gradient(to bottom,transparent,var(--ui-bg));pointer-events:none;z-index:0;}
 html[data-theme] .final-cta .final-brand-backdrop {opacity:.10;}
 html[data-theme] #siteView .site-header .button-small {background:linear-gradient(115deg,#8242e5,#5639c9);border-color:transparent;color:#fff;}
 html[data-theme="dark"] :is(.hero-copy-v2 h1 .gradient-word,.final-cta h2 span) {background:linear-gradient(100deg,#d0b0ff,#a1a8ff);background-clip:text;-webkit-background-clip:text;color:transparent;}
 html[data-theme="dark"] :is(.feature-icon.violet,.feature-icon.cyan,.feature-icon.lime) {background:var(--ui-raised);border:1px solid var(--ui-line);color:var(--ui-accent);}
 html[data-theme="dark"] .feature-icon.cyan {color:#a6b3ff;}
 html[data-theme="dark"] :is(.text-button,.hero-points b,.play-ring,.feature-arrow,.how-steps article>b) {color:var(--ui-accent);}
 html[data-theme="dark"] :is(.hero-copy-v2>p,.hero-points,.hero-bottom,.hero-orbit-label,.final-cta>.section-kicker) {color:var(--ui-muted);}
 html[data-theme="dark"] .platform-footer {color:var(--ui-muted);}
 html[data-theme="dark"] :is(.footer-top>div>b,.footer-top .brand-word) {color:var(--ui-text);}
 html[data-theme="dark"] :is(.footer-top>div:first-child>p,.footer-top>div:first-child>small,.footer-bottom) {color:var(--ui-muted);}
 html[data-theme="dark"] .pill {background:var(--ui-raised);border-color:var(--ui-line);color:#d6c3ed;}
 html[data-theme="dark"] :is(.pill i,.section-kicker i) {background:#b38aef;box-shadow:0 0 10px #b38aef45;}
 html[data-theme="light"] :is(.feature-icon.violet,.feature-icon.cyan,.feature-icon.lime) {background:#eee6f9;border:1px solid #e0d3ee;color:#774ab1;}
 html[data-theme="light"] .feature-icon.cyan {color:#6054aa;}
}
/* The add-section menu follows the active interface palette in both modes. */
@media screen {
 html[data-theme] #sectionPicker {background:var(--ui-surface);color:var(--ui-text);border:1px solid var(--ui-line);box-shadow:0 12px 30px #15162920;}
 html[data-theme] #sectionPicker button {background:var(--ui-raised);color:var(--ui-text);border-color:var(--ui-line);}
 html[data-theme] #sectionPicker button:hover {background:var(--ui-hover);border-color:var(--ui-accent);}
 html[data-theme] #sectionPicker button:focus-visible {outline:2px solid var(--ui-accent);outline-offset:2px;}
 html[data-theme] #sectionPicker button span {color:var(--ui-accent);}
}
@media screen {
 html[data-theme="dark"] .builder-topbar #docTitle {color:#fff;}
}
