@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Libre+Caslon+Text:ital,wght@0,400;1,400&display=swap');

:root {
  --paper: #f4f0e7;
  --paper-deep: #eae4d8;
  --card: #fbf9f4;
  --ink: #262820;
  --muted: #77776d;
  --faint: #a09d91;
  --line: #ded8cc;
  --green: #405f4b;
  --green-dark: #30493a;
  --green-soft: #dfe8dc;
  --clay: #9b5d45;
  --gold: #a67d3d;
  --shadow: 0 18px 55px rgba(52, 46, 35, 0.1);
  --serif: "Libre Caslon Text", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  background:
    radial-gradient(circle at 75% -10%, rgba(216, 201, 166, .2), transparent 35%),
    var(--paper);
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 264px; padding: 32px 22px 24px;
  background: rgba(247, 244, 237, .85); border-right: 1px solid rgba(96, 90, 76, .13);
  backdrop-filter: blur(18px); display: flex; flex-direction: column; z-index: 10;
}

.wordmark { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 18px; }
.wordmark-mark { display: grid; place-items: center; width: 31px; height: 36px; border: 1px solid var(--ink); border-radius: 50% 50% 45% 45%; font-size: 18px; font-style: italic; }
.side-nav { display: grid; gap: 5px; margin-top: 54px; }
.nav-item { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #67675e; cursor: pointer; text-align: left; }
.nav-item:hover { background: rgba(77, 93, 72, .07); color: var(--ink); }
.nav-item.is-active { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; }
.nav-count { margin-left: auto; color: var(--faint); font-size: 12px; }
.sidebar-section { margin-top: 34px; }
.sidebar-heading { padding: 0 10px 12px 12px; display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.sidebar-spacer { flex: 1; }
.tag-nav { display: grid; gap: 2px; }
.tag-nav-button { border: 0; background: transparent; display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 13px; }
.tag-nav-button:hover, .tag-nav-button.is-active { color: var(--ink); background: rgba(255,255,255,.45); }
.tag-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tag-color, var(--green)); }
.storage-note { margin: 16px 10px 0; border-top: 1px solid var(--line); padding-top: 18px; display: flex; gap: 10px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.storage-note strong { color: #5d5e55; font-weight: 500; }
.status-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #5e9167; box-shadow: 0 0 0 4px rgba(94,145,103,.12); }

.main-content { margin-left: 264px; padding: 72px clamp(38px, 6vw, 96px) 100px; max-width: 1500px; }
.mobile-header { display: none; }
.library-header { display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.eyebrow { margin: 0 0 12px; color: var(--clay); font-size: 11px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-family: var(--serif); font-size: clamp(38px, 5vw, 64px); font-weight: 400; letter-spacing: -.045em; line-height: 1.04; }
.header-subtitle { color: var(--muted); margin: 14px 0 0; font-size: 14px; }
.primary-button, .secondary-button, .save-button { border: 0; border-radius: 10px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.primary-button { padding: 13px 18px; background: var(--green); color: white; box-shadow: 0 8px 18px rgba(48,73,58,.18); }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button svg, .secondary-button svg { width: 17px; height: 17px; }
.secondary-button { padding: 11px 15px; border: 1px solid var(--line); background: #fffdf8; color: #4f5049; }
.secondary-button:hover { border-color: #aaa598; }

.toolbar { position: relative; display: flex; gap: 10px; margin-top: 46px; }
.search-field { flex: 1; position: relative; display: flex; align-items: center; }
.search-field svg { position: absolute; left: 17px; color: #8c8b81; width: 18px; }
.search-field input { width: 100%; height: 49px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,253,248,.75); padding: 0 70px 0 47px; color: var(--ink); }
.search-field input::placeholder { color: #9c9a90; }
.search-field kbd { position: absolute; right: 13px; border: 1px solid #ded9cd; background: #f6f2e9; border-radius: 6px; padding: 4px 7px; color: #99968c; font-family: var(--sans); font-size: 11px; }
.filter-button { height: 49px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,253,248,.75); padding: 0 16px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.filter-count { min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 9px; background: var(--green); color: white; font-size: 10px; }
.filter-popover { position: absolute; right: 0; top: 57px; width: 190px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf8; box-shadow: var(--shadow); z-index: 7; }
.filter-popover label { display: flex; align-items: center; gap: 9px; padding: 7px 2px; color: #54554d; font-size: 13px; }
.popover-label { margin: 0 0 5px; color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }

.active-context { margin: 18px 0 -5px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--green-dark); }
.active-context button { border: 0; padding: 2px; background: transparent; color: var(--clay); text-decoration: underline; cursor: pointer; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 25px; align-items: start; }
.entry-card { position: relative; min-height: 245px; display: flex; flex-direction: column; background: var(--card); border: 1px solid rgba(107, 100, 85, .16); border-radius: 14px; padding: 25px 24px 20px; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; overflow: hidden; }
.entry-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 55%, rgba(188,168,126,.06)); pointer-events: none; }
.entry-card:hover { transform: translateY(-3px); box-shadow: 0 13px 35px rgba(55, 49, 39, .08); border-color: rgba(107, 100, 85, .26); }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.kind-label { color: var(--clay); font-size: 9px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.favorite-button { position: relative; z-index: 2; width: 30px; height: 30px; margin: -7px -8px 0 0; display: grid; place-items: center; border: 0; background: transparent; color: #aaa79e; cursor: pointer; }
.favorite-button svg { width: 17px; height: 17px; }
.favorite-button.is-favorite { color: var(--clay); }
.favorite-button.is-favorite svg { fill: currentColor; }
.card-body { margin: 0; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; font-family: var(--serif); font-size: 17px; line-height: 1.62; letter-spacing: -.012em; }
.card-footer { margin-top: auto; padding-top: 24px; }
.card-attribution { margin: 0 0 13px; font-size: 11px; color: var(--muted); }
.card-attribution strong { color: #4d4e47; font-weight: 600; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-chip { display: inline-flex; align-items: center; height: 23px; padding: 0 9px; border-radius: 12px; background: #ebe7de; color: #77756c; font-size: 9px; letter-spacing: .02em; }
.empty-state { padding: 100px 20px; text-align: center; }
.empty-mark { font-family: var(--serif); font-size: 80px; height: 70px; color: #c5b69a; }
.empty-state h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 27px; }
.empty-state p { color: var(--muted); font-size: 13px; margin: 10px auto 20px; max-width: 340px; line-height: 1.6; }

.floating-add, .mobile-nav { display: none; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fffdf8; cursor: pointer; }
.icon-button:hover { border-color: #aaa598; }
.icon-button.small { width: 26px; height: 26px; border: 0; background: transparent; }
.icon-button.small svg { width: 15px; height: 15px; }

dialog { border: 0; padding: 0; background: transparent; color: var(--ink); }
dialog::backdrop { background: rgba(35, 35, 29, .38); backdrop-filter: blur(3px); }
.sheet-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 30px); border-radius: 19px; box-shadow: 0 30px 100px rgba(30,30,25,.25); }
.sheet { background: var(--paper); padding: 0 34px 34px; max-height: calc(100vh - 30px); overflow-y: auto; }
.sheet-header { position: sticky; top: 0; z-index: 4; margin: 0 -34px; padding: 22px 34px 18px; background: rgba(244,240,231,.94); backdrop-filter: blur(12px); display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; text-align: center; border-bottom: 1px solid rgba(110,100,84,.1); }
.sheet-header h2, .settings-header h2 { margin: 2px 0 0; font-family: var(--serif); font-size: 22px; font-weight: 400; }
.sheet-header .eyebrow, .settings-header .eyebrow { margin: 0; font-size: 8px; }
.text-button { border: 0; background: transparent; padding: 8px 0; text-align: left; cursor: pointer; font-size: 13px; color: var(--muted); }
.save-button { padding: 9px 14px; background: var(--green); color: white; }
.capture-tabs { margin: 24px auto; padding: 4px; background: #e8e3d9; border-radius: 11px; display: grid; grid-template-columns: repeat(3, 1fr); }
.capture-tab { border: 0; background: transparent; border-radius: 8px; padding: 10px; display: flex; gap: 7px; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); font-size: 12px; }
.capture-tab svg { width: 16px; height: 16px; }
.capture-tab.is-active { color: var(--green-dark); background: #fffdf8; box-shadow: 0 2px 7px rgba(50,45,35,.08); }
.field-group { margin-top: 19px; }
.field-group label, .label-row > label { display: block; margin-bottom: 8px; color: #4d4e47; font-size: 11px; font-weight: 600; }
.field-group label span { color: var(--faint); font-weight: 400; }
.field-group input, .field-group textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fcfaf5; color: var(--ink); padding: 13px 14px; transition: border-color .15s, box-shadow .15s; }
.field-group textarea { resize: vertical; min-height: 175px; font-family: var(--serif); font-size: 17px; line-height: 1.62; }
.field-group input:focus, .field-group textarea:focus { outline: none; border-color: #8ca08c; box-shadow: 0 0 0 3px rgba(64,95,75,.09); }
.field-meta { display: flex; justify-content: space-between; padding: 7px 2px 0; color: var(--faint); font-size: 10px; }
.two-column-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.type-options { display: flex; gap: 7px; }
.type-option { flex: 1; border: 1px solid var(--line); border-radius: 9px; background: #fcfaf5; padding: 10px 5px; cursor: pointer; font-size: 11px; color: var(--muted); }
.type-option.is-selected { border-color: #7f9885; background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.label-row { display: flex; justify-content: space-between; align-items: center; }
.auto-label { display: flex; align-items: center; gap: 4px; color: var(--gold); font-size: 9px; }
.auto-label svg { width: 13px; height: 13px; }
.tag-editor { min-height: 48px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fcfaf5; padding: 7px 10px; }
.tag-editor:focus-within { border-color: #8ca08c; box-shadow: 0 0 0 3px rgba(64,95,75,.09); }
.tag-editor input { flex: 1; min-width: 110px; width: auto; border: 0; padding: 5px; background: transparent; box-shadow: none !important; }
.selected-tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 13px; background: var(--green-soft); color: var(--green-dark); padding: 5px 8px 5px 10px; font-size: 10px; }
.selected-tag button { width: 13px; height: 13px; border: 0; padding: 0; background: transparent; cursor: pointer; color: inherit; }
.selected-tag svg { width: 11px; height: 11px; }
.tag-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggestion-chip { border: 1px dashed #c9c0ae; background: transparent; color: #887c67; border-radius: 13px; padding: 4px 9px; cursor: pointer; font-size: 9px; }
.favorite-toggle { margin-top: 24px; padding: 16px 2px 2px; border-top: 1px solid var(--line); display: flex !important; align-items: center; justify-content: space-between; cursor: pointer; }
.favorite-toggle strong, .favorite-toggle small { display: block; }
.favorite-toggle strong { font-size: 11px; }
.favorite-toggle small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.favorite-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { position: relative; width: 38px; height: 22px; border-radius: 12px; background: #d7d2c8; transition: .2s; }
.toggle-ui::after { content: ""; position: absolute; width: 18px; height: 18px; top: 2px; left: 2px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.favorite-toggle input:checked + .toggle-ui { background: var(--green); }
.favorite-toggle input:checked + .toggle-ui::after { transform: translateX(16px); }
.photo-panel { border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: rgba(255, 253, 248, .42); }
.photo-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin: 0 1px 13px; }
.photo-heading strong, .photo-heading span { display: block; }
.photo-heading strong { margin-bottom: 4px; color: #464840; font-size: 11px; }
.photo-heading > div > span { max-width: 470px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.private-pill { flex: 0 0 auto; display: inline-flex !important; align-items: center; gap: 4px; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); padding: 5px 8px; font-size: 8px !important; font-weight: 600; }
.private-pill svg { width: 11px; height: 11px; }
.photo-dropzone { width: 100%; min-height: 112px; border: 1px dashed #b9b09f; background: rgba(255,253,248,.65); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 13px; cursor: pointer; color: #57584f; }
.photo-dropzone > span:last-child { display: grid; gap: 5px; text-align: left; }
.photo-dropzone small { color: var(--faint); font-size: 10px; }
.photo-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.photo-pages { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.photo-page { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 78px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; background: #fcfaf5; }
.photo-page img { width: 62px; height: 62px; object-fit: cover; border-radius: 7px; background: #e8e3d9; }
.photo-page-copy { min-width: 0; }
.photo-page-label { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.photo-page-label strong { color: #4b4c45; font-size: 10px; }
.page-status { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 8px; }
.page-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #aaa69c; }
.photo-page[data-status="processing"] .page-status { color: var(--gold); }
.photo-page[data-status="processing"] .page-status::before { background: var(--gold); animation: pulse 1s infinite alternate; }
.photo-page[data-status="done"] .page-status { color: var(--green); }
.photo-page[data-status="done"] .page-status::before { background: var(--green); }
.photo-page[data-status="error"] .page-status { color: var(--clay); }
.photo-page[data-status="error"] .page-status::before { background: var(--clay); }
.photo-page-detail { display: block; color: var(--faint); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-page-progress { width: 100%; height: 3px; margin-top: 7px; display: block; border: 0; border-radius: 2px; overflow: hidden; background: #e8e2d7; }
.photo-page-progress::-webkit-progress-bar { background: #e8e2d7; }
.photo-page-progress::-webkit-progress-value { background: var(--gold); }
.photo-page-progress::-moz-progress-bar { background: var(--gold); }
.photo-page-controls { display: grid; grid-template-columns: repeat(3, 27px); gap: 2px; }
.page-control { width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #969288; cursor: pointer; }
.page-control:hover:not(:disabled) { background: #eee9df; color: var(--ink); }
.page-control:disabled { opacity: .22; cursor: default; }
.page-control.remove { color: #a06a57; }
.page-control svg { width: 13px; height: 13px; }
.photo-actions { display: flex; justify-content: space-between; gap: 9px; margin-top: 11px; }
.photo-actions .secondary-button, .photo-actions .primary-button { min-height: 42px; }
.photo-actions .primary-button { min-width: 168px; }
.photo-actions button:disabled { cursor: wait; opacity: .55; transform: none; }
.ocr-progress { margin-top: 13px; padding: 11px 12px; border-radius: 9px; background: #ebe6dc; }
.ocr-progress > div { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 7px; color: #6b695f; font-size: 8px; }
.ocr-progress progress { width: 100%; height: 5px; display: block; border: 0; border-radius: 3px; overflow: hidden; background: #d9d2c6; }
.ocr-progress progress::-webkit-progress-bar { background: #d9d2c6; }
.ocr-progress progress::-webkit-progress-value { background: var(--green); transition: width .2s; }
.ocr-progress progress::-moz-progress-bar { background: var(--green); }
.photo-guidance { display: flex; align-items: flex-start; gap: 5px; margin: 11px 2px 0; color: var(--faint); font-size: 8px; line-height: 1.5; }
.photo-guidance svg { flex: 0 0 auto; width: 12px; height: 12px; color: var(--gold); }
@keyframes pulse { to { opacity: .28; } }

.detail-dialog { width: min(670px, calc(100vw - 32px)); border-radius: 18px; box-shadow: var(--shadow); }
.detail-sheet { background: var(--card); }
.detail-actions { display: flex; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.detail-actions > div { display: flex; gap: 7px; }
.detail-content { padding: 56px clamp(30px, 8vw, 75px) 48px; }
.detail-content blockquote { margin: 22px 0 27px; white-space: pre-line; font-family: var(--serif); font-size: clamp(23px, 3.4vw, 33px); line-height: 1.53; letter-spacing: -.025em; }
.detail-attribution { margin: 0; color: var(--muted); font-size: 13px; }
.detail-attribution strong { color: var(--ink); }
.detail-content .card-tags { margin-top: 28px; }
.detail-date { margin: 20px 0 0; color: var(--faint); font-size: 10px; }
.detail-footer { border-top: 1px solid var(--line); padding: 16px 20px; text-align: right; }
.danger-button { border: 0; background: transparent; color: #9b5847; padding: 8px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 11px; }
.danger-button svg { width: 15px; height: 15px; }

.settings-dialog { width: min(680px, calc(100vw - 32px)); border-radius: 18px; box-shadow: var(--shadow); }
.settings-sheet { padding: 30px; background: var(--paper); }
.settings-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 25px; }
.storage-card { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 13px; padding: 17px; }
.storage-card.featured { border-color: #bdcbb9; background: rgba(223,232,220,.55); }
.storage-icon { width: 43px; height: 43px; display: grid; place-items: center; color: var(--green); border-radius: 50%; background: white; }
.storage-icon.muted { flex: 0 0 auto; background: #e7e2d8; color: #8b887f; }
.storage-card h3, .settings-copy h3 { margin: 0 0 5px; font-size: 13px; }
.storage-card p, .settings-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.connected-pill, .roadmap-pill { padding: 5px 9px; border-radius: 11px; font-size: 9px; }
.connected-pill { background: #d3e4d2; color: #46674d; }
.roadmap-pill { background: #e7e2d8; color: #77736b; }
.settings-section { margin-top: 18px; padding: 20px 2px 2px; border-top: 1px solid var(--line); }
.settings-section > .secondary-button { margin-top: 14px; }
.support-note { min-height: 15px; margin: 8px 0 0; color: var(--faint); font-size: 9px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.cloud-section { display: flex; align-items: center; gap: 14px; }
.cloud-section .settings-copy { flex: 1; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 32px; transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 10px; background: #282b25; color: white; box-shadow: var(--shadow); font-size: 11px; opacity: 0; visibility: hidden; transition: .2s; }
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { padding-bottom: 74px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 0 18px 95px; }
  .mobile-header { height: 70px; padding: max(13px, env(safe-area-inset-top)) 1px 8px; display: flex; align-items: center; justify-content: space-between; }
  .mobile-header .wordmark { font-size: 16px; }
  .mobile-header .wordmark-mark { width: 27px; height: 31px; font-size: 16px; }
  .avatar-button { width: 34px; height: 34px; border: 1px solid #c5beb0; border-radius: 50%; background: #e3dbcd; color: #625e55; font-size: 11px; }
  .library-header { margin-top: 28px; }
  .library-header h1 { font-size: 39px; max-width: 330px; }
  .header-subtitle { max-width: 320px; font-size: 12px; line-height: 1.55; }
  .desktop-add { display: none; }
  .toolbar { margin-top: 30px; }
  .search-field kbd { display: none; }
  .search-field input { padding-right: 15px; }
  .filter-button { width: 49px; padding: 0; justify-content: center; font-size: 0; }
  .filter-count { position: absolute; margin: -34px 0 0 34px; }
  .collection-grid { grid-template-columns: 1fr; gap: 13px; margin-top: 20px; }
  .entry-card { min-height: 230px; padding: 24px 22px 19px; }
  .card-body { font-size: 17px; -webkit-line-clamp: 5; }
  .floating-add { position: fixed; z-index: 23; bottom: calc(43px + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 50%); width: 54px; height: 54px; border: 4px solid var(--paper); border-radius: 50%; background: var(--green); color: white; display: grid; place-items: center; box-shadow: 0 6px 17px rgba(48,73,58,.3); cursor: pointer; }
  .floating-add svg { width: 23px; height: 23px; }
  .mobile-nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(68px + env(safe-area-inset-bottom)); padding: 8px 10px env(safe-area-inset-bottom); display: grid; grid-template-columns: 1fr 1fr 62px 1fr 1fr; align-items: center; background: rgba(248,245,238,.95); border-top: 1px solid var(--line); backdrop-filter: blur(16px); }
  .mobile-nav-item { border: 0; background: transparent; color: #85837a; display: grid; justify-items: center; gap: 3px; cursor: pointer; font-size: 8px; }
  .mobile-nav-item svg { width: 19px; height: 19px; }
  .mobile-nav-item.is-active { color: var(--green-dark); }
  .sheet-dialog, .detail-dialog, .settings-dialog { width: 100vw; max-width: none; max-height: calc(100vh - 16px); margin: 16px 0 0; border-radius: 20px 20px 0 0; }
  .sheet-dialog[open], .detail-dialog[open], .settings-dialog[open] { position: fixed; top: 0; bottom: 0; }
  .sheet { padding: 0 18px 40px; max-height: calc(100vh - 16px); }
  .sheet-header { margin: 0 -18px; padding: 17px 18px 14px; grid-template-columns: 66px 1fr 66px; }
  .sheet-header h2 { font-size: 18px; }
  .capture-tabs { margin: 18px auto; }
  .photo-panel { margin: 0 -1px; padding: 13px 11px; }
  .photo-heading { display: block; }
  .private-pill { width: max-content; margin-top: 8px; }
  .photo-page { grid-template-columns: 55px minmax(0, 1fr) auto; gap: 9px; }
  .photo-page img { width: 55px; height: 61px; }
  .photo-page-controls { grid-template-columns: repeat(3, 25px); }
  .page-control { width: 25px; height: 25px; }
  .photo-actions .secondary-button { padding-inline: 11px; }
  .photo-actions .primary-button { min-width: 0; flex: 1; }
  .two-column-fields { grid-template-columns: 1fr; gap: 0; }
  .field-group textarea { min-height: 155px; }
  .detail-dialog { max-height: none; }
  .detail-sheet { min-height: calc(100vh - 16px); display: flex; flex-direction: column; }
  .detail-content { padding: 45px 26px; flex: 1; }
  .detail-content blockquote { font-size: 25px; }
  .settings-sheet { min-height: calc(100vh - 16px); padding: 24px 20px; overflow-y: auto; }
  .storage-card { grid-template-columns: 42px 1fr; }
  .storage-card .connected-pill { grid-column: 2; width: min-content; }
  .toast { bottom: 91px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
