/* P01 UX/UI Reconstruction Round 8 · terminal shared visual-system layer.
 * Product pages keep their own body identity; this file standardizes only
 * cross-product interaction, readability, focus, dialog and mobile ergonomics.
 */
:root{
  --vf-focus-ring:color-mix(in srgb,var(--ws-teal,#0f766e) 34%,transparent);
  --vf-control-radius:9px;
  --vf-touch-target:44px;
  --vf-shell-max:1240px;
  --vf-shell-gutter:32px;
  --vf-panel-radius:12px;
  --vf-shell-shadow:0 1px 2px rgba(15,23,42,.035);
}

/* UX01 · global VF Start visual rhythm.
 * Approved HiFi / Direction authority is light, quiet and action-first:
 * neutral canvas, white chrome, restrained teal, compact readable controls.
 * Keep this layer structural; product-specific composition stays downstream.
 */
body.vf-surface-app{
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
@media(min-width:761px){
  .vf-functional-workspace{--ws-sidebar:216px}
}
.vf-surface-app .vf-app-sidebar{
  background:var(--ws-panel);
  border-right-color:var(--ws-line);
  box-shadow:none;
}
.vf-surface-app .vf-app-brand strong{
  color:var(--ws-strong);
  font-size:16px;
  font-weight:760;
  letter-spacing:-.012em;
}
.vf-surface-app .vf-app-brand small{
  color:var(--ws-muted-2);
  font-size:10.5px;
}
.vf-surface-app .vf-app-topbar{
  min-height:58px;
  padding-inline:24px;
  gap:16px;
  background:color-mix(in srgb,var(--ws-panel) 97%,transparent);
  border-bottom-color:var(--ws-line);
  box-shadow:none;
}
.vf-surface-app .vf-global-search{
  width:min(600px,62vw);
  height:42px;
  padding-inline:11px;
  border-color:var(--ws-line-strong);
  border-radius:10px;
  box-shadow:var(--vf-shell-shadow);
  transition:border-color .14s ease,box-shadow .14s ease,background-color .14s ease;
}
.vf-surface-app .vf-global-search:focus-within{
  border-color:color-mix(in srgb,var(--ws-teal) 48%,var(--ws-line-strong));
  box-shadow:0 0 0 3px color-mix(in srgb,var(--ws-teal) 10%,transparent);
}
.vf-surface-app .vf-global-search input{
  font-size:13.5px;
  line-height:1.4;
}
.vf-surface-app .vf-global-search kbd{
  border-color:var(--ws-line);
  background:var(--ws-soft);
  color:var(--ws-muted);
}
.vf-surface-app .vf-top-actions{gap:8px}
.vf-surface-app :where(.vf-context-action,.vf-workspace-button,.vf-secondary-button){
  min-height:38px;
  padding-inline:12px;
  border-color:var(--ws-line-strong);
  border-radius:var(--vf-control-radius);
  background:var(--ws-panel);
}
.vf-surface-app :where(.vf-context-action,.vf-workspace-button,.vf-secondary-button):hover{
  border-color:var(--ws-line-strong);
  background:var(--ws-soft);
}
.vf-surface-app .vf-new-action{
  border-color:var(--ws-teal);
  background:var(--ws-teal);
  color:#fff;
}
.vf-surface-app .vf-new-action:hover{
  border-color:var(--ws-teal-deep);
  background:var(--ws-teal-deep);
  color:#fff;
}
.vf-surface-app .vf-theme-toggle{
  min-width:38px;
  min-height:38px;
  border-radius:var(--vf-control-radius);
}
.vf-surface-app .vf-shell-main{
  width:min(var(--vf-shell-max),calc(100% - var(--vf-shell-gutter)));
  padding-top:28px;
  padding-bottom:72px;
}
.vf-surface-app .vf-global-domain-nav{
  background:color-mix(in srgb,var(--ws-panel) 98%,transparent);
  border-bottom-color:var(--ws-line);
  box-shadow:none;
}
.vf-surface-app .vf-global-domain-nav-inner{
  padding-inline:18px;
  gap:4px;
}
.vf-surface-app .vf-global-domain-links>a{
  padding-inline:12px;
  color:var(--ws-muted);
  font-size:12.5px;
  font-weight:620;
}
.vf-surface-app .vf-global-domain-links>a:hover{
  background:var(--ws-soft);
  color:var(--ws-strong);
}
.vf-surface-app .vf-global-domain-links>a.active{
  color:var(--ws-teal);
  font-weight:760;
}

/* Keyboard focus is a product-wide state, not a page-specific decoration. */
.vf-surface-app :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:3px solid var(--vf-focus-ring);
  outline-offset:2px;
}
.vf-surface-app :where(button,input,select,textarea):disabled{
  opacity:.58;
  cursor:not-allowed;
}

/* First-class Subject pages share the global domain strip without opting into
 * the legacy functional-workspace mobile command-row contract. Keep their own
 * topbar, but reserve the domain-strip height and remove the now-empty mobile
 * sidebar shell. */
.vf-subject-page .vf-app-sidebar{top:var(--ws-domain-nav)}
.vf-subject-page .vf-app-stage{padding-top:var(--ws-domain-nav)}

/* Shared text safety only. Product typography and information density belong
 * to each product stylesheet so the terminal layer cannot flatten HiFi pages. */
.vf-surface-app :where(.vf-home-attention-copy,.vf-home-activity-copy,.vf-subject-title,.vf-subject-section-head,.vf-topic-library-body,.vf-project-action-copy,.vf-project-action-card,.vf-course-card-body,.vf-channel-card-copy,.vf-watch-library-copy,.vf-tool-card-copy,.vf-software-card-copy){
  min-width:0;
  overflow-wrap:anywhere;
}

/* Shared dialogs keep component-specific sizing while respecting the viewport. */
.vf-surface-app dialog{
  max-width:calc(100vw - 24px);
  max-height:calc(100dvh - 24px);
  overscroll-behavior:contain;
}
.vf-surface-app dialog::backdrop{
  background:rgba(10,18,18,.48);
  backdrop-filter:blur(2px);
}

/* The old page-body surface nav may wrap; the global nine-entry strip remains
 * independently scrollable so every product stays reachable on narrow screens.
 */
.vf-surface-app .surface-nav{
  flex-wrap:wrap;
  overflow-x:visible;
}
.vf-subject-page .vf-subject-pagination{
  flex-wrap:wrap;
  max-width:100%;
}

/* Common icon/control geometry. Large product CTAs retain their own dimensions. */
.vf-surface-app :where(.vf-icon-button,.vf-theme-toggle,.vf-mobile-category-close){
  min-width:36px;
  min-height:36px;
}
.vf-surface-app :where(.vf-context-action,.vf-workspace-button,.vf-secondary-button){
  min-height:36px;
  border-radius:var(--vf-control-radius);
}

/* Topics · full-page knowledge-library polish. Scoped so no other Subject page changes. */
.vf-topic-library-page .vf-subject-main{padding-top:22px;gap:0}
.vf-topic-library-page .vf-topic-hero{grid-template-columns:minmax(0,1fr) auto;gap:24px;margin-bottom:6px}
.vf-topic-library-page .vf-subject-title h1{font-size:28px}
.vf-topic-library-page .vf-subject-title p{max-width:650px;margin-top:7px;font-size:12.5px;line-height:1.6}
.vf-topic-library-page .vf-subject-stats{min-height:0;display:flex;align-items:center;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible}
.vf-topic-library-page .vf-subject-stats>div{min-width:88px;padding:3px 13px;align-items:flex-start;gap:2px}
.vf-topic-library-page .vf-subject-stats>div:first-child{padding-left:0}
.vf-topic-library-page .vf-subject-stats>div+div:before{top:8%;bottom:8%}
.vf-topic-library-page .vf-subject-stats small{font-size:9.8px;font-weight:600}
.vf-topic-library-page .vf-subject-stats strong{color:var(--ws-strong);font-size:18px;font-weight:740}
.vf-topic-library-page .vf-subject-chips{gap:5px;margin:8px 0 14px}
.vf-topic-library-page .vf-subject-chips a{min-height:31px;padding:0 10px;border-radius:8px;background:transparent;color:var(--ws-muted);font-size:10.8px;font-weight:620}
.vf-topic-library-page .vf-subject-chips a:hover{background:var(--ws-soft);color:var(--ws-text)}
.vf-topic-library-page .vf-subject-chips a.active{border-color:color-mix(in srgb,var(--ws-teal) 28%,var(--ws-line));background:var(--ws-teal-soft);color:var(--ws-teal)}
.vf-topic-library-page .vf-subject-section-head{min-height:38px;margin-bottom:8px;align-items:center}
.vf-topic-library-page .vf-subject-section-head>div{display:flex;align-items:baseline;gap:8px;min-width:0}
.vf-topic-library-page .vf-subject-section-head h2{font-size:15.5px}
.vf-topic-library-page .vf-subject-section-head>div>small{color:var(--ws-muted-2);font-size:10.5px}
.vf-topic-library-page .vf-subject-section-head select{height:32px;font-size:10.8px}
.vf-topic-library-page .vf-topic-library-grid{gap:10px}
.vf-topic-library-page .vf-topic-library-card{border-radius:10px;box-shadow:none;transition:border-color .14s ease,background-color .14s ease}
.vf-topic-library-page .vf-topic-library-card:hover{transform:none;border-color:var(--ws-line-strong);background:color-mix(in srgb,var(--ws-soft) 45%,var(--ws-panel));box-shadow:none}
.vf-topic-library-page .vf-topic-library-body{padding:12px 12px 10px}
.vf-topic-library-page .vf-topic-library-body h3{font-size:14.5px;line-height:1.4}
.vf-topic-library-page .vf-topic-library-body h3>a:focus-visible,.vf-topic-library-page .vf-topic-library-cover:focus-visible{outline:2px solid var(--ws-teal);outline-offset:-2px}
.vf-topic-library-page .vf-topic-library-body p{margin-top:6px;font-size:10.8px;line-height:1.55}
.vf-topic-library-page .vf-topic-library-tags{gap:4px;margin-top:8px}
.vf-topic-library-page .vf-topic-library-tags span{padding:3px 6px;border:0;border-radius:5px;background:var(--ws-soft-2);font-size:9.4px}
.vf-topic-library-page .vf-topic-library-card>footer{min-height:44px;padding:5px 8px 5px 12px;flex-wrap:nowrap;gap:6px;font-size:9.8px}
.vf-topic-library-page .vf-topic-updated{color:var(--ws-muted-2)}
.vf-topic-library-page .vf-topic-library-actions{gap:3px}
.vf-topic-library-page .vf-topic-library-actions .vf-icon-button{width:34px;height:34px;min-width:34px;min-height:34px;border-color:transparent;background:transparent}
.vf-topic-library-page .vf-topic-library-card:hover .vf-topic-library-actions .vf-icon-button,.vf-topic-library-page .vf-topic-library-card:focus-within .vf-topic-library-actions .vf-icon-button{border-color:var(--ws-line);background:var(--ws-panel)}
.vf-topic-library-page .vf-topic-empty{padding:30px 18px}
.vf-topic-library-page .vf-topic-empty a{min-height:34px;margin-top:12px;padding:0 11px;border:1px solid color-mix(in srgb,var(--ws-teal) 24%,var(--ws-line));border-radius:7px;background:var(--ws-teal-soft);display:inline-flex;align-items:center;justify-content:center;color:var(--ws-teal);font-size:10.8px;font-weight:700;text-decoration:none}
.vf-topic-library-page .vf-subject-footnote{margin-top:22px;padding-top:12px}

@media(max-width:760px){
  :root{--vf-shell-gutter:20px;--ws-domain-nav:48px}
  .vf-surface-app .vf-global-domain-links{
    scroll-padding-inline:10px;
    -webkit-overflow-scrolling:touch;
  }
  .vf-surface-app .vf-global-domain-links>a{
    min-height:44px;
    padding-inline:10px;
    font-size:12.75px;
  }
  .vf-surface-app .vf-shell-main{
    width:min(var(--vf-shell-max),calc(100% - var(--vf-shell-gutter)));
    padding-top:16px;
    padding-bottom:52px;
  }
  .vf-surface-app .vf-global-domain-nav-inner{padding-inline:6px;gap:0}
  .vf-surface-app .vf-global-domain-links>a{padding-inline:11px}
  .vf-subject-page .vf-app-topbar{padding-inline:10px;gap:8px}
  .vf-subject-page .vf-global-search{width:100%;height:40px;min-width:0}
  .vf-subject-page .vf-top-actions{gap:5px}

  /* One mobile interaction floor across product pages. Layouts may wrap, but
   * the action itself must remain comfortably tappable. */
  .vf-surface-app :where(
    .vf-icon-button,
    .vf-action-menu-trigger,
    .vf-action-menu-popover .vf-action-menu-item,
    .vf-theme-toggle,
    .vf-context-action,
    .vf-workspace-button,
    .vf-secondary-button,
    .vf-mobile-category-close,
    .vf-subject-pagination a,
    .vf-project-action-row>a,
    .vf-project-action-row>button,
    .vf-topic-open,
    .vf-course-open,
    .vf-course-state-action,
    .vf-watch-coverage-button,
    .vf-watch-enrich-button,
    .vf-channel-controls form button,
    .vf-channel-controls nav a,
    .vf-channel-facets a,
    .vf-watch-controls form button,
    .vf-watch-statuses a,
    .vf-watch-facets a,
    .vf-watch-filterbar select,
    .vf-tool-task-search button,
    .vf-tool-facets a,
    .vf-tool-detail-search button,
    .vf-tool-detail-sort a,
    .vf-tool-detail-pages a,
    .vf-software-platforms a,
    .vf-software-run-row a,
    .vf-software-detail-controls form button,
    .vf-software-detail-controls nav a,
    .vf-software-empty-reset,
    .vf-software-detail .vf-tool-detail-pages a,
    .vf-course-continue-link,
    .vf-course-import-body button,
    .vf-course-section-head select
  ){
    min-width:var(--vf-touch-target)!important;
    min-height:var(--vf-touch-target)!important;
  }
  .vf-surface-app :where(.vf-subject-chips a,.vf-course-chips a){min-height:var(--vf-touch-target)!important}
  .vf-subject-page :where(.vf-channel-controls form,.vf-watch-controls form,.vf-tool-detail-search,.vf-software-detail-controls>form){height:44px!important;min-height:44px}
  .vf-surface-app dialog{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}
  body.vf-subject-page{padding-bottom:0}
  .vf-subject-page .vf-app-sidebar{display:none!important;top:auto;bottom:auto}

  .vf-topic-library-page .vf-subject-main{padding-top:14px}
  .vf-topic-library-page .vf-topic-hero{grid-template-columns:1fr;gap:10px;margin-bottom:4px}
  .vf-topic-library-page .vf-subject-title h1{font-size:25px}
  .vf-topic-library-page .vf-subject-title p{font-size:11.8px}
  .vf-topic-library-page .vf-subject-stats{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding-top:7px;border-top:1px solid var(--ws-line)}
  .vf-topic-library-page .vf-subject-stats>div{min-width:0;padding:2px 8px;align-items:flex-start}
  .vf-topic-library-page .vf-subject-stats>div:first-child{padding-left:0}
  .vf-topic-library-page .vf-subject-stats strong{font-size:16px}
  .vf-topic-library-page .vf-subject-chips{margin:7px 0 11px}
  .vf-topic-library-page .vf-subject-section-head{align-items:flex-start;flex-direction:row}
  .vf-topic-library-page .vf-subject-section-head select{min-height:44px;height:44px}
  .vf-topic-library-page .vf-topic-library-card>footer{align-items:center;flex-direction:row}
  .vf-topic-library-page .vf-topic-library-actions{width:auto;margin-left:auto}
  .vf-topic-library-page .vf-topic-library-tags span:nth-child(n+3){display:none}
  .vf-topic-library-page .vf-topic-empty a{min-height:44px}
}

@media(max-width:460px){
  .vf-topic-library-page .vf-subject-section-head{align-items:flex-start;flex-direction:column;gap:8px}
  .vf-topic-library-page .vf-subject-section-head>label{width:100%;justify-content:space-between}
  .vf-topic-library-page .vf-subject-section-head select{min-width:145px}
}

@media (prefers-reduced-motion: reduce){
  .vf-surface-app *,
  .vf-surface-app *::before,
  .vf-surface-app *::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}

/* R77 — Saved display settings must affect real resource surfaces.
 * These selectors intentionally target resource notes/source metadata only;
 * product copy, health facts and externally sourced media overviews stay visible.
 */
body[data-vf-show-descriptions="0"] .vf-asset-copy>em,
body[data-vf-show-descriptions="0"] .vf-topic-copy>em,
body[data-vf-show-descriptions="0"] .vf-book-copy>p,
body[data-vf-show-descriptions="0"] .vf-project-card>p,
body[data-vf-show-descriptions="0"] .vf-channel-card .vf-channel-copy>p,
body[data-vf-show-descriptions="0"] .vf-topic-library-card .vf-topic-library-body>p,
body[data-vf-show-descriptions="0"] .vf-course-card .vf-course-card-body>p,
body[data-vf-show-descriptions="0"] .vf-project-action-card>header p,
body[data-vf-show-descriptions="0"] .vf-tool-detail-copy>em,
body[data-vf-show-descriptions="0"] .vf-tool-product-description,
body[data-vf-show-descriptions="0"] .vf-software-detail-copy>em{
  display:none!important;
}

body[data-vf-show-domains="0"] .vf-resource-domain{
  display:none!important;
}

/* P01 Full Product UX/UI Closure · Public Shared Rhythm R1.
 * Navigation is a first-class product entry too. It keeps its functional
 * workspace layout, but its page heading follows the same public hierarchy as
 * Channels / Watch / Topics / Courses / Projects / Tools / Software. */
.vf-functional-workspace .vf-workspace-head{
  min-height:0;
  margin-bottom:14px;
  align-items:flex-start;
}
.vf-functional-workspace .vf-workspace-head h1{
  font-size:26px!important;
  line-height:1.15!important;
  font-weight:760;
  letter-spacing:-.025em;
}
.vf-functional-workspace .vf-workspace-head p{
  margin-top:5px;
  max-width:760px;
  font-size:12px;
  line-height:1.55;
}
.vf-functional-workspace .vf-workspace-toolbar{
  border-radius:10px;
  box-shadow:none;
}
.vf-functional-workspace .vf-workspace-toolbar :is(select,button,a){
  font-size:12px;
}

@media(max-width:760px){
  .vf-functional-workspace .vf-workspace-head{
    margin-bottom:11px;
  }
  .vf-functional-workspace .vf-workspace-head h1{
    font-size:24px!important;
    line-height:1.18!important;
  }
  .vf-functional-workspace .vf-workspace-head p{
    font-size:11.8px;
    line-height:1.5;
  }
}



/* R1 top product switcher authority. */
.vf-surface-app .vf-global-product-brand{
  min-width:max-content;
}
.vf-surface-app .vf-global-product-copy strong{
  font-size:13px;
  font-weight:760;
}
.vf-surface-app .vf-global-product-copy small{
  font-size:9.5px;
}
@media(max-width:1040px) and (min-width:761px){
  .vf-surface-app .vf-global-product-copy small{display:none}
  .vf-surface-app .vf-global-domain-links>a{padding-inline:9px}
}
@media(max-width:760px){
  .vf-surface-app .vf-global-product-brand{padding-left:2px;padding-right:4px}
}
