:root {
  --bg: #F4F7FB;
  --panel: rgba(255, 255, 255, 0.98);
  --text: #1f1f22;
  --muted: #6b6b72;
  --border: rgba(74, 96, 146, 0.08);
  --border-strong: rgba(74, 96, 146, 0.14);
  --primary: #006aff;
  --primary-hover: #0058d7;
  --success: #1f9d57;
  --danger: #ef4444;
  --danger-soft: #fff4f5;
  --surface-soft: #f6f6f8;
  --shadow: 0 10px 22px rgba(56, 79, 130, 0.08), 0 24px 44px rgba(56, 79, 130, 0.10);
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: var(--text);
  background: var(--bg);
  padding: 22px 12px;
}

.app-shell {
  max-width: 640px;
  margin: 0 auto;
}

.card,
.panel,
.info,
.lang-switch {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  margin-bottom: 12px;
  background: #ffffff;
}

h1 {
  margin: 0 0 4px;
  font-size: clamp(1.22rem, 2.1vw, 1.75rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: #1d1d22;
}

h1 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

h1 .version {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #006aff;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.45;
  white-space: nowrap;
}

.lang-switch {
  position: relative;
  min-width: 46px;
  border-radius: 9px;
  overflow: visible;
  box-shadow: none;
}

.custom-dropdown {
  position: relative;
  width: 46px;
}

.custom-dropdown-select {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 12px 5px 0;
  border-radius: 9px;
  border: 1px solid rgba(74, 96, 146, 0.10);
  background: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  color: #24242a;
  cursor: pointer;
  user-select: none;
}

.custom-dropdown::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-50%) rotate(45deg);
  transform-origin: center;
  pointer-events: none;
  transition: transform 180ms ease;
}

.custom-dropdown.open::after {
  transform: translateY(-20%) rotate(225deg);
}

.custom-dropdown-options {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.custom-dropdown.open .custom-dropdown-options {
  display: block;
}

#customLanguageSelector .custom-dropdown-options li {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #24242a;
  border-radius: 8px;
  cursor: pointer;
}

.custom-dropdown-options li:hover {
  background: var(--surface-soft);
}
#languageSelector {
  display: none;
}

.stack {
  display: grid;
  gap: 12px;
}

.panel {
  padding: 14px;
}

.panel h2 {
  margin: 0 0 4px;
  font-size: 0.94rem;
  letter-spacing: -0.02em;
  color: #24242a;
}

.result-panel.result-visible {
  animation: resultFadeIn 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--result-delay, 0ms);
}

@keyframes resultFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-panel.result-visible {
    animation: none;
  }
}

.panel-intro {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.79rem;
}

.field-group {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.config-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.password-field-group {
  align-content: start;
}

.password-message-slot {
  display: contents;
}

.keysize-label {
  display: block;
  margin-top: 2px;
  margin-bottom: 6px;
}

.keysize-select {
  display: block;
  width: 100%;
  margin-bottom: 12px;
}

label {
  font-size: 0.83rem;
  font-weight: 600;
  color: #28282e;
}

input,
select,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  outline: none;
  font-size: 0.88rem;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

input:focus,
  select:focus,
  textarea:focus {
    border-color: rgba(0, 0, 0, 0.24);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.07);
}

textarea {
  min-height: 190px;
  resize: vertical;
  line-height: 1.45;
}

#publicKey,
#privateKey {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: normal;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.panel-header h2 {
  margin: 0;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.key-action-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(36, 70, 120, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(32, 67, 116, 0.05);
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.key-action-button svg {
  fill: none;
  stroke: currentColor;
}

.key-action-button.is-success {
  background: #eaf7ef;
  border-color: rgba(31, 157, 87, 0.24);
  color: var(--success);
}

.fingerprint-row {
  position: relative;
}

.fingerprint-row .fingerprint {
  padding-right: 44px;
}

.password-container {
  position: relative;
}

.password-container input[type="password"],
.password-container input[type="text"] {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  z-index: 1;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.icon-btn {
  min-width: 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(36, 70, 120, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 6px 16px rgba(32, 67, 116, 0.05);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
  padding: 0;
}

.copy-button {
  position: absolute;
  top: 50%;
  right: 4px;
  z-index: 1;
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transform: translateY(-50%);
  transition:
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.icon-btn svg {
  fill: currentColor;
}

.copy-button svg {
  fill: none;
  stroke: currentColor;
}

#togglePassword svg,
#togglePasswordConfirm svg,
#copyFingerprint svg,
#copyLongKeyId svg {
  fill: none;
  stroke: currentColor;
}

.primary-btn,
.export-button,
.reset-button,
#generateBtn {
  width: 100%;
  border: 0;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

#generateBtn,
.export-button {
  background: linear-gradient(135deg, #1677ff, var(--primary));
  box-shadow:
    0 12px 24px rgba(0, 106, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.reset-button {
  border: 1px solid rgba(239, 68, 68, 0.24);
  background: #fff4f5;
  color: #d93645;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.08);
}

#generateBtn:disabled,
.export-button:disabled {
  background: #006aff;
}

button:disabled {
  opacity: 0.43;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
  filter: none;
}

.message,
.password-match-message,
.password-length-message,
#keyGenerationSuccess,
#copiedMessage,
#copiedMessageLongKeyId {
  display: none;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
}

#keyGenerationSuccess {
  margin-top: 12px;
}

.key-validity-info {
  display: none;
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(246, 246, 248, 0.98)
  );
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.key-validity-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.key-validity-row + .key-validity-row {
  margin-top: 2px;
}

.key-validity-row strong {
  color: #28282e;
}

.key-validity-reminder {
  display: none;
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.password-match-message.success,
#keyGenerationSuccess,
#copiedMessage,
#copiedMessageLongKeyId {
  color: var(--success);
}

.password-match-message.error,
.password-length-message.error {
  color: var(--danger);
}

.section-card,
.info {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(74, 96, 146, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 254, 0.98));
  padding: 12px;
}

.fingerprint {
  font-size: 0.75rem;
  color: #28282e;
  background: rgba(0, 0, 0, 0.04);
  padding: 10px 11px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 400;
  letter-spacing: normal;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow-x: auto;
  white-space: nowrap;
  flex: 1;
}

.key-info-label {
  font-weight: 700;
}

.loader {
  display: none;
  margin: 14px auto 4px;
  border: 4px solid #ececef;
  border-top: 4px solid #2d2d33;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.private-key-warning {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-top: 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.78rem;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.18);
  line-height: 1.45;
}

.actions-stack {
  display: grid;
  gap: 8px;
}

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

.more-functions-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.more-functions-actions button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
}

.export-key-pair-button {
  border: 1px solid rgba(0, 106, 255, 0.18);
  background: rgba(0, 106, 255, 0.06);
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(0, 106, 255, 0.07);
}

.export-key-pair-button:disabled {
  border-color: rgba(0, 106, 255, 0.14);
  background: rgba(0, 106, 255, 0.06);
  color: var(--primary);
}

.info {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.79rem;
}

.info strong {
  display: block;
  color: #24242a;
  margin-bottom: 14px;
}

.security-details {
  padding: 0;
  overflow: hidden;
}

.security-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: #24242a;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.security-summary::-webkit-details-marker {
  display: none;
}

.security-summary::marker {
  content: "";
}

.security-summary strong {
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.4;
}

.security-chevron {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 180ms ease;
}

.security-details[open] .security-chevron {
  transform: rotate(225deg);
}

.security-details-content {
  padding: 0 12px 12px;
  border-top: 1px solid rgba(74, 96, 146, 0.08);
  animation: securityDetailsFadeIn 220ms ease-out;
}

.security-details-content p:first-child {
  margin-top: 12px;
}

@keyframes securityDetailsFadeIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .security-chevron {
    transition: none;
  }

  .security-details-content {
    animation: none;
  }
}

.security-summary:focus-visible {
  outline: 3px solid rgba(0, 106, 255, 0.24);
  outline-offset: -3px;
}

.info p {
  margin: 0 0 12px;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}
.info p:last-child {
  margin-bottom: 0;
}

.copyright a,
#securityTextLine2 a {
  color: #006aff;
  text-decoration: none;
}

.copyright a:hover,
#securityTextLine2 a:hover {
  text-decoration: underline;
}

.footer-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -2px;
  margin-bottom: 0;
}

.footer-logo img {
  display: block;
  width: 84px;
  max-width: 31%;
  height: auto;
  opacity: 0.72;
  user-select: none;
  pointer-events: none;
}

.copyright {
  text-align: center;
  color: rgba(32, 32, 36, 0.62);
  font-size: 0.78rem;
  margin-top: 16px;
}

.custom-key-size-dropdown {
  display: none;
}

.update-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(2px);
}

.update-modal-box {
  width: max-content;
  max-width: calc(100vw - 36px);
  border-radius: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

.update-modal-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0, 112, 240, 0.08);
  color: #006aff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.update-modal-box h2 {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #24242a;
}

.update-version-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: translateY(-1px);
  flex-shrink: 0;
}

.update-modal-box ul {
  width: max-content;
  max-width: 100%;
  margin: 0 0 10px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.update-modal-thanks {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.update-modal-box li + li {
  margin-top: 6px;
}

.update-modal-box li {
  white-space: nowrap;
}

.update-modal-box button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  background: linear-gradient(135deg, #1677ff, var(--primary));
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
  box-shadow: 0 12px 24px rgba(0, 106, 255, 0.22);
}

.reset-confirm-box {
  width: min(430px, calc(100vw - 36px));
  border-radius: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

.reset-confirm-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.09);
  color: #ef4444;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.reset-confirm-box h2 {
  margin: 0 0 8px;
  color: #24242a;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.reset-confirm-box p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.reset-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.reset-confirm-actions button {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.reset-confirm-cancel {
  border: 1px solid rgba(36, 70, 120, 0.12);
  background: #eef3fa;
  color: #40506a;
  box-shadow: 0 8px 20px rgba(32, 67, 116, 0.08);
}

.reset-confirm-confirm {
  border: 1px solid #ef4444;
  background: #ef4444;
  color: #fff;
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.22);
}

.reset-confirm-actions button:focus-visible {
  outline: 3px solid rgba(0, 106, 255, 0.24);
  outline-offset: 2px;
}

.reset-confirm-confirm:focus-visible {
  outline-color: rgba(239, 68, 68, 0.3);
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 106, 255, 0.2);
}

/* Desktop: Hover-Effekte nur bei Maus oder präzisem Zeiger */
@media (hover: hover) and (pointer: fine) {
  .security-summary:hover {
    background: rgba(0, 106, 255, 0.05);
  }

  .icon-btn:hover {
    transform: translateY(-1px);
    background: rgba(0, 106, 255, 0.1);
    border-color: rgba(0, 106, 255, 0.28);
    box-shadow: 0 10px 24px rgba(0, 106, 255, 0.1);
  }

  .copy-button:hover {
    background: rgba(0, 106, 255, 0.1);
    color: var(--primary-hover);
  }

  .password-toggle:hover {
    background: rgba(0, 106, 255, 0.1);
    color: var(--primary-hover);
  }

  .key-action-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(0, 106, 255, 0.1);
    border-color: rgba(0, 106, 255, 0.28);
    color: var(--primary-hover);
    box-shadow: 0 10px 24px rgba(0, 106, 255, 0.1);
  }

  #generateBtn:hover:not(:disabled),
  .export-button:hover:not(:disabled) {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #0a6df3, var(--primary-hover));
    box-shadow:
      0 17px 30px rgba(0, 106, 255, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }

  .export-key-pair-button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(0, 106, 255, 0.28);
    background: rgba(0, 106, 255, 0.1);
    color: var(--primary-hover);
    box-shadow: 0 10px 22px rgba(0, 106, 255, 0.1);
  }

  .reset-button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(239, 68, 68, 0.38);
    background: #ffe9ec;
    box-shadow: 0 10px 22px rgba(239, 68, 68, 0.12);
  }

  .update-modal-box button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #0a6df3, var(--primary-hover));
    box-shadow: 0 16px 28px rgba(0, 106, 255, 0.28);
  }

  .reset-confirm-cancel:hover {
    transform: translateY(-1px);
    border-color: rgba(36, 70, 120, 0.2);
    background: #e5ecf6;
    box-shadow: 0 10px 22px rgba(32, 67, 116, 0.1);
  }

  .reset-confirm-confirm:hover {
    transform: translateY(-1px);
    border-color: #dc2626;
    background: #dc2626;
    box-shadow: 0 16px 28px rgba(239, 68, 68, 0.28);
  }
}

/* Mobil: dieselbe Hervorhebung nur während des Antippens */
@media (hover: none) and (pointer: coarse) {
  .security-summary:active {
    background: rgba(0, 106, 255, 0.08);
  }

  .icon-btn:active {
    transform: translateY(-1px);
    background: rgba(0, 106, 255, 0.1);
    border-color: rgba(0, 106, 255, 0.28);
    box-shadow: 0 10px 24px rgba(0, 106, 255, 0.1);
  }

  .copy-button:active {
    background: rgba(0, 106, 255, 0.16);
    color: var(--primary-hover);
  }

  .password-toggle:active {
    background: rgba(0, 106, 255, 0.16);
    color: var(--primary-hover);
  }

  .key-action-button:active:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(0, 106, 255, 0.16);
    border-color: rgba(0, 106, 255, 0.28);
    color: var(--primary-hover);
    box-shadow: 0 10px 24px rgba(0, 106, 255, 0.1);
  }

  #generateBtn:active:not(:disabled),
  .export-button:active:not(:disabled) {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #0a6df3, var(--primary-hover));
    box-shadow:
      0 17px 30px rgba(0, 106, 255, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }

  .export-key-pair-button:active:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(0, 106, 255, 0.28);
    background: rgba(0, 106, 255, 0.14);
    color: var(--primary-hover);
    box-shadow: 0 10px 22px rgba(0, 106, 255, 0.1);
  }

  .reset-button:active:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(239, 68, 68, 0.38);
    background: #ffe9ec;
    box-shadow: 0 10px 22px rgba(239, 68, 68, 0.12);
  }

  .update-modal-box button:active {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #0a6df3, var(--primary-hover));
    box-shadow: 0 16px 28px rgba(0, 106, 255, 0.28);
  }

  .reset-confirm-cancel:active {
    transform: translateY(-1px);
    border-color: rgba(36, 70, 120, 0.2);
    background: #e5ecf6;
    box-shadow: 0 10px 22px rgba(32, 67, 116, 0.1);
  }

  .reset-confirm-confirm:active {
    transform: translateY(-1px);
    border-color: #dc2626;
    background: #dc2626;
    box-shadow: 0 16px 28px rgba(239, 68, 68, 0.28);
  }
}

@media (max-width: 640px) {
  body {
    padding: 16px 10px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .update-modal-box {
    width: 100%;
    max-width: 430px;
  }

  .reset-confirm-box {
    width: 100%;
    max-width: 430px;
  }

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

  .update-modal-box ul {
    width: auto;
  }

  .update-modal-box li {
    white-space: normal;
  }

  .hero,
  .panel,
  .info {
    padding: 12px;
  }

  .hero {
    align-items: flex-start;
  }

  .hero-subtitle {
    white-space: normal;
  }

  .config-field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }


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

  .fingerprint-row {
    position: relative;
  }

  .icon-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .fingerprint {
    min-width: 0;
  }

  #keySize,
  #keyExpiration {
    display: none;
  }

  .custom-key-size-dropdown {
    position: relative;
    display: block;
    width: 100%;
    margin-top: -4px;
    margin-bottom: 10px;
  }

  .custom-key-size-dropdown .custom-dropdown-select {
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    justify-content: flex-start;
    padding: 10px 38px 10px 12px;
    font-size: 0.88rem;
    font-weight: 500;
  }

  .custom-key-size-dropdown::after {
    content: "▾";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--muted);
  }

  .custom-key-size-dropdown .custom-dropdown-options {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
  }

  .custom-key-size-dropdown .custom-dropdown-options li {
    padding: 9px 10px;
    cursor: pointer;
    font-size: 0.86rem;
    text-align: left;
    border-radius: 8px;
  }

  .custom-key-size-dropdown .custom-dropdown-options li:hover {
    background: var(--surface-soft);
  }

  .custom-key-size-dropdown.open .custom-dropdown-options {
    display: block;
  }
}
