/* Account and Library follow the approved quiet, neutral reading interface. */
.header-account {
  display: flex;
  align-items: center;
  gap: 18px;
}
.header-sign-in,
.header-mobile-library {
  font-size: 13px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.header-mobile-library {
  display: none;
}
.website-profile {
  position: relative;
  z-index: 30;
}
.website-profile summary {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  min-width: 44px;
  border-radius: 50%;
}
.website-profile summary::-webkit-details-marker,
.library-dropdown summary::-webkit-details-marker {
  display: none;
}
.profile-avatar {
  border: 1px solid var(--line);
  background: var(--soft);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
}
.profile-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 240px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 32px #00000012;
}
.profile-identity {
  padding: 12px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.profile-identity strong,
.profile-identity span {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.profile-identity span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.profile-panel button {
  width: 100%;
  text-align: left;
  min-height: 40px;
  padding: 8px 10px;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
}
.profile-panel button:hover {
  background: var(--hover);
}
.website-login {
  width: min(1120px, 100%);
  margin: 90px auto 100px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 90px;
  align-items: center;
}
.website-login-copy h1 {
  font: 400 clamp(40px, 4.5vw, 62px)/1.24 var(--serif);
  letter-spacing: -0.04em;
}
.website-login-copy p {
  margin-top: 26px;
  max-width: 440px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}
.website-login-form {
  min-width: 0;
}
.website-login-form .cl-rootBox,
.website-login-form .cl-cardBox {
  width: 100%;
}
.account-unavailable {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.account-unavailable h2 {
  font-size: 24px;
  letter-spacing: -0.02em;
}
.account-unavailable p {
  font-size: 14px;
  color: var(--muted);
  margin: 18px 0 24px;
}
.account-unavailable a {
  display: block;
  margin-top: 14px;
  font-size: 13px;
}
.library-site .header {
  max-width: 1400px;
}
.library-workspace {
  width: min(1400px, 100%);
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 32px;
  margin: 48px auto 100px;
  padding: 0 32px;
}
.library-sections {
  border-right: 1px solid var(--line);
  padding-right: 18px;
}
.library-sections a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  min-height: 44px;
  border-radius: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}
.library-sections a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.library-sections a[aria-current="page"] .section-count {
  color: var(--accent);
}
.section-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.library-main {
  min-width: 0;
}
.library-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.library-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  width: 360px;
  max-width: 100%;
  padding: 0 12px;
}
.library-search svg {
  color: var(--muted);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.library-search input {
  width: 100%;
  border: 0;
  min-width: 0;
  outline-offset: 3px;
  background: none;
  min-height: 40px;
  font-size: 13px;
  color: var(--ink);
}
.library-search input::placeholder {
  color: var(--muted);
}
.library-total {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.library-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.library-list-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.library-row-link {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px 0;
  flex: 1;
  min-width: 0;
}
.library-thumbnail {
  flex-shrink: 0;
  position: relative;
  display: block;
  width: 142px;
  aspect-ratio: 16/9;
  background: var(--soft);
  border-radius: 7px;
  overflow: hidden;
}
.library-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumbnail-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  color: #aaaab2;
}
.library-row-copy {
  min-width: 0;
}
.library-row-copy h2 {
  font: 400 21px/1.4 var(--serif);
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
.library-channel {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}
.library-row-meta {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.library-icon-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: transparent;
  color: var(--muted);
  width: 40px;
  height: 40px;
  border-radius: 7px;
  margin-left: 20px;
}
.library-icon-button:hover,
.library-text-button:hover {
  background: var(--hover);
  color: var(--ink);
}
.library-row-error {
  position: absolute;
  bottom: 2px;
  right: 0;
  color: var(--danger);
  font-size: 11px;
}
.library-pagination {
  text-align: center;
  margin: 28px 0;
}
.library-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 36px;
  padding: 8px 13px;
  font-size: 13px;
  background: var(--accent);
  color: var(--accent-foreground);
  border: 1px solid var(--accent);
  border-radius: 7px;
  box-shadow: 0 1px 2px #00000016;
  line-height: 1.35;
  cursor: pointer;
}
.library-button:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.library-button.secondary {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 1px 2px #00000009;
  color: var(--ink);
}
.library-button.secondary:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--line);
}
.library-button svg,
.library-text-button svg,
.library-icon-button svg {
  width: 16px;
  height: 16px;
}
.library-button.danger {
  background: #a04441;
  border-color: #a04441;
  color: #fff;
}
.library-button.danger:hover:not(:disabled) {
  background: #b54e4a;
  border-color: #b54e4a;
}
.library-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 9px;
  background: none;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}
.library-site button:disabled {
  cursor: wait;
  opacity: 0.5;
}
.library-empty,
.library-error {
  text-align: center;
  padding: 85px 20px;
  max-width: 600px;
  margin: 0 auto;
}
.library-empty h1,
.library-error h1 {
  font: 400 30px/1.3 var(--serif);
  letter-spacing: -0.03em;
  margin-top: 22px;
}
.library-empty p,
.library-error p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  margin: 15px auto 25px;
  max-width: 400px;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  margin: 0 auto;
}
.empty-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
}
.empty-links a,
.library-error > a:not(.library-button) {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.library-inline-error,
.reader-status {
  font-size: 13px;
  color: var(--muted);
  margin: 18px 0;
  line-height: 1.7;
}
.library-inline-error {
  color: var(--danger);
}
.reader-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 20px;
  font-size: 13px;
  color: var(--muted);
}
.reader-navigation a {
  display: flex;
  align-items: center;
  gap: 10px;
}
.reader-navigation svg {
  width: 16px;
  height: 16px;
}
.reader-heading {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.reader-heading .library-thumbnail {
  width: 160px;
}
.reader-heading h1 {
  font: 400 clamp(30px, 3.1vw, 44px)/1.25 var(--serif);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.reader-heading p {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.reader-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 40px;
  flex-wrap: wrap;
}
.reader-action-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.reader-actions .library-icon-button {
  margin-left: 0;
  border: 0;
  cursor: pointer;
}
.reader-actions .download-menu .library-menu {
  left: auto;
  right: 0;
}
.library-dropdown {
  position: relative;
}
.library-dropdown summary {
  list-style: none;
}
.library-dropdown[open] > summary {
  background: var(--soft);
}
.reader-actions .versions-menu > summary {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--ink);
}
.version-label {
  color: var(--muted);
  font-size: 12px;
}
.library-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px;
  box-shadow: 0 10px 30px #00000010;
  z-index: 20;
}
.versions-menu .library-menu {
  left: 0;
  min-width: 235px;
  max-height: 340px;
  overflow-y: auto;
}
.library-menu a,
.library-menu > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  background: none;
}
.library-menu a:hover,
.library-menu > button:hover {
  background: var(--hover);
  color: var(--ink);
}
.library-menu a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.library-menu small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
  text-transform: capitalize;
}
.library-menu svg {
  width: 15px;
  height: 15px;
}
.library-menu p {
  padding: 8px;
  font-size: 12px;
}
.summary {
  max-width: 900px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--muted);
}
.summary-block {
  margin-bottom: 30px;
}
.summary-point-heading {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.summary-point-heading h2 {
  font: 600 17px/1.6 var(--sans);
  letter-spacing: 0;
  color: var(--ink);
}
.summary-block h3 {
  font: 500 14px/1.6 var(--sans);
  margin: 8px 0;
  color: var(--muted);
}
.summary-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.summary-block ul,
.summary-block ol.summary-list {
  padding-left: 20px;
  margin: 0;
}
.summary-block .summary-list > li + li,
.summary-block .summary-list li > ul {
  margin-top: 8px;
}
.summary-evidence {
  display: inline-flex;
  margin-left: 6px;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  font-family: monospace;
  color: var(--muted);
}
.summary-evidence a:hover {
  text-decoration: underline;
}
.summary-interpretation-label {
  font-weight: 500;
  color: var(--muted);
}
.summary-source-list {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.summary-source-list summary,
.summary-metadata summary {
  cursor: pointer;
  min-height: 32px;
}
.summary-source-list ol {
  padding-left: 20px;
}
.summary-source-list li {
  margin-bottom: 12px;
}
.summary-source-list blockquote {
  margin: 4px 0 0 0;
  border-left: 2px solid var(--line);
  padding-left: 12px;
  white-space: pre-wrap;
}
.summary-metadata {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  max-width: 900px;
  font-size: 12px;
  color: var(--muted);
}
.summary-metadata dl {
  margin: 10px 0;
  max-width: 430px;
}
.summary-metadata dl > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 0;
}
.summary-metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
  color: var(--muted);
}
.copy-fallback {
  display: block;
  width: 100%;
  min-height: 160px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
}
.library-delete-dialog {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  background: var(--surface);
  box-shadow: 0 15px 60px #00000020;
}
.library-delete-dialog::backdrop {
  background: #292a2a60;
}
.library-delete-dialog h2 {
  font: 400 25px/1.4 var(--serif);
  letter-spacing: -0.03em;
}
.library-delete-dialog p {
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0;
}
.library-delete-dialog fieldset {
  border: 0;
  margin: 20px 0;
  padding: 0;
}
.library-delete-dialog label {
  display: flex;
  gap: 10px;
  font-size: 13px;
  padding: 10px 0;
  align-items: center;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.library-unavailable,
.billing-page {
  max-width: 600px;
  margin: 80px auto;
  padding: 20px;
  text-align: center;
}
.library-unavailable h1,
.billing-page h1 {
  font-size: 36px;
}
.library-unavailable p,
.billing-page p {
  margin: 20px 0;
  color: var(--muted);
}
.billing-page .text-link {
  display: inline-block;
  margin: 20px 10px;
  text-decoration: underline;
}
.library-status {
  padding: 80px 30px;
  color: var(--muted);
  text-align: center;
}
.library-loading {
  padding: 0;
}
.skeleton-row {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 22px;
}
.skeleton {
  display: block;
  border-radius: 4px;
  background: var(--soft);
  animation: library-pulse 1.8s ease-in-out infinite;
}
.skeleton-thumb {
  width: 142px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 7px;
}
.skeleton-lines {
  flex: 1;
  align-self: center;
}
.skeleton-title {
  width: 70%;
  height: 18px;
  margin-bottom: 12px;
}
.skeleton-meta {
  width: 38%;
  height: 11px;
}
.skeleton-text {
  height: 12px;
  width: 95%;
  margin-top: 16px;
}
.reader-loading .skeleton-row {
  border: 0;
  padding: 12px 0 30px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
@keyframes library-pulse {
  50% {
    opacity: 0.55;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}
@media (max-width: 950px) {
  .library-workspace {
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 24px;
    padding: 0 24px;
  }
  .reader-heading .library-thumbnail {
    width: 120px;
  }
  .reader-actions {
    gap: 7px;
  }
  .version-label {
    display: none;
  }
  .website-login {
    grid-template-columns: 1fr 380px;
    gap: 35px;
    padding: 0 25px;
  }
}
@media (max-width: 720px) {
  .header-account {
    gap: 12px;
  }
  .header-mobile-library {
    display: inline-flex;
  }
  .header-account .button-small {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 11px;
  }
  .header-sign-in {
    font-size: 12px;
  }
  .profile-avatar {
    width: 30px;
    height: 30px;
  }
  .website-login {
    display: flex;
    flex-direction: column;
    gap: 34px;
    margin: 42px auto 70px;
    padding: 0 22px;
    align-items: stretch;
  }
  .website-login-copy h1 {
    font-size: 36px;
  }
  .website-login-copy p {
    font-size: 14px;
    margin-top: 18px;
  }
  .website-login-form {
    width: 100%;
  }
  .library-workspace {
    display: block;
    padding: 0 20px;
    margin: 25px auto 60px;
  }
  .library-sections {
    display: flex;
    gap: 8px;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 18px;
    margin-bottom: 25px;
  }
  .library-sections a {
    flex: 1;
    margin: 0;
    min-height: 40px;
  }
  .library-toolbar {
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 16px;
  }
  .library-search {
    width: 100%;
  }
  .library-total {
    margin-left: 0;
  }
  .library-toolbar > .library-text-button {
    margin-left: auto;
  }
  .library-row-link {
    gap: 14px;
    padding: 20px 0;
  }
  .library-thumbnail {
    width: 96px;
  }
  .library-row-copy h2 {
    font-size: 17px;
  }
  .library-channel {
    font-size: 11px;
  }
  .library-row-meta {
    font-size: 10px;
    gap: 5px;
    margin-top: 5px;
  }
  .library-icon-button {
    margin-left: 8px;
    width: 36px;
    height: 36px;
  }
  .library-empty,
  .library-error {
    padding: 60px 0;
  }
  .library-empty h1,
  .library-error h1 {
    font-size: 26px;
  }
  .reader-navigation {
    font-size: 11px;
    gap: 8px;
    margin-bottom: 28px;
  }
  .reader-navigation a {
    gap: 6px;
  }
  .reader-heading {
    gap: 15px;
    align-items: flex-start;
    padding-bottom: 22px;
  }
  .reader-heading .library-thumbnail {
    width: 85px;
    margin-top: 4px;
  }
  .reader-heading h1 {
    font-size: 25px;
  }
  .reader-heading p {
    font-size: 10px;
    gap: 5px;
    margin-top: 12px;
  }
  .reader-actions {
    margin: 16px 0 30px;
    gap: 7px;
  }
  .library-button {
    min-height: 36px;
    font-size: 12px;
    padding: 8px 10px;
    gap: 6px;
  }
  .library-text-button {
    font-size: 11px;
    padding: 7px 6px;
    gap: 5px;
  }
  .reader-actions .versions-menu > summary {
    padding: 8px;
    font-size: 11px;
  }
  .library-menu {
    min-width: 170px;
  }
  .versions-menu .library-menu {
    min-width: 205px;
  }
  .summary {
    font-size: 14px;
    line-height: 1.85;
  }
  .summary-point-heading h2 {
    font-size: 15px;
  }
  .skeleton-thumb {
    width: 96px;
    height: 54px;
  }
  .skeleton-row {
    gap: 14px;
  }
  .skeleton-title {
    height: 15px;
  }
}
