.twofa-wrap {
  width: min(1060px, calc(100vw - 28px));
}

.twofa-page .hero,
.twofa-page .panel,
.twofa-output {
  backdrop-filter: blur(10px);
}

.twofa-hero {
  padding: 24px 26px 22px;
}

.hero-topline,
.twofa-output-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  text-decoration: none;
  white-space: nowrap;
}

.twofa-note {
  position: relative;
  z-index: 1;
  border-radius: 13px;
  line-height: 1.45;
}

.twofa-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.88fr);
  gap: 16px;
  align-items: start;
}

.twofa-input-panel {
  min-height: 526px;
}

.twofa-drop {
  min-height: 300px;
}

.twofa-source {
  min-height: 300px;
  font-family: var(--mono);
  font-size: 13px;
}

.twofa-help {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(23, 50, 58, 0.1);
  border-radius: 13px;
  background: rgba(23, 50, 58, 0.045);
  color: var(--soft);
  font-size: 13px;
  line-height: 1.5;
}

.twofa-help strong {
  color: var(--ink);
}

.twofa-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 10px;
  margin-top: 14px;
}

.twofa-output {
  overflow: hidden;
  border: 1px solid rgba(23, 50, 58, 0.12);
  border-radius: 20px;
  background: rgba(255, 251, 243, 0.78);
  box-shadow: 0 18px 44px rgba(32, 40, 47, 0.1);
}

.twofa-output-head {
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(23, 50, 58, 0.1);
  background: linear-gradient(135deg, rgba(255, 247, 233, 0.9), rgba(255, 255, 255, 0.64));
}

.twofa-summary {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(191, 90, 54, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
}

.twofa-accounts {
  display: grid;
  gap: 10px;
  min-height: 346px;
  max-height: 540px;
  padding: 14px;
  overflow: auto;
}

.twofa-empty {
  display: grid;
  place-content: center;
  min-height: 316px;
  padding: 24px;
  border: 1px dashed rgba(23, 50, 58, 0.2);
  border-radius: 15px;
  text-align: center;
  background: rgba(23, 50, 58, 0.025);
}

.twofa-empty strong {
  color: var(--accent-strong);
  font-size: 15px;
}

.twofa-empty p,
.twofa-boundary p {
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.55;
}

.twofa-account,
.twofa-account-card {
  position: relative;
  display: grid;
  padding: 14px;
  border: 1px solid rgba(23, 50, 58, 0.12);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.68);
}

.twofa-account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.twofa-account-identity {
  min-width: 0;
}

.twofa-account-email {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.twofa-account-details {
  margin: 5px 0 0;
  color: var(--soft);
  font-size: 12px;
}

.twofa-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
}

.twofa-code {
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
}

.twofa-seconds,
.twofa-remaining {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
}

.twofa-timing {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.twofa-progress {
  width: 100%;
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 50, 58, 0.1);
}

.twofa-progress > span,
.twofa-progress-value {
  display: block;
  width: var(--totp-progress, 100%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d88b4a);
  transition: width 0.25s linear;
}

.twofa-card-actions {
  display: grid;
  align-content: start;
  gap: 8px;
}

.twofa-card-actions button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12px;
}

.twofa-copy {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(23, 50, 58, 0.14);
  font-size: 12px;
}

.twofa-delete {
  color: #922f2a;
  background: rgba(146, 47, 42, 0.07);
  border-color: rgba(146, 47, 42, 0.16);
}

.twofa-boundary {
  padding: 15px 20px 18px;
  border-top: 1px solid rgba(23, 50, 58, 0.1);
  background: rgba(23, 50, 58, 0.035);
}

.twofa-boundary strong {
  color: var(--accent-strong);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .twofa-grid {
    grid-template-columns: 1fr;
  }

  .twofa-input-panel {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .twofa-wrap {
    width: min(100vw - 16px, 100%);
  }

  .twofa-hero,
  .twofa-output-head,
  .twofa-boundary {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .back-link {
    width: 100%;
  }

  .twofa-note {
    display: grid;
    gap: 3px;
  }

  .twofa-actions {
    grid-template-columns: 1fr;
  }

  .twofa-output-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .twofa-account {
    grid-template-columns: 1fr;
  }

  .twofa-account-card {
    grid-template-columns: 1fr;
  }

  .twofa-card-actions {
    grid-template-columns: 1fr 1fr;
  }
}
