:root,
html[data-theme="vellum"] {
  --shell: #efe9de;
  --surface: #f7f3eb;
  --surface-raised: #fcfaf5;
  --inset: #e6dfd1;
  --line: #d5ccbc;
  --line-bright: #b8ac98;
  --text-bright: #1e1b17;
  --text: #332e28;
  --text-muted: #686054;
  --text-dim: #8c8273;
  --signal: #8b3a2b;
  --signal-fill: #8b3a2b;
  --on-accent: #ffffff;
  --observed: #2d6a4f;
  --caution: #b07d2b;
}

html[data-theme="parchment"] {
  --shell: #e8e0d0;
  --surface: #f2ece0;
  --surface-raised: #f9f5ec;
  --inset: #ded4c1;
  --line: #cbbba2;
  --line-bright: #b09d80;
  --text-bright: #1a1612;
  --text: #2e2821;
  --text-muted: #5e5346;
  --text-dim: #827564;
  --signal: #7a2e21;
  --signal-fill: #7a2e21;
  --on-accent: #ffffff;
  --observed: #235c42;
  --caution: #9c6b1e;
}

html[data-theme="ink"] {
  --shell: #141311;
  --surface: #1b1916;
  --surface-raised: #24211d;
  --inset: #2c2823;
  --line: #332e28;
  --line-bright: #4d453b;
  --text-bright: #f4EFE6;
  --text: #d8d0c4;
  --text-muted: #9c9283;
  --text-dim: #6e665b;
  --signal: #d97757;
  --signal-fill: #b85838;
  --on-accent: #ffffff;
  --observed: #52b788;
  --caution: #e0a952;
}

html[data-theme="slate"] {
  --shell: #11151c;
  --surface: #171c24;
  --surface-raised: #1e2530;
  --inset: #262f3d;
  --line: #2d3748;
  --line-bright: #4a5568;
  --text-bright: #f0f4f8;
  --text: #d9e2ec;
  --text-muted: #9fb3c8;
  --text-dim: #627d98;
  --signal: #63b3ed;
  --signal-fill: #3182ce;
  --on-accent: #ffffff;
  --observed: #68d391;
  --caution: #f6ad55;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  background: var(--shell);
  border-block-end: 1px solid var(--line);
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.brand-title {
  display: block;
  font-family: "New York", "Iowan Old Style", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.15;
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.scope-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--inset);
  color: var(--signal);
  border: 1px solid var(--line);
}

.scope-pill.is-private {
  background: var(--signal-fill);
  color: var(--on-accent);
  border-color: var(--signal);
}

.mode-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.2rem;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}

.mode-tab.is-active {
  background: var(--signal-fill);
  color: var(--on-accent);
}

.utility-cluster {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-picker-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.theme-select,
.sort-select {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.32rem 0.55rem;
  font-size: 0.76rem;
}

.owner-key-btn,
.primary-btn {
  background: var(--signal-fill);
  color: var(--on-accent);
  border: 1px solid var(--signal);
  border-radius: 6px;
  padding: 0.36rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-block-size: calc(100vh - 57px);
}

.sidebar {
  background: var(--shell);
  border-inline-end: 1px solid var(--line);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  max-block-size: calc(100vh - 57px);
  position: sticky;
  inset-block-start: 57px;
}

.sidebar-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 0.5rem;
}

.sidebar-heading {
  margin: 0 0 0.25rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-inline: 0.5rem;
}

.sidebar-heading-row .sidebar-heading {
  padding-inline: 0;
  margin: 0;
}

.sidebar-count {
  font-size: 0.68rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-dim);
}

.sidebar-hint {
  margin: 0.2rem 0.5rem 0.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.shelf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shelf-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shelf-btn {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.38rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 0.79rem;
  text-align: left;
  cursor: pointer;
}

.shelf-btn:hover {
  background: var(--surface-raised);
}

.shelf-btn.is-active {
  background: var(--inset);
  border-color: var(--line-bright);
  color: var(--text-bright);
  font-weight: 600;
}

.shelf-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.vis-toggle-btn {
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--text-dim);
  border-radius: 5px;
  padding: 0.22rem 0.42rem;
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
}

.vis-toggle-btn.is-public {
  background: var(--signal-fill);
  color: var(--on-accent);
  border-color: var(--signal);
}

.sidebar-footer {
  margin-block-start: auto;
  padding: 0.75rem 0.5rem 0.25rem;
  border-block-start: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.45rem;
}

.sidebar-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: var(--signal);
  text-decoration: underline;
}

.stage {
  padding: 1.25rem 1.5rem 3rem;
  min-inline-size: 0;
}

.stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-block-end: 1rem;
  border-block-end: 1px solid var(--line);
  margin-block-end: 1.15rem;
}

.stage-title-block h1 {
  margin: 0;
  font-family: "New York", "Iowan Old Style", Georgia, serif;
  font-size: 1.4rem;
  color: var(--text-bright);
}

.stage-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.search-box input {
  width: 280px;
  max-width: 100%;
  padding: 0.4rem 0.7rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--text-bright);
  font-size: 0.8rem;
}

.view-switcher,
.pill-group {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.view-btn,
.filter-pill {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 5px;
  cursor: pointer;
}

.view-btn.is-active,
.filter-pill.is-active {
  background: var(--signal-fill);
  color: var(--on-accent);
}

.curator-banner {
  margin-block-end: 1.1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--inset);
  border: 1px solid var(--signal);
  font-size: 0.78rem;
  color: var(--text-bright);
}

.curator-banner strong {
  color: var(--signal);
  margin-inline-end: 0.4rem;
}

/* Deferred view switching with content-visibility fallback */
.inactive {
  display: none;
}

@supports (content-visibility: hidden) {
  .cached-view.inactive {
    display: block;
    content-visibility: hidden;
  }
}

/* Defer rendering heavy below-the-fold sections */
.deferred-below-fold {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 280px;
}

.covers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 1.15rem;
}

.book-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.55rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.book-card:hover {
  background: var(--surface-raised);
  border-color: var(--line);
  transform: translateY(-2px);
}

.cover-frame {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 7px;
  overflow: hidden;
  background: var(--inset);
  border: 1px solid var(--line);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
}

.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-fallback {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, var(--inset), var(--shell));
  font-family: "New York", Georgia, serif;
}

.cover-fallback-genre {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--signal);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.cover-fallback-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cover-fallback-author {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-muted);
}

.book-card-title {
  font-family: "New York", "Iowan Old Style", Georgia, serif;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-block-size: 2.2rem;
}

.book-card-author {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.hl-badge {
  color: var(--signal);
  font-weight: 600;
}

/* Responsive Data Table (modern-web-guidance: responsive-table) */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(680px, 80vh);
  container-type: inline-size;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.catalog-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  --label-2: "Author";
  --label-3: "Series";
  --label-4: "Publisher";
  --label-5: "Subject";
  --label-6: "Year";
  --label-7: "Pages";
  --label-8: "Highlights";
}

.catalog-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: var(--shell);
}

.catalog-table th,
.catalog-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-block-end: 1px solid var(--line);
}

.catalog-table thead th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.catalog-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--surface-raised);
  font-family: "New York", Georgia, serif;
  font-weight: 600;
  color: var(--text-bright);
}

.catalog-table tbody tr {
  cursor: pointer;
}

.catalog-table tbody tr:hover th,
.catalog-table tbody tr:hover td {
  background: var(--inset);
}

@container (width < 600px) {
  .catalog-table,
  .catalog-table thead,
  .catalog-table tbody,
  .catalog-table tr,
  .catalog-table th,
  .catalog-table td {
    display: block;
  }

  .catalog-table thead {
    /* MANDATORY: Hide column header from layout and screen readers */
    display: none;
  }

  .catalog-table tr {
    margin-block-end: 1rem;
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  .catalog-table tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--inset);
  }

  .catalog-table td:nth-child(2)::before { content: var(--label-2) ": "; font-weight: 600; color: var(--text-muted); }
  .catalog-table td:nth-child(3)::before { content: var(--label-3) ": "; font-weight: 600; color: var(--text-muted); }
  .catalog-table td:nth-child(4)::before { content: var(--label-4) ": "; font-weight: 600; color: var(--text-muted); }
  .catalog-table td:nth-child(5)::before { content: var(--label-5) ": "; font-weight: 600; color: var(--text-muted); }
  .catalog-table td:nth-child(6)::before { content: var(--label-6) ": "; font-weight: 600; color: var(--text-muted); }
  .catalog-table td:nth-child(7)::before { content: var(--label-7) ": "; font-weight: 600; color: var(--text-muted); }
  .catalog-table td:nth-child(8)::before { content: var(--label-8) ": "; font-weight: 600; color: var(--text-muted); }
}

/* Spines rack and library bookcase bays */
.spines-rack {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 3px;
  row-gap: 24px;
  padding: 1.4rem 1.25rem 1.6rem;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(12, 10, 9, 0.36) 0px,
      rgba(22, 18, 16, 0.18) 232px,
      #422a1b 232px,
      #24160d 244px,
      rgba(0, 0, 0, 0.65) 246px,
      rgba(12, 10, 9, 0.36) 256px
    ),
    var(--inset);
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: inset 0 6px 18px rgba(0, 0, 0, 0.38);
}

.spine-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border-radius: 3.5px 3.5px 2px 2px;
  border: 1px solid rgba(0, 0, 0, 0.55);
  padding: 0.42rem 0.18rem;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    inset 2px 0 3px rgba(255, 255, 255, 0.16),
    inset -3px 0 5px rgba(0, 0, 0, 0.38),
    1.5px 3px 6px rgba(0, 0, 0, 0.38);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.16s ease;
}

.spine-item::before,
.spine-item::after {
  content: "";
  width: 100%;
  height: 2px;
  background: var(--spine-foil, #dfb86c);
  opacity: 0.72;
  flex-shrink: 0;
}

.spine-item:hover {
  transform: translateY(-9px) scale(1.03);
  z-index: 4;
  border-color: var(--spine-foil, var(--signal));
  box-shadow:
    inset 2px 0 3px rgba(255, 255, 255, 0.24),
    inset -3px 0 5px rgba(0, 0, 0, 0.42),
    2px 8px 14px rgba(0, 0, 0, 0.52);
}

.spine-head {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.56rem;
  font-weight: 700;
  color: var(--spine-foil, #dfb86c);
  line-height: 1;
  margin-block: 0.15rem;
}

.spine-body {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex: 1;
  min-block-size: 0;
  width: 100%;
  overflow: hidden;
  padding-block: 0.25rem;
}

.spine-item.is-cartouche .spine-body {
  background: var(--spine-cartouche-bg, #f1e7d0);
  color: var(--spine-cartouche-ink, #231412);
  border: 1px solid var(--spine-foil, #c9a259);
  border-radius: 2px;
  margin-inline: 2px;
  padding-block: 0.3rem;
}

.spine-title {
  font-family: "New York", "Iowan Old Style", Georgia, serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-inline-size: 148px;
}

.spine-author {
  font-family: "New York", Georgia, serif;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-inline-size: 110px;
}

.spine-foot {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.52rem;
  font-weight: 700;
  color: var(--spine-foil, #dfb86c);
  opacity: 0.88;
  line-height: 1;
  margin-block-start: 0.15rem;
}

/* Series and Authors cards */
.series-grid,
.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.summary-card:hover {
  border-color: var(--signal);
  background: var(--inset);
}

.summary-card-title {
  font-family: "New York", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
}

.summary-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Commonplace Book */
.commonplace-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 1rem;
}

.commonplace-header h2 {
  margin: 0;
  font-family: "New York", Georgia, serif;
  font-size: 1.15rem;
  color: var(--text-bright);
}

.commonplace-header p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.commonplace-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.commonplace-card {
  padding: 1rem 1.15rem;
  border-radius: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
}

.commonplace-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-block-end: 0.5rem;
  font-size: 0.78rem;
}

.commonplace-book-title {
  font-family: "New York", Georgia, serif;
  font-weight: 700;
  color: var(--text-bright);
}

.commonplace-quote {
  margin: 0.4rem 0;
  padding-inline-start: 0.85rem;
  border-inline-start: 3px solid var(--signal);
  font-family: "New York", Georgia, serif;
  font-size: 0.94rem;
  color: var(--text-bright);
}

.commonplace-quote.is-underline {
  border-inline-start-color: var(--caution);
  text-decoration: underline;
  text-decoration-color: var(--caution);
}

.commonplace-note {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--text);
}

/* Dialogs (modern-web-guidance: light-dismiss-a-dialog) */
dialog.folio-dialog {
  max-width: 680px;
  width: calc(100vw - 2rem);
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  padding: 0;
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

dialog.auth-dialog {
  max-width: 440px;
}

dialog.folio-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(3px);
}

.folio-dialog-inner {
  padding: 1.35rem 1.5rem;
}

.folio-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 0.85rem;
}

.eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--signal);
  margin: 0;
}

.dialog-close-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.folio-top {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1.25rem;
  margin-block-end: 1rem;
}

.folio-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-block: 0.5rem;
}

.meta-pill {
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--inset);
  color: var(--text);
}

.folio-synopsis {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.6;
  max-block-size: 200px;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.token-input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-bright);
  margin-block: 0.35rem 0.85rem;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
}

.auth-error {
  color: #c92a2a;
  font-size: 0.78rem;
  margin: 0 0 0.75rem;
}

/* App Store Showcase & Legal Pages */
.appstore-showcase,
.legal-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.showcase-hero {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  border-block-end: 1px solid var(--line);
}

.showcase-icon {
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  margin-block-end: 1rem;
}

.showcase-hero h2,
.legal-card h1 {
  font-family: "New York", Georgia, serif;
  font-size: 2rem;
  color: var(--text-bright);
  margin: 0.4rem 0 0.75rem;
}

.showcase-lead,
.legal-lead {
  max-width: 680px;
  margin: 0 auto 1.75rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
}

.metric-card,
.feature-card,
.legal-card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
}

.metric-value {
  display: block;
  font-family: "New York", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--signal);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-block-start: 2rem;
}

.feature-card h3 {
  margin: 0 0 0.4rem;
  font-family: "New York", Georgia, serif;
  color: var(--text-bright);
}

.feature-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.showcase-footer {
  margin-block-start: 2.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.showcase-footer a,
.legal-nav a {
  color: var(--signal);
  text-decoration: none;
  font-weight: 600;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--shell);
  border-block-end: 1px solid var(--line);
}

.legal-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.82rem;
}

.legal-card {
  padding: 2rem;
}

.legal-card h2 {
  font-family: "New York", Georgia, serif;
  font-size: 1.2rem;
  color: var(--text-bright);
  margin-block-start: 1.5rem;
}

.editorial-rule {
  border: 0;
  border-block-start: 1px solid var(--line);
  margin: 1.25rem 0;
}

@media (max-width: 860px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    max-block-size: none;
    border-inline-end: 0;
    border-block-end: 1px solid var(--line);
  }
}
