:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f6f7fb;
  color: #1a1f2a;
}

header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #d6dae3;
  background: #fff;
}

header h1 {
  margin: 0;
  font-size: 1.2rem;
}

header p {
  margin: 0.25rem 0 0;
  color: #5a6477;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(380px, 1fr) 340px;
  min-height: calc(100vh - 80px);
}

.parts-pane,
.content-pane,
.meta-pane {
  border-right: 1px solid #d6dae3;
  background: #fff;
}

.parts-pane,
.meta-pane {
  padding: 1rem;
}

.parts-pane h2,
.pages-pane h2,
.transcript-pane h2,
.meta-pane h2 {
  margin-top: 0;
  font-size: 1rem;
}

.content-pane {
  display: grid;
  grid-template-rows: 45% 55%;
}

.pages-pane,
.transcript-pane {
  padding: 1rem;
  overflow: auto;
}

.pages-pane {
  border-bottom: 1px solid #d6dae3;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li button {
  width: 100%;
  text-align: left;
  border: 1px solid #e0e4ee;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.4rem;
  background: #f8f9fd;
  border-radius: 6px;
  cursor: pointer;
}

li button:hover {
  background: #eef2ff;
}

li button.active {
  background: #dde6ff;
  border-color: #b8c8ff;
}

small {
  color: #5a6477;
}

.pane-header,
.meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.pager {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

button {
  border: 1px solid #c9d2e2;
  background: #f5f7fc;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 0.6rem;
}

dt {
  font-weight: 600;
}

dd {
  margin: 0;
  color: #2d3546;
}

details {
  margin-top: 1rem;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto auto;
  }

  .meta-pane {
    grid-column: 1 / span 2;
    border-top: 1px solid #d6dae3;
    border-right: none;
  }
}
