/* Rumi Medical frontend theme fixes v4.
   Screenshot-targeted layout corrections, non-breaking navigation labels,
   doctor-card stability, and per-theme frontend dark-mode controls. */

html[data-dark-mode-enabled="false"] [data-theme-toggle]{display:none!important}

/* Keep every multi-word menu item readable without three-line fragmentation. */
body[class*="frontend-theme-"] .public-nav{width:min(1480px,calc(100% - 28px));max-width:none}
body[class*="frontend-theme-"] .public-links{min-width:0;flex:1 1 auto;justify-content:center;gap:clamp(2px,.55vw,9px);overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
body[class*="frontend-theme-"] .public-links::-webkit-scrollbar{display:none}
body[class*="frontend-theme-"] .public-links a{flex:0 0 auto;white-space:nowrap!important;text-wrap:nowrap;word-break:keep-all!important;overflow-wrap:normal!important;hyphens:none!important;line-height:1.15;padding-inline:clamp(8px,.75vw,13px)}
body[class*="frontend-theme-"] .public-actions{flex:0 0 auto;white-space:nowrap}
body[class*="frontend-theme-"] .public-actions .btn{white-space:nowrap}
body[class*="frontend-theme-"] .side-nav a>span{min-width:0;white-space:nowrap!important;word-break:keep-all!important;overflow-wrap:normal!important;text-overflow:ellipsis;overflow:hidden}
@media(min-width:901px){body.frontend-theme-midnight_neon .side-nav a>span,body.frontend-theme-monolith_black .side-nav a>span{min-width:max-content;overflow:visible;text-overflow:clip}}
body[class*="frontend-theme-"] .sidebar:not(.admin-pos-sidebar) .brand-copy{min-width:0}
body.frontend-theme-oceanic_pulse .public-header,
body.frontend-theme-sakura_health .public-header,
body.frontend-theme-aether_glass .public-header,
body.frontend-theme-capsule_os .public-header{width:min(1480px,calc(100% - 28px))}

/* Prevent bilingual doctor names from collapsing one letter per line. */
.finder-doctor-identity{flex:1 1 0;width:auto;min-width:0}
.finder-doctor-name-link{display:block;min-width:0}
.doctor-bilingual-identity strong,.doctor-bilingual-identity span{word-break:normal!important;overflow-wrap:break-word!important;hyphens:none!important}
.finder-doctor-card,.finder-card-top,.finder-doctor-identity .doctor-bilingual-identity>div{min-width:0}

/* Keep the live-availability note clear of the search button. */
.finder-search-stage{padding-bottom:48px}
.finder-floating-note{right:16px;bottom:0}
[dir="rtl"] .finder-floating-note{right:auto;left:16px}

/* Screenshot contrast repairs: light themes. */
html:not([data-theme="dark"]) body.frontend-theme-alpine_frost .finder-hero-copy>p{color:#4b6277}
html:not([data-theme="dark"]) body.frontend-theme-alpine_frost .finder-proof strong{color:#173a61}
html:not([data-theme="dark"]) body.frontend-theme-alpine_frost .finder-proof span,
html:not([data-theme="dark"]) body.frontend-theme-alpine_frost .finder-confidence-row{color:#516b82}
html:not([data-theme="dark"]) body.frontend-theme-alpine_frost .finder-proof div{border-color:#bfd3e5}

html:not([data-theme="dark"]) body.frontend-theme-sakura_health .finder-hero h1{color:#5f274f}
html:not([data-theme="dark"]) body.frontend-theme-sakura_health .finder-hero h1 em{color:#c94178}
html:not([data-theme="dark"]) body.frontend-theme-sakura_health .finder-hero-copy>p{color:#735568}
html:not([data-theme="dark"]) body.frontend-theme-sakura_health .finder-proof strong{color:#5f274f}
html:not([data-theme="dark"]) body.frontend-theme-sakura_health .finder-proof span,
html:not([data-theme="dark"]) body.frontend-theme-sakura_health .finder-confidence-row{color:#76576a}
html:not([data-theme="dark"]) body.frontend-theme-sakura_health .finder-proof div{border-color:#ddb8c8}

html:not([data-theme="dark"]) body.frontend-theme-nordic_calm .finder-hero-copy>p{color:#4f6570}
html:not([data-theme="dark"]) body.frontend-theme-nordic_calm .finder-proof strong{color:#263746}
html:not([data-theme="dark"]) body.frontend-theme-nordic_calm .finder-proof span,
html:not([data-theme="dark"]) body.frontend-theme-nordic_calm .finder-confidence-row{color:#58707b}
html:not([data-theme="dark"]) body.frontend-theme-nordic_calm .finder-proof div{border-color:#c8d3d7}

html:not([data-theme="dark"]) body.frontend-theme-heritage_medical .finder-hero h1{color:#17213a}
html:not([data-theme="dark"]) body.frontend-theme-heritage_medical .finder-hero h1 em{color:#7b2636}
html:not([data-theme="dark"]) body.frontend-theme-heritage_medical .finder-hero-copy>p{color:#5e5a52}
html:not([data-theme="dark"]) body.frontend-theme-heritage_medical .finder-proof strong{color:#17213a}
html:not([data-theme="dark"]) body.frontend-theme-heritage_medical .finder-proof span,
html:not([data-theme="dark"]) body.frontend-theme-heritage_medical .finder-confidence-row{color:#666158}
html:not([data-theme="dark"]) body.frontend-theme-heritage_medical .finder-proof div{border-color:#cfc5ae}

html:not([data-theme="dark"]) body.frontend-theme-zen_whitespace .finder-hero-copy>p{color:#536a62}
html:not([data-theme="dark"]) body.frontend-theme-zen_whitespace .finder-proof strong{color:#1f2933}
html:not([data-theme="dark"]) body.frontend-theme-zen_whitespace .finder-proof span,
html:not([data-theme="dark"]) body.frontend-theme-zen_whitespace .finder-confidence-row{color:#5d746c}
html:not([data-theme="dark"]) body.frontend-theme-zen_whitespace .finder-proof div{border-color:#ccd8d3}

/* Graphite dark appearance and Midnight search form readability. */
html[data-theme="dark"] body.frontend-theme-graphite_pro .finder-hero h1,
html[data-theme="dark"] body.frontend-theme-graphite_pro .finder-hero h1 em{color:#f8fafc}
html[data-theme="dark"] body.frontend-theme-graphite_pro .finder-hero-copy>p,
html[data-theme="dark"] body.frontend-theme-graphite_pro .finder-confidence-row{color:#d4dde6}
html[data-theme="dark"] body.frontend-theme-graphite_pro .finder-proof strong{color:#fff}
html[data-theme="dark"] body.frontend-theme-graphite_pro .finder-proof span{color:#c7d2dc}
body.frontend-theme-midnight_neon .finder-search-card{color:#e8f5ff;background:#081426}
body.frontend-theme-midnight_neon .finder-search-heading h2,
body.frontend-theme-midnight_neon .finder-field>span{color:#eefaff}
body.frontend-theme-midnight_neon .finder-search-heading p,
body.frontend-theme-midnight_neon .finder-search-note{color:#a9c8d8}
body.frontend-theme-midnight_neon .finder-public-pill{color:#baf7ff;border-color:rgba(34,211,238,.4);background:rgba(34,211,238,.1)}
body.frontend-theme-midnight_neon .finder-field input,
body.frontend-theme-midnight_neon .finder-field select{color:#eaf8ff;background:#0d1d31;border-color:#28506a}
body.frontend-theme-midnight_neon .finder-field input::placeholder{color:#819cad}
body.frontend-theme-midnight_neon .finder-field select option{color:#102235;background:#fff}

/* Admin per-theme dark-mode control. */
body.role-admin .frontend-theme-card{display:flex;flex-direction:column}
body.role-admin .frontend-theme-card-actions{display:grid;gap:10px;margin-top:auto;padding-top:14px}
body.role-admin .frontend-theme-activation-form .btn{width:100%}
body.role-admin .frontend-theme-dark-form{margin:0}
body.role-admin .frontend-dark-mode-toggle{width:100%;min-height:58px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;padding:10px 12px;border:1px solid var(--border);border-radius:14px;background:var(--surface-2);color:var(--text);text-align:start;cursor:pointer;transition:border-color .18s ease,background .18s ease}
body.role-admin .frontend-dark-mode-toggle:hover{border-color:var(--primary);background:var(--primary-soft)}
body.role-admin .frontend-dark-mode-toggle:focus-visible{outline:3px solid color-mix(in srgb,var(--primary) 35%,transparent);outline-offset:2px}
body.role-admin .frontend-dark-mode-track{position:relative;width:42px;height:24px;border-radius:999px;background:#94a3b8;box-shadow:inset 0 0 0 1px rgba(15,23,42,.15)}
body.role-admin .frontend-dark-mode-track i{position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 2px 5px rgba(15,23,42,.25);transition:transform .18s ease}
body.role-admin .frontend-dark-mode-toggle.is-enabled .frontend-dark-mode-track{background:var(--primary)}
body.role-admin .frontend-dark-mode-toggle.is-enabled .frontend-dark-mode-track i{transform:translateX(18px)}
[dir="rtl"] body.role-admin .frontend-dark-mode-toggle.is-enabled .frontend-dark-mode-track i{transform:translateX(-18px)}
body.role-admin .frontend-dark-mode-copy{display:grid;gap:2px;min-width:0}
body.role-admin .frontend-dark-mode-copy strong{font-size:.76rem;color:var(--text)}
body.role-admin .frontend-dark-mode-copy small{font-size:.67rem;color:var(--muted)}
body.role-admin .frontend-dark-mode-toggle>b{min-width:30px;padding:4px 7px;border-radius:999px;background:var(--surface);color:var(--muted);font-size:.65rem;text-align:center}
body.role-admin .frontend-dark-mode-toggle.is-enabled>b{background:var(--primary-soft);color:var(--primary-strong)}

@media(min-width:1100px){
  /* Royal Indigo: remove clipping and negative overlap that hid the search form. */
  body.frontend-theme-royal_indigo .finder-hero{padding:70px 0 82px;clip-path:none;overflow:visible}
  body.frontend-theme-royal_indigo .finder-search-stage{width:min(1040px,100%);margin:26px auto 0;padding-bottom:48px}
  body.frontend-theme-royal_indigo .finder-specialty-strip{padding-top:30px}

  /* Meridian Split: restore a usable information rail and stable doctor rows. */
  body.frontend-theme-meridian_split.guest-shell{padding-inline-start:300px!important}
  body.frontend-theme-meridian_split .public-header{position:fixed!important;inset:0 auto 0 0!important;width:300px!important;height:100vh!important}
  [dir="rtl"] body.frontend-theme-meridian_split .public-header{inset:0 0 0 auto!important}
  body.frontend-theme-meridian_split .public-nav{width:100%!important;height:100%!important;padding:34px 26px!important;display:flex!important;flex-direction:column!important;align-items:stretch!important}
  body.frontend-theme-meridian_split .public-links,
  body.frontend-theme-meridian_split .public-actions{display:flex!important;width:100%!important;flex-direction:column!important;align-items:stretch!important;overflow:visible!important}
  body.frontend-theme-meridian_split .public-links{margin-top:46px!important}
  body.frontend-theme-meridian_split .public-actions{margin-top:auto!important}
  body.frontend-theme-meridian_split .public-links a{width:100%;white-space:nowrap!important;padding:13px 12px}
  body.frontend-theme-meridian_split .finder-doctor-grid{grid-template-columns:minmax(0,1fr)!important}
  body.frontend-theme-meridian_split .finder-doctor-card{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(290px,360px)!important;gap:24px!important}
  body.frontend-theme-meridian_split .finder-card-top,
  body.frontend-theme-meridian_split .finder-doctor-meta,
  body.frontend-theme-meridian_split .finder-doctor-bio,
  body.frontend-theme-meridian_split .finder-tags{grid-column:1!important}
  body.frontend-theme-meridian_split .finder-availability{grid-column:2!important;grid-row:1/6!important}
  body.frontend-theme-meridian_split .finder-card-footer{grid-column:2!important}

  /* Citrus Vital: dense balanced bento grids without narrow cards or empty holes. */
  body.frontend-theme-citrus_vital .finder-specialty-list{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-flow:dense;gap:12px}
  body.frontend-theme-citrus_vital .finder-specialty-chip{grid-row:auto!important;min-height:104px!important}
  body.frontend-theme-citrus_vital .finder-specialty-chip:nth-child(1),
  body.frontend-theme-citrus_vital .finder-specialty-chip:nth-child(6){grid-column:span 2}
  body.frontend-theme-citrus_vital .finder-doctor-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.frontend-theme-citrus_vital .finder-doctor-card{grid-row:auto!important}
  body.frontend-theme-citrus_vital .finder-doctor-card:first-child{grid-column:1/-1}

  /* Editorial and Metro specialty sections use complete, even rows. */
  body.frontend-theme-editorial_remedy .finder-specialty-list{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:12px}
  body.frontend-theme-editorial_remedy .finder-specialty-chip{min-height:108px!important;align-content:center!important}
  body.frontend-theme-metro_clinical .finder-specialty-list{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:10px}
  body.frontend-theme-metro_clinical .finder-specialty-chip{grid-column:auto!important;min-height:112px!important;align-content:center!important}

  /* Mosaic: predictable visual rhythm without oversized tiles or card overlap. */
  body.frontend-theme-mosaic_health .finder-specialty-list{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-flow:dense;grid-auto-rows:112px;gap:12px}
  body.frontend-theme-mosaic_health .finder-specialty-chip{grid-column:auto!important;grid-row:auto!important;min-height:0!important}
  body.frontend-theme-mosaic_health .finder-specialty-chip:nth-child(odd){grid-column:span 2!important}
  body.frontend-theme-mosaic_health .finder-doctor-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.frontend-theme-mosaic_health .finder-doctor-card{grid-row:auto!important;margin-top:0!important;transform:none!important}
  body.frontend-theme-mosaic_health .finder-doctor-card:first-child{grid-column:1/-1}
}

/* Use a full menu sheet before desktop labels become crowded. */
@media(max-width:1180px){
  body[class*="frontend-theme-"].guest-shell{padding-inline-start:0!important}
  body[class*="frontend-theme-"] .public-header{position:sticky!important;inset:auto!important;width:auto!important;height:auto!important;margin:0!important;border-radius:0!important;transform:none!important}
  body[class*="frontend-theme-"] .public-nav{position:relative!important;width:min(100% - 24px,1100px)!important;height:70px!important;display:flex!important;flex-direction:row!important;align-items:center!important;padding:8px 0!important;transform:none!important}
  body[class*="frontend-theme-"] .public-menu-toggle{display:grid!important;margin-inline-start:auto}
  body[class*="frontend-theme-"] .public-links{display:none!important;position:absolute!important;z-index:90;left:0!important;right:0!important;top:calc(100% + 8px)!important;width:100%!important;max-height:min(70vh,520px);margin:0!important;padding:10px!important;overflow-y:auto!important;overflow-x:hidden!important;flex-direction:column!important;align-items:stretch!important;border:1px solid var(--public-menu-border)!important;border-radius:18px!important;background:color-mix(in srgb,var(--public-menu-bg) 96%,var(--surface))!important;box-shadow:0 26px 70px rgba(7,20,36,.24)!important;clip-path:none!important;transform:none!important}
  body[class*="frontend-theme-"] .public-links.open{display:flex!important}
  body[class*="frontend-theme-"] .public-links a{display:flex!important;width:100%!important;min-height:46px;align-items:center;padding:12px 14px!important;white-space:nowrap!important;border-radius:12px!important;transform:none!important}
  body[class*="frontend-theme-"] .public-actions{display:flex!important;width:auto!important;margin:0!important;flex-direction:row!important;align-items:center!important}
  body[class*="frontend-theme-"] .public-actions .public-signin,
  body[class*="frontend-theme-"] .public-actions .public-marketplace-join{display:none!important}
}

/* Neo Care has intentionally oversized controls, so collapse its menu earlier. */
@media(min-width:1181px) and (max-width:1480px){
  body.frontend-theme-neo_care_brutalist .public-nav{position:relative}
  body.frontend-theme-neo_care_brutalist .public-menu-toggle{display:grid;margin-inline-start:auto}
  body.frontend-theme-neo_care_brutalist .public-links{display:none;position:absolute;z-index:90;left:0;right:0;top:calc(100% + 8px);width:100%;padding:10px;overflow:visible;flex-direction:column;align-items:stretch;border:3px solid #111;background:var(--public-menu-bg);box-shadow:7px 7px 0 #111}
  body.frontend-theme-neo_care_brutalist .public-links.open{display:flex}
  body.frontend-theme-neo_care_brutalist .public-links a{width:100%;min-height:46px}
  body.frontend-theme-neo_care_brutalist .public-actions .public-signin,
  body.frontend-theme-neo_care_brutalist .public-actions .public-marketplace-join{display:none}
}

@media(max-width:720px){
  .finder-search-stage{padding-bottom:0}
  body.frontend-theme-mosaic_health .finder-specialty-chip:nth-child(odd){grid-column:auto!important}
  body.role-admin .frontend-dark-mode-toggle{grid-template-columns:auto minmax(0,1fr)}
  body.role-admin .frontend-dark-mode-toggle>b{display:none}
}

/* Frontend Theme Studio V1: reversible visual-token editor and live preview. */
body.role-admin .frontend-theme-studio{margin:18px 0 28px;border:1px solid var(--border);border-radius:24px;background:linear-gradient(145deg,var(--surface),var(--surface-2));box-shadow:var(--shadow-sm);overflow:hidden}
body.role-admin .frontend-theme-studio-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:24px;border-bottom:1px solid var(--border)}
body.role-admin .frontend-theme-studio-head h4,body.role-admin .frontend-theme-catalog-head h4{margin:4px 0 7px;font-size:1.35rem;color:var(--text)}
body.role-admin .frontend-theme-studio-head p,body.role-admin .frontend-theme-catalog-head p{max-width:760px;margin:0;color:var(--muted);font-size:.88rem}
body.role-admin .frontend-theme-status-row,body.role-admin .frontend-theme-studio-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:13px}
body.role-admin .frontend-theme-studio-actions{justify-content:flex-end;margin-top:0}
body.role-admin .frontend-theme-studio-actions form{margin:0}
body.role-admin .frontend-theme-studio-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(340px,.8fr);align-items:start}
body.role-admin .frontend-theme-editor-stack{min-width:0;border-inline-end:1px solid var(--border)}
body.role-admin .theme-studio-tabs{display:flex;gap:8px;padding:14px 18px;border-bottom:1px solid var(--border);background:var(--surface-2)}
body.role-admin .theme-studio-tab{appearance:none;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--muted);padding:10px 15px;font:inherit;font-size:.78rem;font-weight:800;cursor:pointer}
body.role-admin .theme-studio-tab:hover{border-color:var(--primary);color:var(--primary)}
body.role-admin .theme-studio-tab.is-active{border-color:var(--primary);background:var(--primary);color:#fff;box-shadow:0 8px 22px color-mix(in srgb,var(--primary) 22%,transparent)}
body.role-admin [data-theme-studio-panel][hidden]{display:none!important}
body.role-admin .frontend-theme-editor-form,body.role-admin .frontend-theme-content-form{min-width:0;padding:22px}
body.role-admin .frontend-theme-content-form{border-top:1px solid var(--border);background:color-mix(in srgb,var(--surface-2) 55%,transparent)}
body.role-admin .theme-editor-section{border:1px solid var(--border);border-radius:16px;background:var(--surface);overflow:hidden;margin-bottom:14px}
body.role-admin .theme-editor-section>summary{position:relative;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:15px 17px;cursor:pointer;background:var(--surface-2);border-bottom:1px solid transparent}
body.role-admin .theme-editor-section[open]>summary{border-bottom-color:var(--border)}
body.role-admin .theme-editor-section>summary::-webkit-details-marker{display:none}
body.role-admin .theme-editor-section>summary span{font-weight:820;color:var(--text)}
body.role-admin .theme-editor-section>summary small{color:var(--muted);text-align:end}
body.role-admin .theme-editor-section>summary:after{content:"+";font-size:1.25rem;font-weight:800;color:var(--primary);margin-inline-start:auto}
body.role-admin .theme-editor-section[open]>summary:after{content:"−"}
body.role-admin .theme-color-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:16px}
body.role-admin .theme-color-field{display:grid;gap:6px;min-width:0;color:var(--muted);font-size:.74rem;font-weight:760}
body.role-admin .theme-color-control{display:grid;grid-template-columns:40px minmax(0,1fr);align-items:stretch;gap:7px}
body.role-admin .theme-color-control input[type="color"]{width:40px;height:42px;padding:3px;border:1px solid var(--border);border-radius:10px;background:var(--surface);cursor:pointer}
body.role-admin .theme-color-control .input{min-width:0;font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace;font-size:.73rem}
body.role-admin .theme-layout-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:17px}
body.role-admin .theme-range-field{display:grid;gap:8px;padding:13px;border:1px solid var(--border);border-radius:13px;background:var(--surface-2)}
body.role-admin .theme-range-field>span{display:flex;justify-content:space-between;gap:12px;color:var(--text);font-size:.78rem;font-weight:760}
body.role-admin .theme-range-field b{color:var(--primary);font-size:.72rem}
body.role-admin .theme-range-field input[type="range"]{width:100%;accent-color:var(--primary)}
body.role-admin .theme-shadow-field{align-self:end}

body.role-admin .theme-content-editor-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:16px;padding:18px;border:1px solid var(--border);border-radius:16px;background:var(--surface)}
body.role-admin .theme-content-editor-heading h4{margin:4px 0 6px;color:var(--text);font-size:1.12rem}
body.role-admin .theme-content-editor-heading p{max-width:680px;margin:0;color:var(--muted);font-size:.78rem}
body.role-admin .theme-content-tools{display:flex;align-items:end;justify-content:space-between;gap:14px;margin-bottom:14px;padding:14px;border:1px solid var(--border);border-radius:14px;background:var(--surface)}
body.role-admin .theme-content-search{display:grid;gap:6px;min-width:min(420px,100%);color:var(--text);font-size:.75rem;font-weight:800}
body.role-admin .theme-content-tools>div{display:flex;gap:8px;flex-wrap:wrap}
body.role-admin .theme-content-section.is-filtered-out{display:none}
body.role-admin .theme-content-grid .form-group.is-filtered-out{display:none}
body.role-admin .theme-content-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:17px}
body.role-admin .theme-content-grid .form-group{margin:0;min-width:0}
body.role-admin .theme-content-grid .theme-content-wide{grid-column:1/-1}
body.role-admin .theme-content-grid .textarea{min-height:88px;resize:vertical;line-height:1.5}
body.role-admin .theme-content-grid .form-help{font-size:.66rem}
body.role-admin .theme-preview-hero h3 em{font-family:inherit;font-style:italic;color:inherit}
body.role-admin .theme-css-editor{padding:17px}
body.role-admin .theme-css-editor .textarea{min-height:260px;resize:vertical;font-size:.78rem;line-height:1.65;tab-size:2}
body.role-admin .frontend-theme-editor-footer{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px;border:1px solid var(--border);border-radius:16px;background:var(--primary-soft)}
body.role-admin .frontend-theme-editor-footer div{display:grid;gap:3px}
body.role-admin .frontend-theme-editor-footer strong{color:var(--primary-strong);font-size:.86rem}
body.role-admin .frontend-theme-editor-footer small{max-width:650px;color:var(--muted);font-size:.72rem}
body.role-admin .frontend-theme-live-preview{position:sticky;top:18px;min-width:0;padding:22px}
body.role-admin .theme-preview-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}
body.role-admin .theme-preview-toolbar>div{display:grid;gap:2px}
body.role-admin .theme-preview-toolbar strong{font-size:.85rem;color:var(--text)}
body.role-admin .theme-preview-canvas{--bg:#f4f7fb;--surface:#fff;--surface-2:#f8fafc;--surface-3:#eef2f7;--text:#13213a;--muted:#64748b;--border:#dfe7f1;--primary:#0f766e;--primary-strong:#0b5e58;--primary-soft:#dff7f3;--navy:#10233f;--theme-sidebar:#10233f;--theme-sidebar-2:#0f766e;--theme-hero-a:#10233f;--theme-hero-b:#0f766e;--theme-footer:#10233f;--preview-card-radius:18px;--preview-control-radius:12px;--preview-button-radius:12px;--preview-gap:16px;--preview-shadow:0 18px 45px rgba(15,35,63,.12);min-height:520px;padding:14px;border:1px solid var(--border);border-radius:22px;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,sans-serif;box-shadow:var(--shadow-sm);overflow:hidden;transition:.2s ease}
body.role-admin .theme-preview-canvas header{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:var(--preview-control-radius);background:var(--surface);border:1px solid var(--border);box-shadow:var(--preview-shadow)}
body.role-admin .theme-preview-logo{width:28px;height:28px;border-radius:9px;background:linear-gradient(135deg,var(--primary),var(--primary-strong))}
body.role-admin .theme-preview-canvas header nav{display:flex;gap:7px;margin-inline-start:auto}
body.role-admin .theme-preview-canvas header nav i{display:block;width:26px;height:6px;border-radius:999px;background:var(--muted);opacity:.45}
body.role-admin .theme-preview-canvas header button{width:58px;height:24px;border:0;border-radius:var(--preview-button-radius);background:var(--primary)}
body.role-admin .theme-preview-hero{display:grid;grid-template-columns:1.15fr .85fr;gap:var(--preview-gap);align-items:center;margin-top:14px;padding:24px 18px;border-radius:var(--preview-card-radius);background:linear-gradient(135deg,var(--theme-hero-a),var(--theme-hero-b));color:#fff;box-shadow:var(--preview-shadow)}
body.role-admin .theme-preview-hero small{font-size:.58em;letter-spacing:.1em;text-transform:uppercase;opacity:.76}
body.role-admin .theme-preview-hero h3{margin:8px 0 7px;color:#fff;font-size:1.52em;line-height:1.02;letter-spacing:-.04em}
body.role-admin .theme-preview-hero p{margin:0;color:rgba(255,255,255,.76);font-size:.68em}
body.role-admin .theme-preview-actions{display:flex;gap:7px;margin-top:13px}
body.role-admin .theme-preview-actions b,body.role-admin .theme-preview-actions em{padding:7px 9px;border-radius:var(--preview-button-radius);font-size:.58em;font-style:normal}
body.role-admin .theme-preview-actions b{background:var(--primary);color:#fff}
body.role-admin .theme-preview-actions em{border:1px solid rgba(255,255,255,.35);color:#fff}
body.role-admin .theme-preview-hero article{padding:14px;border-radius:var(--preview-card-radius);background:var(--surface);color:var(--text);box-shadow:var(--preview-shadow)}
body.role-admin .theme-preview-hero article>span{display:block;width:34px;height:34px;margin-bottom:10px;border-radius:50%;background:var(--primary-soft);border:7px solid var(--surface-2)}
body.role-admin .theme-preview-hero article strong{font-size:.72rem}
body.role-admin .theme-preview-hero article p{color:var(--muted);font-size:.62em;margin:2px 0 10px}
body.role-admin .theme-preview-hero article div{display:flex;gap:5px}
body.role-admin .theme-preview-hero article i{display:block;width:28%;height:7px;border-radius:999px;background:var(--primary-soft)}
body.role-admin .theme-preview-card-row{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--preview-gap);margin-top:14px}
body.role-admin .theme-preview-card-row article{min-width:0;padding:15px;border:1px solid var(--border);border-radius:var(--preview-card-radius);background:var(--surface);box-shadow:var(--preview-shadow)}
body.role-admin .theme-preview-card-row i{display:block;width:25px;height:25px;margin-bottom:16px;border-radius:8px;background:var(--primary-soft)}
body.role-admin .theme-preview-card-row strong{display:block;color:var(--navy);font-size:.7em}
body.role-admin .theme-preview-card-row p{margin:3px 0 0;color:var(--muted);font-size:.58em}
body.role-admin .frontend-theme-catalog-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin:30px 0 15px}
body.role-admin .frontend-theme-card.is-editing{outline:3px solid color-mix(in srgb,var(--primary) 30%,transparent);outline-offset:2px}
body.role-admin .frontend-theme-card-actions>a.btn{width:100%}

@media(max-width:1180px){
  body.role-admin .frontend-theme-studio-grid{grid-template-columns:1fr}
  body.role-admin .frontend-theme-editor-stack{border-inline-end:0;border-bottom:1px solid var(--border)}
  body.role-admin .frontend-theme-live-preview{position:static}
}
@media(max-width:760px){
  body.role-admin .frontend-theme-studio-head,body.role-admin .frontend-theme-editor-footer,body.role-admin .theme-preview-toolbar{align-items:stretch;flex-direction:column}
  body.role-admin .frontend-theme-studio-actions{justify-content:flex-start}
  body.role-admin .theme-color-grid,body.role-admin .theme-layout-grid,body.role-admin .theme-content-grid{grid-template-columns:1fr}
  body.role-admin .theme-content-grid .theme-content-wide{grid-column:auto}
  body.role-admin .theme-content-editor-heading,body.role-admin .theme-content-tools{align-items:stretch;flex-direction:column}
  body.role-admin .theme-content-search{min-width:0}
  body.role-admin .theme-editor-section>summary{align-items:flex-start;flex-direction:column}
  body.role-admin .theme-editor-section>summary:after{position:absolute;right:18px}
  body.role-admin .theme-preview-hero{grid-template-columns:1fr}
  body.role-admin .theme-preview-card-row{grid-template-columns:1fr}
}

/* 1.7.9 independent main/temporary frontend theme selector */
body.role-admin .frontend-surface-tabs{
  margin:0 0 14px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--surface-2);
  box-shadow:var(--shadow-sm);
}
body.role-admin .frontend-surface-tabs .theme-studio-tab{
  display:flex;
  flex:1 1 0;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-width:0;
  border-radius:13px;
  text-decoration:none;
}
body.role-admin .frontend-surface-tabs .theme-studio-tab strong{
  color:inherit;
  font-size:.84rem;
}
body.role-admin .frontend-surface-tabs .theme-studio-tab small{
  max-width:48%;
  overflow:hidden;
  color:inherit;
  font-size:.7rem;
  font-weight:700;
  text-overflow:ellipsis;
  white-space:nowrap;
  opacity:.78;
}
body.role-admin .frontend-surface-note{margin:0 0 18px}
@media (max-width:720px){
  body.role-admin .frontend-surface-tabs{flex-direction:column}
  body.role-admin .frontend-surface-tabs .theme-studio-tab{width:100%}
}
