/* CampusShield AI — mobile header polish.
   Presentation-only: keep existing navigation, search, permissions and backend logic intact. */

@media (max-width: 650px) {
  #workspace .topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 46px;
    grid-template-areas:
      "brand menu"
      "search search";
    align-items: center;
    justify-content: stretch;
    gap: 11px 12px;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: max(10px, env(safe-area-inset-top)) 14px 13px;
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
    overflow: visible;
    background:
      radial-gradient(ellipse at 84% 0%, rgba(139, 227, 160, .13), transparent 42%),
      linear-gradient(135deg, rgba(5, 29, 22, .98), rgba(13, 54, 40, .97));
    border-bottom: 1px solid rgba(139, 227, 160, .2);
    box-shadow: 0 9px 25px rgba(4, 22, 17, .18);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
  }

  #workspace .mobile-topbar-brand {
    grid-area: brand;
    display: flex !important;
    align-items: center;
    justify-self: stretch;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
    color: #f0fbf4;
    font-size: 15px;
    font-weight: 820;
    line-height: 1.15;
    letter-spacing: -.035em;
    white-space: nowrap;
  }

  #workspace .mobile-topbar-brand > span:last-child {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #workspace .mobile-topbar-mark {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(139, 227, 160, .24);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(139, 227, 160, .2), rgba(255, 255, 255, .055));
    color: #aaf0bc !important;
    box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 5px 14px rgba(0, 0, 0, .12);
  }

  #workspace .mobile-topbar-mark svg {
    width: 21px;
    height: 21px;
  }

  #workspace .mobile-topbar-help {
    display: none !important;
  }

  #workspace .mobile-nav-toggle {
    grid-area: menu;
    display: inline-grid !important;
    place-items: center;
    justify-self: end;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border: 1px solid rgba(169, 226, 190, .28);
    border-radius: 14px;
    background: rgba(237, 255, 244, .1);
    color: #eaffef;
    font-size: 20px;
    line-height: 1;
    box-shadow: inset 0 1px rgba(255, 255, 255, .09), 0 5px 14px rgba(0, 0, 0, .1);
    -webkit-tap-highlight-color: transparent;
  }

  #workspace .mobile-nav-toggle:active {
    background: rgba(139, 227, 160, .2);
    transform: scale(.97);
  }

  #workspace .mobile-nav-toggle:focus-visible {
    outline: 3px solid #8be3a0;
    outline-offset: 2px;
  }

  #workspace .global-search {
    grid-area: search;
    display: block;
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: none;
    margin: 0 !important;
  }

  #workspace .global-search-input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 44px 0 43px;
    border: 1px solid rgba(175, 222, 193, .27);
    border-radius: 15px;
    background: rgba(244, 255, 248, .095);
    color: #f1fbf4;
    font-size: 16px;
    line-height: 1.2;
    box-shadow: inset 0 1px rgba(255, 255, 255, .055);
  }

  #workspace .global-search-input::placeholder {
    color: #b9d0c2;
    opacity: 1;
  }

  #workspace .global-search-input:focus {
    border-color: rgba(139, 227, 160, .72);
    background: rgba(244, 255, 248, .13);
    box-shadow: 0 0 0 3px rgba(139, 227, 160, .16);
    outline: none;
  }

  #workspace .global-search-icon {
    left: 15px;
    color: #acd7bb;
  }

  #workspace .global-search-kbd {
    display: none;
  }

  #workspace .global-search-results {
    top: calc(100% + 8px);
    z-index: 60;
    border: 1px solid rgba(203, 226, 210, .95);
    border-radius: 15px;
    box-shadow: 0 18px 40px rgba(3, 22, 15, .24);
  }

  #workspace .topbar-title,
  #workspace .topbar-actions {
    display: none !important;
  }
}

@media (max-width: 360px) {
  #workspace .topbar {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 9px 9px;
    padding-right: 11px;
    padding-left: 11px;
  }

  #workspace .mobile-nav-toggle {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  #workspace .mobile-topbar-brand {
    gap: 8px;
    font-size: 14px;
  }

  #workspace .mobile-topbar-mark {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #workspace .mobile-nav-toggle {
    transition: none !important;
  }
}

html[data-theme="dark"] #workspace .global-search-results {
  border-color: #315342;
  background: #102b22;
  color: #e5f1e9;
}


/* Mobile dashboard bento refinement inspired by the supplied reference.
   Keeps the existing action destinations and emergency guidance unchanged. */
@media (max-width: 650px) {
  #workspace .quick-action-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid #d5e7dc;
    border-radius: 19px;
    background: linear-gradient(150deg, #ffffff 0%, #f4faf6 100%);
    box-shadow: 0 12px 28px rgba(8, 41, 31, .075), inset 0 1px rgba(255,255,255,.95);
  }

  #workspace .quick-action-bar-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    color: #667b72;
    font-size: 11px;
    line-height: 1.45;
  }

  #workspace .quick-action-eyebrow {
    color: #176746;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .18em;
  }

  #workspace .quick-action-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px;
    width: 100%;
    min-width: 0;
  }

  #workspace .quick-action-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
    min-height: 66px;
    padding: 10px;
    border: 1px solid #dcebe2;
    border-radius: 14px;
    background: linear-gradient(145deg, #ffffff, #f0f7f2);
    color: #23483a;
    font-size: 10.5px;
    font-weight: 850;
    line-height: 1.3;
    text-align: left;
    box-shadow: 0 5px 13px rgba(12, 55, 35, .045), inset 0 1px rgba(255,255,255,.95);
    transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
  }

  #workspace .quick-action-button > span:last-child {
    display: block;
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
  }

  #workspace .quick-action-button:active {
    transform: scale(.985);
  }

  #workspace .quick-action-button.quick-action-primary {
    border-color: #14583b;
    background: linear-gradient(145deg, #0a3024, #17603f);
    color: #f5fff7;
    box-shadow: 0 8px 17px rgba(7, 49, 30, .16), inset 0 1px rgba(255,255,255,.12);
  }

  #workspace .quick-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 11px;
    background: #e0f2e6;
    color: #216b48;
  }

  #workspace .quick-action-icon svg {
    width: 18px;
    height: 18px;
  }

  #workspace .quick-action-primary .quick-action-icon {
    background: rgba(255,255,255,.12);
    color: #a9edb8;
  }

  #workspace .quick-action-safety-note {
    grid-column: 1 / -1;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid #e1ebe4;
    border-radius: 12px;
    background: #f7faf8;
    color: #62756c;
    font-size: 10px;
    line-height: 1.55;
  }

  #workspace .quick-action-safety-note strong {
    color: #285744;
  }
}

@media (max-width: 380px) {
  #workspace .quick-action-bar {
    gap: 10px;
    padding: 11px;
    border-radius: 17px;
  }

  #workspace .quick-action-buttons {
    gap: 7px;
  }

  #workspace .quick-action-button {
    gap: 7px;
    min-height: 64px;
    padding: 9px;
    font-size: 10px;
  }

  #workspace .quick-action-icon {
    flex-basis: 29px;
    width: 29px;
    height: 29px;
    border-radius: 10px;
  }

  #workspace .quick-action-icon svg {
    width: 17px;
    height: 17px;
  }
}

html[data-theme="dark"] #workspace .quick-action-bar {
  border-color: #315342;
  background: linear-gradient(150deg, #122d22, #0e261d);
  box-shadow: 0 12px 28px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.035);
}

html[data-theme="dark"] #workspace .quick-action-bar-heading {
  color: #b4cabe;
}

html[data-theme="dark"] #workspace .quick-action-eyebrow {
  color: #9fe5ad;
}

html[data-theme="dark"] #workspace .quick-action-button:not(.quick-action-primary) {
  border-color: #315342;
  background: linear-gradient(145deg, #1a3a2d, #142f24);
  color: #e5f1e9;
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}

html[data-theme="dark"] #workspace .quick-action-icon {
  background: #254b36;
  color: #a8e8b1;
}

html[data-theme="dark"] #workspace .quick-action-safety-note {
  border-color: #315342;
  background: #152b21;
  color: #b6c9bd;
}

html[data-theme="dark"] #workspace .quick-action-safety-note strong {
  color: #b2e8bb;
}


/* CampusShield mobile-first home bento and icon-led navigation refresh. */
.campus-home-bento { margin: 0 0 22px; }
.campus-home-eyebrow {
  display: inline-block;
  margin-bottom: 5px;
  color: #26734e;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .18em;
}
.campus-home-bento .student-shortcuts-heading h2 {
  color: #17382c;
  font-size: clamp(18px, 2.1vw, 22px);
  font-weight: 850;
  letter-spacing: -.045em;
}
.campus-home-bento .student-shortcuts-heading p { color: #72847a; }
.campus-home-bento-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(134px, auto);
  gap: 11px;
}
.campus-home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
  min-height: 145px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid #dce9df;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #f4faf5 100%);
  color: #17382c;
  text-align: left;
  box-shadow: 0 7px 22px rgba(7, 45, 29, .055), inset 0 1px rgba(255,255,255,.95);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
button.campus-home-card { width: 100%; cursor: pointer; }
button.campus-home-card:hover { transform: translateY(-2px); border-color: #9bcdb0; box-shadow: 0 13px 28px rgba(7,45,29,.1); }
.campus-home-card:focus-visible { outline: 3px solid #6cc68a; outline-offset: 3px; }
.campus-home-map, .campus-home-ai { grid-column: span 2; grid-row: span 2; min-height: 260px; }
.campus-home-map {
  isolation: isolate;
  background:
    radial-gradient(ellipse at 86% 20%, rgba(127,217,138,.18), transparent 39%),
    linear-gradient(145deg, #f9fcf9, #edf6ef);
}
.campus-home-map-art {
  position: absolute;
  right: 13px;
  bottom: 13px;
  width: 42%;
  height: 43%;
  border: 1px solid rgba(42,126,70,.13);
  border-radius: 16px;
  opacity: .75;
  background:
    linear-gradient(28deg, transparent 46%, rgba(42,126,70,.15) 47%, rgba(42,126,70,.15) 49%, transparent 50%),
    linear-gradient(145deg, transparent 48%, rgba(42,126,70,.13) 49%, rgba(42,126,70,.13) 51%, transparent 52%),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(42,126,70,.07) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(42,126,70,.07) 23px 24px);
  pointer-events: none;
}
.campus-home-map-art span { position: absolute; display: block; height: 2px; border-radius: 2px; background: rgba(42,126,70,.2); transform-origin:left center; }
.campus-home-map-art span:nth-child(1) { width: 72%; left: 9%; top: 28%; transform: rotate(18deg); }
.campus-home-map-art span:nth-child(2) { width: 64%; left: 25%; top: 70%; transform: rotate(-38deg); }
.campus-home-map-art span:nth-child(3) { width: 48%; left: 12%; top: 83%; transform: rotate(-8deg); }
.campus-home-card-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 9px; width: 100%; margin-bottom: 12px; }
.campus-home-card .student-shortcut-icon {
  display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; margin: 0;
  border: 1px solid #d6eadc; border-radius: 12px; background: #e5f4e9; color: #216c45;
}
.campus-home-card .student-shortcut-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.campus-home-status, .campus-home-card-kicker {
  color: #5d7b69; font-size: 8px; font-weight: 900; letter-spacing: .12em; line-height: 1.35; text-transform: uppercase;
}
.campus-home-status { padding: 6px 8px; border: 1px solid #d5e8d9; border-radius: 999px; background: #eef7ef; color: #39734e; white-space: nowrap; }
.campus-home-card > strong { position: relative; z-index: 1; color: #17382c; font-size: 15px; font-weight: 850; letter-spacing: -.035em; }
.campus-home-card > p { position: relative; z-index: 1; max-width: 38ch; margin: 6px 0 0; color: #6b7f73; font-size: 11px; line-height: 1.55; }
.campus-home-card-footer { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 13px; color: #26734e; font-size: 10px; font-weight: 850; }
.campus-home-card-footer span { font-size: 15px; line-height: 1; }
.campus-home-ai {
  background:
    radial-gradient(ellipse at 90% 10%, rgba(127,217,138,.2), transparent 39%),
    linear-gradient(145deg, #082d22 0%, #104b34 65%, #1d6240 100%);
  border-color: #1e6546;
  color: #f4fff6;
  box-shadow: 0 12px 28px rgba(7,45,29,.17), inset 0 1px rgba(255,255,255,.13);
}
.campus-home-ai .student-shortcut-icon { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); color: #a6ecb2; }
.campus-home-ai .campus-home-card-kicker { color: #b8e8c2; }
.campus-home-ai > strong { color: #f5fff7; font-size: 20px; }
.campus-home-ai > p { color: #d5e9db; }
.campus-home-ai .campus-home-card-footer { color: #b4edbf; }
.campus-home-pulse .student-shortcut-icon { background: #e7f1fc; border-color: #d8e6f5; color: #376b9a; }
.campus-home-academics .student-shortcut-icon { background: #f1edfb; border-color: #e5dcf7; color: #6853a0; }
.campus-home-safety .student-shortcut-icon { background: #e7f4ec; color: #216c45; }
html[data-theme="dark"] .campus-home-bento .student-shortcuts-heading h2 { color: #e7f3ea; }
html[data-theme="dark"] .campus-home-bento .student-shortcuts-heading p { color: #b1c5b6; }
html[data-theme="dark"] .campus-home-eyebrow { color: #9fe5ad; }
html[data-theme="dark"] .campus-home-card:not(.campus-home-ai) { background: linear-gradient(145deg,#142f24,#10271e); border-color: #315342; color: #e5f1e9; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
html[data-theme="dark"] .campus-home-card:not(.campus-home-ai) > strong { color: #eff8f0; }
html[data-theme="dark"] .campus-home-card:not(.campus-home-ai) > p { color: #b7cbbd; }
html[data-theme="dark"] .campus-home-card:not(.campus-home-ai) .campus-home-card-footer { color: #a9e8b5; }
html[data-theme="dark"] .campus-home-card:not(.campus-home-ai) .student-shortcut-icon { background: #234531; border-color: #315b40; color: #a8e8b2; }
html[data-theme="dark"] .campus-home-map-art { border-color: rgba(127,217,138,.12); opacity: .35; }
@media (max-width: 950px) {
  .campus-home-bento-grid { grid-template-columns: repeat(2, minmax(0,1fr)); grid-auto-rows: minmax(130px,auto); }
  .campus-home-map, .campus-home-ai { grid-column: span 2; grid-row: auto; min-height: 190px; }
  .campus-home-pulse, .campus-home-academics, .campus-home-safety { grid-column: span 1; min-height: 150px; }
  .campus-home-safety { grid-column: span 2; }
}
@media (max-width: 650px) {
  .campus-home-bento { margin-bottom: 18px; }
  .campus-home-bento .student-shortcuts-heading { margin-bottom: 11px; }
  .campus-home-bento .student-shortcuts-heading h2 { font-size: 18px; }
  .campus-home-bento-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; grid-auto-rows: minmax(142px,auto); }
  .campus-home-card { min-height: 148px; padding: 13px; border-radius: 16px; }
  .campus-home-map, .campus-home-ai { grid-column: span 2; min-height: 172px; }
  .campus-home-card-top { margin-bottom: 10px; }
  .campus-home-card .student-shortcut-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 11px; }
  .campus-home-status, .campus-home-card-kicker { font-size: 7.5px; }
  .campus-home-card > strong { font-size: 14px; }
  .campus-home-card > p { font-size: 10.5px; }
  .campus-home-safety { grid-column: span 2; }
  .campus-home-map-art { width: 35%; height: 34%; right: 10px; bottom: 10px; opacity: .45; }
}
@media (max-width: 360px) {
  .campus-home-card { padding: 11px; }
  .campus-home-card > p { max-width: 32ch; font-size: 10px; }
  .campus-home-card-footer { padding-top: 10px; }
}

/* Floating CampusShield pill navigation, inspired by the supplied mobile navigation references. */
@media (max-width: 650px) {
  .mobile-bottom-nav {
    position: fixed; left: 50%; right: auto; bottom: calc(9px + env(safe-area-inset-bottom));
    transform: translateX(-50%); width: min(calc(100vw - 24px), 470px);
    display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); align-items: end; gap: 3px;
    padding: 7px 9px 6px; border: 1px solid rgba(205,226,211,.92); border-radius: 24px;
    background: rgba(250,253,250,.94); box-shadow: 0 12px 34px rgba(6,39,27,.16), 0 2px 6px rgba(6,39,27,.07);
    -webkit-backdrop-filter: blur(20px) saturate(1.2); backdrop-filter: blur(20px) saturate(1.2);
  }
  .mobile-bottom-nav button {
    display: flex; flex: initial; min-width: 0; min-height: 56px; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px; padding: 4px 1px;
    border: 0; border-radius: 14px; background: transparent; color: #61786b;
    font-size: 12px; line-height: 1; -webkit-tap-highlight-color: transparent;
  }
  .mobile-bottom-nav .mobile-bottom-icon { display: grid; place-items: center; width: 26px; height: 25px; color: currentColor; }
  .mobile-bottom-nav .mobile-bottom-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-bottom-nav button small { font-size: 8px; font-weight: 850; line-height: 1.15; white-space: nowrap; }
  .mobile-bottom-nav button.active:not(.mobile-nav-report) { background: #e7f5e9; color: #176b43; }
  .mobile-bottom-nav button:focus-visible { outline: 3px solid #71cc8b; outline-offset: 1px; }
  .mobile-bottom-nav .mobile-nav-report { min-height: 66px; margin-top: -23px; color: #1d6a43; }
  .mobile-bottom-nav .mobile-nav-report .mobile-bottom-icon {
    width: 51px; height: 51px; border-radius: 18px; border: 3px solid rgba(255,255,255,.8);
    background: linear-gradient(145deg,#89e19a,#36a96c); color: #083522;
    box-shadow: 0 8px 18px rgba(25,115,66,.28), 0 0 0 5px rgba(127,217,138,.13);
  }
  .mobile-bottom-nav .mobile-nav-report .mobile-bottom-icon svg { width: 25px; height: 25px; stroke-width: 2.3; }
  .mobile-bottom-nav .mobile-nav-report.active .mobile-bottom-icon { background: linear-gradient(145deg,#2a7e46,#145936); color: #fff; }
  .mobile-bottom-nav .mobile-nav-report small { color: #216d45; }
  html[data-theme="dark"] .mobile-bottom-nav { border-color: #315342; background: rgba(12,36,26,.94); box-shadow: 0 14px 35px rgba(0,0,0,.35); }
  html[data-theme="dark"] .mobile-bottom-nav button { color: #b5cabb; }
  html[data-theme="dark"] .mobile-bottom-nav button.active:not(.mobile-nav-report) { background: #214632; color: #b8edc0; }
  html[data-theme="dark"] .mobile-bottom-nav .mobile-nav-report .mobile-bottom-icon { border-color: #173d28; color: #0a2d1c; }
  #workspace .main { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  #workspace .content { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .mobile-bottom-nav { width: calc(100vw - 16px); padding-inline: 6px; gap: 1px; }
  .mobile-bottom-nav button small { font-size: 7.5px; }
  .mobile-bottom-nav .mobile-nav-report .mobile-bottom-icon { width: 47px; height: 47px; }
}

/* Icon-led sidebar refinement: keep the current accessible collapsible navigation and grouped routes. */
#app-sidebar .nav-section-label { margin-top: 5px; color: #91b79b; font-size: 9px; font-weight: 900; letter-spacing: .17em; }
#app-sidebar .nav button {
  min-height: 46px; gap: 10px; padding: 8px 11px; border: 1px solid transparent;
  border-radius: 13px; color: #c5d5cc; font-size: 12px; font-weight: 740;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
#app-sidebar .nav button .nav-icon {
  width: 31px; height: 31px; flex: 0 0 31px; border-radius: 10px;
  background: rgba(127,217,138,.09); color: #8fe09b;
}
#app-sidebar .nav button .nav-icon svg { width: 17px; height: 17px; }
#app-sidebar .nav button:hover { border-color: rgba(127,217,138,.2); background: rgba(255,255,255,.065); color: #fff; transform: translateX(1px); }
#app-sidebar .nav button.active {
  border-color: rgba(127,217,138,.26); background: linear-gradient(100deg,rgba(127,217,138,.18),rgba(127,217,138,.07));
  color: #f6fff7; box-shadow: inset 3px 0 #7fd98a, inset 0 1px rgba(255,255,255,.05);
}
#app-sidebar .nav button.active .nav-icon { background: #7fd98a; color: #0a3020; }
.app.sidebar-collapsed #app-sidebar .nav button { justify-content: center; padding-inline: 5px; }
.app.sidebar-collapsed #app-sidebar .nav button.active { box-shadow: inset 0 -3px #7fd98a, inset 0 1px rgba(255,255,255,.05); }

/* ShieldMind Premium workspace — quiet luxury in CampusShield forest, mint and navy. */
#page-shieldmind .shieldmind-workspace-header{align-items:center;padding:4px 0 9px}
#page-shieldmind .shieldmind-brand-lockup .shieldmind-mark{background:linear-gradient(145deg,#0d3c2b,#174d39)!important;color:#a8efb8!important;box-shadow:0 8px 22px rgba(12,65,40,.18),inset 0 1px rgba(255,255,255,.15)}
#page-shieldmind .shieldmind-brand-lockup h1{font-size:clamp(25px,3vw,34px);letter-spacing:-.055em}
#page-shieldmind .shieldmind-workspace-badge{padding:8px 12px;border-color:#cfe7d6;background:linear-gradient(145deg,#f3fbf4,#e8f6ec);color:#206944;font-size:9px;font-weight:900;letter-spacing:.045em;text-transform:uppercase}
#page-shieldmind .shieldmind-workspace-badge>span:first-child{color:#287e4b;font-size:12px}
#page-shieldmind .shieldmind-hero-compact{min-height:150px;padding:clamp(18px,2.6vw,28px);border-color:#b9dfc6;border-radius:21px;background:radial-gradient(ellipse at 92% 10%,rgba(135,225,153,.26),transparent 31%),radial-gradient(ellipse at 78% 100%,rgba(87,173,123,.16),transparent 40%),linear-gradient(118deg,#effaf2 0%,#f2fbf7 52%,#e7f7ec 100%);box-shadow:0 13px 32px rgba(16,74,42,.06),inset 0 1px rgba(255,255,255,.9)}
#page-shieldmind .shieldmind-hero h2{color:#123c2a;font-size:clamp(20px,2.2vw,27px);letter-spacing:-.05em}
#page-shieldmind .shieldmind-hero p{max-width:72ch;color:#557366;font-size:12px}
#page-shieldmind .shieldmind-capability-list span{color:#246b43;font-size:10px;font-weight:800}
#page-shieldmind .shieldmind-hero-art{width:106px;height:96px;flex-basis:106px;background:radial-gradient(circle,#d7f3df,#c6e9d0);color:#206b42}
#page-shieldmind .shieldmind-hero-art span:nth-child(2){width:51px;height:51px;border-radius:17px;background:linear-gradient(145deg,#0d3c2b,#1d6944);color:#b4f3be;box-shadow:0 10px 22px rgba(8,65,35,.24)}
#page-shieldmind .shieldmind-access-notice{border:1px solid #d7e8d9;background:#f8fbf6;color:#56715d}
#page-shieldmind .shieldmind-paid-gate{position:relative;isolation:isolate;display:grid;grid-template-columns:minmax(0,1fr) minmax(175px,.32fr);align-items:center;gap:clamp(18px,3vw,38px);min-width:0;overflow:hidden;margin:0 0 18px;padding:clamp(20px,3vw,34px);border:1px solid #1b583b;border-radius:22px;background:radial-gradient(ellipse at 95% 7%,rgba(137,231,151,.2),transparent 36%),radial-gradient(ellipse at 75% 100%,rgba(67,161,98,.22),transparent 42%),linear-gradient(122deg,#082d20 0%,#10442f 58%,#164f36 100%);color:#f4fff6;box-shadow:0 19px 45px rgba(8,55,31,.17),inset 0 1px rgba(255,255,255,.12)}
#page-shieldmind .shieldmind-paid-gate[hidden]{display:none!important}
#page-shieldmind .shieldmind-paid-gate-copy{position:relative;z-index:2;min-width:0}
#page-shieldmind .shieldmind-paid-eyebrow{display:inline-flex;align-items:center;gap:8px;margin:0 0 11px;color:#b1ecc0;font-size:9px;font-weight:950;letter-spacing:.17em}
#page-shieldmind .shieldmind-paid-eyebrow span{color:#8de5a2;font-size:16px}
#page-shieldmind .shieldmind-paid-gate h2{max-width:24ch;margin:0;color:#f4fff6;font-size:clamp(23px,3vw,34px);line-height:1.08;letter-spacing:-.055em}
#page-shieldmind .shieldmind-paid-gate-copy>p:not(.shieldmind-paid-gate-status){max-width:68ch;margin:11px 0 18px;color:#d1e7d7;font-size:12px;line-height:1.65}
#page-shieldmind .shieldmind-paid-benefits{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
#page-shieldmind .shieldmind-paid-benefits>div{display:grid;grid-template-columns:29px minmax(0,1fr);align-items:center;gap:2px 9px;min-width:0;padding:10px 11px;border:1px solid rgba(193,235,203,.15);border-radius:12px;background:rgba(245,255,247,.065);box-shadow:inset 0 1px rgba(255,255,255,.045)}
#page-shieldmind .shieldmind-paid-benefits>div>span{grid-row:span 2;display:grid;place-items:center;width:29px;height:29px;border-radius:9px;background:rgba(141,229,162,.15);color:#b1efbd;font-size:9px;font-weight:900}
#page-shieldmind .shieldmind-paid-benefits strong{color:#f1fff4;font-size:10.5px;font-weight:850}
#page-shieldmind .shieldmind-paid-benefits small{color:#c0dac8;font-size:9px;line-height:1.4}
#page-shieldmind .shieldmind-paid-gate-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:15px;margin-top:19px}
#page-shieldmind .shieldmind-paid-gate-footer>div{display:grid;gap:3px}
#page-shieldmind .shieldmind-paid-gate-footer>div strong{color:#f4fff6;font-size:14px;font-weight:900}
#page-shieldmind .shieldmind-paid-gate-footer>div small{color:#c3ddca;font-size:9px}
#page-shieldmind .shieldmind-paid-cta{min-height:45px;padding:11px 17px;border-color:#b4edbf;background:linear-gradient(135deg,#a8edb4,#68c987);color:#0a3923;box-shadow:0 10px 23px rgba(0,0,0,.13),inset 0 1px rgba(255,255,255,.4);font-size:11px}
#page-shieldmind .shieldmind-paid-cta:hover:not(:disabled){background:linear-gradient(135deg,#baf5c3,#7bd697)}
#page-shieldmind .shieldmind-paid-gate-status{min-height:16px;margin:13px 0 0!important;color:#bee2c8!important;font-size:9.5px!important}
#page-shieldmind .shieldmind-paid-gate-art{position:relative;display:grid;place-items:center;width:min(100%,210px);aspect-ratio:1;justify-self:center;border-radius:50%;background:radial-gradient(circle,rgba(156,239,172,.16),rgba(130,219,150,.055) 48%,transparent 70%)}
#page-shieldmind .shieldmind-orbit{position:absolute;border:1px solid rgba(172,235,185,.27);border-radius:50%}
#page-shieldmind .shieldmind-orbit-one{inset:8%}
#page-shieldmind .shieldmind-orbit-two{inset:19%;border-style:dashed;opacity:.75}
#page-shieldmind .shieldmind-core{display:grid;place-items:center;width:86px;height:86px;border:1px solid rgba(211,255,218,.38);border-radius:27px;background:linear-gradient(145deg,#0e3a2a,#1a6240);color:#b1f0bd;box-shadow:0 19px 36px rgba(0,0,0,.25),0 0 0 12px rgba(135,226,154,.08),inset 0 1px rgba(255,255,255,.18);font-size:20px;font-weight:950}
#page-shieldmind .shieldmind-spark{position:absolute;color:#b0edba}
#page-shieldmind .shieldmind-spark-one{top:18%;left:15%;font-size:21px}
#page-shieldmind .shieldmind-spark-two{right:14%;bottom:20%;font-size:27px}
#page-shieldmind .shieldmind-verified-mark{position:absolute;right:15%;bottom:22%;display:grid;place-items:center;width:27px;height:27px;border:2px solid #123e2a;border-radius:9px;background:#9be4aa;color:#0d3924;font-size:13px;font-weight:950}
#page-shieldmind .shieldmind-quick-actions[hidden],#page-shieldmind .shieldmind-workspace-grid[hidden]{display:none!important}
#page-shieldmind .shieldmind-plan-mini{display:none!important}
#page-shieldmind .shieldmind-workspace-grid:not([hidden]){animation:shieldmind-workspace-in .25s ease both}
@keyframes shieldmind-workspace-in{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
#page-billing .shieldmind-prices{align-items:stretch}
#page-billing .shieldmind-price{display:flex;flex-direction:column;min-height:220px;padding:17px;border-color:#dbe8df;border-radius:16px;background:linear-gradient(150deg,#fff,#f7fbf7);box-shadow:0 7px 22px rgba(13,58,34,.045)}
#page-billing .shieldmind-price strong{color:#204936;font-size:12px}
#page-billing .shieldmind-price b{margin:9px 0 5px;color:#123d2a;font-size:27px;letter-spacing:-.06em}
#page-billing .shieldmind-price span{color:#32734a;font-size:10px;font-weight:800}
#page-billing .shieldmind-price small{min-height:42px;margin:8px 0 15px;color:#718278;font-size:10px;line-height:1.5}
#page-billing .shieldmind-price .btn{width:100%;margin-top:auto}
#page-billing .shieldmind-price.premium{border-color:#9bcba8;background:radial-gradient(ellipse at 100% 0%,rgba(142,222,155,.17),transparent 44%),linear-gradient(150deg,#f6fcf6,#edf7ef)}
html[data-theme="dark"] #page-shieldmind .shieldmind-paid-gate{border-color:#3b7650;background:radial-gradient(ellipse at 95% 7%,rgba(137,231,151,.13),transparent 36%),linear-gradient(122deg,#071f16,#0d3926 58%,#11442d)}
html[data-theme="dark"] #page-shieldmind .shieldmind-hero-compact{border-color:#315b41;background:radial-gradient(ellipse at 92% 10%,rgba(135,225,153,.12),transparent 31%),linear-gradient(118deg,#132c20,#183a29)}
html[data-theme="dark"] #page-shieldmind .shieldmind-hero h2{color:#eff9f0}
html[data-theme="dark"] #page-shieldmind .shieldmind-hero p{color:#b7cebc}
html[data-theme="dark"] #page-shieldmind .shieldmind-capability-list span{color:#a9e5b3}
html[data-theme="dark"] #page-shieldmind .shieldmind-workspace-badge{border-color:#315b41;background:#1c3d2a;color:#b3edbd}
html[data-theme="dark"] #page-billing .shieldmind-price{border-color:#315342;background:linear-gradient(150deg,#142f24,#10271e)}
html[data-theme="dark"] #page-billing .shieldmind-price strong,html[data-theme="dark"] #page-billing .shieldmind-price b{color:#ecf8ee}
html[data-theme="dark"] #page-billing .shieldmind-price span{color:#a9e4b1}
html[data-theme="dark"] #page-billing .shieldmind-price small{color:#b2c7b8}
@media(max-width:900px){#page-shieldmind .shieldmind-paid-gate{grid-template-columns:minmax(0,1fr) 155px;gap:12px}#page-shieldmind .shieldmind-paid-gate-art{width:155px}#page-shieldmind .shieldmind-paid-benefits{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){
 #page-shieldmind .shieldmind-paid-gate{grid-template-columns:minmax(0,1fr);gap:4px;padding:17px;border-radius:18px}
 #page-shieldmind .shieldmind-paid-gate-art{display:none}
 #page-shieldmind .shieldmind-paid-gate h2{font-size:25px}
 #page-shieldmind .shieldmind-paid-gate-copy>p:not(.shieldmind-paid-gate-status){font-size:11px;margin:9px 0 14px}
 #page-shieldmind .shieldmind-paid-benefits{gap:7px}
 #page-shieldmind .shieldmind-paid-benefits>div{padding:9px}
 #page-shieldmind .shieldmind-paid-gate-footer{align-items:stretch;flex-direction:column;gap:10px}
 #page-shieldmind .shieldmind-paid-cta{width:100%}
 #page-shieldmind .shieldmind-workspace-badge{font-size:8px;padding:6px 8px}
}
@media(max-width:370px){
 #page-shieldmind .shieldmind-brand-lockup .campus-hub-eyebrow{font-size:7px;letter-spacing:.1em}
 #page-shieldmind .shieldmind-brand-lockup h1{font-size:21px}
 #page-shieldmind .shieldmind-workspace-badge{white-space:normal;text-align:center;max-width:112px}
}
@media(prefers-reduced-motion:reduce){#page-shieldmind .shieldmind-workspace-grid:not([hidden]){animation:none}}

/* Premium AI exam-practice paywall notice. */
#page-past-questions .pq-access-gate{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px 14px;margin:12px 0 14px;padding:12px 13px;border:1px solid #b8d9c1;border-radius:13px;background:linear-gradient(135deg,#f1faf3,#e9f6ec);color:#345b41;font-size:11px;line-height:1.55}
#page-past-questions .pq-access-gate[hidden]{display:none!important}
#page-past-questions .pq-access-gate .btn{min-height:36px;white-space:nowrap}
html[data-theme="dark"] #page-past-questions .pq-access-gate{border-color:#315b41;background:linear-gradient(135deg,#172f22,#12291d);color:#c2ddc8}
@media(max-width:600px){#page-past-questions .pq-access-gate{grid-template-columns:minmax(0,1fr)}#page-past-questions .pq-access-gate .btn{width:100%}}

/* Keep the ShieldMind entitlement badge compact at narrow phone widths. */
#page-shieldmind .shieldmind-workspace-badge { min-width:0; max-width:100%; }
#page-shieldmind .shieldmind-workspace-badge #shieldmind-plan-status {
  display:block;
  min-width:0;
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
}
@media(max-width:400px) {
  #page-shieldmind .shieldmind-workspace-header { align-items:flex-start; gap:8px; }
  #page-shieldmind .shieldmind-workspace-badge { flex:0 1 104px; min-width:0; padding:6px 8px; }
  #page-shieldmind .shieldmind-workspace-badge #shieldmind-plan-status { font-size:8px; line-height:1.2; }
}


/* Active ShieldMind plan allowance summary. Values mirror server-enforced tier limits. */
#page-shieldmind .shieldmind-plan-summary{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,.85fr) auto;align-items:center;gap:12px;margin:12px 0 16px;padding:13px 15px;border:1px solid #d5e9da;border-radius:15px;background:linear-gradient(110deg,#f1faf3,#f8fcf8);color:#254d35}
#page-shieldmind .shieldmind-plan-summary[hidden]{display:none!important}
#page-shieldmind .shieldmind-plan-summary-tier,#page-shieldmind .shieldmind-plan-summary-metric{display:grid;gap:3px;min-width:0}
#page-shieldmind .shieldmind-plan-summary-label{color:#668573;font-size:9px;font-weight:900;letter-spacing:.09em}
#page-shieldmind .shieldmind-plan-summary strong{color:#1d6138;font-size:16px;line-height:1.25}
#page-shieldmind .shieldmind-plan-summary small{color:#6d8574;font-size:10px;line-height:1.35}
#page-shieldmind .shieldmind-plan-summary-manage{min-height:36px;white-space:nowrap}
html[data-theme="dark"] #page-shieldmind .shieldmind-plan-summary{border-color:#31543c;background:linear-gradient(110deg,#142c1e,#182c22);color:#d7ebda}
html[data-theme="dark"] #page-shieldmind .shieldmind-plan-summary-label,html[data-theme="dark"] #page-shieldmind .shieldmind-plan-summary small{color:#a8c5ad}
html[data-theme="dark"] #page-shieldmind .shieldmind-plan-summary strong{color:#b9e8c1}
@media(max-width:760px){#page-shieldmind .shieldmind-plan-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}#page-shieldmind .shieldmind-plan-summary-manage{grid-column:1/-1;width:100%}}
@media(max-width:370px){#page-shieldmind .shieldmind-plan-summary{padding:11px;gap:10px}#page-shieldmind .shieldmind-plan-summary strong{font-size:14px}}


/* ShieldMind answer utilities: readable, source-linked and easy to reuse. */
#page-shieldmind .shieldmind-message-sources{margin:13px 0 0;padding:11px 12px;border:1px solid #d9e9dc;border-radius:12px;background:#f5faf5}
#page-shieldmind .shieldmind-message-sources>strong{display:block;margin-bottom:7px;color:#245d3c;font-size:10px;letter-spacing:.04em;text-transform:uppercase}
#page-shieldmind .shieldmind-message-sources ul{display:grid;gap:7px;margin:0;padding:0;list-style:none}
#page-shieldmind .shieldmind-message-sources li{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:3px 7px;min-width:0}
#page-shieldmind .shieldmind-source-marker{color:#267248;font-size:10px;font-weight:900}
#page-shieldmind .shieldmind-message-sources a,#page-shieldmind .shieldmind-message-sources li>span:not(.shieldmind-source-marker){min-width:0;color:#285f40;font-size:11px;line-height:1.45;overflow-wrap:anywhere;text-decoration:underline;text-decoration-color:#a9cfb3;text-underline-offset:2px}
#page-shieldmind .shieldmind-message-sources small{grid-column:2;color:#74877a;font-size:9px}
#page-shieldmind .shieldmind-copy-answer{display:inline-flex;align-items:center;min-height:30px;margin-top:9px;padding:5px 10px;border:1px solid #d8e7dc;border-radius:9px;background:#fff;color:#356849;font-size:10px;font-weight:800;cursor:pointer}
#page-shieldmind .shieldmind-copy-answer:hover{background:#edf7ef;border-color:#a8d0b3}
html[data-theme="dark"] #page-shieldmind .shieldmind-message-sources{border-color:#315342;background:#142d21}
html[data-theme="dark"] #page-shieldmind .shieldmind-message-sources>strong,html[data-theme="dark"] #page-shieldmind .shieldmind-source-marker,html[data-theme="dark"] #page-shieldmind .shieldmind-message-sources a,html[data-theme="dark"] #page-shieldmind .shieldmind-message-sources li>span:not(.shieldmind-source-marker){color:#b4e8bd}
html[data-theme="dark"] #page-shieldmind .shieldmind-message-sources small{color:#a6bca9}
html[data-theme="dark"] #page-shieldmind .shieldmind-copy-answer{border-color:#365a43;background:#183626;color:#b9ebc2}
@media(max-width:600px){#page-shieldmind .shieldmind-message-sources{padding:9px}#page-shieldmind .shieldmind-copy-answer{min-height:36px}}

.mobile-theme-toggle { display: none; }

/* Mobile theme control: keep the theme switch reachable when desktop actions
   are hidden, and let the mobile header itself follow the selected theme. */
@media (max-width: 650px) {
  #workspace .topbar {
    grid-template-columns: minmax(0, 1fr) 42px 46px !important;
    grid-template-areas:
      "brand theme menu"
      "search search search" !important;
  }

  #workspace .mobile-theme-toggle {
    grid-area: theme;
    display: inline-grid !important;
    place-items: center;
    justify-self: end;
    align-self: center;
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid rgba(169, 226, 190, .28);
    border-radius: 13px;
    background: rgba(237, 255, 244, .1);
    color: #eaffef;
    box-shadow: inset 0 1px rgba(255,255,255,.09), 0 5px 14px rgba(0,0,0,.1);
  }

  #workspace .mobile-theme-toggle svg {
    width: 20px;
    height: 20px;
  }

  html[data-theme="light"] #workspace .topbar {
    background:
      radial-gradient(ellipse at 84% 0%, rgba(34, 139, 91, .08), transparent 42%),
      linear-gradient(135deg, #f7fbf8, #eaf4ed);
    border-bottom-color: #cfe1d6;
    box-shadow: 0 9px 25px rgba(19, 59, 42, .08);
  }

  html[data-theme="light"] #workspace .mobile-topbar-brand {
    color: #183b31;
  }

  html[data-theme="light"] #workspace .mobile-topbar-mark {
    border-color: #c8dfd0;
    background: linear-gradient(145deg, #e0f2e6, #f3faf5);
    color: #176b4b !important;
    box-shadow: inset 0 1px rgba(255,255,255,.9), 0 5px 14px rgba(19,59,42,.08);
  }

  html[data-theme="light"] #workspace .mobile-theme-toggle,
  html[data-theme="light"] #workspace .mobile-nav-toggle {
    border-color: #c8dfd0;
    background: rgba(255,255,255,.82);
    color: #176b4b;
    box-shadow: 0 3px 10px rgba(19,59,42,.07);
  }

  html[data-theme="light"] #workspace .mobile-theme-toggle:focus-visible,
  html[data-theme="light"] #workspace .mobile-nav-toggle:focus-visible {
    outline-color: #23825e;
  }

  html[data-theme="light"] #workspace .global-search-input {
    border-color: #c9ddd0;
    background: rgba(255,255,255,.9);
    color: #173a31;
    box-shadow: inset 0 1px rgba(255,255,255,.95), 0 3px 10px rgba(19,59,42,.04);
  }

  html[data-theme="light"] #workspace .global-search-input::placeholder {
    color: #698478;
  }

  html[data-theme="light"] #workspace .global-search-input:focus {
    border-color: #23825e;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(35,130,94,.13);
  }

  html[data-theme="light"] #workspace .global-search-icon {
    color: #347b5c;
  }
}

@media (max-width: 360px) {
  #workspace .topbar {
    grid-template-columns: minmax(0, 1fr) 40px 44px !important;
    gap: 9px 9px;
    padding-right: 11px;
    padding-left: 11px;
  }

  #workspace .mobile-theme-toggle {
    flex-basis: 40px;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }
}
