.portal-preview { scroll-margin-block-start: 95px; }
.portal-nav {
  display: grid; width: fit-content; max-width: 100%; margin: 0 auto clamp(13px, 1.8vw, 23px);
  grid-template-columns: repeat(6, auto); gap: 3px; padding: 4px; background: #191919;
  border: 1px solid #ffffff23; border-radius: 12px; box-shadow: inset 0 1px #ffffff08;
}
.portal-nav button {
  min-height: 39px; padding: 5px clamp(8px, 1.15vw, 17px); border: 1px solid transparent;
  border-radius: 8px; background-color: transparent; color: #bfbfbf; cursor: pointer;
  font: 645 13px/1.26 var(--sans); white-space: nowrap;
  transition: background-color .19s ease-out, border-color .19s ease-out, color .19s ease-out;
}
.portal-nav button[aria-selected="true"] { border-color: #ffffff19; background-color: #343434; color: #f7f7f7; box-shadow: inset 0 1px #ffffff0f; }
@media (hover: hover) and (pointer: fine) {
  .portal-nav button[aria-selected="false"]:hover { background-color: #252525; color: #eee; }
}
.portal-nav button:focus-visible { outline-offset: -2px; }
.portal-window {
  text-align: left; border: 1px solid #ffffff29; border-radius: 15px; overflow: clip; background: #191919;
  box-shadow: 0 18px 55px #0008, 0 2px 6px #0003;
}
.portal-top {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  min-height: 59px; padding: 10px clamp(12px, 2.35vw, 27px);
  border-bottom: 1px solid #ffffff1b; background: #222;
}
.portal-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.portal-brand h2, .portal-page-head h3, .portal-card h4, .portal-row h4 {
  margin: 0; font-family: var(--sans); font-weight: 780; line-height: 1.28; letter-spacing: -.025em; text-wrap: initial;
}
.portal-brand h2 { font-size: 15px; }
.portal-page-head p { color: #bcbcbc; font-size: 12px; margin-top: 3px; }
.portal-status { color: #c1c1c1; white-space: nowrap; padding: 4px 8px; border: 1px solid #ffffff24; border-radius: 6px; font-size: 11px; }
.portal-content { min-width: 0; min-height: 313px; padding: clamp(14px, 2.45vw, 29px); }
.portal-preview.is-interactive .portal-panel:not([hidden]) { animation: portal-enter .32s cubic-bezier(.2,.8,.25,1) both; }
@keyframes portal-enter {
  from { opacity: .45; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.portal-page-head { margin-bottom: 13px; }
.portal-page-head h3 { font-size: 23px; margin-bottom: 2px; }
.portal-overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; }
.portal-stack { display: grid; gap: 8px; }
.portal-card { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 14px; background: #202020; border: 1px solid #353535; border-radius: 11px; }
.portal-feature {
  align-content: center; min-height: 190px; padding: clamp(14px, 2.4vw, 28px);
  background: radial-gradient(ellipse at 87% 1%, #373737, transparent 67%), #242424;
}
.portal-label { color: #bdbdbd; font-size: 11px; line-height: 1.4; font-weight: 735; }
.portal-indicator { display: inline-block; vertical-align: 1px; margin-right: 3px; width: 5px; height: 5px; background: #eaeaea; border-radius: 50%; }
.portal-card h4 { font-size: clamp(13px, 1.48vw, 20px); }
.portal-feature h4, .portal-lecture-cover h4 { max-width: 490px; font-size: clamp(18px, 2.55vw, 32px); }
.portal-card p:not(.portal-label), .portal-row p, .portal-mini ul { font-size: 12px; color: #c5c5c5; }
.portal-button, .portal-text-link {
  width: fit-content; display: inline-flex; align-items: center; gap: 8px; color: #f2f2f2;
  font: 690 12px/1.25 var(--sans); text-decoration: none; transition: color .2s ease-out;
}
.portal-button { margin-top: 5px; min-height: 36px; border: 1px solid #535353; border-radius: 8px; background: #353535; padding: 6px 10px; text-decoration: none; cursor: pointer; }
.portal-button:hover { background: #484848; }
.portal-text-link:hover { color: #fff; }
.portal-text-link span { display: inline-block; text-decoration: none; }
.portal-panel > .portal-text-link { margin-top: 11px; }
.portal-chat { display: grid; align-content: start; gap: 8px; margin-bottom: 8px; }
.portal-chat-message { width: fit-content; max-width: min(94%, 480px); padding: 8px 11px; background: #272727; border: 1px solid #363636; border-radius: 10px 10px 10px 3px; }
.portal-chat-message + .portal-chat-message { justify-self: end; background: #303030; border-radius: 10px 10px 3px 10px; }
.portal-chat-message p { font-size: 13px; line-height: 1.5; }
.portal-list { display: grid; gap: 7px; }
.portal-row {
  min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 10px; padding: 9px 11px; border: 1px solid #333; border-radius: 9px; background: #212121;
}
.portal-row > span { display: grid; place-items: center; width: 30px; height: 30px; background: #2e2e2e; border-radius: 8px; color: #ebebeb; }
.portal-row h4 { font-size: 14px; }
.portal-row small { font-size: 10px; color: #c3c3c3; }
.portal-lecture-cover {
  min-height: 170px; align-content: center; padding: 16px;
  background: radial-gradient(ellipse at 92% 9%, #3b3b3b, transparent 71%), #242424;
}
.portal-mini ul { margin: 0; padding-left: 15px; }

.portal-chat-layout { display: grid; grid-template-columns: minmax(138px, .7fr) minmax(0, 2.7fr); gap: 10px; }
.portal-rooms { display: grid; align-content: start; gap: 4px; background: #191919; border: 1px solid #323232; border-radius: 10px; padding: 6px; }
.portal-rooms button {
  min-height: 42px; padding: 6px 9px; text-align: left; border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: #c8c8c8; cursor: pointer; font: 660 12px/1.26 var(--sans);
}
.portal-rooms button:hover { color: #fff; background: #252525; }
.portal-rooms [aria-pressed="true"] { color: #fff; background: #303030; border-color: #424242; }
.portal-chat-frame { min-width: 0; background: #161616; border: 1px solid #313131; border-radius: 10px; padding: 10px; }
.portal-chat-frame h4 { margin: 0 0 8px; font: 770 14px/1.3 var(--sans); }
.portal-chat-frame .portal-chat-message p { font-size: 12px; }
.portal-chat-frame .portal-chat { margin-bottom: 4px; }

@media (max-width: 680px) {
  .portal-preview { scroll-margin-block-start: 113px; }
  .portal-top { min-height: 54px; }
  .portal-brand h2 { font-size: 13px; }
  .portal-brand .school-monogram { width: 25px; height: 25px; flex-basis: 25px; }
  .portal-status { font-size: 10px; padding: 3px 5px; }
  .portal-content { min-height: 308px; }
  .portal-page-head h3 { font-size: 20px; }
  .portal-overview-grid { grid-template-columns: minmax(0,1fr); }
  .portal-stack { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .portal-card { padding: 10px; }
  .portal-feature { min-height: 0; padding: 12px; }
  .portal-row { grid-template-columns: auto minmax(0,1fr); }
  .portal-row > small { grid-column: 2; }
  .portal-chat-layout { grid-template-columns: minmax(0,1fr); }
  .portal-rooms { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .portal-rooms button { text-align: center; }
}
@media (max-width: 550px) {
  .portal-nav { width: 100%; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .portal-nav button { min-height: 44px; padding-inline: 3px; font-size: 12px; }
}
