/* A quiet working surface, shared by the landing pages and document tools. */
@media screen {
  :root { --ui-ink:#191919; --ui-muted:#62646b; --ui-line:#e5e5e7; }
  body { background:#fff; color:var(--ui-ink); }
  ::selection { background:#dbe8ff; color:#191919; }
  input, textarea { caret-color:#1a73e8; }
  a { text-underline-offset:3px; }
  .topbar { height:76px; min-height:76px; max-width:1240px; padding:0 40px; border-bottom:1px solid var(--ui-line); }
  .brand { font-size:24px; letter-spacing:-.035em; gap:12px; }
  .brand-icon { width:30px; height:34px; }
  .topbar .tool-nav { margin-left:auto; margin-right:42px; gap:28px; font-size:14px; }
  .topbar .tool-nav a { min-height:44px; }
  .beta { font-size:12px; font-weight:400; letter-spacing:0; padding:5px 8px; background:#f3f3f3; border:0; }
  main { max-width:1240px; padding:36px 40px 0; }
  .home-page .topbar, .home-page main { max-width:1360px; }
  .home-page footer { max-width:1280px; }
  .intro { max-width:none; text-align:left; margin:0 0 28px; }
  .intro h1 { max-width:100%; font-size:clamp(30px,3.5vw,44px); line-height:1.12; letter-spacing:-.035em; margin-bottom:12px; }
  .intro h1 span { color:#5f6368; }
  .intro>p { font-size:16px; line-height:1.6; margin:0; max-width:72ch; color:#62646b; }
  .product-scope { font-size:14px; margin:0 0 20px; gap:12px; color:#414247; }
  .google-colors { gap:5px; }
  .google-colors i { width:8px; height:8px; }
  .home-page .intro { margin-bottom:28px; }
  .home-page .intro h1 { font-size:clamp(40px,5.35vw,76px); line-height:1.06; letter-spacing:-.04em; font-weight:750; margin:0 0 18px; max-width:none; }
  .home-page .intro h1 br { display:initial; }
  .home-page .intro>p { font-size:20px; line-height:1.5; max-width:none; }
  .button { min-height:42px; border-radius:6px; padding:10px 16px; font-size:14px; }
  .primary { background:#242424; color:#fff; }
  .primary:hover { background:#080808; }
  .secondary { background:#fff; border-color:#d7d7db; color:#252525; }
  .secondary:hover { background:#f5f5f6; }
  .text-button { color:#62646b; font-size:14px; margin:0; padding:5px 0; min-height:32px; }
  .intake-grid { display:block; max-width:none; }
  .document-size-help { max-width:75ch; margin:12px 0 0; color:var(--ui-muted); font-size:14px; line-height:1.6; }
  .server-mode .document-size-help { display:none; }
  .large-document-notice { margin:16px 0; padding:12px 16px; border-left:3px solid #967000; background:#fffbee; color:#665322; font-size:14px; line-height:1.6; overflow-wrap:anywhere; }
  .large-document-notice[hidden] { display:none; }
  .intake-controls { width:100%; }
  .intake-controls .upload-panel { display:flex; flex-direction:row; justify-content:space-between; align-items:center; gap:24px; width:100%; max-width:none; margin:0; padding:24px; border:1px dashed #c5c6cb; border-radius:8px; background:#fff; }
  .upload-top { gap:20px; min-width:0; }
  .upload-top .file-icon { display:grid; width:54px; height:56px; border:1px solid var(--ui-line); border-radius:8px; background:#fff; color:#252525; }
  .file-icon svg { width:26px; height:26px; }
  .upload-top h2 { margin:0 0 5px; font-size:21px; line-height:1.3; letter-spacing:-.025em; }
  .upload-top p { font-size:15px; line-height:1.5; color:#62646b; }
  .upload-actions { margin:0; flex:none; }
  .upload-actions .button { min-height:46px; padding:12px 20px; }
  .upload-panel.dragover { border-color:#4285f4; background:#f5f9ff; }
  .intake-meta { display:flex; align-items:center; gap:24px; flex-wrap:wrap; margin:10px 0 20px; position:relative; }
  .intake-meta .local-note { margin:0 auto 0 0; color:#62646b; font-size:14px; }
  .local-note svg { width:18px; height:18px; }
  .intake-meta .text-button { font-size:14px; margin:0; }
  .manual-help { font-size:14px; color:#62646b; }
  .manual-help summary { cursor:pointer; min-height:32px; align-content:center; }
  .manual-help[open] { flex-basis:100%; order:3; padding:12px 0; }
  .manual-help p { font-size:14px; line-height:1.65; max-width:85ch; margin:8px 0 0; }
  .manual-help .caveat { font-size:13px!important; border:0; padding:0; }
  .intake-controls .google-import { max-width:none; padding:0; margin:0; border:0; }
  .google-import>label { font-size:14px; font-weight:600; margin:0 0 8px; }
  .link-input-row { gap:10px; }
  .link-input-row #googleLinks { min-height:44px; font-family:inherit; font-size:15px; background:var(--control-surface); border-color:#d7d7db; border-radius:6px; padding:10px 12px; }
  #googleLinks::placeholder { color:#71737b; opacity:1; }
  .link-input-row .button { min-width:100px; min-height:44px; }
  .import-meta { display:flex; justify-content:space-between; gap:12px; align-items:baseline; margin-top:7px; }
  .import-meta>.import-help { margin:0; }
  .import-help { color:#6b6d74; font-size:13px; line-height:1.55; }
  .import-options { font-size:13px; color:#62646b; flex-shrink:0; }
  .import-options summary { cursor:pointer; min-height:28px; }
  .import-options[open] { max-width:360px; }
  .import-options .import-help { margin:4px 0; }
  .google-register-choice { font-size:14px!important; font-weight:400!important; margin:8px 0 0; }
  .import-actions:has(.google-connection:empty):has(#googleDisconnect[hidden]) { display:none; }
  .import-actions { margin:8px 0 0; }
  #googleStatus:empty, #status:empty { display:none; }
  #googleStatus { margin-top:8px; }
  .output-example { margin:16px 0 0; padding:0; border:0; background:#fff; border-radius:0; }
  .output-example>summary { cursor:pointer; color:#62646b; font-size:14px; min-height:36px; align-content:center; }
  .output-example-content { max-width:680px; padding:12px 0 20px; }
  .output-example p, .zip-example li { font-size:14px; }
  .export-presets { position:relative; margin:28px 0 0; padding:0 0 24px; border:0; border-bottom:1px solid var(--ui-line); display:block; min-width:0; }
  .export-presets legend { float:left; width:100%; padding:18px 0 22px; border-top:1px solid var(--ui-line); color:#191919; font-size:21px; font-weight:700; letter-spacing:-.025em; }
  .preset-list { clear:both; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; }
  .preset-hint { position:absolute; top:18px; right:0; margin:0; font-size:14px; color:#6b6d74; }
  .preset-option { padding:12px 24px; border:0; border-radius:0; background:#fff; gap:18px; }
  .preset-option+.preset-option { border-left:1px solid var(--ui-line); }
  .preset-option:first-of-type { padding-left:0; }
  .preset-option:last-of-type { padding-right:0; }
  .preset-option:has(input:checked) { background:#fff; border-color:var(--ui-line); }
  .preset-option:hover { background:#fafafa; }
  .preset-option input { width:19px; height:19px; margin-top:4px; accent-color:var(--preset-color); }
  .preset-option strong { position:relative; font-size:21px; line-height:1.3; font-weight:700; letter-spacing:-.025em; color:#191919; padding-left:15px; }
  .preset-option strong:before { content:''; width:3px; height:24px; position:absolute; left:0; top:2px; border-radius:2px; background:var(--preset-color); }
  .preset-option small { font-size:15px; line-height:1.6; color:#62646b; margin:12px 0 12px 15px; }
  .preset-formats { display:block; font-size:13px; line-height:1.5; color:#6b6d74; margin-left:15px; }
  .home-fix { gap:30px; margin:0; padding:18px 0; font-size:14px; }
  .home-fix strong { font-size:16px; }
  .home-fix a { color:#62646b; }
  body.loaded .intake-grid, body.loaded .export-presets, body.loaded .home-fix { display:none; }
  footer { max-width:1160px; margin:16px auto 0; padding:16px 0 24px; font-size:13px; color:#6b6d74; align-items:start; }
  footer .feedback-panel { margin:0 0 0 auto; border:0; padding:0; max-width:440px; font-size:13px; }
  footer .feedback-panel>summary { padding:0; min-height:24px; font-weight:400; }
  .feedback-panel[open] { max-width:480px; }
  .workspace-toolbar { padding:22px 0; }
  .workspace-toolbar h2 { font-size:21px; }
  .review-settings { gap:28px; padding:18px 0; }
  .review-settings legend { font-size:16px; margin-bottom:10px; }
  .review-settings .comment-primary, .review-settings .review-filter-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
  .review-settings .filter-field>label { font-size:13px; line-height:1.4; min-height:18px; }
  .review-settings .filter-field select, .review-settings .filter-field input[type=date], .review-settings #commentAuthor { font:400 14px/1.4 Arial,Helvetica,sans-serif; min-height:38px; height:38px; border-color:#d7d7db; }
  .review-extra { grid-column:1/-1; margin-top:12px; color:#62646b; font-size:13px; }
  .review-extra>summary { min-height:30px; cursor:pointer; align-content:center; }
  .review-extra .extra-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:10px 0; }
  .review-extra .settings-heading { margin:6px 0; }
  .review-extra .comment-advanced { margin-top:10px; }
  .review-extra .comment-advanced label, .review-register-toggle { font-size:13px; }
  .review-extra .settings-help { margin-top:10px; font-size:13px; }
  .settings-heading p, .settings-heading #suggestionCount { font-size:12px; }
  .settings-heading:has(p:empty) { min-height:0; margin:0; }
  .settings-heading .text-button { font-size:13px; }
  .pdf-options .review-settings { background:#fff; border:0; border-top:1px solid var(--ui-line); border-radius:0; padding:18px 0; }
  .pdf-options>summary { font-size:14px; }
  .pdf-options>summary span, .disclosure-hint { display:none; }
  .inventory-heading { padding-bottom:12px; }
  .inventory-heading h2 { font-size:19px; }
  .inventory-heading #inventorySummary { font-size:13px; }
  .inventory-columns { font-size:12px; }
  .inventory-row>label { font-size:14px; }
  .inventory-actions .format-chip { font-size:12px; padding:5px 10px; min-height:32px; }
  .export-details>summary, .document-preview-details>summary { font-size:14px; }
  .comment-card { padding:10px 12px!important; }
  .comment-meta { gap:5px 8px; margin-bottom:5px; }
  .comment-meta .comment-date { flex-basis:auto; font-size:11px; margin-left:auto; }
  .comment-body { font-size:14px; line-height:1.55; }
  .doc-row, .doc-row:has(.doc-changes) { grid-template-columns:minmax(0,1fr) 260px; }
  .doc-row.no-comments, .comments-hide .doc-row { grid-template-columns:minmax(0,1fr); }
  .comments-inline .doc-row, .comments-inline .doc-row:has(.doc-changes) { grid-template-columns:minmax(0,1fr); }
  .document-preview-scroll { scrollbar-color:#c7c9ce #f6f6f7; }
}
@media screen and (max-width:1000px) {
  .topbar { padding:0 28px; }
  main { padding:30px 28px 0; }
  .topbar .tool-nav { margin-right:12px; gap:20px; }
  .home-page .intro h1 { font-size:clamp(40px,5.35vw,66px); }
  footer { margin:16px 28px 0; }
  .preset-option { padding:10px 16px; gap:12px; }
  .preset-option strong { font-size:19px; }
  .review-settings { grid-template-columns:1fr; }
  .intake-meta { gap:14px; }
}
@media screen and (max-width:700px) {
  .topbar { height:auto; min-height:104px; padding:16px 20px 8px; flex-wrap:wrap; gap:12px; }
  .brand { font-size:22px; }
  .topbar .tool-nav { display:flex; flex-wrap:nowrap; order:3; flex-basis:100%; margin:0; max-width:none; justify-content:space-between; gap:12px; font-size:14px; }
  .tool-nav a, .images-navigation summary { min-height:40px; }
  .beta { display:block; margin-left:auto; }
  .images-navigation>div { left:auto; right:0; }
  main { padding:28px 20px 0; }
  .product-scope { margin-bottom:16px; font-size:13px; }
  .home-page .intro h1 { font-size:clamp(36px,7.9vw,53px); line-height:1.08; }
  .home-page .intro>p { font-size:17px; }
  .home-page .intro>p br { display:none; }
  .intro h1 { font-size:32px; }
  .intake-controls .upload-panel { flex-direction:column; align-items:stretch; padding:20px; gap:20px; }
  .upload-top { gap:14px; }
  .upload-top .file-icon { width:44px; height:48px; }
  .upload-top h2 { font-size:19px; }
  .upload-top p { font-size:14px; }
  .upload-actions, .upload-actions .button { width:100%; }
  .intake-meta { gap:6px 16px; margin-bottom:20px; }
  .intake-meta .local-note { width:100%; font-size:13px; }
  .manual-help, .intake-meta .text-button { font-size:13px; }
  .link-input-row #googleLinks { font-size:16px; }
  .link-input-row .button { min-width:78px; padding:10px 12px; }
  .import-meta { flex-wrap:wrap; gap:3px; }
  .import-options { width:100%; }
  .import-options[open] { max-width:none; }
  .preset-list { grid-template-columns:1fr; }
  .export-presets { margin-top:20px; padding-top:0; padding-bottom:6px; }
  .export-presets legend { padding:20px 0 4px; font-size:20px; }
  .preset-hint { clear:both; position:static; grid-column:1/-1; font-size:13px; margin:0 0 10px; }
  .preset-option, .preset-option:first-of-type, .preset-option:last-of-type { border:0; padding:15px 0; gap:16px; }
  .preset-option+.preset-option { border-top:1px solid var(--ui-line); }
  .preset-option strong { font-size:20px; }
  .preset-option small { margin-top:7px; margin-bottom:8px; font-size:15px; }
  .home-fix { gap:14px 20px; font-size:14px; padding:20px 0; }
  .home-fix strong { flex-basis:100%; }
  footer { margin:12px 20px 0; flex-direction:row; flex-wrap:wrap; gap:10px; }
  footer>span:nth-child(2) { flex-basis:100%; }
  .review-settings .comment-primary, .review-settings .review-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .review-extra .extra-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .review-settings .filter-field select, .review-settings .filter-field input[type=date], .review-settings #commentAuthor { font-size:16px; min-height:42px; height:42px; }
  .inventory-row { gap:8px; }
  .inventory-actions { max-width:180px; }
  .inventory-actions .format-chip { min-height:36px; font-size:12px; padding:6px 8px; }
  .inventory-heading>.button { width:100%; margin-top:8px; }
  .doc-row, .doc-row:has(.doc-changes) { grid-template-columns:minmax(0,1fr); }
  .comment-meta .comment-date { margin-left:0; }
  .comment-card { max-width:100%; }
}
@media print {
  .manual-help, .home-fix, .review-extra { display:none!important; }
}
/* Shared disclosures and distinct review/archive workspaces. */
@media screen {
  details>summary { list-style:none; cursor:pointer; }
  details>summary::-webkit-details-marker { display:none; }
  details>summary::before { content:''!important; display:inline-block; width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(-45deg); margin:0 10px 2px 2px; flex:none; }
  details[open]>summary::before { transform:rotate(45deg); margin-bottom:4px; }
  details>summary::after { content:none!important; }
  .primary-inventory>summary { display:none; }
  .document-preview-details { border-top:0; margin-top:6px; }
  .document-preview-details .preview-label>span { display:none; }
  .document-notes-disclosure { font-size:13px; margin:6px 0 0; }
  .document-notes-disclosure summary { min-height:28px; line-height:1.6; }
  .document-notes-disclosure .warnings { max-width:75ch; }
  .review-export-link { font-size:13px!important; margin-top:7px!important; }
  .review-export-link a { color:#414247; }
  .zip-action { display:flex; flex-direction:column; gap:6px; align-items:flex-end; }
  .zip-action .button { white-space:nowrap; }
  #archiveSize { font-size:12px; color:#62646b; line-height:1.4; }
  #archiveSize:empty { display:none; }
  #inventory-pdf>p { display:block; grid-column:1/-1; grid-row:2; padding-left:23px; margin:0; color:#62646b; font-size:13px; }
  #inventory-pdf>.inventory-actions { grid-column:2; grid-row:1; }
  #inventory-images>.document-extras { grid-column:1/-1; }
  #inventory-images #imageGallery { border:0; }
  #inventory-images #imageGallery>summary { padding-left:23px; font-size:13px; font-weight:400; }
  .inventory-gallery .image-grid { grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); }
  .pdf-options #commentFilterStatus:not([hidden]) { display:block; }
  .settings-heading:has(#commentFilterStatus[hidden]) { display:none; }
  .comment-card:target { outline:none!important; box-shadow:none!important; }
  .landing-guide { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:64px; border-top:1px solid var(--ui-line); margin-top:32px; padding:36px 0 16px; }
  .landing-guide h2 { font-size:23px; line-height:1.3; letter-spacing:-.025em; margin:0 0 18px; }
  .landing-guide h3 { font-size:17px; line-height:1.4; margin:28px 0 10px; }
  .landing-guide p { font-size:16px; line-height:1.7; color:#62646b; margin:0 0 16px; max-width:72ch; }
  .guide-faq details { border-bottom:1px solid var(--ui-line); padding:14px 0; }
  .guide-faq details:first-of-type { padding-top:0; }
  .guide-faq summary { font-size:15px; font-weight:500; line-height:1.6; min-height:32px; }
  .guide-faq p { font-size:15px; margin:12px 0 0; }
  body.loaded .landing-guide { display:none; }
  .site-footer, .home-page .site-footer { display:block; max-width:1160px; }
  .home-page .site-footer { max-width:1280px; }
  .site-footer>nav { display:flex; flex-wrap:wrap; gap:12px 24px; margin:2px 0 24px; }
  .site-footer>nav a { font-size:14px; line-height:1.6; color:#62646b; }
  .site-footer>nav.footer-legal { gap:8px 24px; margin:0 0 18px; }
  .site-footer>nav.footer-legal a { display:inline-flex; align-items:center; min-height:32px; }
  .footer-bottom { display:flex; justify-content:space-between; gap:20px; }
  .site-footer .feedback-panel { max-width:none; margin-top:14px; }
  .no-script-notice { display:block; margin:12px 0; padding:12px; border:1px solid var(--ui-line); font-size:14px; line-height:1.5; }
  .no-script-notice:empty { display:none; }
}
@media screen and (max-width:800px) {
  .landing-guide { grid-template-columns:1fr; gap:30px; }
  .zip-action { margin-top:10px; align-items:flex-start; }
}
@media print {
  .landing-guide,.site-footer,.no-script-notice,.review-export-link,.large-document-notice { display:none!important; }
  .comment-card:target,.comment-card:focus,.comment-card:hover { outline:none!important; box-shadow:none!important; }
}

@media screen and (max-width:390px) {
  .topbar .brand { font-size:20px; gap:9px; }
  .topbar .beta { display:none; }
}

/* Direct navigation and a shorter first screen. */
@media screen {
  .topbar { height:auto; min-height:72px; gap:16px; padding-top:10px; padding-bottom:10px; flex-wrap:nowrap; }
  .topbar .tool-nav { display:flex; flex-wrap:nowrap; margin:0 0 0 auto; gap:18px; }
  .topbar .tool-nav a { display:flex; align-items:center; min-height:44px; white-space:nowrap; line-height:1.35; }
  .topbar .tool-nav a[aria-current="page"] { color:#191919; text-decoration:underline; text-underline-offset:5px; }
  .topbar .beta { flex-shrink:0; }
  .home-page main { padding-top:24px; }
  .home-page .intro { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:24px; margin-bottom:22px; }
  .home-page .intro h1 { grid-column:1/-1; font-size:clamp(36px,4.4vw,60px); line-height:1.08; margin-bottom:12px; }
  .home-page .intro>p { font-size:17px; line-height:1.5; }
  .home-page .product-scope { align-self:end; margin:0 0 3px; font-size:13px; }
  .home-page .intake-controls .upload-panel { padding:18px 20px; }
  .home-page .upload-top .file-icon { width:46px; height:48px; }
  .home-page .upload-top h2 { font-size:20px; }
  .home-page .intake-meta { margin:6px 0 14px; }
  .home-page .export-presets { margin-top:20px; padding-bottom:18px; }
  .home-page .export-presets legend { padding:14px 0 16px; font-size:20px; }
  .home-page .preset-hint { top:14px; }
  .home-page .preset-option { padding-top:8px; padding-bottom:8px; }
  .home-page .preset-option small { margin-top:8px; margin-bottom:8px; }
}
@media screen and (max-width:1120px) {
  .topbar { flex-wrap:wrap; gap:4px 20px; padding-top:12px; padding-bottom:8px; }
  .topbar .beta { display:block; margin-left:auto; }
  .topbar .tool-nav { order:3; flex-basis:100%; justify-content:space-between; margin:0; gap:16px; }
}
@media screen and (max-width:700px) {
  .topbar { padding:12px 20px 6px; }
  .topbar .tool-nav { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0 14px; font-size:13px; }
  .topbar .tool-nav a { white-space:normal; padding:5px 0; }
  .topbar .beta { font-size:11px; }
  .home-page main { padding-top:20px; }
  .home-page .intro { display:block; margin-bottom:18px; }
  .home-page .intro h1 { font-size:clamp(32px,7.5vw,44px); margin-bottom:10px; }
  .home-page .intro>p { font-size:16px; }
  .home-page .product-scope { margin:10px 0 0; }
  .home-page .intake-controls .upload-panel { padding:16px; gap:16px; }
  .home-page .upload-top { gap:12px; }
  .home-page .upload-top h2 { font-size:18px; }
  .home-page .upload-top .file-icon { width:40px; height:44px; flex-shrink:0; }
  .home-page .intake-meta { margin:6px 0 12px; }
  .home-page .export-presets { margin-top:16px; padding-bottom:6px; }
  .home-page .export-presets legend { padding:16px 0 4px; }
  .home-page .preset-option { padding:12px 0; }
}
@media screen and (max-width:390px) {
  .topbar .beta { display:none; }
}

/* One clear PDF tool and an Images menu shared across pages. */
@media screen {
  .topbar .tool-nav { display:flex; align-items:center; gap:26px; }
  .topbar .images-navigation { font-size:14px; }
  .images-navigation>summary { min-height:44px; }
  .images-navigation>summary:after { content:''; width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg); margin-top:-4px; }
  .images-navigation[open]>summary:after { transform:rotate(225deg); margin-top:3px; }
  .topbar .images-navigation>div { left:auto; right:0; min-width:230px; }
  .topbar .images-navigation a { padding:8px 12px; white-space:nowrap; }
  .images-navigation a:hover { background:#f5f5f6; }
  .comments-export-page .suggestion-settings { display:none!important; }
  .comments-export-page .review-settings { grid-template-columns:1fr; }
  .comment-export-options { margin:8px 0 16px; }
  .comments-export-page .zip-action { align-items:flex-end; }
  .comments-example-scroll { overflow-x:auto; }
  .comments-example { width:100%; border-collapse:collapse; text-align:left; font-size:14px; line-height:1.6; }
  .comments-example th,.comments-example td { padding:10px 12px; border-bottom:1px solid var(--ui-line); vertical-align:top; }
  .comments-example th { font-weight:600; }
}
@media screen and (min-width:901px) {
  .topbar { flex-wrap:nowrap; min-height:72px; padding-top:10px; padding-bottom:10px; gap:20px; }
  .topbar .tool-nav { flex-basis:auto; order:0; margin:0 0 0 auto; }
  .topbar .beta { margin-left:0; }
}
@media screen and (max-width:900px) {
  .topbar .tool-nav { justify-content:space-between; gap:12px; }
}
@media screen and (max-width:700px) {
  .topbar .tool-nav { font-size:14px; }
  .topbar .tool-nav>a { white-space:nowrap; }
  .topbar .images-navigation { font-size:14px; }
  .comments-export-page .zip-action { align-items:flex-start; }
}
@media screen and (max-width:360px) {
  .topbar .tool-nav,.topbar .images-navigation { font-size:13px; }
  .topbar .tool-nav { gap:10px; }
}
@media screen and (max-width:480px) {
  .topbar .tool-nav { display:grid; grid-template-columns:max-content minmax(0,1fr) max-content max-content; }
  .topbar .tool-nav>a:nth-child(2) { white-space:normal; min-width:0; justify-self:center; }
}

/* Compact, shared surfaces for upload and export controls. */
@media screen {
  :root { --control-surface:#f6f5f4; }
  .intake-controls .upload-panel { background:var(--control-surface); }
  .intake-controls .upload-panel.dragover { border-color:#1a73e8; outline:2px solid #1a73e8; outline-offset:2px; }
  .review-settings, .pdf-options .review-settings, .suggestion-options .review-settings {
    background:var(--control-surface); border:0; border-radius:6px; padding:14px 16px; margin:0 0 12px; gap:18px;
  }
  .review-settings fieldset, .review-settings legend { background:transparent; }
  .review-settings legend { margin-bottom:8px; }
  .review-settings .comment-primary, .review-settings .review-filter-grid,
  .review-settings .review-extra .extra-fields { grid-template-columns:repeat(3,minmax(0,220px)); gap:8px 12px; max-width:684px; }
  .review-settings .filter-field { gap:4px; }
  .review-settings .filter-field select, .review-settings .filter-field input[type=date], .review-settings #commentAuthor { min-height:36px; height:36px; }
  .review-settings .review-extra { max-width:684px; margin-top:6px; }
  .review-settings .review-extra .extra-fields { margin:6px 0; }
  .review-settings .review-extra .comment-advanced { margin-top:6px; gap:8px 16px; }
  .review-settings .review-extra .settings-heading { margin:4px 0 0; }
  .review-settings .review-extra .settings-heading .text-button { margin-left:0; }
  .export-inventory { background:var(--control-surface); padding:14px 16px 10px; border:0; border-radius:6px; }
  .inventory-heading { padding-bottom:6px; gap:12px; }
  .inventory-heading h2 { font-size:18px; }
  .inventory-columns { padding:6px 0; }
  .inventory-row { min-height:40px; padding:5px 0; border-color:#e4e2e0; }
  .inventory-missing { margin:8px 0; }
  .export-info { margin:4px 0; }
  .pdf-options .review-settings, .suggestion-options .review-settings { margin:4px 0; padding:10px 0 4px 23px; }
  .suggestion-options { grid-column:1/-1; }
  .suggestion-options>summary { padding:6px 0 6px 23px; min-height:30px; color:#62646b; font-size:14px; }
  #inventory-suggestions>p { display:block; grid-column:1/-1; grid-row:2; padding-left:23px; margin:0; max-width:85ch; color:#62646b; font-size:13px; line-height:1.5; }
  #inventory-suggestions>.inventory-actions { grid-column:2; grid-row:1; }
  .import-progress { display:flex; align-items:center; gap:10px; margin:0 0 16px; padding:12px 16px; background:var(--control-surface); border-radius:6px; font-size:14px; line-height:1.5; }
  .import-progress[hidden] { display:none; }
  .import-spinner { width:18px; height:18px; flex:0 0 18px; border:2px solid #d6d3d0; border-top-color:#242424; border-radius:50%; animation:import-spin .8s linear infinite; }
  .is-importing #status, .is-importing #googleStatus { display:none; }
  @keyframes import-spin { to { transform:rotate(360deg); } }
}
@media screen and (max-width:700px) {
  .review-settings, .export-inventory { padding:12px; }
  .review-settings .comment-primary, .review-settings .review-filter-grid,
  .review-settings .review-extra .extra-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .review-settings .filter-field select, .review-settings .filter-field input[type=date], .review-settings #commentAuthor { font-size:16px; min-height:42px; height:42px; }
  .pdf-options .review-settings, .suggestion-options .review-settings { padding:8px 0; }
  .inventory-row { grid-template-columns:minmax(0,1fr); gap:4px; }
  .inventory-row>.inventory-actions, #inventory-pdf>.inventory-actions, #inventory-suggestions>.inventory-actions { grid-column:1; grid-row:auto; justify-content:flex-start; padding-left:23px; max-width:none; }
  .inventory-columns { display:none; }
  .inventory-heading { display:flex; align-items:flex-start; flex-wrap:wrap; }
  .zip-action { margin-top:2px; }
  .inventory-actions .format-chip { min-height:36px; }
}
@media (prefers-reduced-motion:reduce) { .import-spinner { animation:none; } }
@media print { .import-progress { display:none!important; } }

/* A shared card language for every function on the home page. */
@media screen {
  .home-page { --feature-border:#e4e4e4; --feature-radius:14px; --feature-ink:#191919; }
  .home-page .export-presets { display:block; margin:22px 0 0; padding:0; border:0; }
  .home-page .export-presets legend { float:none; width:auto; margin:0 0 12px; padding:0; border:0; font-size:18px; line-height:1.4; font-weight:600; letter-spacing:-.02em; }
  .home-page .preset-hint { top:2px; font-size:13px; }
  .home-page .preset-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
  .home-page .feature-card { display:flex; position:relative; min-width:0; margin:0; padding:22px; gap:0; border:1px solid var(--feature-border); border-radius:var(--feature-radius); background:#fff; color:var(--feature-ink); text-decoration:none; box-shadow:none; cursor:pointer; transition:background-color .15s ease-out,border-color .15s ease-out; }
  .home-page .feature-card:hover { background:#fafaf9; border-color:#b9b9b7; text-decoration:none; }
  .home-page .preset-option:has(input:checked) { background:#fff; border-color:#292929; }
  .home-page .feature-card:focus-visible, .home-page .feature-card:has(input:focus-visible) { outline:2px solid #1a73e8; outline-offset:3px; }
  .home-page .preset-option input { position:absolute; top:19px; right:19px; margin:0; width:17px; height:17px; accent-color:#191919; }
  .home-page .feature-card-content { display:flex; flex-direction:column; min-width:0; width:100%; }
  .home-page .feature-icon { display:flex; align-items:center; justify-content:center; width:46px; height:46px; margin:0 0 18px; border-radius:50%; flex-shrink:0; }
  .home-page .feature-icon svg { display:block; width:32px; height:32px; }
  .home-page .feature-icon-blue { background:#1685f4; }
  .home-page .feature-icon-red { background:#ff5142; }
  .home-page .feature-icon-green { background:#21b447; }
  .home-page .feature-icon-yellow { background:#ffb800; }
  .home-page .feature-card strong { display:block; padding:0; margin:0; font-size:20px; line-height:1.3; font-weight:700; letter-spacing:-.025em; color:var(--feature-ink); overflow-wrap:break-word; }
  .home-page .feature-card strong::before { content:none; }
  .home-page .feature-card small { display:block; margin:8px 0 0; font-size:14px; line-height:1.55; color:#62646b; }
  .home-page .feature-card .preset-formats { display:block; margin:0; padding-top:12px; margin-top:auto; color:#62646b; font-size:12px; line-height:1.5; }
  .home-page .home-fix { display:block; margin:20px 0 0; padding:0; }
  .home-page .home-fix>strong { display:block; font-size:18px; line-height:1.4; font-weight:600; letter-spacing:-.02em; margin:0 0 12px; }
  .home-page .feature-links { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
  .home-page .home-ocr-link { margin:14px 0 0; font-size:14px; line-height:1.6; }
  .home-page .home-ocr-link a { display:inline-block; padding:5px 0; color:var(--ui-ink); text-decoration:underline; text-underline-offset:3px; }
  .home-page .feature-link { padding:20px; }
  .home-page .feature-link strong { font-size:18px; }
  .home-page .feature-arrow { display:inline-flex; width:18px; height:18px; margin-left:6px; vertical-align:-2px; }
  .home-page .feature-arrow svg { width:100%; height:100%; }
  .home-page.loaded .export-presets, .home-page.loaded .home-fix { display:none; }
}
@media screen and (max-width:1000px) {
  .home-page .feature-card { padding:18px; }
  .home-page .feature-card strong { font-size:18px; }
  .home-page .feature-links { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media screen and (max-width:700px) {
  .home-page .export-presets { margin-top:20px; }
  .home-page .export-presets legend { margin-bottom:4px; }
  .home-page .preset-hint { position:static; margin:0 0 12px; font-size:13px; }
  .home-page .preset-list { grid-template-columns:1fr; gap:10px; }
  .home-page .preset-option .feature-card-content { display:grid; grid-template-columns:40px minmax(0,1fr); gap:0 14px; }
  .home-page .preset-option .feature-icon { grid-row:1/4; width:40px; height:40px; margin:0; }
  .home-page .preset-option .feature-icon svg { width:28px; height:28px; }
  .home-page .preset-option strong { padding-right:25px; }
  .home-page .preset-option small, .home-page .preset-option .preset-formats { grid-column:2; }
  .home-page .preset-option .preset-formats { padding-top:8px; }
  .home-page .home-fix { margin-top:18px; }
  .home-page .feature-links { gap:10px; }
  .home-page .feature-link { padding:16px; }
  .home-page .feature-link .feature-icon { width:40px; height:40px; margin-bottom:14px; }
  .home-page .feature-link .feature-icon svg { width:28px; height:28px; }
  .home-page .feature-link strong { font-size:17px; }
}
@media screen and (max-width:380px) { .home-page .feature-links { grid-template-columns:1fr; } }
@media (prefers-reduced-motion:reduce) { .home-page .feature-card { transition:none; } }

/* Progress sits beside the action and reports measured work when available. */
@media screen {
  .import-progress { display:block; padding:12px 14px; margin:12px 0; width:100%; grid-column:1/-1; scroll-margin:20px; }
  .progress-heading { display:flex; justify-content:space-between; align-items:baseline; gap:16px; }
  .progress-message { overflow-wrap:anywhere; }
  .progress-percent { flex-shrink:0; color:#62646b; font-size:12px; font-variant-numeric:tabular-nums; }
  .progress-track { height:5px; overflow:hidden; border-radius:3px; background:#dededa; margin-top:9px; }
  .progress-fill { display:block; height:100%; width:0; border-radius:inherit; background:#21863f; transition:width .15s linear; }
  .is-indeterminate .progress-fill { animation:progress-slide 1.25s ease-in-out infinite; transition:none; }
  @keyframes progress-slide { from { transform:translateX(-105%); } to { transform:translateX(390%); } }
  #archiveSize.is-calculating::after { content:''; display:block; height:3px; border-radius:2px; margin-top:4px; background:#21863f; animation:progress-pulse 1s ease-in-out infinite alternate; }
  @keyframes progress-pulse { to { opacity:.35; } }
  .merge-tool.merge-loaded .merge-queue { display:block; }
  .merge-tool .merge-queue { margin:20px 0 0; background:#f6f5f4; padding:18px; }
  .merge-queue h2 { font-size:19px; margin:0 0 10px; }
  .merge-options { margin:14px 0; }
  .merge-options p { max-width:80ch; font-size:13px; line-height:1.6; margin:8px 0; }
  .merge-options label { display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:14px; }
  #mergeModeNotice { color:#62646b; }
  .merge-tool #error { scroll-margin:20px; }
  #mergeResultStatus { font-size:13px; color:#62646b; margin:12px 0 0; }
  #mergeResultStatus:empty { display:none; }
  #mergePreview { margin:0 0 22px; scroll-margin:20px; }
  #mergePreview>.preview-label { margin-top:4px; }
  .merge-tool #originalPDFPreview { display:block; width:100%; height:70vh; min-height:380px; max-height:760px; }
  .merge-tool.original-pdf #mergePreview>.preview-label { display:flex!important; }
  .merge-tool.original-pdf .review-settings, .merge-tool.original-pdf #noCommentsNote, .merge-tool.original-pdf .print-tips { display:none!important; }
}
@media (prefers-reduced-motion:reduce) {
  .progress-fill { transition:none; }
  .is-indeterminate .progress-fill, #archiveSize.is-calculating::after { animation:none; }
}
/* Image text recognition follows the existing compact, neutral controls. */
@media screen {
  .ocr-controls { margin:12px 0 18px; padding:14px 16px; background:#f6f5f4; border-radius:6px; }
  .ocr-heading { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:6px 16px; }
  .ocr-heading h3 { font-size:16px; line-height:1.4; margin:0; }
  .ocr-heading a,.ocr-help,.ocr-status,.ocr-image-status { font-size:14px; line-height:1.5; color:#595959; }
  .ocr-actions,.ocr-result-actions { display:flex; align-items:flex-end; flex-wrap:wrap; gap:10px 14px; margin:12px 0 0; }
  .ocr-actions>label { display:flex; flex-direction:column; gap:5px; font-size:14px; }
  .ocr-actions select { min-height:40px; max-width:100%; background:#fff; border:1px solid #d7d7db; border-radius:6px; padding:8px 10px; font-size:14px; }
  .ocr-actions .button { min-height:40px; }
  .ocr-actions .text-button,.ocr-result-actions .text-button { min-height:40px; font-size:14px; margin:0; }
  .ocr-controls .ocr-help { margin:10px 0 0; max-width:80ch; }
  .ocr-controls .ocr-status { margin:8px 0 0; }
  .ocr-status:empty,.ocr-image-status:empty { display:none; }
  .document-extras .image-grid.has-ocr { grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); align-items:start; }
  .image-ocr { margin-top:8px; }
  .image-ocr .button { font-size:14px; min-height:36px; }
  .image-ocr .ocr-image-status { font-size:14px; margin:8px 0; overflow-wrap:anywhere; }
  .ocr-result { margin-top:10px; }
  .ocr-result label { display:block; margin-bottom:6px; font-size:14px; }
  .ocr-result textarea { display:block; width:100%; min-height:150px; max-height:480px; resize:vertical; background:#f6f5f4; border:1px solid #d7d7db; border-radius:6px; padding:10px; font-size:16px; line-height:1.5; color:#252525; }
  .ocr-result-actions { margin-top:4px; gap:4px 16px; }
  #inventory-ocr>p { display:block; grid-column:1/-1; grid-row:2; padding-left:23px; margin:0; color:#62646b; font-size:13px; line-height:1.5; }
  #inventory-ocr>.inventory-actions { grid-column:2; grid-row:1; }
  @media(max-width:700px) {
    #inventory-ocr>.inventory-actions { grid-column:1; grid-row:auto; justify-content:flex-start; padding-left:23px; max-width:none; }
  }
  .ocr-example blockquote { margin:16px 0; padding:16px; background:#f6f5f4; font-size:16px; line-height:1.6; }
  .ocr-example p { font-size:14px; line-height:1.6; }
  @media(max-width:520px) {
    .ocr-controls { padding:12px; }
    .ocr-actions { align-items:stretch; }
    .ocr-actions>label,.ocr-actions>.button { flex-basis:100%; }
    .ocr-actions select { width:100%; }
    .ocr-tool .image-export-heading { align-items:flex-start; }
    .ocr-tool .image-export-heading>.button { white-space:normal; }
  }
}
@media print { .ocr-controls,.image-ocr { display:none!important; } }
