:root {
  color-scheme: light;
  --paper: #f5f3ed;
  --paper-deep: #ece9df;
  --surface: #fffefa;
  --ink: #242720;
  --ink-soft: #55594f;
  --muted: #85877c;
  --line: #e4e1d7;
  --green: #3e5c49;
  --green-dark: #2c4435;
  --green-pale: #e5eade;
  --orange: #d98653;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #8ba18b;
  outline-offset: 3px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.app-frame { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  min-height: 100vh; padding: 30px 20px 18px 24px; background: #eeece3;
  border-right: 1px solid #e5e2d8; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: inline-flex; align-items: center; gap: 9px; width: max-content; font-family: var(--serif); font-size: 25px; font-weight: 700; letter-spacing: -1.2px; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; color: var(--green); }
.brand-mark svg { width: 32px; height: 32px; }
.brand-period { color: var(--orange); }
.side-label { margin: 54px 0 12px 8px; color: #929387; font-size: 9px; font-weight: 750; letter-spacing: 1.55px; }
.side-label-spaced { margin-top: 41px; }
.side-nav { display: grid; gap: 3px; }
.nav-item {
  min-height: 42px; display: flex; align-items: center; gap: 12px; border-radius: 9px;
  padding: 0 10px; color: #74776e; font-size: 12px; font-weight: 550; transition: background .18s, color .18s;
}
.nav-item:hover { background: rgba(255,255,255,.52); color: var(--ink); }
.nav-item.active { background: #fffefa; color: var(--ink); box-shadow: 0 1px 2px rgba(37,39,32,.035); }
.nav-icon { width: 18px; text-align: center; color: #788b76; font-size: 16px; }
.nav-count { margin-left: auto; color: #9c9d93; font-size: 10px; font-variant-numeric: tabular-nums; }
.nav-chevron { margin-left: auto; color: #a7a89e; font-size: 15px; }
.source-card { padding: 13px 12px 12px; border: 1px solid #dfddd3; border-radius: 10px; background: rgba(255,254,250,.54); }
.source-top { display: flex; align-items: center; gap: 7px; }
.drive-symbol { width: 17px; height: 17px; display: inline-flex; }
.drive-symbol svg { width: 17px; height: 17px; }
.source-status { width: 6px; height: 6px; border-radius: 50%; margin-left: 2px; background: #b6b7ad; }
.source-status.connected { background: #61906a; box-shadow: 0 0 0 3px rgba(97,144,106,.12); }
.source-status-copy { color: #818379; font-size: 9px; }
.source-folder { margin: 11px 0 0 24px; font-family: var(--serif); font-size: 14px; line-height: 1.25; }
.source-link { display: inline-flex; gap: 4px; margin: 8px 0 0 24px; color: var(--green); font-size: 10px; font-weight: 650; }
.source-link:hover { text-decoration: underline; }
.sidebar-spacer { flex: 1; min-height: 28px; }
.sidebar-note { padding: 0 8px 25px; color: #898a80; font-family: var(--serif); font-size: 12px; line-height: 1.55; }
.note-rule { display: block; width: 30px; height: 1px; margin-bottom: 12px; background: #c5c7b8; }
.sidebar-note p { margin: 0; }
.sidebar-footer { min-height: 49px; padding: 10px 4px 0; border-top: 1px solid #dedcd2; display: flex; align-items: center; gap: 9px; }
.profile-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #d9ddcf; color: #526650; font-family: var(--serif); font-size: 12px; }
.profile-copy { display: grid; gap: 2px; min-width: 0; color: #4d5148; font-size: 9px; }
.profile-copy strong { font-size: 10px; font-weight: 650; }
.profile-copy span { max-width: 143px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #909187; }
.icon-button { width: 27px; height: 27px; border: 0; border-radius: 7px; margin-left: auto; background: transparent; color: #999b90; cursor: pointer; }
.icon-button:hover { background: #e5e2d8; color: var(--ink); }

.main-content { width: min(100%, 1440px); margin: 0 auto; padding: 0 clamp(28px, 5vw, 76px) 24px; }
.topbar { min-height: 74px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.crumb { display: flex; align-items: center; gap: 10px; min-width: 0; color: #87897e; font-size: 9px; font-weight: 700; letter-spacing: 1.1px; }
.crumb span:last-child { max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #55594f; }
.crumb-divider { color: #c4c5bc; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.sync-caption { color: #909187; font-size: 10px; }
.button { min-height: 38px; border: 1px solid transparent; border-radius: 7px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 10px; font-weight: 650; cursor: pointer; transition: transform .16s, background .16s, border-color .16s, opacity .16s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-dark { background: var(--green-dark); color: #fffefa; box-shadow: 0 3px 7px rgba(33,56,41,.12); }
.button-dark:hover:not(:disabled) { background: #21382b; }
.button-icon { font-size: 15px; line-height: 0; }
.button-dark.syncing .button-icon { animation: spin 1.2s linear infinite; }
.button-outline { border-color: #c9cbbf; background: transparent; color: var(--green-dark); }
.button-outline:hover { background: #f5f5ed; border-color: #aab2a3; }

.hero { min-height: 276px; padding: 41px 44px 38px; margin-top: 25px; border-radius: 12px; overflow: hidden; position: relative; display: flex; align-items: center; background: #e7ebdf; }
.hero::after { content: ""; width: 420px; height: 420px; position: absolute; top: -162px; right: 21px; border: 1px solid rgba(77,101,79,.1); border-radius: 50%; }
.hero-copy { z-index: 1; max-width: 560px; position: relative; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #82877a; font-size: 8px; font-weight: 750; letter-spacing: 1.65px; }
.eyebrow-line { width: 19px; height: 1px; display: inline-block; background: var(--orange); }
.hero h1 { margin: 17px 0 11px; font-family: var(--serif); font-size: clamp(35px, 4.4vw, 53px); font-weight: 400; line-height: .98; letter-spacing: -1.8px; }
.hero h1 em { color: #58725b; font-weight: 400; }
.hero-copy > p { margin: 0; color: #777c70; font-size: 11px; line-height: 1.65; }
.hero-decoration { width: 340px; height: 240px; position: absolute; right: 4.4%; top: 21px; }
.decor-book { position: absolute; bottom: 29px; width: 79px; height: 145px; padding: 16px 11px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 3px 6px 6px 3px; color: rgba(255,255,255,.91); box-shadow: 7px 8px 18px rgba(42,57,44,.17), inset 4px 0 4px rgba(255,255,255,.15); font-family: var(--serif); font-size: 10px; letter-spacing: 1px; line-height: 1.4; }
.decor-book::before { content: ""; position: absolute; inset: 0 auto 0 7px; width: 1px; background: rgba(255,255,255,.22); }
.decor-book i { width: 18px; height: 1px; display: block; background: rgba(255,255,255,.64); }
.decor-book-one { left: 70px; transform: rotate(-11deg); background: linear-gradient(145deg,#b77b53,#875d45); }
.decor-book-two { left: 137px; bottom: 41px; z-index: 2; height: 161px; transform: rotate(2deg); background: linear-gradient(145deg,#60765b,#354d3b); }
.decor-book-three { left: 207px; transform: rotate(11deg); background: linear-gradient(145deg,#668198,#435d70); }
.decor-orbit { position: absolute; border: 1px solid rgba(88,113,88,.22); border-radius: 50%; transform: rotate(-24deg); }
.orbit-one { width: 245px; height: 102px; top: 53px; left: 43px; }
.orbit-two { width: 278px; height: 118px; top: 35px; left: 24px; transform: rotate(24deg); }
.decor-star { position: absolute; top: 24px; right: 12px; color: #ce936d; font-size: 21px; }

.setup-panel { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 16px; margin-top: 22px; padding: 22px 24px; border: 1px solid #d8decf; border-radius: 10px; background: #f3f5ee; }
.setup-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: #e1e8dc; color: var(--green); font-size: 18px; }
.setup-copy .eyebrow { margin: 1px 0 8px; }
.setup-copy h2 { margin: 0 0 7px; font-family: var(--serif); font-size: 20px; font-weight: 400; }
.setup-copy > p:not(.eyebrow) { max-width: 670px; margin: 0; color: #777c72; font-size: 11px; line-height: 1.55; }
.setup-copy .button { margin-top: 13px; }
.setup-checklist { display: flex; flex-wrap: wrap; gap: 9px 20px; margin-top: 15px; color: #777c72; font-size: 9px; }
.setup-checklist span { display: inline-flex; align-items: center; gap: 6px; }
.setup-checklist b { color: #b67e5b; font-size: 8px; letter-spacing: .4px; }
.setup-checklist code { border-radius: 3px; padding: 2px 4px; background: #e7eade; font-size: 9px; }

.metrics { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-height: 123px; position: relative; overflow: hidden; padding: 17px 19px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.metric-featured { background: #f0f1e9; border-color: #e3e5d9; }
.metric-label { display: block; color: #919287; font-size: 8px; font-weight: 750; letter-spacing: 1.4px; }
.metric-value { display: block; margin: 9px 0 5px; font-family: var(--serif); font-size: 29px; font-weight: 400; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.metric-foot { display: flex; align-items: center; gap: 6px; color: #92948a; font-size: 9px; }
.metric-dot { width: 5px; height: 5px; border-radius: 50%; background: #7e9b76; }
.metric-watermark { position: absolute; right: 16px; bottom: 8px; color: rgba(98,123,91,.10); font-family: var(--serif); font-size: 46px; font-style: italic; }
.watermark-olive { color: rgba(153,146,89,.1); }
.watermark-blue { color: rgba(93,124,144,.1); }

.catalogue { margin-top: 43px; }
.catalogue-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.catalogue-heading .eyebrow { margin-bottom: 9px; }
.catalogue-heading h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 400; letter-spacing: -.45px; }
.heading-count { margin-left: 5px; color: #9a9c92; font-family: var(--sans); font-size: 10px; vertical-align: 4px; }
.sort-control { position: relative; }
.sort-control::after { content: "⌄"; position: absolute; top: 6px; right: 8px; color: #888a80; font-size: 13px; pointer-events: none; }
.sort-control select { appearance: none; min-width: 132px; height: 32px; padding: 0 25px 0 9px; border: 1px solid #e2dfd4; border-radius: 6px; background: #fffefa; color: #66695f; font-size: 9px; cursor: pointer; }
.toolbar { margin: 18px 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.search-box { height: 38px; width: min(100%, 340px); padding: 0 10px; display: flex; align-items: center; gap: 8px; border: 1px solid #e2dfd4; border-radius: 7px; background: #fffefa; color: #8b8d82; }
.search-symbol { font-family: var(--serif); font-size: 23px; line-height: 1; transform: rotate(-20deg); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10px; }
.search-box input::placeholder { color: #a1a297; }
.search-box kbd { padding: 2px 5px; border: 1px solid #e5e2d9; border-radius: 3px; color: #b1b2a8; font-family: var(--sans); font-size: 8px; white-space: nowrap; }
.format-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-chip { min-height: 29px; padding: 0 10px; border: 1px solid transparent; border-radius: 20px; background: transparent; color: #85877d; font-size: 9px; cursor: pointer; }
.filter-chip:hover { color: var(--ink); background: #edede5; }
.filter-chip.selected { border-color: #dfe3d7; background: #e8ecdf; color: #465c47; font-weight: 650; }
.filter-chip.more-format { display: none; }
.sync-progress { margin: -3px 0 20px; }
.progress-track { height: 3px; overflow: hidden; border-radius: 5px; background: #e1e4da; }
.progress-track span { display: block; width: 26%; height: 100%; border-radius: inherit; background: #718a6d; animation: progress 1.5s ease-in-out infinite; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: #86897f; font-size: 9px; }
.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.book-card { min-width: 0; padding: 11px; border: 1px solid #e6e3d9; border-radius: 9px; background: var(--surface); transition: transform .18s, box-shadow .18s, border-color .18s; }
.book-card:hover { transform: translateY(-2px); border-color: #d8d8ca; box-shadow: 0 6px 18px rgba(44,52,40,.06); }
.book-cover { min-height: 129px; position: relative; overflow: hidden; padding: 13px 12px 10px; border-radius: 5px; display: flex; flex-direction: column; justify-content: space-between; color: rgba(255,255,255,.92); box-shadow: inset 5px 0 7px rgba(255,255,255,.11); }
.book-cover::before { content: ""; position: absolute; top: 0; bottom: 0; left: 8px; width: 1px; background: rgba(255,255,255,.21); }
.book-cover::after { content: ""; width: 130px; height: 130px; position: absolute; right: -55px; bottom: -73px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 0 0 9px rgba(255,255,255,.035), 0 0 0 20px rgba(255,255,255,.025); }
.cover-tone-0 { background: linear-gradient(145deg, #9f7050, #684a3b); }
.cover-tone-1 { background: linear-gradient(145deg, #617b64, #344b3b); }
.cover-tone-2 { background: linear-gradient(145deg, #627d90, #3f586a); }
.cover-tone-3 { background: linear-gradient(145deg, #a28b59, #706342); }
.cover-tone-4 { background: linear-gradient(145deg, #816986, #55435d); }
.cover-tone-5 { background: linear-gradient(145deg, #b36b53, #754439); }
.cover-monogram { position: relative; z-index: 1; font-family: var(--serif); font-size: 32px; line-height: 1; opacity: .93; }
.cover-title { max-width: 90%; position: relative; z-index: 1; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-family: var(--serif); font-size: 10px; line-height: 1.35; letter-spacing: .35px; }
.cover-format { position: absolute; top: 9px; right: 9px; z-index: 1; padding: 4px 5px; border: 1px solid rgba(255,255,255,.3); border-radius: 3px; color: rgba(255,255,255,.82); font-size: 7px; font-weight: 750; letter-spacing: .55px; }
.book-info { min-height: 105px; padding: 11px 1px 3px; display: flex; flex-direction: column; }
.book-title { display: -webkit-box; min-height: 34px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: #33362f; font-family: var(--serif); font-size: 13px; line-height: 1.3; }
.book-author { margin: 5px 0 0; overflow: hidden; color: #85877d; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.book-series { margin: 4px 0 0; overflow: hidden; color: #7b896e; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.book-meta { margin-top: auto; padding-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #a0a196; font-size: 8px; }
.book-size { font-variant-numeric: tabular-nums; }
.book-open { color: #63806b; font-weight: 700; }
.book-open:hover { text-decoration: underline; }
.book-warning { margin-top: 6px; color: #b37a50; font-size: 8px; }
.empty-state { min-height: 220px; padding: 38px 18px; border: 1px dashed #d8d8cc; border-radius: 9px; text-align: center; background: rgba(255,254,250,.35); }
.empty-symbol { color: #88977d; font-size: 22px; }
.empty-state h3 { margin: 9px 0 5px; font-family: var(--serif); font-size: 20px; font-weight: 400; }
.empty-state p { max-width: 390px; margin: 0 auto; color: #8a8c82; font-size: 10px; line-height: 1.6; }
.empty-state .button { margin-top: 14px; }
.pagination { margin: 17px 0 3px; display: flex; align-items: center; justify-content: space-between; color: #8d8f84; font-size: 9px; }
.page-actions { display: flex; gap: 6px; }
.page-button { width: 31px; height: 29px; border: 1px solid #e1ded4; border-radius: 6px; background: #fffefa; color: #64675e; cursor: pointer; }
.page-button:hover:not(:disabled) { border-color: #b9c0b1; color: var(--green); }
.page-button:disabled { cursor: not-allowed; opacity: .45; }
.main-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 53px; padding-top: 13px; border-top: 1px solid var(--line); color: #a1a297; font-size: 8px; font-weight: 650; letter-spacing: .9px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: min(410px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid #445c48; border-radius: 8px; background: #304838; color: #fffefa; box-shadow: 0 8px 24px rgba(24,40,29,.17); font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .22s, transform .22s; }
.toast.visible { opacity: 1; transform: translateY(0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progress { 0% { transform: translateX(-130%); } 100% { transform: translateX(490%); } }

@media (max-width: 1180px) {
  .main-content { padding-inline: 34px; }
  .hero-decoration { right: -2%; opacity: .92; transform: scale(.9); transform-origin: center right; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .search-box { width: min(100%, 460px); }
}
@media (max-width: 820px) {
  .app-frame { grid-template-columns: 214px minmax(0, 1fr); }
  .sidebar { padding-inline: 17px; }
  .main-content { padding-inline: 24px; }
  .hero { padding-inline: 30px; }
  .hero-decoration { right: -77px; opacity: .48; }
  .metrics { gap: 8px; }
  .metric-card { padding-inline: 13px; }
  .metric-value { font-size: 25px; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .app-frame { display: flex; flex-direction: column; }
  .sidebar { position: relative; top: auto; height: auto; min-height: 0; padding: 12px 18px; border-right: 0; border-bottom: 1px solid #e2dfd5; display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .brand { font-size: 22px; }
  .brand-mark, .brand-mark svg { width: 28px; height: 28px; }
  .sidebar .side-label, .side-nav, .source-card, .sidebar-spacer, .sidebar-note { display: none; }
  .sidebar-footer { min-height: 35px; padding: 0; border: 0; }
  .profile-mark { width: 25px; height: 25px; }
  .profile-copy strong { display: none; }
  .profile-copy span { max-width: 115px; }
  .icon-button { width: 24px; height: 24px; }
  .main-content { padding: 0 16px 20px; }
  .topbar { min-height: 60px; }
  .crumb { gap: 7px; font-size: 8px; letter-spacing: .6px; }
  .top-actions { gap: 8px; }
  .sync-caption { display: none; }
  .button { min-height: 34px; padding-inline: 10px; font-size: 9px; }
  .hero { min-height: 235px; margin-top: 15px; padding: 29px 23px; }
  .hero h1 { font-size: 37px; }
  .hero-copy > p { font-size: 10px; }
  .hero-decoration { right: -177px; opacity: .25; transform: scale(.82); }
  .setup-panel { grid-template-columns: 32px minmax(0,1fr); gap: 11px; padding: 17px 14px; }
  .setup-icon { width: 31px; height: 31px; }
  .setup-copy h2 { font-size: 18px; }
  .setup-checklist { display: grid; gap: 7px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
  .metric-card { min-height: 108px; padding: 13px; }
  .metric-card:last-child { grid-column: 1 / -1; min-height: 88px; }
  .metric-label { font-size: 7px; }
  .metric-value { margin: 8px 0 4px; font-size: 25px; }
  .metric-foot { font-size: 8px; }
  .catalogue { margin-top: 33px; }
  .catalogue-heading h2 { font-size: 23px; }
  .sort-control select { min-width: 113px; font-size: 8px; }
  .toolbar { margin-top: 13px; gap: 8px; }
  .search-box { width: 100%; }
  .format-filter { gap: 2px; }
  .filter-chip { min-height: 26px; padding-inline: 8px; font-size: 8px; }
  .book-grid { gap: 9px; }
  .book-card { padding: 8px; }
  .book-cover { min-height: 106px; padding: 10px 9px; }
  .cover-monogram { font-size: 28px; }
  .book-info { min-height: 101px; padding-top: 9px; }
  .book-title { font-size: 12px; }
  .main-footer { margin-top: 40px; font-size: 7px; letter-spacing: .5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.toast.toast-error { border-color: #925b48; background: #784b3d; }
