body.portal-app { min-height: 100vh; min-height: 100dvh; }
body.portal-locked .portal-shell { display: none; }
body:not(.portal-locked) #accessGate { display: none; }
.portal-header { gap: 0.75rem; }
.portal-shell { min-height: 0; }
.portal-main { min-width: 0; }
.portal-chat { height: min(620px, 80dvh); }
.portal-main table { min-width: 720px; }
.portal-sidebar .nav-btn { min-width: 0; height: auto; align-items: flex-start; }
.portal-sidebar .nav-btn > span { min-width: 0; white-space: normal; text-align: left; line-height: 1.3; }
.portal-main input,
.portal-main select,
.portal-main textarea { max-width: 100%; }

@media (max-width: 1023px) {
  body.portal-app { height: auto; overflow-x: hidden; overflow-y: auto; }
  .portal-header { align-items: flex-start; }
  .portal-wordmark { font-size: 1rem; }
  .portal-badge { display: none; }
  .portal-shell {
    display: block;
    overflow: visible;
    height: auto;
  }
  aside.portal-sidebar {
    display: none !important;
    width: 100%;
    max-height: 70dvh;
    border-right: 0;
    border-bottom: 1px solid rgb(30 41 59);
  }
  aside.portal-sidebar.is-open { display: flex !important; }
  .portal-main { overflow-x: auto; height: auto; max-width: 100%; }
  .portal-chat { height: auto; min-height: 28rem; }
  .portal-main .text-3xl { font-size: 1.35rem; line-height: 1.2; }
}

@media (min-width: 1024px) {
  aside.portal-sidebar { display: flex !important; width: 16rem; max-height: none; border-bottom: 0; }
}

@media (max-width: 639px) {
  .portal-owner { display: none; }
  .portal-main { padding: 0.75rem; }
  .portal-main .w-64 { width: 100%; }
}
