:root {
  color-scheme: light;
  --bg: #f5f6f2;
  --soft: #f1f3ee;
  --card: #ffffff;
  --hi: #e9eee7;
  --border: #dce2d9;
  --text: #24362e;
  --muted: #647168;
  --accent: #285542;
  --deep: #e7eee5;
  --amber: #925522;
  --danger: #a13e31;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .55; cursor: default; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #173e2e; }
svg { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, .upload-actions label:focus-within, .add-photos:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: #d4e4d1; color: #193b2a; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.full { width: 100%; }
.mono { font-family: ui-monospace, monospace; }
.warning-text { color: var(--amber); }
.context-label, .eyebrow { display: block; margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 12px; left: 12px; z-index: 200; padding: 12px 18px; background: white; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; padding: 32px 20px 20px; display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid var(--border); background: #eef1e9; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 27px/1.1 var(--serif); letter-spacing: -.8px; }
.brand:hover { color: var(--text); }
.brand-symbol { display: grid; place-items: center; color: var(--accent); flex-shrink: 0; }
.brand-symbol svg { width: 28px; height: 32px; stroke-width: 1.5; }
.brand-sub { display: block; margin-top: 8px; color: var(--muted); font: 400 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
.primary-nav { margin-top: 38px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; margin: 3px 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); text-align: left; font-size: 14px; overflow-wrap: anywhere; }
.nav-item [data-icon] { display: flex; align-items: center; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { background: #e4e9df; color: var(--text); }
.nav-item.active { background: #dce7d8; color: #204b37; font-weight: 600; }
.nav-count { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.workspace { margin: 26px 10px 12px; padding-top: 22px; border-top: 1px solid #d4ddcf; }
.workspace strong { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.workspace small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
#books-nav .nav-item { font-size: 13px; }
#books-nav .book-item.active { background: transparent; }
.manage-books { font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.sidebar-bottom { margin-top: auto; padding-top: 30px; }
.sidebar-bottom p { margin: 12px 12px 0; color: var(--muted); font-size: 12px; }
.main-shell { margin-left: 232px; }
.topbar { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 40px; border-bottom: 1px solid var(--border); }
.breadcrumb { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.breadcrumb strong { color: var(--text); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 22px; min-width: 0; }
.connection { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12px; }
.connection i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.connection.offline { color: var(--danger); }
.connection.offline i { background: var(--danger); }
.profile { display: flex; align-items: center; gap: 9px; padding: 4px 0; border: 0; background: transparent; font-size: 14px; }
.profile > span:first-child { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e1e8dc; color: var(--accent); font-size: 14px; }
.profile svg { width: 14px; height: 14px; }
.mobile-brand, .mobile-nav, .mobile-copy { display: none; }
main { max-width: 1480px; margin: auto; padding: 34px 40px 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0 0 7px; font: 500 40px/1.1 var(--serif); letter-spacing: -1.3px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid #cbd4c8; border-radius: 6px; background: white; color: var(--text); font-size: 14px; font-weight: 550; line-height: 1.45; text-decoration: none; text-align: center; white-space: normal; }
.button svg { width: 18px; height: 18px; }
.button:hover { background: var(--soft); border-color: #98ad97; color: var(--text); }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover { background: #1d4332; border-color: #1d4332; color: white; }
.button.danger { color: var(--danger); border-color: #c99489; }
.small-button { min-height: 38px; padding: 8px 12px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0 0 24px; padding: 17px 0 20px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat { min-width: 0; padding-left: 22px; border-left: 1px solid var(--border); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat strong { display: block; margin-bottom: 3px; font-size: 24px; font-weight: 550; line-height: 1.2; letter-spacing: -.5px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat > span { display: block; color: var(--muted); font-size: 13px; }
.stat:nth-child(3) strong { font-size: 22px; }
.inventory-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; }
.inventory-heading h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 17px; font-weight: 550; }
.inventory-heading h2 > span { color: var(--muted); font-size: 13px; font-weight: 400; }
.toolbar { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(120px, 195px) 150px auto; gap: 10px; align-items: center; }
.search { position: relative; display: flex; align-items: center; min-width: 0; }
.search > span { position: absolute; left: 13px; display: flex; color: var(--muted); pointer-events: none; }
.search svg { width: 18px; height: 18px; }
.search input { width: 100%; margin-top: 0; padding-left: 40px; }
.toolbar > select { min-width: 0; font-size: 13px; }
.filters { display: flex; gap: 19px; max-width: 100%; margin: 16px 0 22px; border-bottom: 1px solid var(--border); overflow-x: auto; overscroll-behavior-x: contain; }
.filters, .detail-tabs, .gallery-thumbs { scrollbar-width: none; }
.filters::-webkit-scrollbar, .detail-tabs::-webkit-scrollbar, .gallery-thumbs::-webkit-scrollbar { display: none; }
.filter { position: relative; min-height: 42px; padding: 7px 2px 11px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.filter:hover { color: var(--text); }
.filter.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.layout-toggle { display: flex; gap: 2px; padding: 3px; border: 1px solid #cbd4c8; border-radius: 6px; background: white; }
.layout-toggle button { display: grid; place-items: center; width: 37px; height: 36px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--muted); }
.layout-toggle button.active { background: var(--deep); color: var(--accent); }
.layout-toggle svg { width: 18px; height: 18px; }
.inventory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.piece-card { display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: white; text-align: left; min-width: 0; transition: border-color .15s; }
.piece-card:hover { border-color: #91a38a; }
.piece-photo { position: relative; aspect-ratio: 4/3; background: #e9ece5; overflow: hidden; }
.piece-photo > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { display: grid; place-items: center; width: 100%; height: 100%; min-height: 100px; color: #81917e; }
.photo-placeholder svg { width: 42px; height: 42px; stroke-width: 1; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 4px; background: #f7f7f3; color: #4c574e; font-size: 12px; line-height: 1.3; }
.badge i { display: none; }
.piece-photo > .badge { position: absolute; top: 12px; left: 12px; }
.badge-draft { background: #f5ecda; color: #79531f; }
.badge-ready { background: #e9efdf; color: #405b2c; }
.badge-listed { background: #e4eee8; color: #255140; }
.badge-sold { background: #f4f4f0; color: #515c52; }
.photo-count { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 4px; background: #fffffff2; color: #3c4b3e; font-size: 12px; }
.photo-count svg { width: 14px; height: 14px; }
.piece-body { padding: 17px 18px 0; }
.piece-brand { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.piece-brand > span { color: var(--muted); text-align: right; font-size: 12px; }
.piece-body h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 44px; margin: 8px 0; font-size: 17px; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.piece-ref { margin: 0 0 12px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.piece-ref > span { font-family: ui-monospace, monospace; }
.piece-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; margin: 12px 0 16px; }
.piece-price strong { display: block; font-size: 24px; font-weight: 550; letter-spacing: -.6px; line-height: 1.3; }
.piece-price strong > span { color: var(--muted); font-weight: 400; }
.piece-price small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.piece-price > .muted { font-size: 14px; }
.card-arrow { display: flex; align-items: center; color: var(--accent); }
.card-arrow svg { width: 20px; height: 20px; }
.piece-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #e6eae2; color: var(--muted); font-size: 12px; }
.piece-meta > span { min-width: 0; max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece-meta > span:first-child { display: flex; gap: 5px; align-items: center; }
.piece-meta > span:last-child { max-width: 42%; }
.piece-meta svg { width: 13px; height: 13px; }
.ai-progress { display: flex; align-items: center; gap: 5px; color: var(--accent); }
.ai-progress .spinner { width: 12px; height: 12px; }
.publication-status { display: flex; flex-wrap: wrap; gap: 6px; min-height: 23px; }
.publication-badge { padding: 2px 7px; border: 1px solid; border-radius: 3px; font-size: 12px; line-height: 1.4; }
.publication-badge.ebay { border-color: #c9d6e2; background: #eff4f8; color: #375770; }
.publication-badge.leboncoin { border-color: #e3d0bd; background: #faf1e7; color: #8a4c27; }
.unpublished { color: var(--muted); font-size: 12px; }
.empty { grid-column: 1/-1; display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 270px; padding: 35px 20px; text-align: center; }
.empty > svg { width: 34px; height: 34px; margin-bottom: 18px; color: #75886e; stroke-width: 1.2; }
.empty h3 { margin: 0 0 9px; font-size: 21px; font-weight: 550; }
.empty p { max-width: 36ch; margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.empty.compact { min-height: 200px; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid #ccd9c8; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 42px; padding: 22px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.footer-links, .legal-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; }
.footer-links a, .legal-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover, .legal-links a:hover { text-decoration: underline; }
input, textarea, select { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #cbd4c8; border-radius: 6px; background: white; color: var(--text); font-size: 15px; line-height: 1.45; }
input, select { min-height: 44px; }
input::placeholder, textarea::placeholder { color: #7b847b; font-size: 14px; opacity: 1; }
input:focus, textarea:focus, select:focus { border-color: #65815f; }
textarea { resize: vertical; line-height: 1.65; }
label { display: block; min-width: 0; color: #3a493d; font-size: 14px; }
label > input, label > select, label > textarea { margin-top: 7px; }
input[type="checkbox"] { width: 17px; height: 17px; min-height: 0; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
label .optional { color: var(--muted); font-size: 12px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.span-all { grid-column: 1/-1; }
.notice { display: flex; align-items: flex-start; gap: 10px; margin: 22px 0; padding: 12px 14px; border-left: 3px solid #a1b794; background: var(--soft); color: #4e5f4c; font-size: 13px; line-height: 1.65; }
.notice > svg { width: 18px; height: 18px; margin-top: 2px; }
.notice p { margin: 0; }
.notice.warning { border-color: #b8894d; background: #faf2e5; color: #785022; }
.publication-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 11px 0; font-size: 14px; line-height: 1.55; cursor: pointer; }
.publication-check input { margin-top: 3px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: white; flex-shrink: 0; }
.icon-button:hover { border-color: #8fa286; background: var(--soft); }
.text-button { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 4px 0; border: 0; background: transparent; color: var(--accent); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.text-button svg { width: 14px; height: 14px; }
label > .text-button { float: right; min-height: 24px; padding: 0; }
dialog { width: min(720px, calc(100vw - 40px)); max-width: calc(100vw - 40px); max-height: calc(100dvh - 48px); padding: 30px; border: 1px solid var(--border); border-radius: 10px; background: white; color: var(--text); overscroll-behavior: contain; box-shadow: 0 18px 60px #20302626; }
dialog::backdrop { background: #20302666; }
.small-dialog { width: 460px; }
.small-dialog p { margin: 20px 0; font-size: 14px; line-height: 1.65; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.dialog-heading h2 { margin: 0; font: 500 31px/1.15 var(--serif); letter-spacing: -.7px; }
.small-dialog .dialog-heading h2 { font-size: 28px; }
.new-dialog { width: 760px; }
.new-dialog > form > p { max-width: 56ch; font-size: 14px; }
.upload-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 16px; }
.upload-actions > label { position: relative; cursor: pointer; }
.new-previews { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.new-preview { position: relative; height: 128px; border-radius: 6px; overflow: hidden; }
.new-preview > img { width: 100%; height: 100%; object-fit: cover; }
.new-preview > button { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 4px; background: white; }
.new-preview > button svg { width: 18px; height: 18px; }
.new-preview > span { position: absolute; bottom: 0; left: 0; right: 0; padding: 4px 8px; background: #ffffffeb; font-size: 12px; }
.upload-placeholder { grid-column: 1/-1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 115px; border: 1px dashed #bccab4; border-radius: 6px; background: #f7f8f4; color: var(--muted); font-size: 14px; }
.upload-placeholder svg { width: 26px; height: 26px; color: var(--accent); }
.new-dialog .form-grid { margin-top: 24px; }
.optional-fields { margin-top: 24px; padding: 15px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
summary { min-height: 30px; font-size: 14px; cursor: pointer; }
.optional-fields summary { color: var(--accent); }
.dialog-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.upload-progress { color: var(--accent); font-size: 14px; }
.detail-dialog { width: 1160px; }
.detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 24px; margin-bottom: 26px; border-bottom: 1px solid var(--border); }
.detail-top h2 { margin: 0; font: 500 32px/1.2 var(--serif); letter-spacing: -.6px; overflow-wrap: anywhere; }
.detail-layout { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: 32px; }
.detail-left, .detail-right { min-width: 0; }
.gallery-main { height: 350px; overflow: hidden; border-radius: 6px; background: #f0f2ec; }
.gallery-main a { display: block; height: 100%; }
.gallery-main img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 8px; margin: 12px 0 18px; padding: 3px; overflow-x: auto; }
.gallery-thumb { width: 60px; height: 64px; padding: 2px; border: 2px solid transparent; border-radius: 4px; background: var(--soft); overflow: hidden; flex-shrink: 0; }
.gallery-thumb.active { border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-summary { margin: 20px 0; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.detail-summary > div { display: flex; justify-content: space-between; gap: 15px; margin: 9px 0; color: var(--muted); font-size: 12px; }
.detail-summary strong { color: var(--text); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.export-note { margin: 10px 0 0; text-align: center; }
.activity { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.activity p { margin: 13px 0; color: var(--muted); font-size: 13px; }
.activity p small { display: block; margin-top: 3px; font-size: 12px; }
.activity strong { color: var(--text); font-weight: 500; }
.ai-state { display: flex; align-items: center; gap: 12px; padding: 0 0 20px; margin-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ai-state > svg { color: var(--accent); }
.ai-state > div { flex: 1; min-width: 0; }
.ai-state strong { display: block; font-weight: 550; font-size: 14px; }
.ai-state small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.ai-state.has-error strong { color: var(--danger); }
.detail-tabs { display: flex; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.detail-tab { display: flex; align-items: center; gap: 6px; min-height: 45px; padding: 10px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 550; }
.detail-tab > span { font-size: 12px; }
.save-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; margin-top: 24px; border-top: 1px solid var(--border); background: white; }
.publish-actions { padding-top: 24px; margin-top: 26px; border-top: 1px solid var(--border); }
.publish-actions > div { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.publish-actions > p { margin: 12px 0 0; line-height: 1.65; }
.publish-actions .button { font-size: 13px; padding: 8px 11px; }
.analysis-card { padding: 20px 0; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.analysis-card:first-child { padding-top: 0; }
.analysis-card h3 { margin: 8px 0 18px; font-size: 21px; font-weight: 550; }
.analysis-card dl { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; font-size: 14px; }
.analysis-card dt { color: var(--muted); }
.analysis-card dd { margin: 0; overflow-wrap: anywhere; }
.analysis-card p, .analysis-card ul { font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.analysis-card ul { padding-left: 20px; }
.analysis-card li { margin: 9px 0; }
.analysis-card details p { color: var(--muted); }
.estimate-card { padding: 22px; border-left: 3px solid var(--accent); background: #edf2e8; }
.estimate-value { margin: 12px 0; font-size: 31px; font-weight: 550; letter-spacing: -.7px; overflow-wrap: anywhere; }
.estimate-value > span { color: var(--muted); font-weight: 400; }
.estimate-card p { margin-bottom: 14px; font-size: 14px; line-height: 1.65; }
.estimate-card > small { display: block; margin-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.sources-title { margin: 28px 0 14px; font-size: 20px; font-weight: 550; }
.source-card { display: block; padding: 18px 0; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.source-card:hover { color: var(--text); }
.source-card > div { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.source-card strong { font-size: 23px; font-weight: 550; }
.source-card > div > span { color: var(--muted); font-size: 12px; }
.source-card > p { margin: 9px 0; color: #53604f; font-size: 14px; line-height: 1.65; }
.source-card > small { display: flex; align-items: center; gap: 5px; color: var(--accent); font-size: 12px; overflow-wrap: anywhere; }
.source-card > small svg { width: 13px; height: 13px; }
.other-sources { margin: 24px 0; }
.other-sources a { overflow-wrap: anywhere; }
#pricing-pane > .button { margin-top: 10px; }
.evidence { padding: 16px 0; border-top: 1px solid var(--border); font-size: 14px; }
.evidence p { margin: 9px 0; color: var(--muted); }
.evidence a { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.evidence svg { width: 14px; height: 14px; }
.toast { position: fixed; bottom: 26px; left: 50%; z-index: 100; max-width: min(600px, calc(100vw - 32px)); padding: 14px 20px; border: 1px solid #d1dccb; border-radius: 6px; background: #edf3e8; color: #224731; font-size: 14px; box-shadow: 0 5px 20px #2030261a; pointer-events: none; opacity: 0; transform: translate(-50%, 12px); transition: opacity .15s, transform .15s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: #dfb6a5; background: #fff1e9; color: #873d27; }
.inventory.list-view { grid-template-columns: 1fr; gap: 14px; }
.inventory.list-view .piece-card { display: grid; grid-template-columns: 170px minmax(0, 1fr); }
.inventory.list-view .piece-photo { height: 100%; min-height: 200px; aspect-ratio: auto; }
.inventory.list-view .piece-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; padding: 17px 22px 0; }
.inventory.list-view .piece-brand { grid-column: 1; grid-row: 1; justify-content: flex-start; gap: 14px; }
.inventory.list-view .piece-body h3 { grid-column: 1; grid-row: 2; min-height: 0; margin: 7px 0; }
.inventory.list-view .piece-ref { grid-column: 1; grid-row: 3; }
.inventory.list-view .publication-status { grid-column: 1; grid-row: 4; margin-bottom: 12px; }
.inventory.list-view .piece-bottom { grid-column: 2; grid-row: 1/5; align-self: center; margin: 0; gap: 24px; min-width: 130px; }
.inventory.list-view .piece-meta { grid-column: 1/-1; grid-row: 5; }
body.signed-out > .sidebar, body.signed-out > .main-shell, body.signed-out > .mobile-nav, body.signed-out > .skip-link { display: none; }
.auth-screen { display: grid; grid-template-columns: 1fr 1fr; min-height: 100dvh; }
.auth-intro { display: flex; flex-direction: column; padding: 54px clamp(36px, 6vw, 100px); background: #e9eee3; }
.auth-intro .brand { font-size: 34px; }
.auth-intro .brand-symbol svg { width: 33px; height: 38px; }
.auth-intro .brand-sub { font-size: 13px; }
.auth-summary { margin: auto 0; padding: 66px 0; max-width: 430px; }
.auth-summary h2 { margin-bottom: 22px; font: 500 48px/1.12 var(--serif); letter-spacing: -1.5px; }
.auth-summary > p { max-width: 38ch; color: #52634e; font-size: 17px; line-height: 1.7; }
.auth-overview { display: grid; gap: 22px; list-style: none; margin: 35px 0 0; padding: 25px 0 0; border-top: 1px solid #cdd8c4; }
.auth-overview li { display: flex; align-items: baseline; gap: 17px; }
.auth-overview li > span { color: #7d8d73; font-size: 12px; font-variant-numeric: tabular-nums; }
.auth-overview strong { font-size: 15px; font-weight: 550; }
.auth-overview p { margin: 5px 0 0; color: #61705c; font-size: 14px; }
.auth-footnote { margin: 0; color: #61705c; font-size: 13px; }
.auth-panel { display: grid; align-items: center; padding: 50px clamp(28px, 5vw, 90px); background: #fcfdf9; }
.auth-card { width: min(400px, 100%); margin: auto; }
.auth-card h1 { margin: 0 0 32px; font: 500 37px/1.15 var(--serif); letter-spacing: -.8px; }
.auth-card form { display: grid; gap: 21px; }
.auth-card label { font-size: 14px; }
.auth-card input:not([type="checkbox"]) { font-size: 16px; min-height: 48px; }
.auth-card .button { min-height: 48px; margin-top: 3px; }
.auth-card form > p { margin: 0; font-size: 13px; }
.auth-card .legal-links { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border); }
.auth-message { margin: 18px 0 0; color: var(--danger); font-size: 14px; }
.auth-message:empty { display: none; }
.auth-card .publication-check { padding: 0; font-size: 13px; }
.account-section { display: grid; gap: 13px; padding: 25px 0; border-top: 1px solid var(--border); }
.account-section:first-child { border-top: 0; padding-top: 0; }
.account-section h3 { margin: 0; font-size: 18px; font-weight: 550; }
.account-section p { margin: 0; overflow-wrap: anywhere; }
.inline-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.inline-form label { flex: 1; min-width: min(200px, 100%); }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.usage-grid > div { display: grid; gap: 5px; }
.usage-grid span { color: var(--muted); font-size: 13px; }
.usage-grid strong { font-size: 20px; font-weight: 550; }
.pair-code { display: grid; gap: 7px; padding: 16px; background: var(--soft); }
.pair-code strong { font: 500 27px/1.4 ui-monospace, monospace; letter-spacing: .1em; color: var(--accent); }
.pair-code span { color: var(--muted); font-size: 13px; }
.book-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 3px; background: var(--soft); color: var(--muted); font-size: 12px; white-space: nowrap; }
.members { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.members li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.members small { display: block; font-size: 12px; overflow-wrap: anywhere; }
.admin-dialog { width: 980px; }
.table-wrap { overflow-x: auto; max-width: 100%; }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users th { padding: 12px 10px; color: var(--muted); font-weight: 500; text-align: left; }
table.users td { padding: 14px 10px; border-top: 1px solid var(--border); vertical-align: middle; }
table.users tr.disabled { opacity: .6; }
table.users input { width: 70px; padding: 7px; font-size: 14px; }
.link-box { display: flex; gap: 10px; }
.link-box input { flex: 1; font-family: ui-monospace, monospace; font-size: 13px; }
.book-select { display: none; }
.sales-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin-bottom: 24px; }
.sales-kpis > div { display: grid; gap: 6px; align-content: start; min-width: 0; }
.sales-kpis span, .sales-kpis small { color: var(--muted); font-size: 13px; }
.sales-kpis strong { font-size: 27px; font-weight: 550; overflow-wrap: anywhere; }
.month-chart { display: block; width: 100%; height: auto; max-height: 250px; }
.month-chart .baseline { stroke: var(--border); stroke-width: 1; }
.month-chart .mark { fill: #577d50; }
.month-chart .hit { fill: transparent; }
.month-chart text { fill: var(--muted); font-size: 11px; }
.month-chart .bar:hover .mark, .month-chart .bar:focus .mark { fill: var(--accent); }
.month-chart .bar:focus { outline: 1px solid var(--accent); }
body.legal-page { background: #fcfdf9; }
.legal { max-width: 760px; margin: 0 auto; padding: 38px 24px 60px; line-height: 1.8; }
.legal h1 { margin: 30px 0 10px; font: 500 39px/1.15 var(--serif); letter-spacing: -.8px; }
.legal h2 { margin: 32px 0 10px; font-size: 20px; font-weight: 550; }
.legal-date { color: var(--muted); font-size: 13px; }
.legal .legal-links { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); }
.legal mark { padding: 1px 3px; background: #f5e4bd; color: #63441b; }
@media (min-width: 1700px) {
  .inventory { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .sidebar { width: 218px; padding-left: 16px; padding-right: 16px; }
  .main-shell { margin-left: 218px; }
  .brand { font-size: 25px; gap: 8px; }
  main { padding: 28px 28px 0; }
  .topbar { padding: 12px 28px; }
  .inventory { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .toolbar { grid-template-columns: minmax(0, 1fr) 145px 130px; }
  .search { grid-column: 1/3; }
  .toolbar > #category-filter { grid-column: 1/3; grid-row: 2; }
  .toolbar > #sort { grid-column: 3; grid-row: 2; }
  .layout-toggle { grid-column: 3; grid-row: 1; justify-self: end; }
  .stat { padding-left: 16px; }
  .stats { gap: 14px; }
  .stat strong, .stat:nth-child(3) strong { font-size: 22px; }
}
@media (max-width: 850px) {
  .sidebar { display: none; }
  .main-shell { margin-left: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 66px; padding: 12px 24px; background: #fcfdf9; }
  .breadcrumb, .connection, .topbar .profile { display: none; }
  .mobile-brand { display: block; color: var(--text); font: 600 25px/1.1 var(--serif); letter-spacing: -.7px; text-decoration: none; }
  .topbar-right { max-width: 52%; gap: 0; }
  .book-select { display: block; max-width: 100%; width: 210px; min-height: 40px; padding: 8px 9px; font-size: 13px; }
  main { padding: 26px 24px 0; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: #fcfdf9; }
  .mobile-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 54px; padding: 4px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
  .mobile-action [data-icon] { display: flex; }
  .mobile-action svg { width: 21px; height: 21px; }
  .mobile-action.active, .mobile-action.mobile-add { color: var(--accent); font-weight: 600; }
  .mobile-add svg { stroke-width: 2; }
  .toast { bottom: calc(83px + env(safe-area-inset-bottom)); }
  .auth-intro { padding: 38px 30px; }
  .auth-summary h2 { font-size: 39px; }
  .auth-summary > p { font-size: 15px; }
  .auth-overview strong { font-size: 14px; }
  .auth-overview p { font-size: 13px; }
  .auth-panel { padding: 40px 28px; }
  .detail-layout { grid-template-columns: 1fr; gap: 30px; }
  .detail-left { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .gallery-main, .gallery-thumbs, .detail-summary, .activity { grid-column: 1/-1; }
  .detail-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0 25px; }
  .detail-summary > div { display: block; }
  .detail-summary strong { display: block; margin-top: 4px; text-align: left; }
  .detail-left > .add-photos { align-self: start; }
  .detail-left > a.button { grid-column: 2; grid-row: 3; align-self: start; }
  .export-note { grid-column: 1/-1; }
  .detail-dialog { padding: 26px; }
  .inventory.list-view .piece-card { grid-template-columns: 145px minmax(0, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  main { padding: 23px 18px 0; }
  .topbar { min-height: 64px; padding: 11px 18px; }
  .mobile-brand { font-size: 24px; }
  .topbar-right { max-width: 49%; }
  .page-heading { gap: 12px; margin-bottom: 19px; }
  .page-heading h1 { font-size: 32px; margin-bottom: 0; white-space: nowrap; }
  .page-heading p { display: none; }
  .page-heading > .button { padding: 10px 12px; min-height: 44px; font-size: 14px; }
  .desktop-copy { display: none; }
  .mobile-copy { display: inline; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin-bottom: 18px; padding: 13px 0; }
  .stat { display: flex; align-items: baseline; gap: 7px; padding-left: 0; border-left: 0; }
  .stat strong, .stat:nth-child(3) strong { flex-shrink: 0; margin: 0; font-size: 18px; letter-spacing: -.3px; white-space: nowrap; }
  .stat > span { font-size: 12px; line-height: 1.4; }
  .inventory-heading { margin-bottom: 12px; }
  .inventory-heading h2 { font-size: 15px; }
  #last-sync { font-size: 12px; }
  .toolbar { grid-template-columns: minmax(0, 1fr) 100px; gap: 8px; }
  .search { grid-column: 1; grid-row: 1; }
  .toolbar > #category-filter { grid-column: 1; grid-row: 2; }
  .toolbar > #sort { grid-column: 2; grid-row: 2; padding-left: 8px; padding-right: 4px; }
  .layout-toggle { grid-column: 2; grid-row: 1; }
  .layout-toggle button { width: 40px; }
  .filters { gap: 22px; margin: 9px 0 18px; }
  .filter { font-size: 13px; }
  .inventory { grid-template-columns: 1fr; gap: 22px; }
  .piece-body { padding: 17px 18px 0; }
  .piece-body h3 { min-height: 0; font-size: 19px; }
  .piece-brand, .piece-brand > span, .piece-ref { font-size: 13px; }
  .piece-price strong { font-size: 25px; }
  .piece-meta { font-size: 12px; }
  .empty { min-height: 245px; padding: 28px 12px; }
  .empty h3 { font-size: 21px; }
  .auth-screen { display: block; min-height: 100dvh; background: #fcfdf9; }
  .auth-intro { padding: 28px 24px 23px; background: #e9eee3; }
  .auth-intro .brand { font-size: 30px; }
  .auth-intro .brand-sub { margin-top: 5px; font-size: 12px; }
  .auth-summary, .auth-footnote { display: none; }
  .auth-panel { display: block; padding: 35px 24px; }
  .auth-card { width: 100%; max-width: 420px; }
  .auth-card h1 { margin-bottom: 28px; font-size: 33px; }
  .auth-card .legal-links { margin-top: 32px; font-size: 12px; }
  dialog { max-width: calc(100vw - 20px); width: calc(100vw - 20px); max-height: calc(100dvh - 24px); padding: 24px 19px; border-radius: 8px; }
  .dialog-heading { gap: 12px; margin-bottom: 22px; align-items: flex-start; }
  .dialog-heading h2, .small-dialog .dialog-heading h2 { font-size: 28px; padding-top: 5px; }
  .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .span-all { grid-column: auto; }
  input, textarea, select { font-size: 16px; }
  .toolbar input, .toolbar select { font-size: 14px; }
  .upload-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .new-previews { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .new-preview { height: 110px; }
  .dialog-footer { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; }
  .dialog-footer .button { padding-left: 11px; padding-right: 11px; font-size: 13px; }
  .detail-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 23px 18px calc(24px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; }
  .detail-top { gap: 12px; padding-bottom: 20px; margin-bottom: 22px; }
  .detail-top h2 { font-size: 29px; }
  .detail-top .context-label { font-size: 12px; }
  .gallery-main { height: 290px; }
  .detail-left { gap: 0 10px; }
  .detail-left > .button { font-size: 12px; padding: 10px; }
  .detail-summary { gap: 0 20px; margin: 20px 0 0; }
  .detail-summary > div { font-size: 12px; }
  .export-note { font-size: 12px; }
  .activity { margin-top: 20px; }
  .ai-state { flex-wrap: wrap; gap: 10px; }
  .ai-state > svg { display: none; }
  .ai-state .button { min-height: 40px; }
  .detail-tabs { gap: 24px; }
  .detail-tab { font-size: 14px; }
  .save-bar { position: sticky; bottom: -24px; z-index: 2; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); }
  .save-bar > .small { max-width: 48%; font-size: 12px; }
  .estimate-card { padding: 18px; }
  .estimate-value { font-size: 29px; }
  .analysis-card dl { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); font-size: 13px; }
  .sales-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 15px; }
  .sales-kpis strong { font-size: 25px; }
  .month-chart text { display: none; font-size: 26px; }
  .month-chart .bar:nth-of-type(3n+1) text, .month-chart .bar:last-of-type text { display: block; }
  .link-box { flex-wrap: wrap; }
  .link-box input { flex-basis: 100%; }
  .book-head { align-items: flex-start; flex-wrap: wrap; }
  .inline-form > .button { flex-shrink: 0; }
  footer { gap: 14px; margin-top: 30px; padding-bottom: 26px; }
  footer .footer-links { gap: 8px 14px; }
  .inventory.list-view { gap: 12px; }
  .inventory.list-view .piece-card { grid-template-columns: 100px minmax(0, 1fr); }
  .inventory.list-view .piece-photo { min-height: 220px; }
  .inventory.list-view .piece-body { grid-template-columns: minmax(0, 1fr); padding: 13px 13px 0; }
  .inventory.list-view .piece-brand { font-size: 12px; flex-wrap: wrap; gap: 3px; }
  .inventory.list-view .piece-brand > span { font-size: 12px; }
  .inventory.list-view .piece-body h3 { font-size: 16px; }
  .inventory.list-view .piece-ref { font-size: 12px; }
  .inventory.list-view .piece-bottom { grid-column: 1; grid-row: 5; min-width: 0; margin-bottom: 12px; }
  .inventory.list-view .piece-price strong { font-size: 22px; }
  .inventory.list-view .piece-meta { grid-row: 6; font-size: 12px; }
  .inventory.list-view .piece-meta > span:first-child { max-width: 100%; }
  .inventory.list-view .piece-meta > span:last-child { display: none; }
  .inventory.list-view .piece-photo > .badge { top: 8px; left: 6px; max-width: 89px; padding: 4px 6px; font-size: 11px; }
  .inventory.list-view .photo-count { right: 6px; bottom: 7px; }
  .inventory.list-view .card-arrow { display: none; }
  .legal { padding: 26px 20px 50px; }
  .legal h1 { font-size: 33px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; scroll-behavior: auto !important; }
}
