/*
 * Student Commons 5.11.2 — terminal contrast and icon visibility polish.
 * This layer sits after 5.11.1 and only strengthens foreground legibility.
 * It does not alter routing, data, membership, wallet or service behaviour.
 */

/* ---------- Guest palette: stronger small-copy and icon contrast ---------- */
html[data-theme="light"] body.nsc591-guest-document .nsc590-guest-app,
html[data-theme="light"] body.nsc591-guest-document .nsc590-guest-main{
  --nsc5112-muted:#364a40;
  --nsc5112-icon:#005a36;
  --nsc5112-accent:#005a36;
  --nsc5112-border:#8fa69a;
}
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app,
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-main{
  --nsc5112-muted:#d0ddd6;
  --nsc5112-icon:#b5f7d2;
  --nsc5112-accent:#b5f7d2;
  --nsc5112-border:#789486;
  /* Raise 5.11.1's secondary foregrounds for small UI text. */
  --nsc5111-guest-body:#e4eee9;
  --nsc5111-guest-muted:#d0ddd6;
  --nsc5111-guest-border:#789486;
  --nsc5111-guest-link:#b5f7d2;
  --nsc5111-guest-link-hover:#e2fff0;
}

/* Tiny metadata and secondary labels were technically valid but too subdued in live screenshots. */
html[data-theme] body.nsc591-guest-document .nsc590-guest-app :is(
  small,
  .nsc590-thread-stats,
  .nsc590-thread-card-meta small,
  .nsc590-answer-public-meta,
  .nsc590-home-rail li small,
  .nsc590-compact-list small,
  .nsc590-rail-join small,
  .nsc590-preview-card small,
  .nsc590-preview-stack span,
  .nsc590-footer-bottom
){
  color:var(--nsc5112-muted)!important;
  -webkit-text-fill-color:var(--nsc5112-muted)!important;
  opacity:1!important;
  filter:none!important;
}

/* Public section kickers and participation prompt need to read as intentional labels. */
html[data-theme] body.nsc591-guest-document .nsc590-guest-app :is(
  .nsc590-kicker,
  .nsc590-section-head>div>span,
  .nsc590-top-answer,
  .nsc590-thread-card-meta>span,
  .nsc590-rail-join>span,
  .nsc590-guest-main .nsc5-eyebrow
){
  color:var(--nsc5112-accent)!important;
  -webkit-text-fill-color:var(--nsc5112-accent)!important;
  opacity:1!important;
  font-weight:850!important;
}

/* SVGs inherited currentColor but several older rules still hard-coded a dark green stroke. */
html[data-theme] body.nsc591-guest-document .nsc590-guest-app :is(
  .nsc594-search-trigger,
  .nsc593-search-trigger,
  .nsc590-benefits li,
  .nsc590-home-rail li a>span,
  .nsc590-compact-list>a>span,
  .nsc590-guest-mobile-nav a:not(.is-join)
){
  color:var(--nsc5112-icon)!important;
  -webkit-text-fill-color:var(--nsc5112-icon)!important;
}
html[data-theme] body.nsc591-guest-document .nsc590-guest-app :is(
  .nsc594-search-trigger svg,
  .nsc593-search-trigger svg,
  .nsc590-benefits svg,
  .nsc590-home-rail li svg,
  .nsc590-compact-list svg,
  .nsc590-guest-mobile-nav svg
){
  color:var(--nsc5112-icon)!important;
  stroke:currentColor!important;
  stroke-width:2.15!important;
  opacity:1!important;
  filter:none!important;
}

/* Make icon chips distinct from dark card surfaces rather than mint-on-mint. */
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app :is(
  .nsc590-home-rail li a>span,
  .nsc590-compact-list>a>span
){
  background:#e8fff3!important;
  color:#005d38!important;
  -webkit-text-fill-color:#005d38!important;
  border:1px solid #b8e7cf!important;
}
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app :is(
  .nsc590-home-rail li a>span svg,
  .nsc590-compact-list>a>span svg
){
  color:#005d38!important;
  stroke:#005d38!important;
}
html[data-theme="light"] body.nsc591-guest-document .nsc590-guest-app :is(
  .nsc590-home-rail li a>span,
  .nsc590-compact-list>a>span
){
  background:#e7f5ed!important;
  color:#005a36!important;
  -webkit-text-fill-color:#005a36!important;
  border:1px solid #bad4c6!important;
}

/* Benefit tiles: preserve dark surfaces while making their glyphs unmistakable. */
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app .nsc590-benefits li{
  border-color:var(--nsc5112-border)!important;
  color:#f1f8f4!important;
  -webkit-text-fill-color:#f1f8f4!important;
}
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app .nsc590-benefits li svg{
  color:#b5f7d2!important;
  stroke:#b5f7d2!important;
}

/* Search control: older 5.9.3/5.9.4 CSS explicitly forced a light-theme green icon. */
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app .nsc594-search-trigger{
  border-color:#789486!important;
  color:#f7fbf9!important;
  -webkit-text-fill-color:#f7fbf9!important;
}
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app .nsc594-search-trigger>span{
  color:#f7fbf9!important;
  -webkit-text-fill-color:#f7fbf9!important;
}
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app .nsc594-search-trigger svg{
  color:#b5f7d2!important;
  stroke:#b5f7d2!important;
}
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app .nsc594-search-trigger kbd{
  background:#1d3328!important;
  border-color:#85a597!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  opacity:1!important;
}

/* Rail card and compact-list body copy. */
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app :is(
  .nsc590-home-rail p,
  .nsc590-rail-join p,
  .nsc590-answer-grid p,
  .nsc590-thread-stats,
  .nsc590-compact-list small
){
  color:#e4eee9!important;
  -webkit-text-fill-color:#e4eee9!important;
}
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app .nsc590-rail-join>span{
  color:#b5f7d2!important;
  -webkit-text-fill-color:#b5f7d2!important;
  text-shadow:none!important;
}

/* Public card borders should remain visible when the display is dimmed. */
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app :is(
  .nsc590-thread-card,
  .nsc590-answer-grid article,
  .nsc590-home-rail>section,
  .nsc590-compact-list,
  .nsc590-auth-card,
  .nsc590-participation-gate,
  .nsc590-circle-join-gate
){
  border-color:#789486!important;
}

/* Footer copy: increase small-copy brightness but keep hierarchy below headings. */
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app .nsc590-guest-footer :is(
  p,span,small,.nsc590-footer-bottom
){
  color:#e1eee7!important;
  -webkit-text-fill-color:#e1eee7!important;
  opacity:1!important;
}
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app .nsc590-guest-footer a,
html[data-theme="dark"] body.nsc591-guest-document .nsc590-guest-app .nsc590-guest-footer a *{
  color:#f7fff9!important;
  -webkit-text-fill-color:#f7fff9!important;
  opacity:1!important;
}

/* ---------- Member shell: modest small-text/icon lift only ---------- */
html[data-theme="dark"] body.nsc5-document.nsc590-member-document .nsc590-member-app{
  --nsc5111-muted:#cad8d1;
  --nsc5111-link:#b1f5cf;
  --nsc5111-link-hover:#e1fff0;
  --nsc5111-border:#7e978b;
}
html[data-theme="dark"] body.nsc5-document.nsc590-member-document .nsc590-member-app :is(
  .nsc5-icon-button svg,
  .nsc5-nav-item svg,
  .nsc5-account-menu-toggle svg,
  .nsc5-mobile-nav svg
){
  color:currentColor!important;
  stroke:currentColor!important;
  opacity:1!important;
}

@media(forced-colors:active){
  html[data-theme] body.nsc5-document .nsc5-app svg{forced-color-adjust:auto}
}
