/* The modal shell shared by every dialog, plus the two dialogs whose body styling is generic: the export modal and the add-account method picker. */

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 5vw;
  background: var(--modal-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal.active {
  display: flex;
}
.modal-content {
  width: min(640px, 90vw);
  max-width: 90vw;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: auto;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.confirm-modal-content {
  width: min(26rem, 90vw);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 1rem;
  font-weight: 600;
}
.modal-close {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted-foreground);
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.modal-close:hover {
  background: transparent;
  color: var(--destructive);
}
.modal-close:focus-visible {
  outline: 2px solid var(--destructive);
  outline-offset: 2px;
  color: var(--destructive);
}
.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  min-height: 0;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.confirm-message {
  margin: 0;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* Export modal */
.export-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.125rem;
}
.export-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
  user-select: none;
  min-width: 0;
}
.export-row:hover {
  background: var(--accent);
  border-color: var(--border);
}
.export-row.selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--card));
}
.export-row input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.export-row-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
}
.export-row-email {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.export-row-meta {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#exportJsonPreview textarea {
  width: 100%;
  min-height: 12rem;
  max-height: 40vh;
  padding: 0.625rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.45;
  background: var(--secondary);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  resize: none;
}
@media (max-width: 720px) {
  .export-list {
    grid-template-columns: 1fr;
    max-height: 45vh;
  }
  #exportModal .modal-footer {
    justify-content: stretch;
  }
  #exportModal .modal-footer .btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
  }
}
/* Add-account method picker */
.method-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
  margin-bottom: 1rem;
}
.method-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  text-align: left;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  cursor: pointer;
  font: inherit;
  transition:
    border-color 0.15s,
    background-color 0.15s,
    transform 0.12s ease;
}
.method-card:hover {
  border-color: var(--border-focus);
  background: color-mix(in oklab, var(--primary) 5%, var(--card));
  transform: translateY(-1px);
}
.method-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.method-card:active {
  transform: translateY(0);
}
.method-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--primary) 10%, var(--card));
  color: var(--primary);
  font-size: 1rem;
}
.method-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}
.method-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--foreground);
  line-height: 1.25;
}
.method-desc {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.method-arrow {
  flex: none;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  opacity: 0.6;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}
.method-card:hover .method-arrow {
  opacity: 1;
  transform: translateX(2px);
  color: var(--primary);
}
@media (max-width: 720px) {
  .method-list {
    grid-template-columns: 1fr;
  }
}

