.security-dialog {
  width: min(440px, calc(100vw - 32px));
}

.backup-dialog {
  --action-button-width: 156px;
  width: min(540px, calc(100vw - 32px));
}

.security-dialog form {
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 29px;
}

.security-symbol {
  align-items: center;
  background: #e3f4f1;
  border-radius: 50%;
  display: flex;
  height: 46px;
  justify-content: center;
  margin-bottom: 19px;
  width: 46px;
}

.security-symbol span {
  background: var(--teal-dark);
  border: 0;
  border-radius: 3px;
  height: 14px;
  position: relative;
  top: 4px;
  width: 18px;
}

.security-symbol span::before {
  border: 2px solid var(--teal-dark);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  content: "";
  height: 10px;
  left: 50%;
  position: absolute;
  top: -9px;
  transform: translateX(-50%);
  width: 12px;
}

.security-symbol span::after {
  background: #e3f4f1;
  border-radius: 2px;
  content: "";
  height: 5px;
  left: 50%;
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  width: 2px;
}

.backup-symbol {
  align-items: center;
  background: #e3f4f1;
  border-radius: 50%;
  display: flex;
  height: 46px;
  justify-content: center;
  margin-bottom: 15px;
  width: 46px;
}

.backup-symbol span {
  border: 2px solid var(--teal-dark);
  border-radius: 3px;
  display: block;
  height: 24px;
  position: relative;
  width: 19px;
}

.backup-symbol span::before {
  border-bottom: 2px solid var(--teal-dark);
  border-right: 2px solid var(--teal-dark);
  content: "";
  height: 6px;
  left: 50%;
  position: absolute;
  top: 5px;
  transform: translateX(-50%) rotate(45deg);
  width: 6px;
}

.backup-symbol span::after {
  background: var(--teal-dark);
  content: "";
  height: 10px;
  left: 50%;
  position: absolute;
  top: 3px;
  transform: translateX(-50%);
  width: 2px;
}

.security-dialog h2 {
  color: var(--navy);
  font-size: 24px;
  letter-spacing: -0.03em;
  margin: 0 0 9px;
}

.security-dialog form > p:not(.dialog-eyebrow):not(.security-error) {
  color: #647483;
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 19px;
}

.security-password-field {
  margin-top: 12px;
}

.security-warning {
  background: #fff8e8;
  border: 1px solid #efdbad;
  border-radius: 8px;
  color: #715a25;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 15px;
  padding: 10px;
}

.backup-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.backup-actions .button {
  margin-top: 0;
}

.backup-selected-file {
  align-items: center;
  background: #f5f8f9;
  border: 1px solid #dce5e9;
  border-radius: 10px;
  display: grid;
  gap: 11px;
  grid-template-columns: 34px minmax(0, 1fr);
  margin: 3px 0 15px;
  padding: 10px 12px;
}

.backup-selected-file[hidden] {
  display: none;
}

.backup-selected-file > span:last-child,
.backup-selected-file strong,
.backup-selected-file small {
  display: block;
  min-width: 0;
}

.backup-selected-file strong {
  color: var(--navy);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-selected-file small {
  color: #71808e;
  font-size: 11px;
  margin-top: 2px;
}

.backup-file-icon {
  border: 2px solid #5a8e8a;
  border-radius: 3px;
  height: 30px;
  position: relative;
  width: 24px;
}

.backup-file-icon::before,
.backup-file-icon::after {
  background: #5a8e8a;
  content: "";
  height: 2px;
  left: 5px;
  position: absolute;
  width: 11px;
}

.backup-file-icon::before {
  top: 9px;
}

.backup-file-icon::after {
  top: 15px;
}

.backup-preview {
  border: 1px solid #dbe5e9;
  border-radius: 11px;
  margin-top: 5px;
  overflow: hidden;
}

.backup-preview[hidden] {
  display: none;
}

.backup-preview-heading {
  align-items: baseline;
  background: #f3f7f8;
  border-bottom: 1px solid #dbe5e9;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 11px 13px;
}

.backup-preview-heading strong {
  color: var(--navy);
  font-size: 13px;
}

.backup-preview-heading small {
  color: #70808e;
  font-size: 10px;
  text-align: right;
}

.backup-preview-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 12px 13px;
}

.backup-preview-counts div {
  border-right: 1px solid #e1e7ea;
  min-width: 0;
  padding: 0 10px;
  text-align: center;
}

.backup-preview-counts div:first-child {
  padding-left: 0;
}

.backup-preview-counts div:last-child {
  border-right: 0;
  padding-right: 0;
}

.backup-preview-counts dt {
  color: #71808e;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.backup-preview-counts dd {
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.backup-restore-options {
  border: 0;
  border-top: 1px solid #e1e7ea;
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 12px 13px 13px;
}

.backup-restore-options legend {
  color: #526474;
  font-size: 11px;
  font-weight: 800;
  padding: 12px 0 0;
}

.backup-restore-options label {
  align-items: flex-start;
  border: 1px solid #dce5e9;
  border-radius: 9px;
  cursor: pointer;
  display: grid;
  gap: 9px;
  grid-template-columns: 17px minmax(0, 1fr);
  padding: 10px;
}

.backup-restore-options label:has(input:checked) {
  background: #edf8f6;
  border-color: #79bbb5;
}

.backup-restore-options input {
  accent-color: var(--teal-dark);
  margin: 2px 0 0;
}

.backup-restore-options strong,
.backup-restore-options small {
  display: block;
}

.backup-restore-options strong {
  color: var(--navy);
  font-size: 12px;
}

.backup-restore-options small {
  color: #687887;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 2px;
}

.security-error {
  background: #fff1f0;
  border: 1px solid #edc4c0;
  border-radius: 8px;
  color: #a33c36;
  font-size: 12px;
  margin: 12px 0 0;
  padding: 9px 10px;
}

.security-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.confirmation-dialog {
  border: 1px solid rgba(16, 42, 67, 0.1);
  width: min(500px, calc(100vw - 32px));
}

.confirmation-dialog form {
  padding: 0;
}

.confirmation-content {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: 40px minmax(0, 1fr);
  padding: 26px 28px 24px;
}

.confirmation-symbol {
  align-items: center;
  background: #fff2f1;
  border: 1px solid #edc9c6;
  border-radius: 10px;
  color: #a93c36;
  display: flex;
  font-size: 17px;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.confirmation-copy {
  min-width: 0;
}

.confirmation-dialog h2 {
  color: var(--navy);
  font-size: 21px;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 1px 0 8px;
}

.confirmation-copy p {
  color: #647483;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

.confirmation-dialog-actions {
  background: #f6f8f9;
  border-top: 1px solid #e2e8ec;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
  padding: 14px 20px;
}

.confirmation-dialog-actions .button {
  min-width: var(--action-button-width);
  width: var(--action-button-width);
}

.preflight-actions .button {
  width: 148px;
}

.button-confirm-danger {
  background: #b5443e;
  color: #ffffff;
}

.button-confirm-danger:hover,
.button-confirm-danger:focus-visible {
  background: #983630;
  outline: none;
}

.security-dialog[data-busy="true"] {
  cursor: wait;
}

.security-dialog[data-busy="true"] button,
.security-dialog[data-busy="true"] input {
  pointer-events: none;
}

@media (max-width: 520px) {
  .backup-actions {
    justify-content: flex-start;
  }

  .backup-actions .button {
    flex: 1 1 120px;
    justify-content: center;
  }

  .backup-preview-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .backup-preview-heading small {
    text-align: left;
  }

  .backup-preview-counts {
    padding-left: 10px;
    padding-right: 10px;
  }

  .backup-preview-counts div {
    padding-left: 6px;
    padding-right: 6px;
  }

  .backup-preview-counts dd {
    font-size: 13px;
  }
}

.app-shell.is-vault-locked .workspace,
.app-shell.is-vault-locked .top-actions {
  visibility: hidden;
}

