:root {
  --ink: #25211f;
  --muted: #746d67;
  --paper: #f5f1ea;
  --paper-deep: #ece5dc;
  --panel: rgba(255,255,255,.72);
  --line: rgba(37,33,31,.13);
  --accent: #6f675f;
  --shadow: 0 18px 50px rgba(50,42,36,.09);
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; min-height: 100vh; background: radial-gradient(circle at top left, rgba(255,255,255,.88), transparent 36rem), var(--paper); }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px,4vw,64px); border-bottom: 1px solid var(--line); background: rgba(245,241,234,.86); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 10; }
.wordmark { font-family: Georgia, "Times New Roman", serif; font-size: 28px; text-decoration: none; letter-spacing: -.03em; }
.topbar-right { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 14px; }
.topbar-right form { margin: 0; }
.text-button { border: 0; background: none; color: var(--ink); padding: 0; text-decoration: underline; text-underline-offset: 4px; }
.page, .workspace { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 100px; }
.narrow { width: min(760px, calc(100% - 40px)); }
.page-heading { margin-bottom: 34px; }
.page-heading h1, .book-hero h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.045em; margin: 5px 0 10px; line-height: .98; }
.page-heading h1 { font-size: clamp(42px,6vw,72px); }
.page-heading p { color: var(--muted); font-size: 17px; max-width: 640px; line-height: 1.6; }
.split, .section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: var(--accent); text-transform: uppercase; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.secondary { background: rgba(255,255,255,.6); color: var(--ink); }
.book-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(270px,1fr)); gap: 18px; }
.book-card { display: block; min-height: 230px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; text-decoration: none; box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease; }
.book-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.book-card h2 { margin: 50px 0 8px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 31px; line-height: 1; }
.book-card p { color: var(--muted); margin: 0; }
.back { display: inline-block; color: var(--muted); margin-bottom: 36px; text-decoration: none; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px,4vw,38px); box-shadow: var(--shadow); }
.panel h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 30px; margin: 6px 0 14px; letter-spacing: -.025em; }
.panel p { color: var(--muted); line-height: 1.65; }
.stack { display: grid; gap: 20px; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 750; }
input, textarea, select { width: 100%; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.8); padding: 13px 14px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent); }
textarea { resize: vertical; line-height: 1.5; }
fieldset { border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
legend { font-size: 12px; font-weight: 800; padding: 0 6px; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 600; margin: 8px 0; }
.check input { width: auto; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; padding: 28px; }
.empty.compact { padding: 18px; font-size: 14px; }
.book-hero { min-height: 310px; display: flex; justify-content: space-between; gap: 32px; align-items: flex-start; padding: clamp(34px,6vw,74px); background: linear-gradient(135deg,color-mix(in srgb,var(--accent) 11%,white),rgba(255,255,255,.72)); border: 1px solid color-mix(in srgb,var(--accent) 24%,transparent); border-radius: 32px; box-shadow: var(--shadow); margin-bottom: 22px; }
.book-hero h1 { font-size: clamp(50px,8vw,96px); max-width: 850px; }
.book-hero .author { font-family: Georgia, "Times New Roman", serif; font-size: 23px; color: var(--muted); margin: 0; }
.welcome { max-width: 720px; margin-top: 34px; color: var(--ink); font-size: 17px; line-height: 1.65; }
.workspace-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.conversation { grid-column: 1 / -1; }
.manage { margin: 22px 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 26px; }
.settings-grid .wide { grid-column: 1 / -1; }
.client-list { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.client-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.client-list span { color: var(--muted); }
.status-row { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; font-size: 14px; }
.resource-list { display: grid; gap: 10px; margin-top: 22px; }
.resource { display: grid; gap: 4px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 15px; text-decoration: none; background: rgba(255,255,255,.56); }
.resource span { color: var(--muted); font-size: 13px; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 8px; margin-top: 16px; }
.note-feed { display: grid; gap: 14px; margin: 28px 0; }
.note { max-width: 78%; border-radius: 18px; padding: 18px 20px; }
.note.editor { background: color-mix(in srgb,var(--accent) 10%,white); border: 1px solid color-mix(in srgb,var(--accent) 20%,transparent); }
.note.client { margin-left: auto; background: white; border: 1px solid var(--line); }
.note-meta { display: flex; justify-content: space-between; gap: 20px; font-size: 12px; margin-bottom: 10px; }
.note-meta span { color: var(--muted); }
.note-body { line-height: 1.62; }
.note-compose { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 24px; }
.note-compose .button { justify-self: end; }
.login-page { display: grid; place-items: center; padding: 28px; }
.login-shell { width: min(1050px,100%); min-height: min(720px,calc(100vh - 56px)); display: grid; grid-template-columns: 1.1fr .9fr; border: 1px solid var(--line); border-radius: 34px; overflow: hidden; box-shadow: var(--shadow); background: rgba(255,255,255,.62); }
.login-brand { padding: clamp(40px,7vw,86px); display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(155deg,rgba(255,255,255,.32),rgba(111,103,95,.14)); }
.login-brand h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(68px,11vw,132px); letter-spacing: -.06em; margin: 10px 0 28px; line-height: .8; }
.login-brand p { max-width: 500px; font-family: Georgia, "Times New Roman", serif; font-size: 24px; line-height: 1.4; }
.login-card { padding: clamp(40px,7vw,76px); align-self: center; }
.login-card h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 42px; margin: 0 0 8px; }
.login-card > p { color: var(--muted); margin-bottom: 34px; }
.error { padding: 12px 14px; margin-bottom: 18px; border-radius: 12px; background: #f4dedb; color: #6d2820; font-size: 14px; }
@media (max-width: 800px) {
  .workspace-grid, .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 330px; }
  .book-hero, .split, .section-heading { flex-direction: column; }
  .inline-form, .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .wide { grid-column: auto; }
  .note { max-width: 92%; }
}
