.app-shell {
  min-height: 100vh;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.9rem, env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  gap: 0.5rem;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
  padding: 0.45rem 0.35rem;
  background: color-mix(in srgb, var(--paper-strong) 86%, transparent);
  backdrop-filter: blur(14px);
}

.title-stack {
  min-width: 0;
  text-align: center;
}

.brand-title {
  display: inline-grid;
  grid-template-columns: 2rem minmax(0, auto);
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

.brand-title img {
  width: 2rem;
  height: 2rem;
}

.is-reader .brand-title img {
  display: none;
}

.is-reader .brand-title {
  grid-template-columns: minmax(0, auto);
}

.title-stack h1 {
  margin: 0;
  overflow: hidden;
  font-size: 1.24rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-stack p {
  margin: 0.12rem 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 360px) {
  .title-stack h1 {
    font-size: 1rem;
    white-space: normal;
    text-wrap: balance;
  }
}

.icon-button,
.tool-button,
.star-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--paper-strong) 86%, transparent);
  box-shadow: 0 4px 16px rgba(40, 34, 25, 0.08);
}

.icon-button {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.45rem;
}

.back-button {
  visibility: hidden;
}

.is-reader .back-button {
  visibility: visible;
}

.advanced-list .back-button {
  visibility: visible;
}

main {
  max-width: 960px;
  margin: 0 auto;
}
