/* Activity-view layout: a content preview followed by destination app icons. */
html:has(dialog.vault-export-sheet:modal, > .sorty-vault-save-picker-host) { overflow:hidden !important; overscroll-behavior:none; }
/* Preserve the space a classic scrollbar occupied before the modal locked scrolling. */
html:has(dialog.vault-export-sheet[data-preserve-scrollbar]:modal, > .sorty-vault-save-picker-host[data-preserve-scrollbar]) { scrollbar-gutter:stable; }
dialog.vault-export-sheet {
  --export-surface:#1c1c1e; --export-raised:#2c2c2e; --export-text:#f5f5f7;
  --export-muted:#a1a1a6; --export-line:#38383a;
  position:fixed; inset:auto; margin:0; box-sizing:border-box; width:min(408px,calc(100vw - 24px));
  max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow:auto;
  padding:20px; border:0; border-radius:24px; background:var(--export-surface); color:var(--export-text);
  box-shadow:var(--vault-popover-shadow); scrollbar-color:var(--export-muted) transparent;
  font:14px/1.4 -apple-system,BlinkMacSystemFont,"Helvetica Neue",sans-serif;
}
dialog.vault-export-sheet:focus { outline:none; }
dialog.vault-export-sheet[open] { animation:vault-export-appear 180ms cubic-bezier(.22,1,.36,1); }
dialog.vault-export-sheet::backdrop { background:#0004; backdrop-filter:blur(3px); }
.vault-export-preview { display:flex; align-items:center; gap:14px; padding-bottom:20px; border-bottom:1px solid var(--export-line); }
.vault-export-preview > div:last-child { flex:1; min-width:0; }
.vault-export-preview h2 { margin:0 0 5px; color:var(--export-text); font-size:17px; font-weight:650; line-height:1.35; overflow-wrap:anywhere; }
.vault-export-preview p { margin:0; color:var(--export-muted); font-size:13px; line-height:1.5; }
.vault-export-image { display:grid; place-items:center; width:56px; height:56px; flex:0 0 56px; overflow:hidden; border-radius:14px; background:var(--export-raised); color:var(--sp-accent); }
.vault-export-image img { display:block; width:100%; height:100%; object-fit:cover; }
.vault-export-image > svg { width:28px; height:28px; }
.vault-export-options { display:grid; grid-template-columns:repeat(var(--vault-export-columns,4),minmax(0,1fr)); gap:8px; padding:20px 0; }
.vault-export-options button {
  display:flex; flex-direction:column; align-items:center; gap:8px; width:100%; min-width:0; min-height:100px;
  margin:0; padding:0; border:0; border-radius:14px; background:transparent; color:var(--export-text);
  font:500 12px/17px -apple-system,BlinkMacSystemFont,sans-serif; text-align:center; cursor:pointer;
}
.vault-export-app { display:grid; place-items:center; width:64px; height:64px; flex:none; border-radius:15px; box-shadow:inset 0 0 0 1px #ffffff14; }
.vault-export-app svg { width:48px; height:48px; }
.vault-export-app-sheets { background:linear-gradient(#22ba7c,#0f9d58); }
.vault-export-app-excel { background:linear-gradient(#21a366,#107c41); }
.vault-export-app-csv { background:linear-gradient(#59a5ff,#3478f6); }
.vault-export-app-json { background:linear-gradient(#68686e,#48484a); }
.vault-export-options button:hover .vault-export-app { filter:brightness(1.12); }
.vault-export-options button:active .vault-export-app { transform:scale(.96); }
.vault-export-cancel { width:100%; min-height:36px; padding:8px 12px; border:0; border-radius:12px; background:var(--export-raised); color:var(--export-text); font:600 13px/20px -apple-system,BlinkMacSystemFont,sans-serif; cursor:pointer; }
.vault-export-sheet button:focus-visible { outline:2px solid var(--export-muted); outline-offset:3px; }
@keyframes vault-export-appear { from { opacity:0; transform:translateY(8px) scale(.98); } to { opacity:1; transform:none; } }
@media(prefers-color-scheme:light) {
  dialog.vault-export-sheet { --export-surface:#fff; --export-raised:#f2f2f7; --export-text:#1c1c1e; --export-muted:#68686e; --export-line:#e5e5ea; }
}
@media(max-width:600px) {
  dialog.vault-export-sheet { width:calc(100vw - 24px); padding:18px 16px; }
  .vault-export-app { width:56px; height:56px; border-radius:14px; }
  .vault-export-options { gap:4px; }
  .vault-export-image { width:52px; height:52px; flex-basis:52px; }
}
@media(prefers-reduced-motion:reduce) {
  dialog.vault-export-sheet[open] { animation:none; }
  .vault-export-options button:active .vault-export-app { transform:none; }
}

.vault-delete-sheet .vault-export-preview { border:0; padding:0; }
.vault-delete-sheet .vault-export-preview p { white-space:pre-line; overflow-wrap:anywhere; }
.vault-delete-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; margin-top:22px; }
.vault-delete-actions .vault-export-cancel { width:auto; }

/* The Save sheet uses the same preview, destination tiles and Cancel row. */
.irs-save-scan-sheet {
  --sorty-field-bg:var(--export-raised);
  --sorty-field-text:var(--export-text);
  --sorty-field-muted:var(--export-muted);
  --sorty-field-border:var(--export-line);
  --sorty-field-accent:var(--export-muted);
}
.irs-save-scan-sheet h3 { margin:16px 0 0; color:var(--export-text); font-size:14px; }
.irs-save-scan-sheet .irs-project-choices {
  max-height:240px; overflow:auto; padding:12px 0 4px; scrollbar-width:thin; overscroll-behavior:contain;
}
.irs-save-scan-sheet .irs-project-choices:empty { display:none; }
.irs-save-scan-sheet .irs-project-choices button > span:last-child {
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere;
}
.irs-save-scan-sheet .vault-save-project-icon { background:var(--export-raised); color:var(--export-text); }
.irs-save-scan-sheet .vault-save-project-icon svg { width:30px; height:30px; }
.irs-save-scan-sheet .scan-icon-filled { display:none; }
.irs-save-scan-sheet form { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; margin:12px 0 16px; }
.irs-save-scan-sheet form label { display:grid; gap:5px; color:var(--export-muted); font-size:12px; }
.irs-save-scan-sheet form :is(input,button) {
  box-sizing:border-box; min-width:0; height:36px; padding:6px 10px; border:1px solid var(--export-line);
  border-radius:10px; background:var(--export-raised); color:var(--export-text); font:inherit; font-size:13px;
}
.irs-save-scan-sheet form button { background:var(--export-text); color:var(--export-surface); border-color:transparent; font-weight:600; cursor:pointer; }
.irs-save-scan-sheet form button:disabled { opacity:.5; cursor:wait; }
.irs-save-scan-sheet form input:focus-visible { outline:2px solid var(--export-muted); outline-offset:2px; }
.irs-save-sheet-error { margin:-6px 0 12px; color:var(--export-muted); }
.irs-save-sheet-error:empty { display:none; }
