:root {
  color-scheme: light;
  --ink: #161616;
  --secondary: #66666d;
  --line: #e5e5e8;
  --surface: #f7f7f8;
  --focus: #565db5;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; color: var(--ink); background: #fff; }
main { flex: 1; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.25rem, 5vw, 3.65rem); line-height: 1.17; font-weight: 650; letter-spacing: -.047em; }
h2 { font-size: 1.36rem; line-height: 1.3; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, .button, .pill { color: inherit; cursor: pointer; }
button { border: 1px solid var(--line); background: #fff; min-height: 42px; padding: 7px 13px; border-radius: 9px; }
button:hover:not(:disabled), a.pill:hover { background: #f1f1f3; }
button:disabled { opacity: .47; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 7px 15px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.solid { background: #171717; color: #fff; border-color: #171717; font-weight: 600; }
.solid:hover:not(:disabled), a.solid:hover { background: #393939; border-color: #393939; }
.quiet { border: 0; background: transparent; }
.muted { color: var(--secondary); font-size: .91rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }

.topbar { display: flex; align-items: center; min-height: 72px; padding: 10px clamp(16px, 3vw, 54px); gap: clamp(20px, 4vw, 64px); background: #fff; }
.wordmark { font-size: 1.21rem; font-weight: 730; letter-spacing: -.065em; white-space: nowrap; }
.topbar nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 34px); }
.topbar nav a { padding: 7px 5px; font-size: .94rem; color: #3e3e42; white-space: nowrap; }
.topbar nav a:hover, .topbar nav a[aria-current] { color: #111; text-decoration: underline; text-underline-offset: 6px; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.top-actions a, .top-actions button { font-size: .88rem; }
#member-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12ch; }
.wallet { background: var(--surface); }
.wallet-actions { display: flex; align-items: center; gap: 2px; }
.top-actions .wallet-refresh { min-width: 32px; padding-inline: 5px; border-radius: 50%; font-size: 1.1rem; }
.site-footer { margin: 30px clamp(16px, 3vw, 54px) 0; padding: 23px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--secondary); font-size: .82rem; }

.landing { width: min(calc(100% - 2 * clamp(16px, 3vw, 54px)), 1520px); margin: 0 auto; }
.hero { position: relative; isolation: isolate; padding: clamp(83px, 12vw, 172px) 0 clamp(80px, 10vw, 154px); text-align: center; }
.hero::before, .hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
}
.hero::before {
  background:
    radial-gradient(ellipse 42% 56% at 14% 44%, #dce8ffbd 0%, transparent 76%),
    radial-gradient(ellipse 37% 56% at 86% 32%, #e8dfffce 0%, transparent 77%),
    radial-gradient(ellipse 35% 41% at 84% 72%, #f9e5dfc7 0%, transparent 78%);
  animation: atmosphere 18s ease-in-out infinite alternate;
}
.hero::after {
  background: radial-gradient(circle, #525b8024 .7px, transparent 1px) 0 0 / 20px 20px;
  mask-image: radial-gradient(ellipse 32% 47% at 12% 46%, #000 0%, transparent 78%);
}
@keyframes atmosphere {
  from { transform: translate3d(-1.1%, -.5%, 0) scale(.99); opacity: .82; }
  to { transform: translate3d(1.1%, 1.1%, 0) scale(1.03); opacity: 1; }
}
.hero h1 { margin-bottom: 29px; }
.composer { display: flex; position: relative; flex-direction: column; width: min(100%, 780px); margin: 0 auto 22px; padding: 13px 15px 11px 17px; min-height: 108px; border-radius: 24px; border: 1px solid #dedee3; background: #f7f7f8; text-align: left; box-shadow: 0 5px 20px #1d1e2710; }
.composer:focus-within { border-color: #b5b5c1; }
.composer textarea { padding: 4px 0; border: 0; outline: 0; background: transparent; min-height: 75px; resize: none; overflow-y: hidden; }
.quick-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.quick-links button, .quick-links a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; min-height: 39px; padding: 7px 13px; font-size: .85rem; color: #44444a; }
.quick-links a:hover { background: var(--surface); }
.landing-cards { display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr); gap: 16px; }
.feature { min-height: clamp(240px, 26vw, 395px); padding: clamp(22px, 3vw, 44px); position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: start; border-radius: 14px; gap: 12px; }
.feature-research { background: linear-gradient(125deg, #edf0ff 0%, #e4ecff 55%, #b4cbfa 100%); }
.feature-library { background: linear-gradient(135deg, #f8edf9 0%, #efe9ff 66%, #dedbf9 100%); }
.overline { font-size: .68rem; font-weight: 730; letter-spacing: .14em; }
.feature strong { font-size: clamp(1.6rem, 3.5vw, 3.3rem); line-height: 1.19; letter-spacing: -.06em; font-weight: 650; }
.feature-action { margin-top: auto; font-size: .9rem; }
.feature:hover .feature-action { text-decoration: underline; }
.feature-orbit, .feature-pages { position: absolute; z-index: -1; pointer-events: none; }
.feature-orbit { width: min(49%, 540px); aspect-ratio: 1; border-radius: 50%; bottom: -45%; right: 2%; background: radial-gradient(circle at 32% 28%, #fcfcff 2%, #c7d8ff 23%, #819ce8 58%, #4d5cad 82%); box-shadow: -13px -9px 48px #fff9, 0 0 0 20px #ffffff3f, 0 0 0 50px #ffffff3f; }
.feature-pages { width: 39%; height: 58%; right: 8%; bottom: -18%; border: 1px solid #fff; background: linear-gradient(130deg,#fff, #b9b7e9); border-radius: 9px; transform: rotate(-22deg); box-shadow: 13px 12px 0 #b3abdc66, 26px 22px 0 #b3abdc66; }

.workspace { width: min(calc(100% - 2 * clamp(16px, 4vw, 60px)), 1130px); margin: 0 auto; }
.view { padding: clamp(38px, 7vw, 94px) 0 44px; scroll-margin-block-start: 160px; }
.view-header { margin-bottom: 26px; }
.view-header h1 { font-size: clamp(2.1rem, 4.8vw, 3.2rem); }
.view-header p { margin-top: 10px; color: var(--secondary); }
form { display: grid; gap: 14px; }
label { display: grid; gap: 5px; font-size: .9rem; font-weight: 600; min-width: 0; }
label .muted { font-size: .78rem; font-weight: 400; }
input, textarea { color: inherit; background: #fff; width: 100%; min-height: 44px; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
textarea { resize: vertical; }
input[type="file"] { border-style: dashed; }
input[type="checkbox"] { accent-color: #222; width: 19px; min-height: 19px; }
.reference-box { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px 14px; }
.reference-box legend { padding: 0 5px; font-size: .9rem; font-weight: 600; }
.reference-box legend .muted { font-size: .78rem; font-weight: 400; }
.reference-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.reference-toolbar label { cursor: pointer; min-height: 38px; padding-inline: 12px; }
.reference-toolbar label:hover { background: var(--surface); }
.reference-toolbar:has(input:focus-visible) label { outline: 2px solid var(--focus); outline-offset: 3px; }
.reference-box:disabled .reference-toolbar label { opacity: .47; cursor: default; }
.reference-list { list-style: none; padding: 0; margin: 10px 0 0; }
.reference-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 42px; border-top: 1px solid var(--line); font-size: .85rem; }
.reference-list li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.reference-list button { min-height: 34px; padding-inline: 8px; }
#attachment-status { margin-top: 8px; }
#attachment-status.error { color: #9b2e2e; }
.columns, .credits-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.split, .actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.split { justify-content: space-between; }
.end { justify-content: end; }
.rows { display: grid; gap: 8px; }
.row, .box { border: 1px solid var(--line); border-radius: 13px; padding: 15px; min-width: 0; }
.box { padding: clamp(14px, 3vw, 25px); }
.row p { margin-top: 5px; }
.row .actions { margin-top: 9px; }
.badge { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 550; border-radius: 99px; background: var(--surface); padding: 2px 8px; margin-inline-start: 7px; vertical-align: middle; }
.more { margin-top: 14px; }
.library-search { max-width: 470px; margin-bottom: 27px; }
.shelf + .shelf { margin-top: 30px; }
.shelf h2 { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.shelf h2 span { font-size: .75rem; font-weight: 400; color: var(--secondary); }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 13px; }
.book-grid > .empty { grid-column: 1 / -1; }
.book { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; display: flex; flex-direction: column; }
.cover { background: #f2f2f4; height: clamp(160px, 20vw, 240px); display: grid; place-items: center; padding: 12px; overflow: hidden; }
.cover img { height: 100%; min-height: 0; max-height: 100%; max-width: 100%; object-fit: contain; box-shadow: 0 5px 14px #1e20382a; border-radius: 4px; }
.cover:has(img) .cover-empty { display: none; }
.cover-empty { font-size: 1.6rem; font-weight: 600; color: #6c6c76; }
.book-copy { padding: 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.book-copy .actions { margin-top: auto; padding-top: 8px; }
.book-copy .pill { min-height: 37px; padding-inline: 10px; font-size: .79rem; }
.book-meta { font-size: .74rem; color: var(--secondary); }
.credits-grid { align-items: start; }
.box > p, .box > form, .box > .rows, #payment-retry { margin-top: 11px; }
#presets { justify-content: start; }
.ledger { margin-top: 28px; }
.ledger h2 { margin-bottom: 11px; }
.account-view { max-width: 640px; }
.check { display: flex; align-items: center; gap: 6px; margin: 16px 0; }
#bind-form { margin-bottom: 14px; }
.inline-note, .toast { color: #33334a; background: #f0f0f6; border: 1px solid #e0e0ee; border-radius: 11px; padding: 10px 12px; font-size: .88rem; }
.toast { position: fixed; z-index: 8; bottom: 15px; right: 16px; max-width: min(440px, calc(100vw - 32px)); box-shadow: 0 3px 12px #19192b1c; }
.toast.error { background: #fff2f2; color: #8d2525; border-color: #f0cece; }

dialog { width: min(440px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid var(--line); border-radius: 18px; padding: clamp(17px, 4vw, 27px); color: inherit; }
dialog::backdrop { background: #14141b55; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dialog-heading button { font-size: 1.4rem; line-height: 1; }
.switches { display: flex; gap: 4px; margin-block: 12px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.switches button { flex: 1; min-width: 0; padding-inline: 5px; border-color: transparent; background: transparent; font-size: .83rem; }
.switches button[aria-pressed="true"] { border-color: var(--line); background: #fff; font-weight: 650; }
.auth-reset { margin-top: 6px; padding-inline: 0; }
#auth-note { margin-top: 10px; }
#auth-note.error { color: #9b2e2e; }
.sms-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 7px; }

body.reading { overflow: hidden; }
body.reading .topbar, body.reading .site-footer { display: none; }
body.reading .workspace { width: 100%; max-width: none; }
.reader { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.reader-top, .reader-tools { border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr minmax(0, 3fr) 1fr; align-items: center; gap: 8px; padding: 8px clamp(9px, 3vw, 42px); }
.reader-top h1 { font-size: clamp(1.03rem, 2.5vw, 1.5rem); text-align: center; letter-spacing: -.03em; }
.reader-top a { font-size: .83rem; }
.reader-top a:first-child, .reader-tools > button { justify-self: start; }
.reader-top a:last-child, .reader-group:last-child { justify-self: end; }
.reader-tools { grid-template-columns: 1fr auto 1fr; }
.reader-tools button { min-height: 38px; padding: 5px 8px; }
.reader-group, #reader-jump { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.reader-group > button { min-width: 36px; font-size: 1.18rem; }
#reader-fit { font-size: .74rem; }
#reader-jump { font-size: .78rem; }
#reader-number { min-height: 38px; width: 3.3em; text-align: center; padding: 2px; appearance: textfield; }
#reader-number::-webkit-inner-spin-button, #reader-number::-webkit-outer-spin-button { appearance: none; }
.reader-body { position: relative; display: flex; min-height: 0; min-width: 0; }
.reader-sidebar { flex: none; width: min(29vw, 305px); padding: 10px; border-right: 1px solid var(--line); overflow: auto; background: #fff; }
.reader-sidebar .switches { margin-top: 0; }
.reader-list { display: grid; gap: 5px; }
.reader-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; text-align: start; padding-inline-start: calc(8px + var(--indent, 0px)); font-size: .82rem; }
.reader-list small { color: var(--secondary); }
.reader-list .search-hit { grid-column: 1 / -1; overflow-wrap: anywhere; }
.reader-list button[aria-current="location"] { background: #f0f0f5; }
#reader-search-form { grid-template-columns: minmax(0, 1fr) auto; gap: 5px; margin-bottom: 10px; }
.reader-scroll { flex: 1; min-width: 0; overflow: auto; overscroll-behavior: contain; padding: clamp(10px, 2.5vw, 34px); background: #f4f4f6; }
#reader-status { color: var(--secondary); text-align: center; margin-top: 12vh; }
.reader-sheet { position: relative; margin-inline: auto; background: #fff; box-shadow: 0 5px 30px #1e1e3020; overflow: hidden; }
.reader-sheet canvas { display: block; width: 100%; height: 100%; }
.reader-progress { display: flex; align-items: center; gap: 10px; padding: 6px clamp(12px, 3vw, 42px) max(6px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--secondary); font-size: .74rem; }
.reader-progress progress { flex: 1; height: 5px; min-width: 0; accent-color: #383842; }

/* PDF.js text layer alignment. The upstream Apache license is in pdfjs/LICENSE. */
.textLayer { position: absolute; inset: 0; overflow: clip; text-align: initial; line-height: 1; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; z-index: 1; --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); }
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0 0; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0; font-size: calc(var(--text-scale-factor) * var(--font-height)); --scale-x: 1; --rotate: 0deg; transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(calc(1 / var(--min-font-size))); }
.textLayer .markedContent { display: contents; }
.textLayer ::selection { background: #797edc77; }

@media (max-width: 790px) {
  .topbar { min-height: 64px; gap: 11px; }
  .topbar nav { gap: 9px; }
  .top-actions { gap: 4px; }
  .top-actions button, .top-actions a { padding-inline: 8px; }
  .hero { padding: 69px 0 63px; }
  .hero h1 { margin-bottom: 20px; }
  .landing-cards { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 10px; }
  .feature { min-height: 205px; }
  .reader-sidebar { position: absolute; inset: 0 auto 0 0; width: min(86vw, 320px); z-index: 3; box-shadow: 5px 0 21px #1e1e302b; }
}
@media (max-width: 510px) {
  .topbar { flex-wrap: wrap; }
  #member-name { max-width: 7ch; }
  .topbar nav { order: 3; width: 100%; justify-content: space-between; border-top: 1px solid var(--line); }
  .topbar nav a { font-size: .85rem; padding: 5px 9px; }
  .hero { padding: 64px 0 54px; }
  .composer { border-radius: 19px; }
  .quick-links { gap: 5px; }
  .quick-links button, .quick-links a { padding-inline: 9px; font-size: .75rem; }
  .feature { min-height: 166px; padding: 15px 12px; gap: 6px; }
  .feature strong { font-size: 1.25rem; }
  .feature-action { font-size: .72rem; }
  .columns, .credits-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cover { height: 135px; }
  .book-copy { padding: 8px; }
  .book-copy .pill { padding-inline: 7px; }
  .reader-top { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px; }
  .reader-top a { min-height: 36px; padding-inline: 7px; font-size: .71rem; }
  .reader-top h1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .reader-tools { gap: 2px; }
  .reader-tools button { min-width: 32px; padding-inline: 5px; }
  #reader-number { width: 2.65em; }
  .reader-group, #reader-jump { gap: 2px; }
}
.product-label { color: #5c5c66; font-size: .69rem; font-weight: 720; letter-spacing: .15em; }
.hero .product-label { margin-bottom: 14px; }
.hero-summary { max-width: 590px; margin: -13px auto 25px; font-size: clamp(.93rem, 2vw, 1.06rem); color: var(--secondary); }
.mobile-break { display: none; }
.hero > *, .landing-cards, .product-details { animation: enter .6s cubic-bezier(.2,.65,.3,1) both; }
.hero-summary { animation-delay: .05s; }
.hero .composer { animation-delay: .10s; }
.hero .quick-links { animation-delay: .15s; }
.landing-cards { animation-delay: .20s; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.feature-orbit, .feature-pages { transition: translate .5s cubic-bezier(.2,.65,.3,1); }
.feature:hover :is(.feature-orbit,.feature-pages) { translate: 0 -10px; }
.product-details { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: center; gap: clamp(24px, 7vw, 110px); padding: clamp(50px, 10vw, 140px) clamp(0px, 5vw, 76px); }
.product-copy h2 { margin-top: 9px; font-size: clamp(2rem, 4vw, 3.6rem); letter-spacing: -.05em; }
.product-copy p:not(.product-label) { color: var(--secondary); margin-top: 13px; max-width: 32ch; }
.product-copy .pill { margin-top: 18px; }
.reader-preview { border: 1px solid #e2e2eb; background: #f5f5f9; border-radius: 15px; overflow: hidden; box-shadow: 0 13px 46px #25253e12; }
.preview-toolbar { display: flex; justify-content: space-between; gap: 5px; padding: 13px; background: white; color: #54545f; font-size: .75rem; }
.preview-layout { display: grid; grid-template-columns: .65fr 1.35fr; min-height: clamp(210px, 29vw, 370px); }
.preview-index { display: flex; flex-direction: column; gap: 8px; padding: 14px 10px; border-right: 1px solid var(--line); color: #5c5c68; font-size: .69rem; }
.preview-sheet { background: #fff; align-self: center; margin: 17px 12%; padding: clamp(12px, 3vw, 29px); display: grid; gap: 7px; min-height: 76%; box-shadow: 0 6px 20px #25253e17; }
.preview-sheet span { color: #6d6d77; font-size: .58rem; letter-spacing: .09em; }
.preview-sheet strong { font-size: clamp(.95rem, 2.35vw, 2.1rem); letter-spacing: -.045em; line-height: 1.25; }
.preview-sheet i { height: 3px; background: #e5e5ed; border-radius: 2px; }
.preview-sheet i:last-child { width: 65%; }
@media (max-width: 790px) {
  .product-details { grid-template-columns: 1fr; gap: 25px; padding-inline: 0; }
  .reader-preview { max-width: 560px; }
}
@media (max-width: 510px) {
  .mobile-break { display: inline; }
  .desktop-break { display: none; }
  .hero-summary { margin: -7px auto 18px; }
  .hero h1 { font-size: clamp(1.94rem, 8vw, 2.6rem); }
  .feature strong { font-size: clamp(1.01rem, 4.7vw, 1.35rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .hero::before { animation: none; }
}

.starter-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--secondary); font-size: .82rem; }
.starter-actions .pill { min-height: 39px; font-size: .9rem; }
.starter-actions strong { color: var(--ink); }
.research-feedback { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding: 9px 12px; border: 1px solid #ead4da; border-radius: 12px; color: #842e43; background: #fff5f7; font-size: .85rem; text-align: left; }
.hero-delivery-note { max-width: 680px; margin: -7px auto 16px; color: var(--secondary); font-size: .8rem; }
.hero > .research-feedback { width: min(100%, 780px); margin: -10px auto 16px; }
.research-feedback a { font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

.research-view, .jobs-view, .job-detail-view { padding-top: clamp(24px, 4vw, 60px); }
.research-banner, .jobs-banner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, .33fr); min-height: 188px; gap: 1px; margin-bottom: clamp(15px, 3vw, 25px); overflow: hidden; border-radius: 23px; animation: enter .45s both; }
.research-intro, .jobs-intro, .research-rate { position: relative; isolation: isolate; overflow: hidden; padding: clamp(20px, 3vw, 36px); }
.research-intro { background: radial-gradient(ellipse at 92% 100%, #d6ddff 0%, transparent 68%), linear-gradient(130deg, #f3efff, #eef2ff); }
.research-intro::after, .jobs-intro::after { content: ""; position: absolute; z-index: -1; pointer-events: none; width: 48%; aspect-ratio: 1; right: -10%; bottom: -115%; border: 1px solid #7463b82f; border-radius: 50%; box-shadow: 0 0 0 18px #7463b815, 0 0 0 39px #7463b80c; }
.section-kicker { color: #55516e; font-size: .69rem; font-weight: 730; letter-spacing: .13em; line-height: 1.5; }
.section-kicker > span { display: inline-block; width: 6px; height: 6px; margin: 0 5px 1px 0; border-radius: 50%; background: currentColor; }
.research-intro h1, .jobs-intro h1 { font-size: clamp(2.05rem, 4.4vw, 3.5rem); margin-top: 8px; }
.research-intro > p:not(.section-kicker), .jobs-intro > p:not(.section-kicker) { margin: 9px 0 0; color: #474555; font-size: .93rem; }
.research-view { padding-top: 16px; }
.research-banner { min-height: 0; margin-bottom: 12px; border-radius: 15px; grid-template-columns: minmax(0, 1fr) auto; }
.research-intro { padding: 14px 18px; }
.research-intro h1 { margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.75rem); }
.research-intro > p:not(.section-kicker) { margin-top: 4px; font-size: .8rem; }
.text-link { display: inline-block; font-weight: 650; font-size: .85rem; margin-top: 14px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.research-rate { background: radial-gradient(ellipse at 90% 85%, #ffc5b7, transparent 82%), #ffe9e0; display: flex; flex-direction: column; justify-content: end; }
.research-rate::before { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(circle, #a2534b30 .8px, transparent 1px) 0 0 / 13px 13px; mask-image: radial-gradient(ellipse at 93% 12%, #000, transparent 68%); }
.research-rate .section-kicker, .rate-caption { color: #70443f; }
.research-rate p { margin-top: 5px; font-size: .89rem; }
.research-rate strong { font-variant-numeric: tabular-nums; letter-spacing: -.07em; line-height: 1.1; font-size: clamp(2.5rem, 5vw, 4rem); }
.rate-caption { font-size: .75rem; margin-top: 5px; }
.research-rate { min-width: 128px; padding: 12px 20px; justify-content: center; }
.research-rate p { margin-top: 2px; }
.research-rate strong { font-size: 2rem; }
.research-form { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; }
.research-primary { display: grid; gap: 12px; min-width: 0; }
.question-panel, .research-options { min-width: 0; padding: clamp(15px, 2.6vw, 28px); border: 1px solid var(--line); border-radius: 18px; }
.question-panel { box-shadow: 0 9px 36px #362d7410; }
.question-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#jump-to-submit { flex: none; min-height: 36px; padding: 6px 11px; font-size: .8rem; }
.question-panel label strong { font-size: clamp(1.15rem, 2.3vw, 1.55rem); }
.question-panel textarea { min-height: 170px; margin-top: 12px; padding: 12px; background: #f9f8fc; border-color: #e7e3f1; resize: none; overflow-y: hidden; }
.research-submit { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.research-submit .muted { font-size: .78rem; }
.research-note { display: flex; gap: 12px; align-items: start; padding: 15px; border-radius: 15px; color: #38356c; background: #f0effc; font-size: .86rem; }
.research-note > span { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; color: #fff; background: #51449b; }
.research-note p { margin-top: 4px; color: #565475; }
.research-options { background: #fafaff; }
.research-options { padding: 14px 18px; }
.options-heading { cursor: pointer; font-weight: 650; }
.options-heading .muted { margin-inline-start: 8px; font-weight: 400; font-size: .8rem; }
.research-options[open] .options-heading { margin-bottom: 14px; }
.options-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; }
.options-fields input, .options-fields textarea { font-weight: 400; }
.research-upload { padding: 12px 16px; border-radius: 16px; }
.reference-drop { display: grid; justify-items: center; gap: 4px; padding: 14px 12px; border: 1px dashed #aaa1cd; border-radius: 12px; background: #f7f5ff; color: #423763; text-align: center; cursor: pointer; }
.reference-drop:hover, .reference-drop.dragging { border-color: #6553a7; background: #eee9ff; }
.reference-drop strong { font-size: .9rem; }
.reference-drop #attachment-rules { color: #696278; font-size: .79rem; font-weight: 400; }
.upload-symbol { font-size: 1.4rem; line-height: 1; }
.reference-upload-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; }
.reference-upload-meta .muted { font-size: .77rem; }
.reference-box:disabled .reference-drop { opacity: .5; cursor: default; }

.jobs-banner { grid-template-columns: minmax(0, 1fr) minmax(265px, .64fr); min-height: 174px; }
.jobs-intro { background: radial-gradient(ellipse at 92% 85%, #ffd9c9, transparent 65%), #fff2ea; }
.jobs-intro::after { border-color: #bf714b3b; box-shadow: 0 0 0 20px #bf714b17, 0 0 0 42px #bf714b0d; }
.job-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; }
.job-stats > div { min-width: 0; padding: 16px 7px; display: grid; align-content: center; justify-items: center; gap: 5px; background: #e9e5ff; color: #48396e; }
.job-stats > div:nth-child(2) { background: #e0e9ff; color: #314878; }
.job-stats > div:nth-child(3) { background: #f8e4ed; color: #73445d; }
.job-stats span { font-size: .78rem; font-weight: 650; }
.job-stats strong { color: #22213a; font-size: clamp(1.55rem, 4vw, 2.65rem); line-height: 1.2; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.jobs-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
#job-filters { display: flex; flex-wrap: wrap; gap: 5px; }
#job-filters [aria-pressed="true"] { color: #322966; background: #eeebff; border-color: #e1dcfa; font-weight: 650; }
.job-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.job-grid > .empty { grid-column: 1 / -1; padding: 24px; }
.job-card { --card-color: #f1edff; --card-ink: #503d87; --card-ring: #51449b20; position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid #e9e7f0; border-radius: 17px; overflow: hidden; box-shadow: 0 3px 16px #26204709; transition: box-shadow .2s ease, border-color .2s ease; }
@media (hover: hover) {
  .job-card:hover { border-color: #b8b0d9; box-shadow: 0 8px 22px #26204716; }
}
.job-card-details::after { content: ""; position: absolute; inset: 0; }
.job-card-read { position: relative; }
[data-tone="completed"] { --card-color: #eaf1ff; --card-ink: #344c87; --card-ring: #4d71b920; }
[data-tone="closed"] { --card-color: #fff0ea; --card-ink: #804b45; --card-ring: #aa5d5320; }
.job-card-head { position: relative; isolation: isolate; overflow: hidden; min-height: 112px; padding: 13px 15px; background: var(--card-color); display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.job-card-head::after { content: ""; position: absolute; z-index: -1; pointer-events: none; width: 78px; aspect-ratio: 1; border-radius: 50%; right: -11px; top: -18px; border: 1px solid var(--card-ring); box-shadow: 0 0 0 10px var(--card-ring), 0 0 0 23px var(--card-ring); }
.job-card-head h3, .job-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.job-card-head h3 { font-size: 1.09rem; line-height: 1.45; }
.job-tag { align-self: start; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; background: #ffffffa6; padding: 4px 8px; color: var(--card-ink); font-size: .71rem; font-weight: 680; }
.job-tag::before { content: ""; background: currentColor; width: 5px; height: 5px; border-radius: 50%; }
.job-card-body { display: flex; flex-direction: column; gap: 8px; padding: 13px 15px; flex: 1; }
.job-excerpt { color: #52505b; font-size: .84rem; }
.job-card-date { font-size: .74rem; color: var(--secondary); }
.job-card-body .actions { margin-top: auto; padding-top: 5px; }
.job-card-body .pill { min-height: 40px; padding-inline: 11px; font-size: .79rem; }
.job-back { margin-bottom: 12px; }
.job-detail-hero { --card-color: #f1edff; --card-ink: #503d87; padding: clamp(16px, 3vw, 32px); border-radius: 18px; background: var(--card-color); }
.job-detail-hero[data-tone="completed"] { --card-color: #eaf1ff; --card-ink: #344c87; }
.job-detail-hero[data-tone="closed"] { --card-color: #fff0ea; --card-ink: #804b45; }
.job-detail-hero h1 { font-size: clamp(1.55rem, 4vw, 2.8rem); margin-top: 10px; }
.job-detail-hero .muted { margin-top: 8px; }
.job-delivery-notice { width: fit-content; max-width: 100%; margin-top: 13px; padding: 9px 12px; border-radius: 10px; background: #ffffffb3; color: #443764; font-size: .88rem; }
.job-delivery-notice a { display: inline-block; margin-inline-start: 7px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.job-detail-hero .actions { margin-top: 16px; }
.job-detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 13px; align-items: start; margin-top: 14px; }
.job-detail-grid .box > p { margin-top: 8px; white-space: pre-wrap; }
.job-detail-grid h3 { margin-top: 18px; }
.job-detail-grid dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 10px; font-size: .86rem; }
.job-detail-grid dt { color: var(--secondary); }
.job-detail-grid dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .job-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .research-form, .job-detail-grid { grid-template-columns: 1fr; }
  .research-banner, .jobs-banner { grid-template-columns: 1fr; min-height: 0; border-radius: 17px; }
  .research-banner { grid-template-columns: minmax(0, 1fr) auto; }
  .research-intro { padding: 12px 14px; }
  .research-rate { min-width: 86px; padding: 10px 12px; }
  .research-rate p, .rate-caption { margin: 0; }
  .research-rate strong { font-size: 1.7rem; }
  .job-stats > div { padding-block: 10px; gap: 2px; }
  .question-panel textarea { min-height: 135px; }
}
@media (max-width: 510px) {
  .job-grid { grid-template-columns: 1fr; gap: 9px; }
  .options-heading .muted { display: block; margin: 4px 0 0 18px; }
  .jobs-toolbar .pill { padding-inline: 10px; font-size: .8rem; }
  .job-card-head { min-height: 84px; }
  .research-options .reference-box { padding-inline: 9px; }
}

/* Project navigation and the research composer share the same layout on every route. */
body { padding-left: 260px; }
.project-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 260px; background: #f7f7f9; border-right: 1px solid #ebebef; display: flex; flex-direction: column; padding: 16px 12px 12px; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px 16px 10px; }
.sidebar-head .wordmark { font-size: 1.12rem; }
.sidebar-toggle { display: inline-grid; place-items: center; flex-shrink: 0; width: 38px; min-height: 38px; padding: 8px; border-radius: 10px; }
.sidebar-toggle svg, .attachment-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-nav { display: grid; gap: 3px; padding-bottom: 16px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 10px; font-size: .88rem; }
.sidebar-link:hover, .sidebar-draft:hover, .sidebar-project:hover { background: #ebebf0; }
.sidebar-icon { display: grid; place-items: center; flex: none; width: 21px; font-size: 1.25rem; line-height: 1; }
.sidebar-label { white-space: nowrap; }
.sidebar-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.sidebar-section-head { display: flex; align-items: center; justify-content: space-between; padding-left: 10px; margin-top: 8px; }
.sidebar-section-head h2 { font-size: .76rem; font-weight: 550; color: #777781; }
.sidebar-section-head button { min-height: 34px; padding: 4px 10px; color: #777781; }
.sidebar-filters { display: flex; gap: 3px; margin: 5px 4px 12px; }
.sidebar-filters button { flex: 1; min-height: 30px; border: 0; border-radius: 7px; padding: 4px 5px; font-size: .73rem; color: #777781; background: transparent; }
.sidebar-filters [aria-pressed="true"] { color: #403650; background: #eae7f0; font-weight: 600; }
.sidebar-projects { display: grid; gap: 3px; }
.sidebar-project, .sidebar-draft { display: grid; gap: 5px; border-radius: 10px; padding: 10px 11px; }
.sidebar-project-title { font-size: .85rem; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.sidebar-project-state { font-size: .68rem; color: #777781; display: flex; align-items: center; gap: 5px; }
.sidebar-project-state::before { content: ''; width: 5px; height: 5px; background: #a49bbd; border-radius: 50%; }
.sidebar-project[data-state="completed"] .sidebar-project-state::before { background: #7c91b9; }
.sidebar-project[data-state="closed"] .sidebar-project-state::before { background: #ad9896; }
.sidebar-project[aria-current], .sidebar-draft[aria-current] { background: #eae5f5; }
.sidebar-drafts { padding-bottom: 10px; border-bottom: 1px solid #e7e7eb; }
.sidebar-draft { font-size: .84rem; }
.sidebar-draft small { font-size: .7rem; color: #777781; }
.sidebar-status { padding: 10px; font-size: .8rem; color: #777781; }
.sidebar-status.error, #starter-attachment-status.error { color: #9b2e2e; }
.sidebar-more { width: 100%; margin-block: 8px; font-size: .78rem; }
#sidebar-login { margin: 10px; font-size: .82rem; }
.sidebar-account { margin-top: 12px; border-top: 1px solid #e7e7eb; border-radius: 0; padding-top: 17px; }
#sidebar-open { display: none; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: #19182266; border: 0; border-radius: 0; padding: 0; cursor: default; }
.sidebar-backdrop:hover:not(:disabled) { background: #19182266; }
.sidebar-collapsed { padding-left: 64px; }
.sidebar-collapsed .project-sidebar { width: 64px; padding-inline: 8px; }
.sidebar-collapsed .sidebar-head { padding: 0 4px 16px; }
.sidebar-collapsed .sidebar-head .wordmark, .sidebar-collapsed .sidebar-label, .sidebar-collapsed .sidebar-content { display: none; }
.sidebar-collapsed .sidebar-link { justify-content: center; padding-inline: 6px; }
.sidebar-collapsed .sidebar-account { margin-top: auto; }
.topbar { gap: 20px; padding-inline: 24px; }
.hero { min-height: calc(100svh - 80px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 70px 0 80px; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.starter-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.starter-tools > span { white-space: nowrap; }
.attachment-button { display: inline-grid; place-items: center; flex: none; min-height: 38px; width: 38px; padding: 8px; border-radius: 50%; }
.starter-attachment-rules { font-size: .69rem; line-height: 1.5; color: #85858c; padding-left: 4px; }
#starter-attachment-count { font-size: .72rem; }
#starter-attachment-status { font-size: .78rem; }
.starter-files { margin: 0; }
.starter-files li { grid-template-columns: minmax(0, 1fr) auto auto; padding: 3px 6px; background: #fff8; border: 1px solid #e7e7ed; border-radius: 9px; margin-bottom: 5px; }
.composer.dragging { border-color: #8b7eb8; background: #f0ebfa; box-shadow: 0 0 0 3px #bfb0e333; }
@media (min-width: 901px) {
  .topbar > .wordmark { display: none; }
  #enter-workspace { display: none; }
  .topbar #member-name { max-width: 10ch; }
}
@media (max-width: 900px) {
  body, body.sidebar-collapsed { padding-left: 0; }
  .project-sidebar { z-index: 30; width: min(300px, calc(100vw - 44px)); transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .sidebar-open { overflow: hidden; }
  .sidebar-open .project-sidebar { transform: translateX(0); visibility: visible; transition-delay: 0s; }
  #sidebar-open { display: inline-grid; }
  .topbar { gap: 10px; padding-inline: 14px; }
  .hero { min-height: calc(100svh - 120px); padding: 54px 0 64px; }
  #enter-workspace { display: none; }
}
@media (max-width: 650px) {
  #guest-actions > a { display: none; }
  .topbar .wordmark { font-size: 1.06rem; }
  .topbar nav { order: 3; width: 100%; justify-content: space-around; border-top: 1px solid var(--line); }
  .topbar #member-name { display: none; }
  .top-actions .wallet { padding-inline: 10px; font-size: .8rem; min-height: 36px; gap: 4px; }
  .top-actions .wallet-refresh { min-width: 30px; }
  .topbar { flex-wrap: wrap; gap: 5px; }
  .hero h1 { font-size: clamp(1.85rem, 6.5vw, 2.6rem); }
  .starter-actions { gap: 5px; }
  .starter-tools { gap: 2px; font-size: .74rem; }
  .starter-actions .pill { padding-inline: 11px; font-size: .8rem; }
  #starter-attachment-count { flex-basis: 100%; padding-left: 8px; }
  .starter-attachment-rules { font-size: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
  .project-sidebar { transition: none; }
}
.starter-files { display: flex; gap: 8px; min-width: 0; max-width: 100%; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.starter-files li { flex: 0 0 min(240px, 88%); grid-template-columns: minmax(0, 1fr) auto; gap: 2px 7px; padding: 9px 11px; margin-bottom: 0; }
.starter-files li span:first-child { grid-column: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.starter-files li .muted { grid-column: 1; font-size: .7rem; }
.starter-files li button { grid-column: 2; grid-row: 1 / 3; font-size: .75rem; }

/* Long prompts grow only to a comfortable reading height; actions stay outside the scroll area. */
.composer textarea { min-height: 75px; max-height: clamp(130px, 28svh, 250px); scrollbar-width: thin; overscroll-behavior: contain; }
.composer.long-prompt { width: min(100%, 1040px); }
.hero:has(.composer.long-prompt) { padding-block: 32px; }
.hero:has(.composer.long-prompt) h1 { margin-bottom: 20px; }
.hero:has(.composer.long-prompt) .hero-summary { margin-bottom: 18px; }
.question-panel textarea { min-height: 144px; max-height: clamp(160px, 34svh, 320px); scrollbar-width: thin; overscroll-behavior: contain; }
.workspace:has(.research-view.long-prompt:not([hidden])) { max-width: 1240px; }
@media (max-width: 650px) {
  .composer textarea { min-height: 75px; max-height: clamp(110px, 22svh, 175px); }
  .question-panel textarea { min-height: 120px; max-height: clamp(140px, 26svh, 220px); }
  .hero:has(.composer.long-prompt) { padding-block: 24px; }
}
@media (max-height: 700px) {
  .hero:has(.composer.long-prompt) { padding-block: 16px; }
  .hero:has(.composer.long-prompt) .product-label,
  .hero:has(.composer.long-prompt) .hero-summary { display: none; }
  .hero:has(.composer.long-prompt) h1 { margin-bottom: 14px; }
}
.composer.long-prompt { gap: 8px; }
@media (max-height: 500px) {
  .hero:has(.composer.long-prompt) { min-height: 0; }
  .hero:has(.composer.long-prompt) h1,
  body:has(#welcome:not([hidden]) .composer.long-prompt) .topbar nav { display: none; }
  .composer.long-prompt textarea { min-height: 70px; max-height: clamp(70px, 24svh, 100px); }
}
#pdf-save-dialog { width: min(calc(100% - 24px), 480px); }
#pdf-save-dialog > p { margin-top: 12px; }
#pdf-save-dialog .pdf-save-name { padding: 11px 13px; border-radius: 10px; background: #f5f3fa; font-size: .9rem; overflow-wrap: anywhere; }
#pdf-save-dialog > button { width: 100%; margin-top: 16px; }
#pdf-save-dialog > .actions { margin-top: 12px; }
#pdf-save-dialog .actions > a { flex: 1; font-size: .83rem; }
#pdf-save-dialog .pdf-save-tip { font-size: .76rem; }
#wechat-payment { width: min(calc(100% - 24px), 440px); text-align: center; }
#wechat-payment .dialog-heading { text-align: left; }
#wechat-payment-qr { display: block; width: min(100%, 280px); height: auto; margin: 16px auto; background: white; }
#wechat-payment > p { margin-top: 12px; }
#wechat-payment .wechat-payment-amount { font-size: 1.4rem; font-weight: 700; }
#wechat-payment .actions { justify-content: center; margin-top: 18px; }
#wechat-payment .muted { font-size: .78rem; }
