.portal-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

:root {
  --portal-sidebar-width: 15rem;
}

body {
  padding-top: var(--portal-header-height, 3.75rem);
}

html.portal-sidebar-collapsed {
  --portal-sidebar-width: 4rem;
}

.portal-sidebar {
  position: fixed;
  top: var(--portal-header-height, 3.75rem);
  left: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  width: 15rem;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #e6e6e6;
  background: white;
  transition: width 0.2s ease;
}

.portal-sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem 0.5rem;
}

.portal-main-wrap {
  min-width: 0;
  width: 100%;
  min-height: calc(100vh - var(--portal-header-height, 3.75rem));
}

body.portal-has-sidebar .portal-main-wrap {
  margin-left: var(--portal-sidebar-width, 15rem);
  width: calc(100% - var(--portal-sidebar-width, 15rem));
  transition: margin-left 0.2s ease, width 0.2s ease;
}

.portal-main-inner {
  width: 100%;
  max-width: 90rem;
  margin-left: auto;
  margin-right: auto;
}

body.portal-has-sidebar .portal-main-inner {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

main.portal-main-inner {
  padding-bottom: calc(var(--portal-footer-height, 4.5rem) + 1.5rem);
}

main.portal-main-live-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100vh - var(--portal-header-height, 3.75rem));
  max-height: calc(100vh - var(--portal-header-height, 3.75rem));
  padding: 0;
  padding-bottom: var(--portal-footer-height, 4.5rem);
  overflow: hidden;
}

.portal-live-chat-root {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
}

.portal-live-chat-toolbar {
  flex-shrink: 0;
  border-bottom: 1px solid #e6e6e6;
  background: white;
}

.portal-live-chat-body {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.portal-live-chat-sidebar {
  display: flex;
  min-height: 0;
  width: 16rem;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid #e6e6e6;
  background: white;
}

.portal-live-chat-sidebar-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.portal-live-chat-panel {
  display: flex;
  min-height: 0;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  background: white;
}

.portal-live-chat-messages {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.portal-live-chat-compose {
  flex-shrink: 0;
  border-top: 1px solid #e6e6e6;
  background: white;
}

@media (max-width: 1023px) {
  .portal-live-chat-body {
    flex-direction: column;
    overflow-y: auto;
  }

  .portal-live-chat-sidebar {
    width: 100%;
    max-height: 12rem;
    border-right: 0;
    border-bottom: 1px solid #e6e6e6;
  }

  .portal-live-chat-panel {
    min-height: 20rem;
  }
}

.portal-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 35;
  background: rgba(248, 250, 252, 0.97);
  backdrop-filter: blur(8px);
  box-shadow: 0 -1px 0 #e6e6e6;
}

body.portal-has-sidebar .portal-footer {
  left: var(--portal-sidebar-width, 15rem);
  width: calc(100% - var(--portal-sidebar-width, 15rem));
  transition: left 0.2s ease, width 0.2s ease;
}

.portal-sidebar-link,
.portal-sidebar-link--summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #313131;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.portal-sidebar-link:hover,
.portal-sidebar-link--summary:hover {
  background: #f7f7f7;
  color: #1c1c1c;
}

.portal-sidebar-link--active,
.portal-sidebar-link--summary.portal-sidebar-link--active {
  background: #f5f7fe;
  color: #1428a0;
}

.portal-sidebar-link--amber {
  color: rgb(120 53 15);
}

.portal-sidebar-link--amber:hover {
  color: rgb(69 26 3);
  background: rgb(255 251 235);
}

.portal-sidebar-link--amber.portal-sidebar-link--active {
  background: rgb(254 243 199);
  color: rgb(120 53 15);
}

.portal-sidebar-link--summary {
  list-style: none;
  cursor: pointer;
}

.portal-sidebar-link--summary::-webkit-details-marker {
  display: none;
}

.portal-sidebar-icon {
  display: inline-flex;
  height: 1.25rem;
  width: 1.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.portal-sidebar-icon svg {
  height: 1.25rem;
  width: 1.25rem;
}

.portal-sidebar-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-sidebar-caret {
  flex-shrink: 0;
  font-size: 0.625rem;
  line-height: 1;
  opacity: 0.55;
}

.portal-sidebar-group[open] > summary .portal-sidebar-caret {
  transform: rotate(180deg);
}

.portal-sidebar-subnav {
  margin: 0.125rem 0 0.375rem 0.5rem;
  border-left: 1px solid #e6e6e6;
  padding-left: 0.5rem;
}

.portal-sidebar-sublink {
  display: block;
  border-radius: 0.375rem;
  padding: 0.45rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #717171;
  text-decoration: none;
}

.portal-sidebar-sublink:hover {
  background: #f7f7f7;
  color: #1c1c1c;
}

.portal-sidebar-sublink--active {
  background: #f4f4f4;
  color: #1c1c1c;
}

.portal-sidebar-badge {
  margin-left: auto;
  display: inline-flex;
  height: 1.125rem;
  min-width: 1.125rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgb(220 38 38);
  padding: 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  color: white;
}

.portal-sidebar--collapsed {
  width: 4rem;
}

.portal-sidebar--collapsed .portal-sidebar-link .portal-sidebar-label,
.portal-sidebar--collapsed .portal-sidebar-link--summary .portal-sidebar-label,
.portal-sidebar--collapsed .portal-sidebar-caret,
.portal-sidebar--collapsed .portal-sidebar-subnav,
.portal-sidebar--collapsed .portal-sidebar-badge,
.portal-sidebar--collapsed .portal-sidebar-toggle-label {
  display: none;
}

.portal-sidebar--collapsed .portal-sidebar-link,
.portal-sidebar--collapsed .portal-sidebar-link--summary,
.portal-sidebar--collapsed .portal-sidebar-toggle {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.portal-sidebar--collapsed .portal-sidebar-chevron-expand {
  display: none !important;
}

.portal-sidebar--collapsed .portal-sidebar-chevron-collapse {
  display: block !important;
}

.portal-sidebar-chevron-collapse {
  display: none;
}

.portal-sidebar-icon--toggle {
  position: relative;
  height: 1.25rem;
  width: 1.25rem;
}

.portal-sidebar-icon--toggle svg {
  position: absolute;
  inset: 0;
  margin: auto;
}

.portal-sidebar-footer {
  flex: 0 0 auto;
  border-top: 1px solid #e6e6e6;
  background: white;
  padding: 0.5rem;
}

.portal-sidebar-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #717171;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.portal-sidebar-toggle:hover {
  background: #f4f4f4;
  color: #1c1c1c;
}

.portal-sidebar--collapsed .portal-sidebar-toggle {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

@media (max-width: 767px) {
  :root {
    --portal-sidebar-width: 4rem;
  }

  .portal-sidebar {
    width: 4rem;
  }

  body.portal-has-sidebar .portal-main-wrap {
    margin-left: var(--portal-sidebar-width, 4rem);
    width: calc(100% - var(--portal-sidebar-width, 4rem));
  }

  .portal-sidebar .portal-sidebar-link .portal-sidebar-label,
  .portal-sidebar .portal-sidebar-link--summary .portal-sidebar-label,
  .portal-sidebar .portal-sidebar-caret,
  .portal-sidebar .portal-sidebar-subnav,
  .portal-sidebar .portal-sidebar-toggle-label {
    display: none;
  }

  .portal-sidebar .portal-sidebar-link,
  .portal-sidebar .portal-sidebar-link--summary,
  .portal-sidebar .portal-sidebar-toggle {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .portal-sidebar .portal-sidebar-chevron-expand {
    display: none !important;
  }

  .portal-sidebar .portal-sidebar-chevron-collapse {
    display: block !important;
  }
}
