/* Load after style.css. Shared cover ratios, artwork and 3D transforms stay intact. */
.mobile-nav,
.institution-wordmark {
  display: none;
}

body[data-brand="institution"] :is(.header, .footer) .brand-logo {
  background: none;
}

body[data-brand="institution"] :is(.header, .footer) .institution-wordmark {
  display: grid;
  align-content: center;
  gap: 3px;
  height: 100%;
  font-family: var(--sans);
  color: var(--accent);
  line-height: 1.15;
}

.institution-wordmark > span:first-child {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.045em;
}

.institution-wordmark > span:nth-child(2) {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .025em;
}

.institution-wordmark > small {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}

/* The book is the primary content; controls and sample notices stay quiet. */
#view-library .tenant-switcher {
  gap: 10px;
  margin: 18px 0 12px;
}

#view-library .tenant-switcher a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#view-library .tenant-switcher .icon {
  width: 15px;
  height: 15px;
}

.shelf-summary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font: 400 13px/1.6 var(--sans);
}

.shelf-summary > .icon {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  flex-shrink: 0;
  color: var(--accent);
}

.shelf-summary strong {
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 650px) {
  body:is([data-view="library"], [data-view="institution"]) .demo-strip {
    color: #685371;
    background: #f4f0f7;
  }

  #view-library .tenant-switcher {
    flex-wrap: nowrap;
    gap: 8px;
    margin: 14px 0 10px;
  }

  #view-library .tenant-switcher label {
    flex-shrink: 0;
    font-size: 12px;
  }

  #view-library .tenant-switcher select {
    min-width: 0;
    max-width: 210px;
    flex: 1;
    min-height: 44px;
    border-radius: 7px;
    background: #f6f4f8;
  }

  #view-library .tenant-switcher a {
    flex-shrink: 0;
    font-size: 12px;
  }

  #view-library .shelf-summary {
    font-size: 12px;
    line-height: 1.65;
  }

  #view-library .own-work-strip {
    display: grid;
    gap: 13px;
    margin-top: 30px;
    padding: 22px 0;
  }

  #view-library .own-work-strip h2 {
    font-size: 19px;
    font-weight: 550;
    line-height: 1.5;
  }

  #view-library .own-work-strip .secondary {
    justify-self: start;
    min-height: 44px;
    padding-inline: 13px;
    border-radius: 7px;
  }

  body:is([data-view="library"], [data-view="institution"]) .header-nav {
    display: none;
  }

  #view-library {
    padding-top: 14px;
  }

  #view-library .page-heading h1 {
    font-size: 27px;
  }

  #library-context {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
  }

  #view-library .library-tabs {
    gap: 6px;
    margin: 16px 0 14px;
  }

  #view-library .library-tabs .filter {
    min-height: 44px;
    padding: 10px 13px;
    font-size: 13px;
  }

  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 5px max(12px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: var(--white);
    border-top: 1px solid var(--line);
    font-family: var(--sans);
  }

  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 50px;
    padding: 7px 4px;
    border-radius: 5px;
    color: #746b7c;
    text-decoration: none;
  }

  .mobile-nav a[aria-current="page"] {
    background: transparent;
    color: var(--accent);
    font-weight: 650;
  }

  .mobile-nav .icon,
  .mobile-nav a > svg {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
  }

  .mobile-nav .label {
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
  }

  body:not(.reading) > #main {
    padding-bottom: 24px;
  }

  body:not(.reading) > .footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  body:not(.reading) > .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

body.reading .mobile-nav {
  display: none;
}

/* Route changes focus the main landmark; interactive controls keep their own focus rings. */
#main:focus { outline: none; }
