/* Base / Theme */

:root {
  --bg: #f3f3f1;
  --bg-soft: #fafaf8;
  --panel: #fffefe;
  --panel-strong: #ffffff;
  --panel-muted: #f5f5f3;
  --text: #171717;
  --muted: #707070;
  --border: #e7e7e4;
  --border-strong: #d7d7d3;
  --accent: #161616;
  --accent-soft: #f1f1ee;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.04);
  --reader-font: "Open Sans", "Helvetica Neue", sans-serif;
  --reader-size: 17px;
  --highlight-yellow: #fff0b3;
  --highlight-pink: #ececec;
  --highlight-blue: #e5e5e5;
  --highlight-green: #f0f0f0;
}

body[data-theme="light"] {
  --bg: #f4f4f2;
  --bg-soft: #fbfbfa;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-muted: #f6f6f4;
  --text: #171717;
  --muted: #6c6c6c;
  --border: #e5e5e5;
  --border-strong: #d3d3d3;
  --accent: #111111;
  --accent-soft: #f2f2f2;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.04);
}

body[data-theme="dark"] {
  --bg: #0f1011;
  --bg-soft: #141516;
  --panel: #171819;
  --panel-strong: #1d1e20;
  --panel-muted: #121314;
  --text: #f2f2f1;
  --muted: #a0a0a0;
  --border: #2a2b2d;
  --border-strong: #3a3b3d;
  --accent: #f5f5f4;
  --accent-soft: #222325;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Open Sans", "Helvetica Neue", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(245, 223, 189, 0.58), transparent 26%),
    radial-gradient(circle at 88% 10%, rgba(236, 224, 205, 0.7), transparent 24%),
    linear-gradient(180deg, #faf7f1, #f5eee4 54%, #f8f2e8 100%);
  color: var(--text);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body[data-app-state="authenticated"] {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.4), transparent 28%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea,
details,
summary {
  color: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--accent);
  color: var(--panel-strong);
  padding: 0.78rem 1rem;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button.secondary {
  background: var(--panel-strong);
  color: var(--text);
  border-color: var(--border);
}

button.secondary:hover {
  background: var(--panel-muted);
}

button.small {
  padding: 0.58rem 0.82rem;
  border-radius: 12px;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

#empty-trash-button[data-loading="true"] {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#empty-trash-button[data-loading="true"]::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: button-spin 700ms linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

a {
  color: inherit;
}

.page-shell {
  width: min(1560px, calc(100vw - 1.5rem));
  margin: 0 auto;
  padding: 0.8rem 0 1.25rem;
}

body[data-app-state="authenticated"] .hero {
  display: none;
}

body[data-app-state="authenticated"] {
  overflow: hidden;
}

body[data-app-state="authenticated"] .page-shell {
  height: 100vh;
  height: 100dvh;
  padding-bottom: 0.8rem;
}

.hero {
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.45rem, 5vw, 4.75rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
  max-width: 8ch;
}

.section-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* Marketing */

.marketing-hero,
.guest-layout,
.marketing-footer {
  font-family: "Manrope", "Open Sans", "Segoe UI", sans-serif;
}

.marketing-hero {
  position: relative;
  display: grid;
  gap: clamp(2.2rem, 4vw, 3.5rem);
  padding: 0.3rem 0 0.4rem;
  overflow: hidden;
}

.marketing-halo {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(18px);
  opacity: 0.85;
}

.marketing-halo-left {
  top: 1rem;
  left: -5rem;
  width: 22rem;
  height: 22rem;
  background: radial-gradient(circle, rgba(244, 222, 189, 0.42), rgba(244, 222, 189, 0));
}

.marketing-halo-right {
  top: 2.5rem;
  right: -5rem;
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, rgba(238, 226, 204, 0.54), rgba(238, 226, 204, 0));
}

.marketing-nav-shell,
.marketing-nav-actions,
.marketing-hero-actions,
.marketing-meta-item,
.marketing-proof-item,
.marketing-showcase-topbar,
.marketing-showcase-pane-header,
.marketing-showcase-filters,
.marketing-save-meta,
.marketing-save-footer,
.marketing-reader-topbar,
.marketing-reader-controls,
.marketing-testimonial-author,
.marketing-footer-links {
  display: flex;
  align-items: center;
}

.marketing-nav-shell {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
}

.marketing-nav-actions {
  gap: 1rem;
}

button.marketing-nav-link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #61584e;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  box-shadow: none;
}

button.marketing-nav-link:hover {
  transform: none;
  color: #1d1812;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.72rem;
  min-height: 3.35rem;
  padding: 0.86rem 1.32rem;
  border: 1px solid #1e1a16;
  border-radius: 18px;
  background: #1e1a16;
  color: #fffdfa;
  font-family: "Manrope", "Open Sans", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  box-shadow: 0 18px 38px rgba(43, 31, 18, 0.12);
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.button-link:hover {
  transform: translateY(-1px);
  background: #14110f;
  border-color: #14110f;
  box-shadow: 0 22px 44px rgba(43, 31, 18, 0.15);
}

.button-link-secondary {
  background: rgba(255, 252, 247, 0.88);
  border-color: #d9d0c2;
  color: #433c34;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.button-link-secondary:hover {
  background: #fffdf8;
  border-color: #cfc4b4;
  color: #1f1b16;
  box-shadow: 0 16px 36px rgba(73, 53, 30, 0.08);
}

.marketing-nav-button {
  min-height: 3rem;
  padding-inline: 1.3rem;
}

.marketing-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(360px, 1.02fr) minmax(520px, 0.98fr);
  align-items: center;
  gap: clamp(2.4rem, 5vw, 4.8rem);
  padding-top: 1rem;
}

.marketing-copy-column {
  display: grid;
  gap: 1.6rem;
  align-content: center;
  max-width: 40rem;
}

.marketing-kicker-pill {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 2.2rem;
  padding: 0.35rem 0.85rem;
  margin: 0;
  border: 1px solid rgba(224, 212, 197, 0.9);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.82);
  color: #b08b5f;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: 0 12px 26px rgba(132, 98, 54, 0.05);
}

.marketing-headline-stack {
  display: grid;
  gap: 1.25rem;
}

.marketing-hero-title {
  margin: 0;
  display: grid;
  gap: 0.08em;
  color: #191410;
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: clamp(3.35rem, 6vw, 5.2rem);
  line-height: 0.91;
  letter-spacing: -0.065em;
  font-weight: 500;
}

.marketing-hero-title span {
  white-space: nowrap;
}

.marketing-hero-subcopy {
  max-width: 42ch;
  margin: 0;
  color: #62594e;
  font-size: clamp(1rem, 1.45vw, 1.14rem);
  line-height: 1.8;
  text-wrap: balance;
}

.marketing-hero-actions {
  gap: 0.78rem;
  flex-wrap: wrap;
}

.marketing-hero-button {
  min-width: 11rem;
}

.marketing-demo-button {
  justify-content: flex-start;
}

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 1px solid rgba(207, 197, 184, 0.95);
  background: rgba(255, 255, 255, 0.8);
}

.button-icon svg,
.marketing-meta-item svg,
.marketing-proof-item svg,
.marketing-preview-nav-item svg,
.marketing-feature-icon svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-icon svg {
  width: 0.9rem;
  height: 0.9rem;
}

.marketing-meta-row {
  display: flex;
  align-items: center;
  gap: 0.95rem 1.3rem;
  flex-wrap: wrap;
}

.marketing-meta-item {
  gap: 0.55rem;
  color: #7b7065;
  font-size: 0.9rem;
  font-weight: 500;
}

.marketing-meta-item svg {
  width: 0.92rem;
  height: 0.92rem;
  color: #b08e66;
}

.marketing-showcase {
  position: relative;
  min-width: 0;
}

.marketing-showcase-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(226, 215, 200, 0.9);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 254, 251, 0.9), rgba(251, 246, 239, 0.88)),
    rgba(255, 254, 250, 0.92);
  box-shadow:
    0 28px 72px rgba(109, 86, 53, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
}

.marketing-showcase-topbar {
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(232, 224, 212, 0.9);
  background: rgba(255, 254, 251, 0.7);
}

.marketing-showcase-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #2a241f;
  font-size: 0.84rem;
  font-weight: 700;
}

.marketing-showcase-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.4rem;
  background: #1d1a17;
  color: #fffdf9;
  font-size: 0.72rem;
  font-weight: 800;
}

.marketing-showcase-share,
.marketing-reader-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(225, 216, 203, 0.94);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.82);
  color: #7e7265;
  font-size: 0.77rem;
  font-weight: 700;
}

.marketing-showcase-body {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) minmax(255px, 0.92fr);
  min-height: 31rem;
}

.marketing-showcase-sidebar,
.marketing-showcase-library,
.marketing-showcase-reader {
  min-width: 0;
}

.marketing-showcase-sidebar {
  display: grid;
  align-content: start;
  gap: 1.25rem;
  padding: 1rem 0.8rem;
  border-right: 1px solid rgba(234, 226, 215, 0.92);
  background: rgba(252, 249, 243, 0.96);
}

.marketing-preview-nav-group,
.marketing-preview-sidebar-section,
.marketing-showcase-list,
.marketing-reader-body,
.marketing-cta-copy,
.marketing-testimonial-card,
.marketing-feature-card {
  display: grid;
}

.marketing-preview-nav-group {
  gap: 0.4rem;
}

.marketing-preview-nav-item {
  display: grid;
  grid-template-columns: 0.9rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0 0.5rem;
  border-radius: 11px;
  color: #7d7268;
  font-size: 0.76rem;
  font-weight: 600;
}

.marketing-preview-nav-item.active {
  background: #efe7da;
  color: #2c2520;
}

.marketing-preview-sidebar-section {
  gap: 0.5rem;
  color: #8f857a;
  font-size: 0.74rem;
}

.marketing-preview-sidebar-label {
  margin: 0 0 0.15rem;
  color: #aa9f92;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.marketing-showcase-library {
  border-right: 1px solid rgba(234, 226, 215, 0.92);
  background: rgba(255, 253, 249, 0.92);
}

.marketing-showcase-pane-header {
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1rem 0.85rem;
}

.marketing-showcase-pane-header strong {
  color: #211b16;
  letter-spacing: -0.03em;
}

.marketing-showcase-search {
  min-width: 7rem;
  padding: 0.55rem 0.82rem;
  border-radius: 999px;
  background: #f5f0e8;
  color: #8a7e70;
  font-size: 0.77rem;
  text-align: center;
}

.marketing-showcase-filters {
  gap: 0.45rem;
  padding: 0 1rem 0.35rem;
  flex-wrap: wrap;
}

.marketing-showcase-filter,
.marketing-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.marketing-showcase-filter {
  background: #f2eee7;
  color: #766b61;
}

.marketing-showcase-filter.active {
  background: #22201d;
  color: #fffdf9;
}

.marketing-showcase-filter-select {
  margin-left: auto;
}

.marketing-showcase-list {
  gap: 0.65rem;
  padding: 0.45rem 0.9rem 0.9rem;
}

.marketing-save-card {
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid rgba(231, 224, 214, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.marketing-save-card.active {
  border-color: #dfd3c4;
  box-shadow: 0 8px 18px rgba(85, 61, 32, 0.035);
}

.marketing-save-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: #fffdf9;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.marketing-save-avatar-green {
  background: linear-gradient(145deg, #22c06f, #0a9d58);
}

.marketing-save-avatar-violet {
  background: linear-gradient(145deg, #bfa6ff, #8f74df);
}

.marketing-save-avatar-blush {
  background: linear-gradient(145deg, #f2d9f1, #debed9);
  color: #6a4365;
}

.marketing-save-copy {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.marketing-save-meta {
  gap: 0.35rem;
  color: #8b8074;
  font-size: 0.7rem;
  font-weight: 500;
  flex-wrap: wrap;
}

.marketing-save-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #d6c7af;
}

.marketing-save-card h3,
.marketing-showcase-reader h3 {
  margin: 0;
  color: #1e1914;
  letter-spacing: -0.03em;
}

.marketing-save-card h3 {
  font-size: 0.98rem;
  line-height: 1.32;
}

.marketing-save-footer {
  gap: 0.55rem;
  color: #8b8074;
  font-size: 0.72rem;
  font-weight: 500;
}

.marketing-tag {
  min-height: 1.55rem;
  padding-inline: 0.58rem;
}

.marketing-tag-gold {
  background: #f2e4c6;
  color: #8f6330;
}

.marketing-tag-blue {
  background: #e2e9ff;
  color: #4d67a4;
}

.marketing-tag-rose {
  background: #f4dbe9;
  color: #8b4f75;
}

.marketing-showcase-reader {
  display: grid;
  align-content: start;
  background: linear-gradient(180deg, rgba(250, 247, 241, 0.96), rgba(247, 242, 234, 0.92));
}

.marketing-reader-topbar {
  justify-content: flex-end;
  padding: 0.95rem 1rem 0.8rem;
}

.marketing-reader-body {
  gap: 0.8rem;
  padding: 0 1rem 1rem;
}

.marketing-showcase-reader h3 {
  font-size: 1.68rem;
  line-height: 1.02;
  font-weight: 800;
}

.marketing-tag-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.marketing-reader-hero {
  position: relative;
  overflow: hidden;
  min-height: 9rem;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #f4ead9, #ecd8b8 72%, #ddc19f);
}

.marketing-reader-hero::before,
.marketing-reader-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
}

.marketing-reader-hero::before {
  left: 34%;
  right: -14%;
  height: 72%;
  background: linear-gradient(180deg, #ccb08c, #b9976e);
  border-radius: 55% 45% 0 0 / 100% 100% 0 0;
}

.marketing-reader-hero::after {
  left: -10%;
  right: 38%;
  height: 52%;
  background: linear-gradient(180deg, #ead6b8, #d8b890);
  border-radius: 62% 38% 0 0 / 100% 100% 0 0;
}

.marketing-reader-copy {
  display: grid;
  gap: 0.8rem;
  color: #4a4035;
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.7;
}

.marketing-reader-copy p {
  margin: 0;
}

.marketing-reader-controls {
  justify-content: space-between;
  gap: 0.55rem;
  padding-top: 0.15rem;
  color: #8b8073;
  font-size: 0.76rem;
  font-weight: 700;
}

.marketing-reader-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  min-width: 2.1rem;
  color: inherit;
}

.marketing-reader-control svg {
  width: 0.92rem;
  height: 0.92rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.marketing-reader-control-type {
  font-size: 0.9rem;
  letter-spacing: -0.04em;
}

.marketing-proof-ribbon {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0.8rem;
}

.marketing-proof-label {
  margin: 0;
  color: #8a7a67;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.marketing-proof-items {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem 1.4rem;
  flex-wrap: wrap;
}

.marketing-proof-item {
  gap: 0.45rem;
  color: #847667;
  font-size: 0.86rem;
}

.marketing-proof-item svg {
  width: 0.92rem;
  height: 0.92rem;
  color: #b08e66;
}

.guest-layout {
  display: grid;
  gap: 4.8rem;
  padding-top: 0.9rem;
}

.marketing-section {
  display: grid;
  gap: 1.6rem;
}

.marketing-section-split,
.marketing-testimonial-layout {
  display: grid;
  gap: 1.8rem;
}

.marketing-section-split {
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.75fr);
  align-items: end;
}

.marketing-section-intro {
  display: grid;
  gap: 0.55rem;
  max-width: 40rem;
}

#how-it-works .marketing-section-intro {
  max-width: 58rem;
}

#how-it-works .marketing-section-intro h2 {
  font-size: clamp(2.5rem, 3.9vw, 3.45rem);
}

.marketing-section-intro h2,
.marketing-cta-panel h2 {
  margin: 0;
  color: #1a1510;
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: clamp(2.9rem, 4.7vw, 4.1rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  font-weight: 500;
}

.marketing-section-aside,
.marketing-cta-panel .section-copy,
.marketing-feature-card p,
.marketing-process-step p,
.marketing-testimonial-card p {
  margin: 0;
  color: #655b50;
  font-size: 0.98rem;
  line-height: 1.72;
}

.marketing-section-aside {
  max-width: 30rem;
  justify-self: end;
}

.marketing-card-grid,
.marketing-feature-grid,
.marketing-testimonial-grid {
  display: grid;
  gap: 1rem;
}

.marketing-feature-grid,
.marketing-testimonial-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.marketing-feature-card,
.marketing-testimonial-card {
  gap: 0.95rem;
  padding: 1.35rem;
  border-color: rgba(231, 222, 210, 0.92);
  background: rgba(255, 254, 251, 0.94);
  box-shadow: 0 12px 28px rgba(86, 60, 27, 0.03);
}

.marketing-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 999px;
  background: #f4ede3;
  color: #4b433a;
}

.marketing-feature-card h3,
.marketing-process-step h3 {
  margin: 0;
  color: #1d1813;
  font-size: 1.5rem;
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 500;
}

.marketing-process {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding-top: 0.7rem;
}

.marketing-process::before {
  content: "";
  position: absolute;
  top: 1rem;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(224, 213, 198, 0.2), rgba(214, 199, 181, 0.95), rgba(224, 213, 198, 0.2));
}

.marketing-process-step {
  position: relative;
  gap: 0.75rem;
  padding-top: 2rem;
}

.marketing-process-badge {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #1d1a17;
  color: #fffdf9;
  font-size: 0.8rem;
  font-weight: 800;
}

.marketing-testimonial-layout {
  grid-template-columns: 430px minmax(0, 1fr);
  align-items: start;
}

.marketing-testimonial-layout > .marketing-section-intro {
  max-width: 27rem;
}

.marketing-testimonial-layout > .marketing-section-intro h2 {
  font-size: clamp(2.45rem, 3.3vw, 3.05rem);
  max-width: 13ch;
}

.marketing-testimonial-card {
  padding-top: 1.15rem;
}

.marketing-testimonial-card p {
  font-size: 0.94rem;
  line-height: 1.62;
}

.marketing-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.marketing-rating span {
  width: 0.8rem;
  height: 0.8rem;
  background: linear-gradient(180deg, #a47629, #7f5a21);
  clip-path: polygon(50% 0, 61% 36%, 98% 36%, 68% 57%, 79% 92%, 50% 71%, 21% 92%, 32% 57%, 2% 36%, 39% 36%);
}

.marketing-testimonial-author {
  gap: 0.6rem;
  color: #7e7367;
  font-size: 0.86rem;
  font-weight: 600;
}

.marketing-author-avatar {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  display: inline-flex;
  background:
    radial-gradient(circle at 50% 34%, #f9e7d0 0 18%, transparent 19%),
    radial-gradient(circle at 50% 78%, #c79a63 0 31%, transparent 32%),
    linear-gradient(180deg, #6f4a2d, #cfa877 62%, #d8b68f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.marketing-author-avatar-amber {
  background:
    radial-gradient(circle at 50% 34%, #fae9d2 0 18%, transparent 19%),
    radial-gradient(circle at 50% 78%, #c48b48 0 31%, transparent 32%),
    linear-gradient(180deg, #6c4526, #d5a55f 62%, #e2c18b);
}

.marketing-author-avatar-blue {
  background:
    radial-gradient(circle at 50% 34%, #fae8d5 0 18%, transparent 19%),
    radial-gradient(circle at 50% 78%, #a78f72 0 31%, transparent 32%),
    linear-gradient(180deg, #4e5667, #93a7cb 62%, #d4deef);
}

.marketing-author-avatar-olive {
  background:
    radial-gradient(circle at 50% 34%, #f6e4d0 0 18%, transparent 19%),
    radial-gradient(circle at 50% 78%, #8e8358 0 31%, transparent 32%),
    linear-gradient(180deg, #535232, #94a167 62%, #d6dcc1);
}

.marketing-cta-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 1.65rem;
  padding: 2.75rem 2.9rem 2.45rem;
  overflow: hidden;
  border-radius: 32px;
  border-color: rgba(231, 222, 210, 0.9);
  background:
    radial-gradient(circle at 14% 24%, rgba(246, 229, 198, 0.62), rgba(246, 229, 198, 0) 34%),
    radial-gradient(circle at 88% 26%, rgba(243, 231, 210, 0.48), rgba(243, 231, 210, 0) 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(255, 253, 249, 0.94), rgba(247, 240, 229, 0.96));
  box-shadow:
    0 20px 44px rgba(90, 66, 32, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.marketing-cta-panel::before,
.marketing-cta-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.marketing-cta-panel::before {
  inset: auto 1.45rem 1rem 1.45rem;
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(219, 197, 163, 0), rgba(219, 197, 163, 0.42) 18%, rgba(219, 197, 163, 0.42) 82%, rgba(219, 197, 163, 0));
  opacity: 0.55;
}

.marketing-cta-panel::after {
  right: 8.25rem;
  bottom: 0.7rem;
  width: 14rem;
  height: 1.1rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(153, 125, 87, 0.18), rgba(153, 125, 87, 0));
}

.marketing-cta-copy {
  justify-self: center;
  gap: 0.95rem;
  max-width: 41rem;
  text-align: center;
}

.marketing-cta-copy .eyebrow {
  justify-self: center;
}

.marketing-cta-panel h2 {
  font-size: clamp(2.85rem, 4vw, 3.7rem);
  text-wrap: balance;
}

.marketing-cta-panel .section-copy {
  max-width: 32rem;
  margin-inline: auto;
  font-size: 1rem;
}

.marketing-cta-actions {
  justify-content: center;
  gap: 0.7rem;
  padding-top: 0.2rem;
}

.marketing-cta-art {
  position: relative;
  justify-self: end;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  width: min(100%, 23rem);
  min-height: 0;
}

.marketing-cta-art::before {
  content: none;
}

.marketing-cta-image {
  display: block;
  width: 100%;
  height: auto;
}

.auth-turnstile-slot {
  display: flex;
  justify-content: center;
  min-height: 66px;
}

.auth-page-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  gap: 1.1rem;
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 2.5rem);
}

body[data-auth-page] {
  background:
    radial-gradient(circle at 12% 10%, rgba(245, 223, 189, 0.52), transparent 24%),
    radial-gradient(circle at 85% 0%, rgba(236, 224, 205, 0.52), transparent 22%),
    linear-gradient(180deg, #faf7f1 0%, #f5eee4 54%, #f8f2e8 100%);
  color: #1f1812;
}

.auth-page-panel {
  width: min(100%, 28.6rem);
  padding: clamp(2rem, 4vw, 2.7rem) clamp(1.6rem, 4vw, 2.45rem) 1.55rem;
  border: 1px solid rgba(222, 212, 195, 0.9);
  border-radius: 1.9rem;
  background: linear-gradient(180deg, rgba(255, 254, 251, 0.98), rgba(255, 251, 244, 0.96));
  box-shadow:
    0 24px 70px rgba(96, 72, 44, 0.12),
    0 2px 0 rgba(255, 255, 255, 0.75) inset;
  display: grid;
  gap: 1.35rem;
}

.not-found-panel {
  gap: 1.15rem;
}

.not-found-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  justify-self: center;
  text-decoration: none;
  color: inherit;
}

.not-found-brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.95rem;
  background: #1f1e1c;
  color: #fffdf9;
  font-weight: 800;
  font-size: 1.28rem;
  letter-spacing: -0.04em;
}

.not-found-brand-copy {
  display: grid;
  gap: 0.1rem;
}

.not-found-brand-name {
  color: #1f1812;
  font-size: 1.28rem;
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 1;
}

.not-found-brand-tagline {
  color: #8a7d6e;
  font-size: 0.8rem;
  letter-spacing: -0.01em;
}

.auth-page-badge {
  display: flex;
  justify-content: center;
}

.auth-page-badge-frame {
  width: 4rem;
  height: 4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.15rem;
  border: 1px solid #e7dccd;
  background: linear-gradient(180deg, #fffdfa, #f7efe3);
  box-shadow: 0 10px 24px rgba(122, 92, 58, 0.12);
}

.auth-page-badge-mark {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #2a2825, #171614);
  color: #fffaf2;
  box-shadow: 0 10px 18px rgba(23, 20, 16, 0.2);
}

.auth-page-badge-mark svg {
  width: 1.18rem;
  height: 1.18rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-page-header {
  display: grid;
  gap: 0.55rem;
  text-align: center;
}

.auth-page-pane h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.auth-page-header h1 {
  margin: 0;
  color: #1f1812;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2.35rem, 5.4vw, 3.3rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.auth-page-copy {
  margin: 0;
  color: #7c7063;
  font-size: 1rem;
  line-height: 1.55;
}

.auth-page-eyebrow {
  justify-self: center;
  margin-bottom: 0.1rem;
}

.auth-page-form {
  gap: 1rem;
}

.auth-page-field {
  gap: 0.5rem;
}

.auth-page-field > span,
.auth-page-label-row > span {
  color: #4f3f31;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
}

.auth-page-label-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}

.auth-page-help-copy {
  color: #9c8468;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth-page-form input {
  min-height: 3.2rem;
  padding-inline: 1.05rem;
  border-radius: 999px;
  border: 1px solid #ddd4c5;
  background: rgba(255, 255, 255, 0.94);
  color: #2d241c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.auth-page-form input::placeholder {
  color: #b3a693;
}

.auth-page-form input:focus {
  outline: none;
  border-color: #bdaa94;
  box-shadow: 0 0 0 4px rgba(214, 203, 184, 0.28);
}

.auth-page-form .auth-turnstile-slot {
  margin-top: 0.15rem;
}

.auth-submit {
  min-height: 3.2rem;
  border: 1px solid #1f1e1c;
  border-radius: 999px;
  background: #1f1e1c;
  color: #fffdf9;
  font-weight: 720;
  letter-spacing: -0.015em;
  box-shadow: 0 14px 28px rgba(31, 24, 15, 0.12);
}

.auth-submit:hover {
  background: #171614;
}

.auth-submit[data-pending="true"] {
  opacity: 0.82;
}

.auth-page-form > .auth-submit,
.auth-page-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
}

.auth-page-secondary-link {
  min-height: 3.2rem;
  padding-inline: 1rem;
  border: 1px solid #ddd4c5;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #3f3227;
  font-weight: 640;
  letter-spacing: -0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.auth-page-secondary-link:hover {
  background: #fffdf9;
}

.not-found-actions {
  margin-top: 0.15rem;
}

.not-found-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.95rem 1.1rem;
  flex-wrap: wrap;
  padding-top: 0.1rem;
  color: #8a7d6e;
  font-size: 0.92rem;
}

.not-found-links a {
  color: inherit;
  text-decoration: none;
}

.not-found-links a:hover {
  color: #1f1812;
}

.auth-page-switch {
  margin: 0;
  color: #7c7063;
  font-size: 1rem;
  text-align: center;
}

.auth-page-switch a {
  color: #1f1812;
  text-decoration: none;
  font-weight: 700;
}

.auth-page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  color: #8c7d6e;
  font-size: 0.88rem;
}

.auth-page-footer a {
  color: inherit;
  text-decoration: none;
}

.auth-page-footer a:hover {
  color: #1f1812;
}

@media (max-width: 640px) {
  .auth-page-panel {
    width: min(100%, 100%);
    padding-inline: 1.25rem;
    border-radius: 1.6rem;
  }

  .not-found-brand {
    gap: 0.75rem;
  }

  .not-found-brand-name {
    font-size: 1.16rem;
  }

  .auth-page-header h1 {
    font-size: clamp(2.15rem, 9vw, 2.9rem);
  }

  .auth-page-field > span,
  .auth-page-label-row > span {
    font-size: 0.95rem;
  }
}

/* Modal: Capture */

body[data-capture-modal="open"] {
  overflow: hidden;
}

.capture-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.capture-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 15, 0.36);
  backdrop-filter: blur(10px);
}

.capture-modal-dialog {
  position: relative;
  width: min(34rem, calc(100vw - 1.5rem));
  padding: 1.2rem;
  border: 1px solid #e7dfd2;
  border-radius: 26px;
  background: #fffdf9;
  box-shadow: 0 24px 64px rgba(23, 18, 10, 0.14);
  display: grid;
  gap: 1rem;
}

.capture-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  min-width: 2.4rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #e4dccc;
  background: #fffdfa;
  color: #4a463f;
  box-shadow: none;
}

.capture-modal-header {
  padding: 0.1rem 0.1rem 0.25rem;
}

.capture-modal-header h2 {
  margin: 0.18rem 0 0;
  font-size: 1.45rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.capture-modal-header .section-copy {
  max-width: 34ch;
}

.capture-form {
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid #ece5d8;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffefa, #f9f5ee);
}

.capture-form .field input {
  min-height: 3.15rem;
  background: rgba(255, 255, 255, 0.94);
}

.capture-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Marketing Footer */

.marketing-footer {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0 0 0.5rem;
}

.marketing-footer-column {
  display: grid;
  gap: 0.7rem;
}

.marketing-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.marketing-footer-column-meta {
  justify-items: end;
}

.marketing-footer-copy {
  margin: 0;
  color: #8d877d;
  font-size: 0.82rem;
  justify-self: start;
  text-align: left;
}

.marketing-footer-column-meta .marketing-footer-copy {
  justify-self: end;
  text-align: right;
}

.marketing-footer-links {
  justify-content: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.marketing-footer-links a {
  color: #8d877d;
  font-size: 0.82rem;
  text-decoration: none;
}

.marketing-footer-links a:hover {
  color: #1e1813;
}

.panel,
.library-nav,
.library-list-panel,
.reader-shell,
.account-card,
.save-card,
.feed-card,
.highlight-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 1.1rem 1.2rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field.compact {
  gap: 0.35rem;
}

.field span,
.eyebrow,
.control-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea,
.search-shell input {
  width: 100%;
  padding: 0.86rem 0.96rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
}

.field textarea {
  resize: vertical;
}

.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.grow {
  flex: 1;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: start;
}

.section-heading.compact {
  align-items: center;
}

.section-heading h2,
.section-heading h3,
.library-heading h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

/* App Shell */

.sidebar-label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 0.85rem;
  min-height: calc(100vh - 4rem);
}

body[data-app-state="authenticated"] .app-shell {
  min-height: 100%;
  height: 100%;
}

.app-shell[data-mode="library"] .reader-shell,
.app-shell[data-mode="library"] .tools-stage {
  display: none;
}

.app-shell[data-mode="tools"] .library-stage,
.app-shell[data-mode="tools"] .reader-shell {
  display: none;
}

.app-shell[data-mode="reader"] {
  min-height: calc(100vh - 4rem);
  min-height: calc(100dvh - 4rem);
}

.app-shell[data-mode="reader"] .library-stage,
.app-shell[data-mode="reader"] .tools-stage {
  display: none;
}

.library-nav {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  align-content: start;
  min-height: calc(100vh - 4rem);
  position: sticky;
  top: 0.75rem;
  box-shadow: none;
}

body[data-app-state="authenticated"] .library-nav {
  min-height: 100%;
}

.nav-header,
.brand-lockup,
.account-identity,
.reader-topbar,
.reader-topbar-left,
.reader-actions,
.list-panel-header,
.library-toolbar,
.save-card-footer,
.save-card-actions,
.save-card-side,
.save-card-domain,
.reader-meta-line {
  display: flex;
  align-items: center;
}

.nav-header,
.list-panel-header,
.reader-topbar,
.library-topbar {
  justify-content: space-between;
}

.brand-lockup {
  gap: 0.75rem;
  min-width: 0;
  font-weight: 720;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 14px;
  background: var(--accent);
  color: var(--panel-strong);
  font-size: 0.95rem;
}

.brand-name {
  font-size: 1.1rem;
  line-height: 0.96;
}

.library-nav-links,
.nav-tag-list,
.filter-pill-row,
.save-list,
.feed-list,
.highlight-list {
  display: grid;
  gap: 0.65rem;
}

.nav-link,
.nav-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.74rem 0.88rem;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  box-shadow: none;
  text-align: left;
}

.nav-link:hover,
.nav-tag:hover {
  background: var(--accent-soft);
}

.nav-link.active,
.nav-tag.active {
  background: var(--accent-soft);
  border-color: var(--border);
}

.nav-link.active {
  font-weight: 800;
}

.nav-tag {
  border-radius: 16px;
  flex: 1;
}

.nav-tag-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-tag-row.active {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.nav-tag-row.active .nav-tag {
  background: transparent;
  border-color: transparent;
}

.nav-tag-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.nav-tag-delete span {
  display: block;
  line-height: 1;
  font-size: 1.15rem;
  font-weight: 500;
}

.nav-tag-delete:hover {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
}

.nav-tag-row.active .nav-tag-delete:hover {
  background: rgba(255, 255, 255, 0.72);
}

.nav-tag-name {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-tag-name::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--tag-dot, var(--muted));
}

.nav-tag-count {
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-section {
  display: grid;
  gap: 0.75rem;
}

.tool-stack {
  display: grid;
  gap: 0.85rem;
}

.user-inbox-card {
  display: grid;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-muted);
  padding: 0.9rem;
}

.user-inbox-card code,
#email-inbox {
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.account-card {
  margin-top: auto;
  padding: 0.95rem;
  display: grid;
  gap: 0.7rem;
}

.profile-sheet {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  overflow: hidden;
}

.profile-row {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.05rem;
}

.profile-row + .profile-row {
  border-top: 1px solid var(--border);
}

.profile-row strong,
.profile-row p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.profile-row p {
  color: var(--muted);
}

.profile-logout-button {
  width: 100%;
  min-height: 3.25rem;
  justify-content: center;
  border-radius: 0;
  border-width: 1px 0 0;
  background: transparent;
  box-shadow: none;
}

.profile-logout-button:hover {
  transform: none;
}

.library-stage {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.7rem;
  align-content: start;
  min-height: calc(100vh - 1.6rem);
  min-height: calc(100dvh - 1.6rem);
}

.library-topbar,
.tools-topbar,
.library-list-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.library-topbar,
.tools-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding: 1.1rem 1.2rem;
}

.library-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

.library-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.7rem;
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Tools */

.tools-stage {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tools-card {
  display: grid;
  gap: 1.1rem;
  padding: 1.25rem 1.3rem;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 245, 240, 0.86));
  box-shadow: none;
}

.tools-card-compact {
  grid-column: span 2;
}

.tools-card-feature {
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  align-items: end;
  background:
    radial-gradient(circle at top right, rgba(244, 242, 235, 0.95), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 242, 235, 0.92));
}

.tools-card-header {
  display: grid;
  gap: 0.55rem;
}

.tools-card-header h3 {
  margin: 0.12rem 0 0;
  font-size: 1.25rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.tools-card-copy {
  margin: 0;
  max-width: 34ch;
  color: #6f6a62;
  font-size: 0.95rem;
  line-height: 1.58;
}

.tools-heading {
  display: grid;
  gap: 0.45rem;
}

.tools-heading h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.055em;
}

.tools-heading .section-copy {
  max-width: 42ch;
  color: #726d64;
}

.tools-feature-body {
  display: grid;
  gap: 0.85rem;
}

.tools-card .user-inbox-card {
  background: rgba(255, 255, 255, 0.72);
}

.tools-inbox-card {
  padding: 1rem;
  border-radius: 20px;
}

.tools-feature-note {
  display: flex;
  align-items: start;
  gap: 0.7rem;
  padding: 0 0.1rem;
  color: #79746b;
  font-size: 0.92rem;
  line-height: 1.55;
}

.tools-feature-note p {
  margin: 0;
}

.tools-feature-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #1d1c1a;
  flex: 0 0 auto;
  margin-top: 0.42rem;
}

.tools-action-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Library */

.library-heading {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  grid-column: 2;
  justify-self: center;
}

.library-heading h2 {
  font-size: 1.48rem;
  font-weight: 680;
}

.search-shell {
  width: min(20rem, 100%);
  grid-column: 3;
  justify-self: end;
}

.search-shell input {
  padding-left: 1rem;
  background: var(--panel-muted);
}

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0 0.2rem;
}

.filter-pill-row {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.48rem 0.82rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.88rem;
  box-shadow: none;
}

.sort-label {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.sort-shell {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
}

.sort-shell select {
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 0.46rem 1.95rem 0.46rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 600;
}

.library-list-panel {
  min-height: 0;
  height: 100%;
  padding: 0.8rem;
  overflow: auto;
  overscroll-behavior: contain;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 600;
}

.save-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  padding: 0.78rem 0.82rem;
  cursor: pointer;
  box-shadow: none;
  border-radius: 18px;
}

.save-card:hover {
  border-color: var(--border-strong);
}

.save-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(36, 33, 29, 0.08);
}

.save-card:focus-visible,
.nav-link:focus-visible,
.nav-tag:focus-visible,
.nav-tag-delete:focus-visible,
.card-action:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 65%, white);
  outline-offset: 2px;
}

.save-card-copy {
  min-width: 0;
}

.save-card-domain,
.reader-meta-line {
  gap: 0.38rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.25rem;
  background: var(--site-dot, var(--muted));
  flex: 0 0 auto;
}

.save-card h3 {
  margin: 0.22rem 0 0.34rem;
  font-size: 1.2rem;
  font-weight: 670;
  line-height: 1.24;
  letter-spacing: -0.025em;
  max-width: none;
}

.save-excerpt {
  margin: 0 0 0.48rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.save-card-footer {
  justify-content: space-between;
  gap: 0.45rem;
  align-items: center;
}

.save-card-meta {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.save-meta-inline,
.feed-meta,
.save-date {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.2;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: var(--tag-tint, var(--panel-muted));
  color: var(--tag-ink, var(--text));
  border: 1px solid var(--border);
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 650;
}

.tag-pill:hover {
  transform: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.52rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel-muted);
}

.status-pill.processing {
  background: #f3f3f0;
  border-color: var(--border);
  color: var(--muted);
}

.status-pill.failed {
  background: #f0f0ed;
  border-color: var(--border);
  color: var(--muted);
}

.save-card-side {
  flex-direction: column;
  gap: 0.55rem;
  align-items: flex-end;
}

.save-thumb {
  width: 4.25rem;
  height: 4.25rem;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(145deg, var(--thumb-tint), var(--thumb-strong));
  color: var(--thumb-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.save-thumb-fallback {
  transition: opacity 140ms ease;
}

.save-thumb[data-has-icon="true"] .save-thumb-fallback {
  opacity: 0;
}

.save-thumb[data-has-icon="true"] {
  background: var(--panel);
}

.save-thumb-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: cover;
}

.save-card-actions {
  gap: 0.35rem;
}

.card-action {
  width: 1.95rem;
  height: 1.95rem;
  padding: 0;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  box-shadow: none;
  color: #767676;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-action:hover {
  background: var(--panel-muted);
}

.card-action svg {
  width: 0.82rem;
  height: 0.82rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Reader */

.reader-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 1.6rem);
  height: calc(100dvh - 1.6rem);
  padding: 0;
  overflow: hidden;
  background: var(--panel-strong);
  border-radius: 22px;
}

.reader-topbar {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--panel);
  z-index: 2;
  box-shadow: none;
}

.reader-topbar-left,
.reader-actions {
  gap: 0.45rem;
}

.reader-scroll {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem 1rem 1rem;
  overflow: auto;
  overscroll-behavior: contain;
}

.reader-topbar .secondary.small {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.46rem 0.72rem;
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
}

.reader-topbar .secondary.small svg {
  width: 0.92rem;
  height: 0.92rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reader-topbar .secondary.small span {
  line-height: 1;
}

.reader-topbar .secondary.small:hover {
  background: var(--panel-muted);
}

#reader-back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.28rem 0.14rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #6f6a62;
  box-shadow: none;
  font-size: 0.84rem;
  font-weight: 650;
}

#reader-back-button:hover {
  transform: none;
  background: transparent;
  color: var(--text);
}

#reader-back-button svg {
  width: 0.92rem;
  height: 0.92rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reader-article-shell,
.reader-notes-shell {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.75rem 1.9rem;
  box-shadow: none;
}

.reader-article-shell {
  max-width: none;
  width: 100%;
  margin: 0;
}

.reader-notes-shell {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.reader-meta-row {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.reader-meta-line.subdued {
  color: var(--muted);
}

.dot-separator {
  color: var(--muted);
}

.reader-article-shell h1 {
  margin: 0;
  font-size: clamp(2.1rem, 3.5vw, 3.45rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
  font-weight: 680;
}

.reader-subtitle {
  margin: 0.9rem 0 0;
  max-width: 48rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.52;
}

.reader-hero-image {
  width: 100%;
  display: block;
  margin: 1.45rem 0 0;
  border-radius: 22px;
  background: #eef1f6;
}

.selection-composer {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px dashed var(--border-strong);
  background: var(--panel-muted);
}

.selection-composer p {
  margin-top: 0;
}

.reader-content {
  min-height: 22rem;
  font-family: var(--reader-font);
  font-size: calc(var(--reader-size) - 0.5px);
  line-height: 1.88;
  color: var(--text);
  max-width: none;
}

.reader-content.empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.reader-content p,
.reader-content li,
.reader-content blockquote,
.reader-content h1,
.reader-content h2,
.reader-content h3,
.reader-content h4 {
  max-width: none;
}

.reader-content h1,
.reader-content h2,
.reader-content h3,
.reader-content h4 {
  font-family: "Open Sans", "Helvetica Neue", "Segoe UI", sans-serif;
  letter-spacing: -0.025em;
  line-height: 1.16;
  margin-top: 1.9rem;
  margin-bottom: 0.68rem;
  font-weight: 650;
}

.reader-content h2 {
  font-size: 1.6rem;
}

.reader-content h3 {
  font-size: 1.2rem;
}

.reader-content p + p {
  margin-top: 1.35rem;
}

.reader-content a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--muted) 55%, white);
}

.reader-content mark {
  background: var(--highlight-yellow);
}

.reader-content img,
.reader-content figure {
  max-width: 100%;
  border-radius: 20px;
}

.reader-notes-shell h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.reader-notes-shell {
  padding: 0;
  overflow: hidden;
}

.reader-notes-shell summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reader-notes-shell summary span {
  display: grid;
  gap: 0.18rem;
}

.reader-notes-shell summary .eyebrow {
  margin: 0;
}

.reader-notes-shell summary::-webkit-details-marker {
  display: none;
}

.reader-notes-shell summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1.2rem;
}

.reader-notes-shell[open] summary::after {
  content: "-";
}

.reader-notes-shell .highlight-list {
  padding: 0 1.25rem 1.25rem;
}

.highlight-card {
  padding: 1rem 1.1rem;
  box-shadow: none;
  border-left: 4px solid var(--highlight-yellow);
}

.highlight-card[data-color="pink"] {
  border-left-color: var(--highlight-pink);
}

.highlight-card[data-color="blue"] {
  border-left-color: var(--highlight-blue);
}

.highlight-card[data-color="green"] {
  border-left-color: var(--highlight-green);
}

.highlight-quote {
  display: block;
  line-height: 1.55;
}

.feed-card {
  padding: 0.95rem;
  box-shadow: none;
  border-radius: 18px;
  background:
    linear-gradient(180deg, var(--panel-strong), var(--feed-tint, var(--panel-muted)));
}

.feed-card h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.38;
}

.inline-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: 24rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(27, 25, 22, 0.94);
  color: white;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
}

.empty-state {
  padding: 1.2rem;
  border-radius: 20px;
  border: 1px dashed var(--border-strong);
  background: var(--panel-muted);
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.empty-state p {
  margin: 0;
  line-height: 1.6;
}

.empty-state.compact {
  padding: 0.95rem 1rem;
}

.empty-state.large {
  width: 100%;
  max-width: 38rem;
  text-align: center;
}

.hidden {
  display: none !important;
}

.mobile-bottom-nav,
.mobile-reader-bar,
.mobile-reader-top-actions {
  display: none;
}

/* Responsive */

@media (max-width: 1180px) {
  .marketing-hero-grid {
    grid-template-columns: 1fr;
    gap: 2.6rem;
  }

  .marketing-copy-column {
    max-width: 38rem;
  }

  .marketing-showcase {
    max-width: 60rem;
  }

  .marketing-feature-grid,
  .marketing-testimonial-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketing-testimonial-layout {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .save-card h3 {
    font-size: 1.55rem;
  }
}

@media (max-width: 1040px) {
  .marketing-section-split,
  .app-shell,
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .marketing-feature-grid,
  .marketing-testimonial-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketing-section-aside {
    justify-self: start;
  }

  .marketing-showcase-body {
    grid-template-columns: 122px minmax(0, 1fr);
  }

  .marketing-showcase-reader {
    display: none;
  }

  .marketing-showcase-library {
    border-right: 0;
  }

  .marketing-process {
    grid-template-columns: 1fr;
    gap: 1.4rem;
    padding-top: 0;
  }

  .marketing-process::before {
    top: 0;
    bottom: 0;
    left: 1rem;
    right: auto;
    width: 1px;
    height: auto;
  }

  .marketing-process-step {
    padding-top: 0;
    padding-left: 3rem;
  }

  .marketing-process-badge {
    top: 0;
    left: 0;
  }

  .marketing-cta-panel {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .marketing-cta-art {
    width: min(100%, 20rem);
    justify-self: end;
  }

  .library-nav {
    min-height: auto;
    position: static;
  }

  .library-topbar,
  .tools-topbar,
  .reader-topbar,
  .list-panel-header,
  .library-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .tools-card-compact {
    grid-column: span 1;
  }

  .search-shell {
    width: 100%;
  }
}

/* Mobile */

@media (max-width: 760px) {
  .page-shell {
    width: 100vw;
    height: auto;
    min-height: 0;
    padding: 0 0 1rem;
  }

  body[data-app-state="authenticated"] {
    overflow: hidden;
  }

  body[data-app-state="authenticated"] .page-shell {
    height: 100vh;
    height: 100dvh;
    padding: 0;
  }

  .marketing-hero {
    gap: 1.8rem;
    padding-top: 0;
  }

  .marketing-nav-shell {
    padding: 0.55rem 1rem 0;
  }

  .marketing-nav-actions {
    gap: 0.5rem;
  }

  .marketing-nav-button {
    min-height: 2.7rem;
    padding-inline: 1rem;
  }

  .marketing-hero-grid {
    gap: 1.85rem;
    padding: 0 1rem;
  }

  .marketing-copy-column {
    gap: 1.35rem;
    max-width: none;
  }

  .marketing-headline-stack {
    gap: 1.05rem;
    width: 100%;
  }

  .marketing-kicker-pill {
    min-height: 2rem;
    font-size: 0.78rem;
  }

  .marketing-hero-title {
    display: block;
    width: 100%;
    max-width: none;
    font-size: clamp(1.74rem, 6.9vw, 2.08rem);
    line-height: 0.96;
    letter-spacing: -0.045em;
  }

  .marketing-hero-title span {
    display: block;
    width: 100%;
    white-space: nowrap;
  }

  .marketing-hero-subcopy {
    width: 100%;
    max-width: none;
    font-size: 0.95rem;
    line-height: 1.62;
    text-wrap: pretty;
  }

  .marketing-hero-actions {
    width: 100%;
    display: grid;
  }

  .marketing-hero-button {
    width: 100%;
    min-width: 0;
    min-height: 3rem;
    font-size: 0.96rem;
  }

  .marketing-demo-button {
    display: grid;
    grid-template-columns: 1.7rem 1fr 1.7rem;
    align-items: center;
  }

  .marketing-demo-button .button-icon {
    grid-column: 1;
    justify-self: start;
  }

  .marketing-demo-button span:last-child {
    grid-column: 2;
    justify-self: center;
  }

  .marketing-demo-button::after {
    content: "";
    width: 1.7rem;
    height: 1.7rem;
    grid-column: 3;
  }

  .marketing-meta-row {
    gap: 0.65rem 1rem;
  }

  .marketing-meta-item {
    font-size: 0.82rem;
  }

  .marketing-showcase-shell {
    border-radius: 24px;
  }

  .marketing-showcase-topbar {
    padding: 0.82rem 0.88rem;
  }

  .marketing-showcase-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .marketing-showcase-sidebar,
  .marketing-showcase-reader {
    display: none;
  }

  .marketing-showcase-pane-header {
    padding: 0.85rem 0.85rem 0.75rem;
  }

  .marketing-showcase-search {
    min-width: 0;
    padding: 0.44rem 0.68rem;
    font-size: 0.74rem;
  }

  .marketing-showcase-filters {
    gap: 0.42rem;
    padding: 0 0.85rem 0.2rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .marketing-showcase-filters::-webkit-scrollbar {
    display: none;
  }

  .marketing-showcase-filter {
    flex: 0 0 auto;
    padding: 0.34rem 0.58rem;
    font-size: 0.74rem;
  }

  .marketing-showcase-filter-select {
    margin-left: 0;
  }

  .marketing-showcase-list {
    gap: 0.55rem;
    padding: 0.3rem 0.75rem 0.75rem;
  }

  .marketing-save-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: 16px;
  }

  .marketing-save-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 0.84rem;
  }

  .marketing-save-meta {
    font-size: 0.68rem;
  }

  .marketing-save-card h3 {
    font-size: 0.88rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .marketing-save-footer,
  .marketing-tag {
    font-size: 0.68rem;
  }

  .marketing-showcase-list .marketing-save-card:nth-child(n + 3) {
    display: none;
  }

  .marketing-proof-ribbon {
    padding: 0 1rem;
    gap: 0.7rem;
  }

  .marketing-proof-label {
    font-size: 0.82rem;
    text-align: center;
  }

  .marketing-proof-items {
    gap: 0.65rem 1rem;
  }

  .guest-layout {
    gap: 3.4rem;
    padding-top: 0.45rem;
  }

  .marketing-feature-grid,
  .marketing-testimonial-grid {
    grid-template-columns: 1fr;
  }

  .marketing-section {
    gap: 1.1rem;
    padding: 1.25rem 1rem 0;
  }

  .marketing-section-intro {
    gap: 0.45rem;
    max-width: none;
  }

  .marketing-section-intro h2,
  .marketing-cta-panel h2 {
    font-size: clamp(1.8rem, 8vw, 2.3rem);
    line-height: 1.04;
  }

  .marketing-section-aside,
  .marketing-feature-card p,
  .marketing-process-step p,
  .marketing-testimonial-card p,
  .section-copy {
    font-size: 0.92rem;
    line-height: 1.58;
  }

  .marketing-feature-card,
  .marketing-testimonial-card {
    padding: 1.15rem;
  }

  .marketing-feature-card h3,
  .marketing-process-step h3 {
    font-size: 1.28rem;
  }

  .marketing-process-step {
    padding-left: 2.75rem;
  }

  .marketing-process-badge {
    width: 1.85rem;
    height: 1.85rem;
  }

  .marketing-cta-panel {
    margin: 0 1rem;
    padding: 1.55rem 1.2rem 1.35rem;
    border-radius: 26px;
    gap: 1.35rem;
  }

  .marketing-cta-art {
    width: min(100%, 15.5rem);
    justify-self: center;
  }

  .marketing-footer {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 1rem;
    padding: 0.1rem 1rem 0.8rem;
  }

  .marketing-footer-column-meta {
    justify-items: start;
  }

  .marketing-footer-column-meta .marketing-footer-copy {
    justify-self: start;
    text-align: left;
  }

  .marketing-footer-links {
    justify-content: flex-start;
    gap: 1rem;
  }

  .capture-modal-dialog {
    padding: 0.95rem;
  }

  .auth-submit {
    margin-top: 0.1rem;
  }

  body[data-app-state="authenticated"] .app-shell {
    position: relative;
    height: 100%;
    min-height: 100%;
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--panel);
  }

  .library-nav {
    display: none;
  }

  .library-stage,
  .tools-stage {
    min-height: 0;
    gap: 0;
    background: var(--panel);
  }

  .library-stage {
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  .tools-stage {
    padding-bottom: 5.7rem;
    overflow: auto;
  }

  .library-topbar,
  .tools-topbar,
  .library-list-panel {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .library-topbar,
  .tools-topbar {
    padding: 1.15rem 1.1rem 0.9rem;
    gap: 0.9rem;
    border-top: 0;
    background: var(--panel);
  }

  .library-heading h2 {
    font-size: 2rem;
    font-weight: 680;
    letter-spacing: -0.05em;
  }

  .search-shell {
    width: 100%;
  }

  .search-shell input {
    min-height: 3.1rem;
    border-radius: 16px;
    background: #f6f5f2;
  }

  .library-toolbar {
    gap: 0;
    padding: 0 1.1rem 0.85rem;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    overflow: hidden;
  }

  .filter-pill-row {
    display: flex;
    gap: 0.55rem;
    width: calc(100% + 2.2rem);
    margin: 0 -1.1rem;
    padding: 0 1.1rem;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .filter-pill-row::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    flex: 0 0 auto;
    min-height: 2.35rem;
    padding: 0.42rem 0.82rem;
  }

  .sort-shell {
    display: none;
  }

  .library-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
    margin-top: 0.75rem;
  }

  .list-panel-header {
    display: none;
  }

  .library-list-panel {
    padding: 0.85rem 0.9rem 0;
    background: var(--bg-soft);
    border-bottom: 0;
    padding-bottom: calc(5.7rem + env(safe-area-inset-bottom, 0px));
  }

  .save-list {
    gap: 0.62rem;
  }

  .save-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.68rem;
    padding: 0.78rem 0.82rem;
    border-radius: 16px;
    background: var(--panel);
  }

  .save-card-side {
    gap: 0;
    align-items: flex-start;
  }

  .save-thumb {
    width: 3.7rem;
    height: 3.7rem;
    border-radius: 13px;
  }

  .save-card-actions,
  .save-excerpt {
    display: none;
  }

  .save-card-domain {
    font-size: 0.76rem;
  }

  .save-card h3 {
    margin: 0.12rem 0 0.36rem;
    font-size: 0.98rem;
    line-height: 1.18;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .save-card-footer {
    justify-content: flex-start;
  }

  .save-card-meta {
    gap: 0.3rem;
  }

  .tag-pill,
  .save-meta-inline,
  .save-date {
    font-size: 0.72rem;
  }

  .save-date {
    display: none;
  }

  .tools-grid {
    gap: 0;
  }

  .tools-topbar {
    align-items: start;
  }

  .tools-heading h2 {
    font-size: 2rem;
  }

  .tools-card,
  .tools-card-compact {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .tools-card {
    padding: 1rem 1.1rem;
  }

  .tools-card-feature {
    grid-template-columns: 1fr;
  }

  .tools-card-header h3 {
    font-size: 1.15rem;
  }

  .tools-card-copy {
    max-width: none;
    font-size: 0.92rem;
  }

  .tools-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .mobile-account-card {
    margin-top: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    scroll-margin-bottom: calc(7.4rem + env(safe-area-inset-bottom, 0px));
  }

  .reader-shell {
    height: 100%;
    border-radius: 0;
    border: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: var(--panel);
  }

  .reader-topbar {
    padding: 0.68rem 0.88rem 0.36rem;
    border-bottom: 0;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .reader-actions {
    display: none;
  }

  .reader-topbar-left {
    min-width: 0;
    flex: 1;
    gap: 0.32rem;
  }

  .mobile-reader-top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.38rem;
  }

  .mobile-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    min-width: 2.1rem;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    border: 0;
    color: #7c7b77;
    font-size: 1rem;
    box-shadow: none;
  }

  #reader-back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.24rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
  }

  .reader-article-shell,
  .reader-notes-shell,
  .library-list-panel,
  .tools-stage {
    padding: 0;
  }

  .tools-stage {
    padding-bottom: calc(6.8rem + env(safe-area-inset-bottom, 0px));
  }

  .tools-stage[data-mobile-view="discover"] .tools-card-profile {
    display: none;
  }

  .tools-stage[data-mobile-view="profile"] .tools-card-discover {
    display: none;
  }

  .tools-stage[data-mobile-view="profile"] .tools-card-profile {
    padding: 0.2rem 1rem 1rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .tools-stage[data-mobile-view="profile"] .tools-card-profile .tools-card-header {
    display: none;
  }

  .tools-stage[data-mobile-view="profile"] .tools-topbar {
    align-items: start;
  }

  .tools-stage[data-mobile-view="profile"] #tools-add-link-button {
    display: none;
  }

  .tools-stage[data-mobile-view="profile"] .profile-sheet {
    border-radius: 18px;
  }

  .tools-stage[data-mobile-view="profile"] .profile-row {
    padding: 1rem 1rem 0.95rem;
  }

  .tools-stage[data-mobile-view="profile"] .profile-logout-button {
    min-height: 3.1rem;
  }

  .reader-scroll {
    gap: 0;
    padding: 0 0 5.35rem;
  }

  .reader-article-shell {
    border: 0;
    border-radius: 0;
    padding: 0.12rem 0.96rem 1.35rem;
    background: var(--panel);
  }

  .reader-notes-shell {
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding: 0;
    background: var(--panel);
  }

  #reader-title {
    font-size: 1.45rem;
    line-height: 1.14;
    letter-spacing: -0.04em;
    margin-top: 0.4rem;
  }

  .reader-meta-row,
  .reader-subtitle {
    font-size: 0.92rem;
  }

  .reader-content {
    font-size: 1.05rem;
    line-height: 1.9;
  }

  .mobile-reader-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 0.28rem 0.35rem calc(0.38rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .mobile-reader-action {
    display: grid;
    justify-items: center;
    gap: 0.16rem;
    padding: 0.36rem 0.08rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    box-shadow: none;
  }

  .mobile-reader-action-label {
    line-height: 1;
  }

  .app-shell[data-mode="reader"] .mobile-bottom-nav {
    display: none;
  }

  .app-shell:not([data-mode="reader"]) .mobile-reader-bar {
    display: none;
  }

  .mobile-bottom-nav {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    padding: 0.3rem 0.35rem calc(0.42rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .mobile-nav-item {
    display: grid;
    justify-items: center;
    gap: 0.24rem;
    padding: 0.32rem 0.1rem 0.22rem;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: #9b9b96;
    font-size: 0.68rem;
    font-weight: 600;
    box-shadow: none;
  }

  .mobile-nav-item.active {
    color: var(--text);
  }

  .mobile-nav-icon {
    display: inline-grid;
    place-items: center;
    width: 1.28rem;
    height: 1.28rem;
    line-height: 1;
  }

  .mobile-nav-save {
    align-self: start;
    margin-top: -1.08rem;
  }

  .mobile-nav-save-disc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.05rem;
    height: 3.05rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--panel);
    font-size: 1.7rem;
    line-height: 1;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
  }

  .mobile-nav-icon svg,
  .mobile-reader-action-icon svg,
  .mobile-icon-button svg,
  #reader-back-button svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
  }

  .mobile-reader-action-icon {
    display: inline-grid;
    place-items: center;
    width: 1.12rem;
    height: 1.12rem;
  }

  .mobile-icon-button.active {
    color: #c7831b;
  }

  .mobile-icon-button.active svg {
    fill: currentColor;
    stroke: currentColor;
  }

  #reader-back-button svg {
    width: 0.92rem;
    height: 0.92rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 440px) {
  button.marketing-nav-link {
    font-size: 0.88rem;
  }

  .marketing-nav-button {
    min-height: 2.45rem;
    padding-inline: 0.82rem;
    font-size: 0.84rem;
  }

  .marketing-hero-grid {
    padding-inline: 0.9rem;
  }

  .marketing-kicker-pill {
    font-size: 0.74rem;
  }

  .marketing-hero-title {
    font-size: clamp(1.58rem, 6.7vw, 1.88rem);
    line-height: 0.98;
  }

  .marketing-hero-subcopy {
    font-size: 0.9rem;
    line-height: 1.56;
  }

  .marketing-showcase-shell {
    border-radius: 20px;
  }

  .marketing-save-card h3 {
    font-size: 0.82rem;
  }

  .marketing-proof-item {
    font-size: 0.79rem;
  }

  .marketing-section {
    padding-inline: 0.9rem;
  }

  .marketing-cta-panel {
    margin-inline: 0.9rem;
  }
}
