.orca-dialog {
  position: fixed;
  inset: 0;
  width: min(64rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  border: 0;
  border-radius: 1rem;
  background: transparent;
  margin: auto;
  padding: 0;
}

html.orca-dialog-open,
body.orca-dialog-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.orca-dialog-open {
  position: fixed;
  right: 0;
  left: 0;
  width: 100%;
}

.orca-preview-dialog {
  width: min(72rem, calc(100vw - 2rem));
}

.orca-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.orca-dialog-panel {
  max-height: inherit;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  padding: 1.5rem;
}

.orca-dialog-backdrop {
  display: none;
}

.orca-export-dialog {
  width: min(32rem, calc(100vw - 2rem));
}

.orca-confirm-dialog {
  width: min(30rem, calc(100vw - 2rem));
}

.orca-preview-frame {
  height: min(72vh, 44rem);
  height: min(72dvh, 44rem);
}

.orca-preview-image {
  max-height: min(72vh, 44rem);
  max-height: min(72dvh, 44rem);
}

.orca-preview-filename-form {
  margin-top: 0.25rem;
}

.orca-preview-filename-field {
  display: inline-flex;
  align-items: center;
  max-width: min(34rem, calc(100vw - 10rem));
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.orca-preview-filename-field:focus-within {
  border-color: #0058be;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 88, 190, 0.12);
}

.orca-preview-filename-input {
  min-width: 8rem;
  width: min(24rem, 52vw);
  border: 0;
  background: transparent;
  color: #45464d;
  font-size: 0.875rem;
  line-height: 1.4;
  outline: none;
  padding: 0.25rem 0.125rem 0.25rem 0.375rem;
}

.orca-preview-filename-extension {
  flex-shrink: 0;
  color: #45464d;
  font-size: 0.875rem;
  line-height: 1.4;
  padding-right: 0.375rem;
}

.orca-preview-filename-message {
  min-height: 1rem;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.25;
}

.orca-preview-filename-message.is-error {
  color: #ba1a1a;
}

.orca-current-editing-card {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  background: #ffffff;
  padding: 0.875rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.orca-current-editing-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 3.25rem;
  height: 3.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fcf8fa;
  color: #94a3b8;
}

.orca-mobile-edit-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.orca-mobile-receipt-row-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  min-height: 4.75rem;
  padding: 0.95rem 1rem;
  text-align: left;
}

.orca-mobile-receipt-row-button:active {
  background: #f6f3f5;
}

.orca-mobile-receipt-row-button:focus-visible {
  outline: 2px solid #0058be;
  outline-offset: -2px;
}

.orca-mobile-receipt-primary {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #000000;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.orca-mobile-receipt-primary {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.orca-mobile-receipt-primary--interactive:hover,
.orca-mobile-receipt-primary--interactive:focus-visible {
  color: #0058be;
  text-decoration: underline;
}

.orca-mobile-receipt-detail {
  margin-top: 0.125rem;
  overflow: hidden;
  color: #45464d;
  font-size: 0.75rem;
  line-height: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orca-mobile-receipt-detail--block {
  display: block;
}

.orca-mobile-receipt-detail-value {
  font-size: 0.8rem;
}

.orca-mobile-row-missing-text {
  color: #f59e0b;
  font-weight: 400;
}

.orca-mobile-receipt-primary--interactive.orca-mobile-row-missing-text:hover,
.orca-mobile-receipt-primary--interactive.orca-mobile-row-missing-text:focus-visible {
  color: #f59e0b;
}

.orca-mobile-status-hint {
  color: #45464d;
  font-size: 0.8125rem;
  line-height: 1.35;
  margin-top: 0.75rem;
}

.orca-mobile-status-hint strong {
  color: #1b1b1d;
  font-weight: 600;
}

.orca-mobile-field {
  display: grid;
  gap: 0.5rem;
}

.orca-mobile-label {
  color: #1b1b1d;
  font-size: 0.875rem;
  font-weight: 600;
}

.orca-mobile-input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid #dbe3ef;
  border-radius: 0.75rem;
  background: #ffffff;
  color: #1b1b1d;
  font-size: 1rem;
  line-height: 1.4;
  outline: none;
  padding: 0.75rem 0.875rem;
}

.orca-mobile-input:focus {
  border-color: #0058be;
  box-shadow: 0 0 0 3px rgba(0, 88, 190, 0.12);
}

.orca-mobile-amount-field {
  display: flex;
  align-items: center;
  border: 1px solid #dbe3ef;
  border-radius: 0.75rem;
  background: #ffffff;
}

.orca-mobile-amount-field:focus-within {
  border-color: #0058be;
  box-shadow: 0 0 0 3px rgba(0, 88, 190, 0.12);
}

.orca-mobile-amount-field .orca-mobile-input {
  border: 0;
  box-shadow: none;
}

.orca-mobile-amount-field span {
  flex-shrink: 0;
  color: #64748b;
  font-size: 1rem;
  font-weight: 600;
  padding-right: 0.875rem;
}

.orca-mobile-edit-actions {
  display: grid;
  gap: 0.875rem;
  padding-top: 0.75rem;
}

.orca-mobile-edit-actions .orca-primary-button {
  width: 100%;
  min-height: 3.25rem;
  font-size: 0.9375rem;
}

.orca-mobile-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 3rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: #ba1a1a;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 700;
}

.orca-mobile-delete-button:hover,
.orca-mobile-delete-button:focus-visible {
  background: #fff7f6;
}

.orca-mobile-date-field {
  display: grid;
  gap: 0.75rem;
}

.orca-mobile-date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.orca-mobile-date-trigger .lucide-icon {
  color: #1b1b1d;
  font-size: 1.25rem;
}

.orca-mobile-date-picker {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.orca-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #dbeafe;
  border-top-color: #0058be;
  border-radius: 9999px;
  animation: orca-spin 800ms linear infinite;
}

.orca-toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 100;
  max-width: min(24rem, calc(100vw - 2rem));
  border-radius: 0.875rem;
  background: #111827;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  padding: 0.875rem 1rem;
}

.orca-upload-manager {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 100;
  width: min(24rem, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.orca-upload-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 0.75rem;
}

.orca-upload-item + .orca-upload-item {
  margin-top: 0.625rem;
}

.orca-upload-item-complete {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.orca-upload-item-error {
  background: #fff7f6;
  border-color: #ffdad6;
}

.orca-upload-item-error [data-upload-progress] {
  background: #ba1a1a;
}

@keyframes orca-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes orca-shimmer {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

@keyframes orca-row-updated {
  0% {
    background-color: #ecfdf5;
  }

  55% {
    background-color: #f0fdfa;
  }

  100% {
    background-color: transparent;
  }
}

@keyframes orca-mobile-sheet-enter {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes orca-mobile-sheet-exit {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(100%);
  }
}

@media (max-width: 767px) {
  .orca-dialog {
    width: min(100vw - 1rem, 34rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 0.875rem;
  }

  .orca-preview-dialog {
    width: min(100vw - 1rem, 42rem);
  }

  .orca-dialog-panel {
    border-radius: 0.875rem;
    padding: 1rem;
  }

  .orca-mobile-edit-dialog {
    inset: auto 0 0;
    width: 100vw;
    max-width: 100vw;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - 0.5rem);
    max-height: min(42rem, calc(100svh - env(safe-area-inset-top, 0px) - 0.5rem));
    margin: 0;
    border-radius: 1.5rem 1.5rem 0 0;
    overflow: hidden;
  }

  .orca-mobile-edit-dialog[open] {
    animation: orca-mobile-sheet-enter 220ms cubic-bezier(0.2, 0, 0, 1);
  }

  .orca-mobile-edit-dialog.is-closing {
    animation: orca-mobile-sheet-exit 180ms cubic-bezier(0.4, 0, 1, 1);
  }

  .orca-mobile-edit-dialog.is-dragging {
    -webkit-user-select: none;
    user-select: none;
  }

  .orca-mobile-edit-dialog.is-dragging .orca-mobile-edit-panel {
    will-change: transform;
  }

  .orca-mobile-edit-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 1.5rem 1.5rem 0 0;
    overflow: hidden;
    overscroll-behavior: contain;
    padding: 0;
  }

  .orca-mobile-edit-header {
    flex: 0 0 auto;
    background: #ffffff;
    border-radius: 1.5rem 1.5rem 0 0;
    cursor: grab;
    padding: 0.875rem 1rem 0.75rem;
    touch-action: none;
  }

  .orca-mobile-sheet-handle {
    touch-action: none;
  }

  .orca-mobile-edit-header:active {
    cursor: grabbing;
  }

  .orca-mobile-edit-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .orca-mobile-sheet-handle {
    width: 3rem;
    height: 0.35rem;
    border-radius: 9999px;
    background: #e2e8f0;
    margin: 0 auto 1rem;
  }

  .orca-preview-frame {
    height: min(68dvh, 34rem);
  }

  .orca-preview-image {
    max-height: min(68dvh, 34rem);
  }

  .orca-documents-header {
    align-items: stretch;
    flex-direction: column;
  }

  .orca-filter-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .orca-search-field {
    flex: 0 1 auto;
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .orca-date-range-filter {
    flex-basis: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .orca-menu-panel {
    min-width: 11rem;
  }

  .orca-toast {
    right: 1rem;
    bottom: 1rem;
  }

  .orca-upload-manager {
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 70vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 1rem 1rem 0 0;
  }
}
