/* One application header across Updates, Reader, Studio, and Settings. */
:root {
  --app-header: 72px;
  --app-footer: 26px;
  --app-nav-rail: 278px;
}

body {
  padding-bottom: var(--app-footer);
}

.copyright-strip {
  position: fixed;
  z-index: 18;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--app-footer);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-top: 1px solid #202b39;
  background: #080d13ee;
  color: #778391;
  font-size: 9px;
  letter-spacing: .35px;
  text-align: center;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

/* Extend the divider across the window around the constrained navigation. */
.app-header {
  box-shadow: inset 0 -1px #202b39;
}

.topbar {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  height: var(--app-header);
  padding: 0 24px;
  gap: 0;
  background: #0a1018;
  border-color: #202b39;
}

.topbar .brand {
  flex: 0 0 calc(var(--app-nav-rail) - 24px);
  width: calc(var(--app-nav-rail) - 24px);
  height: var(--app-header);
  margin: 0;
  border-right: 0;
  font-size: 27px;
  letter-spacing: -1.1px;
}

.topbar .brand>svg {
  width: 25px;
  height: 29px;
  margin-right: 10px;
}

.topbar .brand-logo {
  display: block;
  width: auto;
  height: 58px;
  max-width: calc(100% - 24px);
  object-fit: contain;
  object-position: left center;
}

.header-tagline,
.top-status>.status-dot,
.top-status>#connection-label {
  display: none;
}

.workspace-nav {
  position: static;
  flex: 1 1 auto;
  min-width: 0;
  height: var(--app-header);
  margin-left: auto;
  border: 0;
  background: transparent;
}

.workspace-nav>div {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  gap: 32px;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  padding: 0 18px;
}

.workspace-nav .nav-tab {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  justify-content: center;
  padding: 1px 2px 0;
  color: #9aa4b2;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
}

.workspace-nav .primary-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #c7d0dc;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.15px;
}

.workspace-nav .nav-feature-icon {
  order: -1;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .78;
}

.workspace-nav .primary-nav-tab:hover:not(:disabled) .nav-feature-icon,
.workspace-nav .primary-nav-tab.active .nav-feature-icon {
  color: #69aaff;
  opacity: 1;
}

.workspace-nav .nav-tab:hover:not(:disabled) {
  color: #e4e9f0;
}

.workspace-nav .nav-tab.active {
  color: #f5f7fa;
  border-color: transparent;
  box-shadow: inset 0 -2px #4b9dff;
}

.workspace-nav .nav-tab:disabled {
  opacity: .48;
}

.workspace-nav .primary-nav-tab:disabled {
  opacity: .68;
}

.workspace-nav small {
  display: none;
}

.author-nav-divider {
  flex: 0 0 1px;
  align-self: center;
  width: 1px;
  height: 20px;
  margin: 0 -8px;
  background: #2b3746;
}

.topbar>.reader-tools {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  height: 36px;
  padding-left: 14px;
  border-left: 1px solid #263343;
}

body[data-view="reader"] .topbar>.reader-tools {
  display: flex;
}

.topbar>.reader-tools .icon-button,
.topbar>.reader-tools .text-button {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 4px;
  color: #d5dbe5;
}

.topbar>.reader-tools .text-button {
  font: 22px/1 Georgia, "Times New Roman", serif;
}

.topbar>.reader-tools .icon-button svg {
  width: 20px;
  height: 20px;
}

.topbar>.reader-tools button:hover {
  color: #fff;
  background: #172536;
}

.topbar>.reader-tools button.selected {
  color: #6eafff;
}

.top-status {
  flex: 0 0 auto;
  margin-left: 13px;
  gap: 8px;
}

.top-status .secondary {
  min-height: 36px;
  padding: 8px 13px;
  border-color: #344154;
  border-radius: 5px;
  background: #111a25;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.top-status .secondary:hover {
  border-color: #506581;
  background: #172332;
}

.workspace {
  min-height: calc(100dvh - var(--app-header));
}

.reading-room {
  height: calc(100dvh - var(--app-header));
}

.sidebar {
  max-height: calc(100dvh - var(--app-header));
}

body[data-view="reader"] #reader-view {
  min-height: calc(100dvh - var(--app-header) - var(--app-footer));
}

body[data-view="reader"] .reading-room {
  height: calc(100dvh - var(--app-header) - var(--app-footer));
}

body[data-view="reader"] .sidebar {
  bottom: auto;
  max-height: calc(100dvh - var(--app-header) - var(--app-footer));
}

body[data-view="reader"] .audio-dock {
  bottom: calc(var(--app-footer) + 8px);
}

body[data-view="reader"] .toast {
  bottom: calc(var(--app-footer) + 18px);
}

body.reader-has-audio[data-view="reader"] .toast {
  bottom: calc(var(--app-footer) + 70px);
}

@media (max-width: 1180px) {
  .workspace-nav>div {
    gap: 20px;
    padding: 0 12px;
  }

  .workspace-nav .nav-tab {
    font-size: 13px;
  }

  .workspace-nav .primary-nav-tab {
    font-size: 15px;
  }

  .topbar>.reader-tools {
    padding-left: 10px;
  }

  .top-status {
    margin-left: 8px;
  }

  .top-status .secondary {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 860px) and (min-width: 720px) {
  :root {
    --app-nav-rail: 224px;
  }

  .topbar {
    padding-left: 20px;
    padding-right: 16px;
  }

  .topbar .brand {
    flex-basis: 204px;
    width: 204px;
    font-size: 25px;
  }

  .workspace-nav>div {
    justify-content: flex-start;
    gap: 14px;
    padding: 0 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .workspace-nav .nav-tab {
    font-size: 12px;
  }

  .workspace-nav .primary-nav-tab {
    gap: 7px;
    font-size: 14px;
  }

  .workspace-nav .nav-feature-icon {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
  }

  .author-nav-divider {
    margin: 0 -3px;
  }

  .topbar>.reader-tools .icon-button,
  .topbar>.reader-tools .text-button {
    width: 34px;
    min-width: 34px;
  }
}

@media (max-width: 720px) {
  :root {
    --app-header: 112px;
    --app-nav-rail: 260px;
  }

  .topbar {
    align-items: flex-start;
    height: var(--app-header);
    padding: 0 15px 48px;
    gap: 10px;
  }

  .mobile-menu {
    display: inline-grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 64px;
    padding: 0;
  }

  .mobile-menu svg {
    width: 20px;
    height: 20px;
  }

  .topbar .brand {
    flex: 0 0 auto;
    width: auto;
    height: 64px;
    border: 0;
    font-size: 27px;
  }

  .topbar .brand>svg {
    width: 22px;
    height: 26px;
    margin-right: 8px;
  }

  .topbar .brand-logo {
    height: 50px;
    max-width: 150px;
  }

  .workspace-nav {
    position: absolute;
    inset: auto 0 0;
    height: 48px;
    border-top: 1px solid #1d2733;
    border-bottom: 1px solid #202b39;
    background: #0a1018;
  }

  .workspace-nav>div {
    justify-content: flex-start;
    gap: 24px;
    height: 48px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .workspace-nav>div::-webkit-scrollbar {
    display: none;
  }

  .workspace-nav .nav-tab {
    font-size: 13px;
  }

  .workspace-nav .primary-nav-tab {
    gap: 7px;
    font-size: 14px;
  }

  .author-nav-divider {
    flex-shrink: 0;
    margin: 0 -7px;
  }

  .topbar>.reader-tools {
    align-self: flex-start;
    height: 64px;
    margin-left: auto;
    padding-left: 0;
    border: 0;
  }

  .topbar>.reader-tools .icon-button,
  .topbar>.reader-tools .text-button {
    width: 34px;
    min-width: 34px;
    height: 40px;
    margin-top: 12px;
  }

  .topbar>.reader-tools .text-button {
    font-size: 20px;
  }

  .top-status {
    align-items: center;
    height: 64px;
    margin-left: auto;
  }

  body[data-view="reader"] .top-status {
    margin-left: 0;
  }

  .top-status .secondary {
    padding: 7px 9px;
    font-size: 11px;
  }

  .top-status #account-button {
    display: none;
  }

  .workspace {
    min-height: calc(100dvh - var(--app-header));
  }

  .reading-room {
    height: calc(100dvh - var(--app-header));
  }

  .sidebar {
    top: var(--app-header);
    max-height: calc(100dvh - var(--app-header));
  }

  body[data-view="reader"] #reader-view {
    min-height: calc(100dvh - var(--app-header) - var(--app-footer));
  }

  body[data-view="reader"] .reading-room {
    height: calc(100dvh - var(--app-header) - var(--app-footer));
  }

  body[data-view="reader"] .sidebar {
    position: fixed;
    bottom: var(--app-footer);
    max-height: calc(100dvh - var(--app-header) - var(--app-footer));
  }

  body[data-view="reader"] .audio-dock {
    bottom: calc(var(--app-footer) + 7px);
  }
}

@media print {
  body {
    padding-bottom: 0;
  }

  .copyright-strip {
    position: static;
    height: auto;
    padding: 12px;
    color: #333;
    background: #fff;
  }
}
