/* Track Mishnah UI 2.17.14
 * Full desktop left-rail navigation. The signed-in desktop top navigation is
 * removed; project/account controls now live in the memorial sidebar.
 * Responsive fallback header is retained below 1220px so mobile/tablet users
 * do not lose access to navigation or account controls.
 */

@media (min-width: 1220px) {
  body.app-theme-jewel {
    --tm-memorial-sidebar-width: 228px;
    --tm-memorial-header-offset: 0px;
  }

  /* No signed-in desktop top navigation or duplicate dedication. Service and
   * environment notices still render when needed. */
  body.app-theme-jewel .signed-in-site-header {
    position: relative;
    top: auto;
    border: 0;
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none;
  }

  body.app-theme-jewel .signed-in-site-header > .signed-in-dedication-strip,
  body.app-theme-jewel .signed-in-site-header > .signed-in-header-inner {
    display: none !important;
  }

  body.app-theme-jewel .signed-in-site-header > .environment-banner,
  body.app-theme-jewel .signed-in-site-header > .service-notice {
    margin-left: var(--tm-memorial-sidebar-width);
  }

  /* The left rail is now the complete desktop shell. */
  body.app-theme-jewel .tm-memorial-sidebar {
    top: 0;
    gap: 12px;
    padding: 18px 12px 14px;
    overflow-x: hidden;
  }

  body.app-theme-jewel .tm-sidebar-brand {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 10px 13px;
    color: #fff7e9;
    border-bottom: 1px solid rgb(196 163 90 / 48%);
    text-decoration: none;
  }

  body.app-theme-jewel .tm-sidebar-brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
  }

  body.app-theme-jewel .tm-sidebar-brand-mark img {
    width: 31px;
    height: 31px;
    filter: sepia(1) saturate(5) hue-rotate(345deg) brightness(1.35);
  }

  body.app-theme-jewel .tm-sidebar-brand strong,
  body.app-theme-jewel .tm-sidebar-brand small {
    display: block;
  }

  body.app-theme-jewel .tm-sidebar-brand strong {
    color: #fff7e9;
    font-family: var(--serif);
    font-size: 1.08rem;
    line-height: 1.05;
  }

  body.app-theme-jewel .tm-sidebar-brand small {
    margin-top: 3px;
    color: #c9b993;
    font-size: .56rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  body.app-theme-jewel .tm-sidebar-nav {
    gap: 4px;
  }

  body.app-theme-jewel .tm-sidebar-nav a {
    min-height: 39px;
    padding: 7px 10px;
  }

  /* Keep the memorial below navigation rather than using it to consume the
   * remaining height. The utility/account cluster is what anchors low. */
  body.app-theme-jewel .tm-sidebar-memorial {
    gap: 6px;
    margin-top: 18px;
    padding: 29px 10px 13px;
  }

  body.app-theme-jewel .tm-sidebar-memorial-copy {
    font-size: .64rem;
  }

  body.app-theme-jewel .tm-sidebar-utilities {
    display: grid;
    gap: 4px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgb(196 163 90 / 42%);
  }

  body.app-theme-jewel .tm-sidebar-project-switcher {
    display: grid;
    gap: 5px;
    padding: 6px 7px 8px;
    border: 1px solid rgb(196 163 90 / 35%);
    border-radius: 7px;
    background: rgb(255 255 255 / 2%);
  }

  body.app-theme-jewel .tm-sidebar-project-switcher > span {
    color: #cdb779;
    font-size: .53rem;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
  }

  body.app-theme-jewel .tm-sidebar-project-switcher select {
    width: 100%;
    min-height: 34px;
    padding: 6px 29px 6px 8px;
    color: #fff7e9;
    border: 1px solid rgb(196 163 90 / 48%);
    border-radius: 6px;
    background: #0a4736;
    font: inherit;
    font-size: .72rem;
    font-weight: 750;
  }

  body.app-theme-jewel .tm-sidebar-utility,
  body.app-theme-jewel .tm-sidebar-theme-toggle,
  body.app-theme-jewel .tm-sidebar-account > summary {
    position: relative;
    min-height: 39px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    color: #efe7d8;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    font: inherit;
    font-family: var(--serif);
    font-size: .76rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  body.app-theme-jewel .tm-sidebar-utility:hover,
  body.app-theme-jewel .tm-sidebar-theme-toggle:hover,
  body.app-theme-jewel .tm-sidebar-account > summary:hover,
  body.app-theme-jewel .tm-sidebar-utility[aria-current="page"] {
    color: #fff8ea;
    border-color: rgb(196 163 90 / 38%);
    background: #0a4c39;
  }

  body.app-theme-jewel .tm-sidebar-utility img,
  body.app-theme-jewel .tm-sidebar-theme-toggle img,
  body.app-theme-jewel .tm-sidebar-account img {
    filter: brightness(0) invert(1) !important;
    opacity: .82;
  }

  body.app-theme-jewel .tm-sidebar-theme-toggle .theme-label {
    display: inline;
  }


  body.app-theme-jewel .tm-sidebar-notifications .notification-count {
    position: static;
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    border-color: var(--tm-memorial-chrome);
    background: var(--tm-memorial-gold);
  }

  body.app-theme-jewel .tm-sidebar-account {
    position: relative;
  }

  body.app-theme-jewel .tm-sidebar-account > summary {
    list-style: none;
    border-color: rgb(196 163 90 / 40%);
  }

  body.app-theme-jewel .tm-sidebar-account > summary::-webkit-details-marker {
    display: none;
  }

  body.app-theme-jewel .tm-sidebar-account-avatar {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    color: #fff7e9;
    border: 1px solid var(--tm-memorial-gold-line);
    border-radius: 50%;
    background: #0b6047;
    font-family: var(--serif);
    font-size: .72rem;
    font-weight: 800;
  }

  body.app-theme-jewel .tm-sidebar-account-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.app-theme-jewel .tm-sidebar-account-chevron {
    margin-left: auto;
    color: #cdb779;
  }

  body.app-theme-jewel .tm-sidebar-account[open] .tm-sidebar-account-chevron {
    transform: rotate(180deg);
  }

  body.app-theme-jewel .tm-sidebar-account-panel {
    display: grid;
    gap: 3px;
    padding: 4px 4px 0 37px;
  }

  body.app-theme-jewel .tm-sidebar-account-panel a,
  body.app-theme-jewel .tm-sidebar-account-panel button {
    width: 100%;
    min-height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    color: #d8ccb2;
    border: 0;
    border-radius: 5px;
    background: transparent;
    font: inherit;
    font-size: .67rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  body.app-theme-jewel .tm-sidebar-account-panel a:hover,
  body.app-theme-jewel .tm-sidebar-account-panel button:hover {
    color: #fff7e9;
    background: #0a4c39;
  }

  body.app-theme-jewel .tm-sidebar-account-panel form {
    margin: 0;
  }

  /* With the desktop header gone, use the entire viewport height for the
   * approved dashboard + My Learning workspace. */
  body.app-theme-jewel .dashboard-primary-workspace {
    --tm-dashboard-workspace-height: clamp(590px, calc(100vh - 42px), 760px);
  }

  body.app-theme-jewel .dashboard-shell,
  body.app-theme-jewel .page-shell {
    padding-top: 12px;
  }

  /* Notifications opened from the rail float over the content rather than
   * depending on a hidden header's geometry. */
  body.app-theme-jewel .signed-in-site-header .notification-panel-shell {
    position: fixed;
    top: 12px;
    right: 18px;
    left: auto;
    z-index: 60;
    width: min(410px, calc(100vw - var(--tm-memorial-sidebar-width) - 36px));
    padding: 0;
    transform: none;
  }

  body.app-theme-jewel .signed-in-site-header .notification-panel {
    width: 100%;
    margin: 0;
  }
}

/* The sidebar is deliberately a desktop shell. Below 1220px the existing
 * compact responsive header remains the navigation fallback. */
