:root {
  color-scheme: light;
  --navy-950: #061439;
  --navy-900: #071b4d;
  --navy-700: #123b86;
  --teal-700: #007d8d;
  --teal-600: #0099a8;
  --teal-100: #dff8f8;
  --cyan-50: #f0fbfb;
  --surface: #ffffff;
  --surface-soft: #f7fbfc;
  --line: #dce8ee;
  --muted: #64708b;
  --ink: #071b4d;
  --danger: #bd3a3a;
  --shadow: 0 22px 70px rgba(7, 27, 77, 0.11);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --reader-font-scale: 1;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  overflow-x: clip;
  background:
    radial-gradient(circle at 92% 4%, rgba(0, 153, 168, 0.16), transparent 30%),
    radial-gradient(circle at 8% 78%, rgba(0, 153, 168, 0.11), transparent 32%),
    linear-gradient(145deg, #ffffff 0%, #f6fbfc 52%, #eef9fa 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 30px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px);
}

.brand-lockup,
.mobile-brand {
  display: inline-flex;
  align-items: center;
  width: 168px;
  height: 54px;
  overflow: hidden;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy-700), var(--teal-600));
  color: white;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.08em;
  box-shadow: 0 14px 34px rgba(0, 153, 168, 0.22);
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 38px;
}

.nav-item,
.bottom-item {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.nav-icon {
  flex: 0 0 auto;
}

.bottom-nav .nav-icon {
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  font-weight: 800;
}

.nav-item.active,
.nav-item:hover {
  background: linear-gradient(135deg, rgba(0, 153, 168, 0.13), rgba(18, 59, 134, 0.06));
  color: var(--teal-700);
}

.sync-card {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 28px;
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(223, 248, 248, 0.88)),
    radial-gradient(circle at 90% 92%, rgba(0, 153, 168, 0.28), transparent 28%);
  color: var(--navy-900);
}

.sync-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.support-button,
.buy-original-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 950;
}

.support-button {
  background: var(--teal-100);
  color: var(--teal-700);
}

.buy-original-button {
  background: linear-gradient(135deg, var(--navy-700), var(--teal-700));
  color: white;
  box-shadow: 0 12px 28px rgba(7, 27, 77, 0.16);
}

.sync-card .support-button {
  margin-top: 6px;
}

.main-area {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 22px clamp(18px, 4vw, 46px) 48px;
}

.view,
.home-shelves,
.content-shelf {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(240px, 560px) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 10px 12px;
  border: 1px solid rgba(220, 232, 238, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 14px 42px rgba(7, 27, 77, 0.1),
    0 2px 8px rgba(7, 27, 77, 0.04);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  backdrop-filter: blur(20px) saturate(1.25);
}

.mobile-brand {
  display: inline-flex;
  width: 150px;
  height: 48px;
  border-radius: 15px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 251, 252, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search-box:focus-within {
  border-color: rgba(0, 153, 168, 0.48);
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(0, 153, 168, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.mode-badge {
  justify-self: end;
  white-space: nowrap;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.home-shelves {
  display: grid;
  gap: 42px;
  margin-top: 42px;
}

.content-shelf > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.content-shelf h2 { margin-bottom: 0; }

.shelf-link {
  border: 0;
  background: transparent;
  color: var(--teal-700);
  font-weight: 900;
  white-space: nowrap;
}

.horizontal-rail {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 4px 4px 18px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.horizontal-rail > * {
  flex: 0 0 min(290px, 78vw);
  min-width: 0;
  scroll-snap-align: start;
}

.home-knowledge-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-knowledge-item {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.86);
  color: var(--ink);
  text-align: left;
}

.home-knowledge-item span { font-weight: 900; line-height: 1.35; }
.home-knowledge-item small { color: var(--muted); }

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.insight-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #fff, var(--cyan-50));
  box-shadow: 0 14px 42px rgba(7,27,77,.07);
}

.insight-card h3 { margin: 18px 0 10px; font-size: 22px; line-height: 1.15; }
.insight-card p { color: var(--muted); line-height: 1.6; }
.insight-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; color: var(--muted); font-size: 13px; }
.insight-card footer .ghost-button { width: auto; }
.draft-tag { background: #fff1cc; color: #865d00; }
.insight-thesis { max-width: 760px; color: var(--muted); font-size: 19px; line-height: 1.65; }
.insight-attribution { margin: 32px auto 0; max-width: 760px; padding: 20px; border-left: 4px solid var(--teal-600); background: var(--cyan-50); }
.insight-attribution a { color: var(--teal-700); font-weight: 900; }
.insight-post p { margin: 0; white-space: normal; }
.insight-post ul {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding-left: 1.25em;
}
.insight-code {
  overflow-x: auto;
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid #d6e4ea;
  border-radius: 14px;
  background: #f5f9fa;
  color: #15213c;
  font: 500 0.92em/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}
.insight-divider {
  width: 100%;
  height: 1px;
  margin: 32px 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line) 10%, var(--line) 90%, transparent);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: 28px;
  align-items: end;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 82% 22%, rgba(0, 153, 168, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(240, 251, 251, 0.82));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal-700);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 16px;
  color: var(--navy-950);
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.075em;
}

.hero-card p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hero-stats div {
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
}

.hero-stats span {
  display: block;
  color: var(--navy-950);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.hero-stats small {
  color: var(--muted);
  font-weight: 750;
}

.continue-panel {
  margin-top: 22px;
}

.continue-panel h2 {
  margin: 0 0 14px;
  color: var(--navy-950);
  font-size: 22px;
  letter-spacing: -0.045em;
}

.continue-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.continue-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 40%, rgba(0, 153, 168, 0.16), transparent 28%),
    var(--surface);
  box-shadow: 0 16px 48px rgba(7, 27, 77, 0.08);
}

.continue-card .primary-button {
  grid-column: 1 / -1;
}

.cover {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 0.72;
  border-radius: 12px;
  background:
    linear-gradient(155deg, #fff 0%, #e8f6f7 48%, #dff8f8 100%);
  border: 1px solid var(--line);
  color: var(--teal-700);
  font-weight: 950;
  font-size: 24px;
  box-shadow: 0 12px 30px rgba(7, 27, 77, 0.1);
  overflow: hidden;
}

.cover-fallback,
.cover-image {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
}

.cover-fallback {
  display: grid;
  place-items: center;
}

.cover-image {
  position: relative;
  z-index: 1;
  object-fit: cover;
  background: var(--surface-soft);
}

.continue-card h3,
.book-card h3 {
  margin-bottom: 6px;
  color: var(--navy-950);
  letter-spacing: -0.04em;
}

.muted,
.book-card p,
.continue-card p,
.reader-meta,
.section-heading p {
  color: var(--muted);
}

.primary-button,
.ghost-button,
.pagination button,
.reader-action {
  border: 0;
  border-radius: 15px;
  padding: 11px 15px;
  font-weight: 900;
}

.primary-button {
  background: linear-gradient(135deg, var(--teal-700), var(--teal-600));
  color: white;
  box-shadow: 0 12px 28px rgba(0, 153, 168, 0.22);
}

.ghost-button,
.pagination button,
.reader-action {
  border: 1px solid var(--line);
  background: white;
  color: var(--navy-900);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin: 30px 0 16px;
}

.section-heading h2 {
  margin-bottom: 4px;
  color: var(--navy-950);
  font-size: 26px;
  letter-spacing: -0.05em;
}

select {
  min-width: 230px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  padding: 12px 14px;
  font-weight: 750;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.book-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 232px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  text-align: left;
  box-shadow: 0 14px 42px rgba(7, 27, 77, 0.07);
}

.book-card:hover,
.book-card.active {
  border-color: rgba(0, 153, 168, 0.48);
  transform: translateY(-1px);
}

.book-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bookmark-button {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--muted);
  font-size: 18px;
}

.bookmark-button::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12a1 1 0 0 1 1 1v17l-7-4-7 4V4a1 1 0 0 1 1-1z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12a1 1 0 0 1 1 1v17l-7-4-7 4V4a1 1 0 0 1 1-1z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.bookmark-button.saved {
  border-color: rgba(0, 153, 168, 0.32);
  background: var(--teal-100);
  color: var(--teal-700);
}

.progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f0f4;
}

.progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal-700), var(--teal-600));
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.popularity-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.progress-ring {
  --progress-angle: 0deg;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background:
    conic-gradient(var(--teal-700) var(--progress-angle), #e9f0f4 0);
  color: var(--navy-900);
  font-size: 10px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(7, 27, 77, 0.05);
  transition: background 280ms ease, transform 180ms ease;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: white;
}

.progress-ring span {
  position: relative;
  z-index: 1;
}

.book-card:hover .progress-ring,
.reader-toolbar:hover .progress-ring {
  transform: scale(1.04);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--teal-100);
  color: var(--teal-700);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
}

.tag.preview {
  background: #eef2ff;
  color: var(--navy-700);
}

.infinite-status {
  min-height: 24px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.scroll-sentinel {
  width: 100%;
  height: 2px;
}

.reader {
  min-height: calc(100vh - 112px);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 520px;
  padding: 42px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border-radius: 24px;
  background: var(--teal-100);
  color: var(--teal-700);
  font-size: 28px;
}

.reader-shell {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 820px);
  gap: 22px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
}

.toc strong {
  display: block;
  margin-bottom: 12px;
  color: var(--navy-950);
}

.toc button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  padding: 10px 11px;
  text-align: left;
  font-size: 13px;
  font-weight: 750;
}

.toc button.active {
  background: var(--teal-100);
  color: var(--teal-700);
}

.reader-article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.reader-header {
  padding: clamp(24px, 5vw, 44px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 88% 18%, rgba(0, 153, 168, 0.15), transparent 28%),
    linear-gradient(135deg, #ffffff, #f3fbfc);
}

.reader-header h2 {
  margin: 12px 0 12px;
  color: var(--navy-950);
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
  letter-spacing: -0.065em;
}

.reader-header p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.75;
}

.reader-toolbar {
  position: fixed;
  right: 22px;
  bottom: calc(22px + var(--safe-bottom));
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 9px;
  border: 1px solid rgba(220, 232, 238, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 54px rgba(7, 27, 77, 0.18);
  backdrop-filter: blur(18px);
}

.reader-inline-settings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.reader-commerce-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-support {
  min-height: 42px;
}

.font-size-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}

.font-size-control button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  border: 0;
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--navy-900);
  font-weight: 950;
}

.font-size-control button:hover {
  background: var(--teal-100);
  color: var(--teal-700);
}

.font-size-control span {
  min-width: 44px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.highlighted-text {
  border-radius: 6px;
  background: linear-gradient(180deg, transparent 18%, rgba(255, 222, 99, 0.58) 18%, rgba(255, 222, 99, 0.58) 88%, transparent 88%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.saved-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.saved-tab {
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  font-weight: 900;
}

.saved-tab.active {
  background: var(--teal-100);
  color: var(--teal-700);
}

.highlight-list {
  display: grid;
  gap: 14px;
}

.highlight-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 42px rgba(7, 27, 77, 0.07);
}

.highlight-card blockquote {
  margin: 0;
  color: var(--navy-950);
  font-size: 17px;
  line-height: 1.65;
}

.highlight-card footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.highlight-empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
}

.reader-progress {
  flex: 1 1 auto;
  min-width: 80px;
}

.reader-progress-ring {
  width: 44px;
  height: 44px;
  font-size: 10px;
}

.reader-toolbar .progress-track {
  height: 7px;
}

.reader-progress-label {
  min-width: 34px;
  color: var(--navy-900);
  font-size: 12px;
  font-weight: 950;
  text-align: right;
}

.reader-toolbar .reader-action {
  min-height: 40px;
  padding: 0;
  border-radius: 14px;
  white-space: nowrap;
  font-size: 13px;
}

.icon-action {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
}

.highlight-action {
  color: var(--muted);
}

.highlight-action::before {
  content: "";
  width: 21px;
  height: 21px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 11-6 6v3h9l3-3'/%3E%3Cpath d='m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 11-6 6v3h9l3-3'/%3E%3Cpath d='m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.highlight-action::after {
  content: none;
}

.highlight-action:hover,
.highlight-action:focus-visible {
  color: var(--teal-700);
  background: var(--teal-100);
}

.share-action {
  color: var(--muted);
}

.share-action::before {
  content: "";
  width: 21px;
  height: 21px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cline x1='8.59' y1='13.51' x2='15.42' y2='17.49'/%3E%3Cline x1='15.41' y1='6.51' x2='8.59' y2='10.49'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cline x1='8.59' y1='13.51' x2='15.42' y2='17.49'/%3E%3Cline x1='15.41' y1='6.51' x2='8.59' y2='10.49'/%3E%3C/svg%3E") center / contain no-repeat;
}

.share-action:hover,
.share-action:focus-visible {
  color: var(--teal-700);
  background: var(--teal-100);
}

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: var(--navy-900);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(7, 27, 77, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
}

.share-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.reader-toolbar .bookmark-button {
  width: 40px;
  min-width: 0;
  height: 40px;
  padding: 0;
}

.reader-body {
  padding: clamp(24px, 5vw, 44px);
}

.reader-section {
  scroll-margin-top: 104px;
  padding: 0 0 38px;
  margin: 0 0 38px;
  border-bottom: 1px solid var(--line);
}

.reader-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
}

.reader-section h3 {
  margin-bottom: 16px;
  color: var(--navy-950);
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.055em;
}

.reader-content {
  color: #1d2947;
  font-size: calc(18px * var(--reader-font-scale));
  line-height: calc(1.88 + (var(--reader-font-scale) - 1) * 0.18);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.reader-content > * {
  max-width: 100%;
}

.reader-content p,
.reader-content li,
.reader-content blockquote {
  font: inherit;
  line-height: inherit;
  white-space: normal;
}

.reader-content p {
  margin: 0 0 1.15em;
}

.reader-content h1,
.reader-content h2,
.reader-content h3,
.reader-content h4,
.reader-content h5,
.reader-content h6 {
  margin: 1.35em 0 0.55em;
  color: var(--navy-950);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.reader-content img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 1.25em auto;
  border-radius: 18px;
}

.reader-content figure {
  margin: 1.4em 0;
}

.reader-content figcaption {
  margin-top: 0.55em;
  color: var(--muted);
  font-size: 0.82em;
  text-align: center;
}

.reader-content blockquote {
  margin: 1.25em 0;
  padding: 0.8em 1.1em;
  border-left: 4px solid var(--teal-500);
  background: var(--teal-100);
}

.reader-content ul,
.reader-content ol {
  padding-left: 1.4em;
}

.reader-content a {
  color: var(--teal-700);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.reader-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  white-space: normal;
}

.reader-content th,
.reader-content td {
  padding: 0.65em;
  border: 1px solid var(--line);
  text-align: left;
}

.reader-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.notice {
  border: 1px solid rgba(0, 153, 168, 0.28);
  background: rgba(223, 248, 248, 0.72);
  color: var(--teal-700);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 800;
}

.is-hidden {
  display: none !important;
}

.bottom-nav {
  display: none;
}

.modal-open {
  overflow: hidden;
}

.support-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.support-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 20, 57, 0.52);
  backdrop-filter: blur(8px);
}

.support-sheet {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 26px;
  background: white;
  box-shadow: 0 24px 80px rgba(7, 27, 77, 0.26);
  text-align: center;
}

.support-sheet h2 {
  margin: 0 36px 8px;
  color: var(--navy-950);
  font-size: 24px;
}

.support-sheet p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.support-sheet img {
  display: block;
  width: 100%;
  max-height: min(68vh, 520px);
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.support-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--navy-900);
  font-size: 22px;
  line-height: 1;
}


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

.knowledge-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 40px rgba(7, 27, 77, 0.07);
}

.knowledge-card h3 {
  margin: 0;
  color: var(--navy-950);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.knowledge-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.knowledge-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.25em;
  color: #1d2947;
  line-height: 1.65;
}

.knowledge-card li::marker {
  color: var(--teal-500);
}

.knowledge-card-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: auto;
  padding-top: 4px;
}
.knowledge-card-actions .primary-button { width: auto; }
.floating-back-button {
  position: fixed;
  left: 18px;
  bottom: calc(20px + var(--safe-bottom));
  z-index: 60;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(220, 232, 238, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 38px rgba(7, 27, 77, 0.18);
  backdrop-filter: blur(16px);
  color: var(--navy-950);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.floating-back-button:hover {
  transform: translateY(-2px);
  background: var(--teal-50);
  color: var(--teal-700);
  box-shadow: 0 18px 44px rgba(7, 27, 77, 0.22);
}
.floating-back-button:active {
  transform: translateY(0);
}
.detail-next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 760px;
  margin: 28px auto 0;
  padding: 15px 18px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--teal-700), var(--teal-600));
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}
.detail-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 153, 168, 0.32);
  filter: brightness(1.04);
}
.detail-next:active {
  transform: translateY(0);
}
.detail-next[disabled] {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
  filter: none;
}
.knowledge-detail-shell {
  width: min(920px, 100%);
  margin: 0 auto;
  overflow: hidden;
}
.knowledge-detail-header {
  padding: clamp(28px, 6vw, 56px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(223, 248, 248, 0.86), rgba(255, 255, 255, 0.98));
}
.knowledge-detail-header h1 {
  max-width: 760px;
  margin: 10px 0 22px;
  font-size: clamp(34px, 6vw, 58px);
}
.knowledge-detail-points {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin: 0;
  padding-left: 1.25em;
  color: #1d2947;
  line-height: 1.65;
}
.knowledge-detail-points li::marker { color: var(--teal-500); }
.knowledge-detail-content {
  max-width: 760px;
  margin: 0 auto;
}
.knowledge-detail-loading {
  padding: 48px;
  color: var(--muted);
  text-align: center;
}
.knowledge-loading {
  grid-column: 1 / -1;
}

@media (max-width: 1120px) {
  .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-brand {
    display: inline-flex;
    width: 142px;
    height: 48px;
    border-radius: 16px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .mode-badge {
    display: none;
  }

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

@media (max-width: 860px) {
  .home-knowledge-list, .insight-grid { grid-template-columns: 1fr; }
  .horizontal-rail > * { flex-basis: min(280px, 78vw); }
  body {
    background: linear-gradient(180deg, #ffffff, #f2fbfc);
  }

  .main-area {
    padding: 12px 14px calc(84px + var(--safe-bottom));
  }

  .topbar {
    gap: 12px;
    top: max(8px, env(safe-area-inset-top, 0px));
    margin-bottom: 18px;
    padding: 8px;
    border-radius: 20px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .mobile-brand .brand-logo {
    width: 100%;
    max-width: none;
    object-fit: cover;
    transform: none;
  }

  .search-box {
    min-height: 46px;
    padding: 10px 12px;
  }

  .hero-card {
    padding: 24px;
    border-radius: 28px;
  }

  h1 {
    font-size: 36px;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.8);
  }

  .hero-stats div {
    min-width: 0;
    padding: 14px 6px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    text-align: center;
  }

  .hero-stats div:last-child { border-right: 0; }

  .hero-stats span {
    font-size: 20px;
  }

  .hero-stats small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.25;
  }

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

  .catalog-filters,
  .catalog-filters select {
    width: 100%;
  }

  .book-grid,
  .knowledge-grid {
    grid-template-columns: 1fr;
  }

  .continue-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .continue-card .primary-button {
    grid-column: 1 / -1;
  }

  .reader-shell {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    max-height: none;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
    border-radius: 18px;
  }

  .toc strong {
    display: none;
  }

  .toc button {
    width: auto;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .reader-article {
    border-radius: 26px;
  }

  .reader-content {
    font-size: calc(17px * var(--reader-font-scale));
  }

  .reader-toolbar {
    right: 12px;
    bottom: calc(88px + var(--safe-bottom));
    width: auto;
    gap: 7px;
    padding: 8px;
    border-radius: 20px;
  }

  .floating-back-button {
    left: 14px;
    bottom: calc(88px + var(--safe-bottom));
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .reader-toolbar .reader-action {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    font-size: 12px;
  }

  .reader-toolbar .bookmark-button {
    min-width: 0;
  }

  .bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + var(--safe-bottom));
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 40px rgba(7, 27, 77, 0.14);
    backdrop-filter: blur(18px);
    transform: translateY(0);
    transition: transform 260ms cubic-bezier(0.32, 0.72, 0, 1), opacity 220ms ease;
    opacity: 1;
  }

  .bottom-nav.nav-hidden {
    transform: translateY(calc(100% + 18px));
    opacity: 0;
    pointer-events: none;
  }

  .bottom-item {
    display: grid;
    gap: 2px;
    place-items: center;
    padding: 6px 4px;
    border-radius: 15px;
    font-weight: 800;
  }

  .bottom-item .nav-icon {
    width: 20px;
    height: 20px;
  }

  .bottom-item small {
    font-size: 10px;
    line-height: 1.2;
  }

  .bottom-item.active {
    background: var(--teal-100);
    color: var(--teal-700);
  }
}

@media (max-width: 420px) {
  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reader-controls {
    flex-direction: column;
  }

  .reader-controls button {
    width: 100%;
  }
}
