/* paperVault's visual system uses warm paper, ink, and a single terracotta accent.
   The desktop workspace collapses into a compact collection bar on phones. */
:root {
  --paper: #f7f6f2;
  --surface: #fffefa;
  --sidebar: #f0eee7;
  --ink: #302f28;
  --muted: #77766b;
  --line: #e3e1d8;
  --accent: #ae4f30;
  --accent-hover: #923e24;
  --green: #66755c;
  --radius: 12px;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: wait; opacity: .5; }
a { color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #ae4f3080; outline-offset: 4px; }
button { border: 0; }
svg.icon { width: 19px; height: 19px; flex-shrink: 0; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip-link { position: fixed; left: 12px; top: -100px; padding: 12px; z-index: 20; background: white; }
.skip-link:focus { top: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { padding: 39px 20px 0; background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 25px; font-weight: 750; letter-spacing: -1.1px; padding: 0 9px; margin-bottom: 60px; white-space: nowrap; }
.brand-light { font-weight: 450; }
.brand-period { color: var(--accent); }
.brand-mark { width: 30px; height: 34px; color: var(--accent); }
.brand-mark svg { width: 30px; height: 30px; stroke-width: 1.7; }
.sidebar-section-label { font-size: 10px; font-weight: 650; letter-spacing: 1.7px; color: #868477; padding: 0 15px; margin-bottom: 14px; }
.collection-label { margin-top: 37px; }
.nav-list { display: flex; flex-direction: column; gap: 5px; }
.nav-item { background: transparent; padding: 12px 14px; display: flex; gap: 12px; align-items: center; text-align: left; border-radius: 7px; color: #6c6a5f; font-size: 13px; }
.nav-item:hover { background: #e7e4dc; }
.nav-item.active { background: #e4e2d6; color: #454c3d; font-weight: 650; }
.count { margin-left: auto; font-size: 11px; color: #8b897b; font-variant-numeric: tabular-nums; }
.nav-item.active .count { color: #5b6251; }
.category-dot { width: 8px; height: 8px; border-radius: 3px; margin: 0 5px; }
.identity-dot { background: #939b81; }
.travel-dot { background: #cc967d; }
.photos-dot { background: #91a6b5; }
.other-dot { background: #b3a2b8; }
.sidebar-bottom { margin-top: auto; padding-top: 70px; }
.local-note { padding: 22px 15px; border: 1px solid #dedbd0; border-radius: 10px; }
.local-symbol { margin-bottom: 14px; color: #737a63; }
.local-note strong { display: block; font-family: Georgia, serif; font-size: 16px; font-weight: 400; line-height: 1.4; }
.local-note p { color: var(--muted); line-height: 1.7; font-size: 11px; margin: 9px 0 14px; }
.text-button { padding: 0; background: transparent; text-align: left; font-size: 12px; color: var(--accent); line-height: 1.6; }
.text-button:hover { text-decoration: underline; }
.text-button span { margin-left: 5px; }
.profile { margin-top: 26px; padding: 20px 0 23px; display: flex; gap: 10px; align-items: center; border-top: 1px solid #dfdcd2; }
.profile-avatar { border: 1px solid #dad5c7; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: Georgia, serif; font-size: 12px; color: #6c725c; }
.profile strong { font-size: 11px; font-weight: 600; }
.profile div > span { display: block; margin-top: 4px; color: #888576; font-size: 8px; letter-spacing: 1px; }
.online-dot { display: inline-block; border-radius: 50%; width: 6px; height: 6px; background: #829373; flex-shrink: 0; }
.profile > .online-dot { margin-left: auto; }
.workspace { min-width: 0; }
.topbar { height: 88px; padding: 0 47px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.search-field { display: flex; align-items: center; gap: 12px; flex: 1; color: #858477; }
.search-field input { width: 100%; border: 0; background: transparent; color: var(--ink); font-size: 12px; padding: 12px 0; }
.search-field input::placeholder { color: #8a887d; opacity: 1; }
.search-field input:focus { outline: none; }
.search-field:focus-within { color: var(--accent); }
.search-field kbd { font-family: inherit; border: 1px solid #dedbd2; border-radius: 4px; padding: 2px 7px; font-size: 11px; margin-right: auto; }
.offline-label { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #7b7d6d; white-space: nowrap; }
.icon-button { background: transparent; border-radius: 6px; padding: 7px; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; min-width: 34px; color: #8a877b; }
.icon-button:hover { background: #e8e5dd; color: var(--ink); }
.help-button { margin-left: 4px; }
main { max-width: 1390px; margin: 0 auto; padding: 10px 47px 48px; }
.page-eyebrow { display: flex; align-items: center; gap: 9px; font-size: 9px; letter-spacing: 1.8px; font-weight: 600; color: #8b8878; }
.tiny-line { height: 1px; width: 20px; background: #a8a28c; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 19px 0 32px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(37px, 3.9vw, 58px); line-height: 1.1; font-weight: 400; letter-spacing: -2px; margin: 0; }
h1 > span { color: #7c806a; }
.page-heading p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 16px 0 0; }
.button { min-height: 40px; border-radius: 7px; padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; font-size: 11px; font-weight: 550; transition: background .15s; }
.button.primary { background: var(--accent); color: #fff9ee; box-shadow: 0 2px 3px #6a301019; }
.button.primary:hover { background: var(--accent-hover); }
.page-heading > .button { margin-bottom: 4px; padding: 13px 18px; }
.button.subtle { background: transparent; color: #6e6c60; }
.button.subtle:hover { background: #eae7dd; }
.vault-strip { display: flex; align-items: center; padding: 15px 18px; background: #efeee6; border: 1px solid #e6e3d8; border-radius: 9px; gap: 13px; margin-bottom: 34px; }
.vault-file-icon { color: #858674; }
.vault-file { min-width: 0; }
.vault-file strong { font-size: 11px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.vault-file > span { font-size: 9px; color: #807e6f; display: block; margin-top: 5px; line-height: 1.5; }
.vault-file > span.unsaved { color: var(--accent); }
.database-actions { margin-left: auto; display: flex; gap: 3px; }
.database-actions .button { font-size: 10px; padding: 8px 10px; }
.database-actions .icon { width: 16px; height: 16px; }
.collection-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.collection-title-line { display: flex; gap: 10px; align-items: center; }
h2 { font-size: 17px; font-weight: 550; margin: 0; letter-spacing: -.35px; }
.result-count { font-size: 10px; padding: 3px 7px; border-radius: 5px; color: #878474; background: #ebe9e0; }
.sort-control { display: flex; align-items: center; gap: 6px; color: #8c8879; }
.sort-control .icon { width: 15px; height: 15px; }
.sort-control select { font-size: 10px; background: transparent; border: 0; color: #777466; max-width: 130px; padding: 7px 2px; }
.filter-row { display: flex; gap: 6px; align-items: center; padding: 19px 0 23px; }
.filter-chip { background: transparent; font-size: 10px; color: #8a8677; border-radius: 5px; padding: 7px 10px; display: inline-flex; align-items: center; gap: 5px; min-height: 30px; }
.filter-chip .icon { width: 13px; height: 13px; }
.filter-chip.selected { background: #e9e7dd; color: #5b5c4e; }
.filter-chip:hover { background: #eeece4; }
.search-hint { margin-left: auto; font-family: Georgia, serif; font-style: italic; font-size: 11px; color: #969181; }
.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.document-card { position: relative; min-width: 0; background: var(--surface); border: 1px solid #e6e2d8; border-radius: 10px; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.document-card:hover { box-shadow: 0 7px 18px #302f280b; transform: translateY(-2px); }
.card-open { padding: 0; background: transparent; display: block; text-align: left; width: 100%; }
.card-preview { height: 174px; background: #eaece3; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 22px; }
.card-preview.travel { background: #eee6dd; }
.card-preview.photos { background: #e4eaf0; }
.card-preview.other { background: #ece7ef; }
.card-preview img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px #29231518); }
.pdf-sheet { width: 112px; height: 138px; border-radius: 3px; background: #fffdf8; box-shadow: 0 5px 9px #302f2815; padding: 15px; transform: rotate(-5deg); display: flex; flex-direction: column; justify-content: center; gap: 9px; }
.pdf-sheet > span { color: #a88a73; font-size: 8px; letter-spacing: 2px; font-weight: 700; }
.pdf-sheet > strong { font-family: Georgia, serif; font-weight: 400; font-size: 15px; color: #4e4c42; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-sheet i { height: 3px; background: #e6e1d7; width: 100%; }
.pdf-sheet i:last-of-type { width: 65%; }
.pdf-sheet small { color: #9a9386; font-size: 8px; letter-spacing: 1px; margin-top: 6px; }
.file-badge { position: absolute; top: 11px; left: 11px; background: #fffdf4c9; border: 1px solid #fff8; border-radius: 4px; font-size: 8px; font-weight: 650; padding: 4px 6px; letter-spacing: .6px; color: #756f5e; pointer-events: none; }
.favorite-button { position: absolute; top: 8px; right: 8px; background: #fffdf5dd; color: #a39c87; border-radius: 50%; min-height: 29px; min-width: 29px; padding: 6px; }
.favorite-button .icon { width: 15px; height: 15px; }
.favorite-button[aria-pressed="true"] { color: #a47b38; }
.favorite-button[aria-pressed="true"] .icon { fill: #b99a4b30; }
.card-content { padding: 16px 16px 13px; }
.card-content h3 { margin: 0 0 7px; font-weight: 550; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filename { color: #969082; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-bottom { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.category-tag { border: 1px solid #e0e3d4; border-radius: 4px; padding: 3px 6px; color: #7b826a; background: #f3f5ec; font-size: 8px; letter-spacing: .2px; }
.category-tag.travel { border-color: #eadfd1; background: #fbf3eb; color: #ac8367; }
.category-tag.photos { border-color: #dce4e8; background: #eff3f6; color: #7b92a1; }
.category-tag.other { border-color: #e5ddea; background: #f6f1f9; color: #93809d; }
.card-date { font-size: 8px; color: #9c9688; }
.dropzone { width: 100%; display: flex; align-items: center; gap: 14px; padding: 24px; background: transparent; border: 1px dashed #d6d2c5; border-radius: 9px; margin-top: 23px; text-align: left; transition: background .15s, border-color .15s; }
.dropzone:hover, body.dragging .dropzone { background: #edeade; border-color: var(--accent); }
.drop-icon { width: 38px; height: 38px; border-radius: 50%; background: #eeece2; color: #a19b87; }
.dropzone strong { display: block; font-size: 11px; font-weight: 500; color: #7e7967; margin-bottom: 5px; }
.dropzone small { display: block; font-size: 9px; color: #a19a89; line-height: 1.7; }
.accent { color: var(--accent); }
.drop-plus { margin-left: auto; color: #aaa38f; }
.page-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 27px 0; margin-top: 15px; font-size: 9px; color: #a09b8c; }
.page-footer > span:first-child { display: flex; gap: 6px; align-items: center; }
.page-footer .icon { width: 12px; height: 12px; }
.empty-state { text-align: center; padding: 32px 20px 36px; border: 1px solid var(--line); background: #f4f2eb; border-radius: 10px; }
.empty-art { position: relative; height: 105px; width: 130px; margin: 0 auto 22px; }
.empty-paper { position: absolute; width: 65px; height: 85px; border-radius: 5px; border: 1px solid #d5d5c6; }
.empty-paper.back { left: 20px; top: 3px; background: #dfe3d1; transform: rotate(-15deg); }
.empty-paper.front { left: 48px; top: 17px; background: #fffef8; transform: rotate(9deg); box-shadow: 0 5px 9px #302f2808; padding: 13px; color: #a6ae94; }
.empty-paper.front .icon { height: 26px; width: 26px; }
.empty-paper.front i { display: block; height: 2px; background: #e4e2d7; margin-top: 7px; }
.empty-spark { position: absolute; right: 0; color: #b98058; font-size: 26px; }
.empty-state h3, .no-results h3 { font-family: Georgia, serif; font-size: 24px; font-weight: 400; margin: 0 0 10px; letter-spacing: -.6px; }
.empty-state p, .no-results p { font-size: 12px; color: var(--muted); line-height: 1.8; }
.empty-state .button { margin-top: 9px; }
.sample-button { display: block; margin: 18px auto 0; font-size: 10px; }
.no-results { text-align: center; padding: 50px 10px; }
.no-results > [data-icon] { color: #aaa48e; margin-bottom: 17px; }
.demo-banner { background: #eee7da; display: flex; align-items: center; gap: 9px; padding: 11px 13px; margin: 0 0 18px; border-radius: 6px; color: #877451; font-size: 10px; line-height: 1.7; }
.demo-banner .icon { width: 15px; height: 15px; }
.demo-banner button { margin-left: auto; font-size: 10px; white-space: nowrap; }
/* Dialogs remain scrollable independently, including on short mobile screens. */
.modal { padding: 28px; border: 1px solid #e3ddd0; border-radius: 15px; width: min(540px, calc(100% - 28px)); max-height: 90dvh; color: var(--ink); background: var(--surface); box-shadow: 0 24px 90px #28251a30; }
.modal::backdrop { background: #302d2370; backdrop-filter: blur(4px); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.modal-header h2 { font-family: Georgia, serif; font-weight: 400; font-size: 28px; }
.modal-eyebrow { display: block; letter-spacing: 1.5px; font-size: 9px; color: #99907c; margin-bottom: 9px; }
.modal-description { color: var(--muted); line-height: 1.7; font-size: 12px; margin-bottom: 22px; }
.upload-list { display: flex; flex-direction: column; gap: 13px; }
.upload-entry { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.upload-file-name { display: flex; gap: 7px; align-items: center; font-size: 11px; color: #8c8270; margin-bottom: 12px; overflow-wrap: anywhere; }
.field-label { font-size: 11px; color: #706b5c; display: block; margin: 15px 0 7px; }
.text-input { display: block; width: 100%; padding: 11px 12px; border: 1px solid #dcd7cb; border-radius: 6px; background: #fffefa; color: var(--ink); font-size: 12px; }
.modal-footer { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; }
.modal-footer > span { font-size: 11px; color: var(--muted); }
.form-error { color: #a23f2b; font-size: 12px; line-height: 1.7; }
.form-error:empty { display: none; }
.detail-preview { border-radius: 8px; background: #efede5; height: 255px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 0 0 22px; }
.detail-preview > img { max-width: 100%; max-height: 100%; object-fit: contain; }
.detail-preview > iframe { width: 100%; height: 100%; border: 0; }
.pdf-fallback { height: auto; padding: 12px; font-size: 11px; color: var(--muted); margin-top: -15px; }
.detail-meta { color: #918875; font-size: 10px; line-height: 1.8; margin-top: 16px; overflow-wrap: anywhere; }
.detail-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding-top: 20px; margin-top: 18px; border-top: 1px solid var(--line); }
.detail-actions > .danger { margin-right: auto; color: #ac5c45; }
.help-content { font-size: 12px; line-height: 1.8; color: #7b7464; }
.help-content h3 { color: var(--ink); font-size: 13px; margin: 22px 0 5px; }
.help-content p { margin: 5px 0; }
.help-content code { background: #eeeae0; padding: 1px 4px; border-radius: 3px; }
.full-width { width: 100%; margin-top: 24px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #373b2e; color: #fffdf3; border-radius: 9px; box-shadow: 0 5px 25px #2223; padding: 13px 20px; font-size: 12px; max-width: calc(100% - 32px); z-index: 30; line-height: 1.7; }
.fatal-error { color: #a3402a; background: #f4e4dc; padding: 16px; border-radius: 8px; line-height: 1.8; }
@media (min-width: 1600px) { .document-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1150px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { padding-left: 14px; padding-right: 14px; }
  main { padding-left: 30px; padding-right: 30px; }
  .topbar { padding-left: 30px; padding-right: 30px; }
  .search-hint { display: none; }
  .document-grid { gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-preview { height: 180px; }
  .vault-strip { padding: 12px; gap: 10px; }
  .database-actions .button { padding: 8px; }
  .database-actions .button [data-icon] { display: none; }
  .vault-file strong { max-width: 155px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { padding: 19px 20px 14px; border-right: 0; border-bottom: 1px solid var(--line); display: block; }
  .brand { margin-bottom: 19px; font-size: 24px; padding: 0; }
  .brand-mark, .brand-mark .icon { width: 25px; height: 25px; }
  .sidebar-section-label, .sidebar-bottom { display: none; }
  .nav-list { flex-direction: row; flex-wrap: wrap; gap: 5px; display: inline-flex; }
  .nav-item { font-size: 10px; padding: 8px 9px; gap: 5px; min-height: 34px; }
  .nav-item .icon { width: 14px; height: 14px; }
  .nav-item .count { display: none; }
  .category-dot { width: 6px; height: 6px; margin: 0 2px; }
  .topbar { height: 65px; padding: 0 23px; gap: 10px; }
  .search-field input { font-size: 12px; }
  .offline-label, .search-field kbd { display: none; }
  .help-button { margin: 0; }
  main { padding: 10px 23px 32px; }
  .page-eyebrow { font-size: 8px; letter-spacing: 1.3px; }
  h1 { font-size: 44px; letter-spacing: -1.8px; }
  .page-heading { margin: 20px 0 23px; display: block; }
  .page-heading p { font-size: 11px; max-width: 290px; }
  .page-heading > .button { margin: 20px 0 0; padding: 11px 16px; }
  .vault-strip { flex-wrap: wrap; margin-bottom: 26px; gap: 9px; }
  .vault-file { flex: 1; }
  .vault-file strong { max-width: 230px; }
  .database-actions { width: 100%; border-top: 1px solid #e0dccc; padding-top: 7px; justify-content: flex-end; }
  .database-actions .button [data-icon] { display: inline-flex; }
  .database-actions .button { padding: 7px 9px; }
  .database-actions .icon-button { margin-left: auto; }
  .collection-heading h2 { font-size: 16px; }
  .filter-row { padding-bottom: 17px; padding-top: 15px; }
  .document-grid { gap: 12px; }
  .card-preview { height: 145px; padding: 20px 12px; }
  .card-content { padding: 13px 11px 12px; }
  .card-content h3 { font-size: 11px; }
  .filename { font-size: 8px; }
  .card-bottom { flex-wrap: wrap; gap: 7px; margin-top: 12px; }
  .card-date { font-size: 7px; }
  .pdf-sheet { width: 80px; height: 110px; padding: 10px; gap: 7px; }
  .pdf-sheet > strong { font-size: 12px; }
  .pdf-sheet > span { font-size: 6px; }
  .dropzone { padding: 19px 12px; gap: 10px; margin-top: 18px; }
  .drop-icon { width: 27px; height: 27px; flex-shrink: 0; }
  .drop-icon .icon { width: 16px; height: 16px; }
  .dropzone strong { font-size: 10px; }
  .dropzone small { font-size: 8px; }
  .drop-plus { display: none; }
  .page-footer { font-size: 8px; padding-top: 20px; flex-wrap: wrap; }
  .demo-banner { flex-wrap: wrap; font-size: 9px; gap: 6px; }
  .demo-banner button { margin-left: 20px; }
  .modal { padding: 22px; }
  .empty-state { padding: 30px 10px; }
  .empty-state h3 { font-size: 23px; }
  .empty-state p { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

/* Keep supporting copy and controls comfortable to read without changing headings. */
.nav-item,
.local-note p,
.text-button,
.search-field input,
.offline-label,
.button,
.vault-file > span,
.database-actions .button,
.sort-control select,
.filter-chip,
.empty-state p,
.no-results p,
.modal-description,
.field-label,
.text-input,
.form-error,
.help-content,
.toast {
  font-size: 14px;
}

.sidebar-section-label { font-size: 12px; }
.page-heading p { font-size: 16px; }
.offline-label { font-size: 16px; }
.empty-state p { font-size: 16px; }
.vault-file strong { font-size: 16px; }

.count,
.vault-file strong,
.result-count,
.dropzone strong,
.upload-file-name,
.modal-footer > span,
.pdf-fallback,
.detail-meta {
  font-size: 12px;
}

.filename,
.category-tag,
.card-date,
.dropzone small,
.page-footer,
.demo-banner,
.demo-banner button,
.sample-button {
  font-size: 11px;
}

.sample-button { font-size: 14px; }
