/* High contrast: one shared state contract. Loaded after component sheets.
   Only yellow/black themes; inset rings do not affect layout or get clipped by rails.
   Tinted yellow/black surfaces preserve foreground contrast in nested controls. */
:root[data-theme="yellow-black"]{--hc-hover:#292600;--hc-selected:#494300;--hc-selected-hover:#595200}
:root[data-theme="black-yellow"]{--hc-hover:#e6d300;--hc-selected:#c4b400;--hc-selected-hover:#b3a400}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]){
 --selection:var(--hc-selected)!important;--surface-hover:var(--hc-hover)!important;
 --surface-selected-hover:var(--hc-selected-hover)!important;
 --field-hover:var(--hc-hover)!important;--field-focus:var(--hc-selected)!important;
 --on-action-hover:var(--hc-bg)!important;--on-action-blue:var(--hc-bg)!important;
 --on-danger:var(--hc-bg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) body::before{display:none}
/* Small, explicit families: do not put borders around every text span or icon. */
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(
 .cta,.catalog-control,.top-icon,.command-trigger,.command-close,.event-close,
 .library-tabs button,.ms-tabs button,.rail-controls button,.feature-actions a,
 .favorite-toggle,.calendar-add,.hero-playback,.ms-icon,.projects-more,
 .pf-icon-button,.oc-fold,.sp-social a,.sp-social-links a,.sp-links a,
 .projects-menu button,.catalog-dropdown button,.sw-plan-card){
 background:var(--hc-bg)!important;color:var(--hc-fg)!important;
 outline:none;box-shadow:inset 0 0 0 1px var(--hc-fg)!important;
 text-shadow:none!important;filter:none;transition:none!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(
 .cta,.catalog-control,.top-icon,.command-trigger,.command-close,.event-close,
 .library-tabs button,.ms-tabs button,.rail-controls button,.feature-actions a,
 .favorite-toggle,.calendar-add,.hero-playback,.ms-icon,.projects-more,
 .pf-icon-button,.oc-fold,.sp-social a,.sp-social-links a,.sp-links a,
 .projects-menu button,.catalog-dropdown button,.sw-plan-card):not(:disabled):hover{
 background:var(--hc-hover)!important;color:var(--hc-fg)!important;
 box-shadow:inset 0 0 0 2px var(--hc-fg)!important;outline:none;text-decoration:none;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(
 .library-tabs button,.ms-tabs button,.catalog-control,.cta,.sw-plan-card):is(
 .active,.is-active,[aria-pressed=true],[aria-expanded=true]){
 background:var(--hc-selected)!important;color:var(--hc-fg)!important;
 box-shadow:inset 0 0 0 3px var(--hc-fg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(
 .library-tabs button,.ms-tabs button,.catalog-control,.cta,.sw-plan-card):is(
 .active,.is-active,[aria-pressed=true],[aria-expanded=true]):hover{
 background:var(--hc-selected-hover)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(
 .cta--primary,.cta--priority,.favorite-toggle[aria-pressed=true],.calendar-add[aria-pressed=true]){
 background:var(--hc-fg)!important;color:var(--hc-bg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(
 .cta--primary,.cta--priority,.favorite-toggle[aria-pressed=true],.calendar-add[aria-pressed=true]):not(:disabled):hover{
 background:var(--hc-fg)!important;color:var(--hc-bg)!important;
 box-shadow:inset 0 0 0 2px var(--hc-fg),inset 0 0 0 4px var(--hc-bg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(
 .cta,.catalog-control,.top-icon,.library-tabs button,.ms-tabs button,.feature-actions a) :is(span,svg,small,strong){
 color:inherit!important;
}
/* Row selection is separate from checkbox selection. Text never swaps to its own background. */
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(
 .projects-row,.ct-row,.ms-conversation,.ml-row,.td-row,.mg-card,.sl-row,.or-row,
 .pf-item,.nf-row,.cal-agenda-row,.cal-event,.cal-day,.cal-week-date,
 .catalog-choice,.nf-filter-choice,.ov-row,.pov-row){
 color:var(--hc-fg)!important;outline:none;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(
 .projects-row,.ct-row,.ms-conversation,.ml-row,.td-row,.mg-card,.sl-row,.or-row,
 .pf-item,.nf-row,.cal-agenda-row,.cal-event,.cal-day,.cal-week-date,
 .catalog-choice,.nf-filter-choice,.ov-row,.pov-row):hover{
 background:var(--hc-hover)!important;color:var(--hc-fg)!important;
 box-shadow:inset 0 0 0 1px var(--hc-fg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(
 .ct-row,.ms-conversation,.ml-row,.td-row,.mg-card,.sl-row,.or-row,.pf-item,
 .nf-row,.cal-agenda-row,.cal-event,.cal-day,.cal-week-date,.catalog-choice,.nf-filter-choice):is(
 .is-selected,.is-current,.is-checked,[aria-selected=true]){
 background:var(--hc-selected)!important;color:var(--hc-fg)!important;
 box-shadow:inset 0 0 0 3px var(--hc-fg)!important;outline:none;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(
 .ct-row,.ms-conversation,.ml-row,.td-row,.mg-card,.sl-row,.or-row,.pf-item,
 .nf-row,.cal-agenda-row,.cal-event,.cal-day,.cal-week-date):is(
 .is-selected,.is-current,.is-checked,[aria-selected=true]):hover{
 background:var(--hc-selected-hover)!important;
}
/* Checked filter options retain readable ink and a persistent state indicator. */
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(.catalog-choice,.nf-filter-choice,.ms-person-picker label):has(input:checked){
 background:var(--hc-selected)!important;box-shadow:inset 0 0 0 2px var(--hc-fg)!important;
}
/* Product actions remain transparent until the actual button is hovered. */
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .catalog-category-option{
 outline:none!important;box-shadow:inset 0 0 0 1px var(--hc-fg)!important;background:var(--hc-bg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .catalog-category-option>button{
 outline:none;background:transparent!important;color:var(--hc-fg)!important;box-shadow:none!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .catalog-category-option:hover{
 background:var(--hc-hover)!important;box-shadow:inset 0 0 0 2px var(--hc-fg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .catalog-category-option.is-browsing{
 background:var(--hc-selected)!important;box-shadow:inset 0 0 0 3px var(--hc-fg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .catalog-category-option.is-browsing:hover{background:var(--hc-selected-hover)!important}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .catalog-category-option .catalog-category-check{
 background:transparent!important;outline:none;box-shadow:none!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .sl-row :is(.oc-fold,.pf-icon-button,.projects-more):not(:hover):not(:focus-visible){
 background:transparent!important;box-shadow:none!important;
}
/* Calendar: grid boundaries, today underline, selection ring and filled date are distinct. */
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .cal-month{background:var(--hc-fg);border-color:var(--hc-fg)}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .cal-date{color:var(--hc-fg);background:transparent}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .cal-date.is-today{
 background:transparent;color:var(--hc-fg);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:4px;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .cal-date[aria-pressed=true]{
 background:var(--hc-fg);color:var(--hc-bg);font-weight:600;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .cal-hour-slot{border-color:var(--hc-fg)}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .cal-hour-slot:hover{background:var(--hc-hover)}
/* Draw card perimeter above content, not outside a clipped carousel. Keep photographs unchanged. */
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .feature-card{position:relative;outline:none!important}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .feature-card::after{
 content:"";position:absolute;inset:0;border:1px solid var(--hc-fg);border-radius:inherit;pointer-events:none;z-index:3;
 background:none;mask:none;-webkit-mask:none;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .feature-card:hover::after{border-width:2px}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .feature-card.variant-card.is-selected::after{border-width:4px}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .feature-card:hover .feature-copy{background:var(--hc-hover)!important}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .feature-art :is(strong,b,span:not([class]),.brand-wordmark){
 color:var(--hc-fg)!important;opacity:1!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .ct-avatar:not(:has(img)){
 background:var(--hc-bg)!important;color:var(--hc-fg)!important;
 box-shadow:inset 0 0 0 1px var(--hc-fg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .library-variant-count{
 background:transparent!important;color:inherit!important;outline:none!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(.home-shortcuts a,.promo-banner,.hero-main,.hero-thumb){
 outline:none!important;box-shadow:inset 0 0 0 1px var(--hc-fg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .home-shortcuts a:hover{
 background:var(--hc-hover)!important;box-shadow:inset 0 0 0 2px var(--hc-fg)!important;
}
/* Profile links must inherit accessible ink on hover rather than hardcoded white. */
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .sp-screen a:hover{
 color:var(--hc-fg)!important;background:var(--hc-hover)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .sp-screen a:hover *{color:inherit!important}
/* Images used as monochrome controls retain ink; content images and avatars are not filtered. */
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .command-trigger{border-radius:var(--radius-control,10px)}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .command{outline:none!important}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .command.is-open{box-shadow:inset 0 0 0 1px var(--hc-fg)!important}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .sidebar .nav-item{
 outline:none;box-shadow:none!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .sidebar .nav-item:hover{
 box-shadow:inset 0 0 0 2px var(--hc-fg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .sidebar .nav-item.active:hover{
 box-shadow:inset 0 0 0 2px var(--hc-bg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :is(.top-icon,.command-trigger,.command-close) img{filter:var(--hc-icon)!important}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .nf-upgrade.cta{
 background:#000!important;color:#fff!important;border-color:transparent!important;
 box-shadow:inset 0 0 0 1px var(--hc-fg)!important;animation:none!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) .nf-upgrade.cta:hover{
 background:#000!important;color:#fff!important;box-shadow:inset 0 0 0 2px var(--hc-fg)!important;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) button:disabled{
 opacity:1!important;background:var(--hc-bg)!important;color:var(--hc-fg)!important;
 outline:1px dashed var(--hc-fg)!important;outline-offset:-2px!important;
 box-shadow:none!important;cursor:not-allowed;
}
:root:is([data-theme="yellow-black"],[data-theme="black-yellow"]) :focus-visible{
 outline:3px double var(--hc-fg)!important;outline-offset:2px!important;
}
