/* Drive-style library on lobby (index.html) */

.lobby-shell--drive {
  min-height: 100vh;
}

.lobby-shell--drive .lobby-hero--compact {
  padding: 1rem 1.5rem 0.5rem;
}

.lobby-shell--drive .lobby-hero--compact .lobby-hero__inner {
  max-width: none;
}

.lobby-shell--drive .lobby-hero--compact h1 {
  font-size: 1.125rem;
  margin: 0;
}

.lobby-shell--drive .lobby-hero--compact .lobby-hero__lead {
  font-size: 0.8125rem;
  margin: 0.35rem 0 0;
  color: #94a3b8;
  max-width: 40rem;
}

.drive-shell {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) 1fr;
  gap: 0;
  max-width: 80rem;
  margin: 0 auto;
  width: 100%;
  padding: 0 1rem 1.5rem;
  min-height: min(70vh, 720px);
}

@media (max-width: 768px) {
  .drive-shell {
    grid-template-columns: 1fr;
  }
  .drive-tree {
    display: none;
  }
  .drive-tree.is-mobile-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: #0f172a;
    padding: 1rem;
    overflow: auto;
  }
}

.drive-tree {
  background: rgb(15 23 42 / 55%);
  border: 1px solid rgb(148 163 184 / 15%);
  border-radius: 12px;
  padding: 0.65rem 0;
  overflow: auto;
  max-height: calc(100vh - 8rem);
}

.drive-tree__title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.35rem 1rem 0.5rem;
  margin: 0;
}

.drive-tree__btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem 0.35rem calc(0.75rem + var(--depth, 0) * 0.85rem);
  cursor: pointer;
  border-radius: 6px;
  margin: 0 0.35rem;
  width: calc(100% - 0.7rem);
}

.drive-tree__btn:hover,
.drive-tree__btn.is-active {
  background: rgb(59 130 246 / 20%);
  color: #fff;
}

.drive-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgb(15 23 42 / 35%);
  border: 1px solid rgb(148 163 184 / 15%);
  border-radius: 12px;
  margin-left: 0.75rem;
  overflow: hidden;
}

@media (max-width: 768px) {
  .drive-main {
    margin-left: 0;
  }
}

.drive-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgb(148 163 184 / 12%);
  background: rgb(15 23 42 / 50%);
}

.drive-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  flex: 1;
  min-width: 12rem;
}

.drive-breadcrumb a,
.drive-breadcrumb button {
  color: #93c5fd;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}

.drive-breadcrumb a:hover,
.drive-breadcrumb button:hover {
  background: rgb(255 255 255 / 8%);
}

.drive-breadcrumb span.sep {
  color: #475569;
}

.drive-breadcrumb span.current {
  color: #e2e8f0;
  font-weight: 600;
}

.drive-toolbar__meta {
  font-size: 0.75rem;
  color: #64748b;
}

.drive-list-wrap {
  overflow: auto;
  flex: 1;
}

.drive-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.drive-list thead th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgb(148 163 184 / 12%);
  position: sticky;
  top: 0;
  background: #0f172a;
  z-index: 1;
}

.drive-list tbody tr {
  border-bottom: 1px solid rgb(148 163 184 / 8%);
  cursor: pointer;
  transition: background 0.12s;
}

.drive-list tbody tr:hover {
  background: rgb(59 130 246 / 12%);
}

.drive-list td {
  padding: 0.55rem 1rem;
  color: #e2e8f0;
  vertical-align: middle;
}

.drive-list td.name {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 500;
}

.drive-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.drive-icon--folder {
  background: rgb(59 130 246 / 25%);
  color: #93c5fd;
}

.drive-icon--set {
  background: rgb(16 185 129 / 22%);
  color: #6ee7b7;
}

.drive-icon--file {
  background: rgb(148 163 184 / 18%);
  color: #cbd5e1;
}

.drive-list .kind-pill {
  font-size: 0.6875rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgb(148 163 184 / 15%);
  color: #94a3b8;
}

.drive-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
}

body.is-reader-open .drive-shell {
  display: none;
}

body.is-reader-open .lobby-hero--compact {
  display: none;
}

body.webbook--lobby.is-reader-open {
  background: #e8ecf4;
}

body.webbook--lobby.is-reader-open .lobby-shell--drive {
  min-height: 100vh;
}

body.webbook--lobby.is-reader-open .lobby-top {
  max-width: none;
  width: 100%;
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

body.is-reader-open .lobby-footer {
  display: none;
}

#wb-reader-root.wb-reader-panel {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 0 2rem;
  background: #e8ecf4;
  color: var(--text);
  min-height: calc(100vh - 4.5rem);
  box-sizing: border-box;
}

#wb-reader-root.wb-reader-panel .wb-reader-toolbar {
  max-width: none;
  margin: 0;
  padding: 0.65rem max(0.75rem, env(safe-area-inset-right, 0px)) 0.65rem
    max(0.75rem, env(safe-area-inset-left, 0px));
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  flex-wrap: wrap;
}

#wb-reader-root.wb-reader-panel .site-header,
#wb-reader-root.wb-reader-panel .site-main {
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

#wb-reader-root.wb-reader-panel .site-header {
  padding-top: 1rem;
  padding-bottom: 0.75rem;
}

#wb-reader-root.wb-reader-panel .site-main {
  padding-top: 0;
  padding-bottom: 1rem;
  margin-bottom: 0;
}

#wb-reader-root.wb-reader-panel .page-layout,
#wb-reader-root.wb-reader-panel .page-layout--with-toc {
  width: 100%;
  max-width: none;
}

#wb-reader-root.wb-reader-panel .page-content,
#wb-reader-root.wb-reader-panel .page-content.wb-blocks-root,
#wb-reader-root.wb-reader-panel .wb-blocks-root {
  max-width: none;
  width: 100%;
}

#wb-reader-root.wb-reader-panel .subnav-wrap {
  margin-left: calc(-1 * max(0.75rem, env(safe-area-inset-left, 0px)));
  margin-right: calc(-1 * max(0.75rem, env(safe-area-inset-right, 0px)));
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
}

@media (min-width: 900px) {
  #wb-reader-root.wb-reader-panel .page-layout--with-toc {
    grid-template-columns: minmax(0, 1fr) 13rem;
    gap: 1.25rem;
  }
}
