* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #0d121c;
  color: #f7fbff;
}

.app-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
}

.panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 20px 24px 28px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.discontinued-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 14, 0.82);
  backdrop-filter: blur(6px);
}

.discontinued-modal__dialog {
  width: min(100%, 520px);
  padding: 28px;
  border: 1px solid rgba(255, 207, 102, 0.45);
  border-radius: 18px;
  background: #151c28;
  color: #fff7dc;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.discontinued-modal__dialog h2 {
  margin: 0 0 12px;
  font-size: 1.6rem;
  letter-spacing: 0;
}

.discontinued-modal__dialog p {
  margin: 0 0 14px;
  line-height: 1.5;
}

.discontinued-modal__dialog a {
  color: #9ee7ff;
  font-weight: 700;
}

.discontinued-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.discontinued-modal__primary,
.discontinued-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
}

.discontinued-modal__primary {
  background: linear-gradient(135deg, #5cc4ff, #7a5bff);
  color: #091120 !important;
  text-decoration: none;
}

.discontinued-modal__close {
  background: rgba(255, 255, 255, 0.12);
  color: #fff7dc;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.discontinued-modal__close:hover {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.new-version-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid rgba(92, 196, 255, 0.38);
  border-radius: 12px;
  background: rgba(92, 196, 255, 0.1);
  color: #f7fbff;
  text-align: center;
}

.new-version-notice a {
  color: #9ee7ff;
  font-weight: 700;
}

.panel h1,
.panel h2 {
  margin: 0 0 8px;
  letter-spacing: 0.03em;
}

.intro p {
  margin: 4px 0 16px;
  color: rgba(247, 251, 255, 0.85);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  align-items: center;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #5cc4ff, #7a5bff);
  color: #091120;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(92, 196, 255, 0.4);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

.hint {
  opacity: 0.7;
}

:root {
  --key-size: clamp(46px, 5vw, 60px);
}

.keyboard-wrapper {
  overflow-x: auto;
  padding-bottom: 8px;
  margin-top: 12px;
}

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: max-content;
}

.key-row {
  display: flex;
  gap: 8px;
}

.key {
  width: var(--key-size);
  height: var(--key-size);
  flex: 0 0 var(--key-size);
  border-radius: 14px;
  border: 1px solid #262f3d;
  background: linear-gradient(155deg, #1f2734, #121923);
  color: inherit;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.1s ease;
}

.key:hover {
  border-color: #6bd0ff;
  transform: translateY(-1px);
}

.key--active {
  border-color: #7a5bff;
  box-shadow: 0 0 0 2px rgba(122, 91, 255, 0.35);
}

.key-symbol {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  word-break: break-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.key-symbol--small {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.key-code {
  font-size: 0.65rem;
  opacity: 0.65;
  letter-spacing: 0.08em;
  align-self: flex-end;
}

.snippet {
  width: 100%;
  min-height: 220px;
  border-radius: 12px;
  border: 1px solid #262f3d;
  padding: 14px;
  font-family: "Fira Code", Consolas, monospace;
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
  resize: vertical;
}

.download-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}




.layer-tabs {
  display: flex;
  background: #1f2734;
  padding: 4px;
  border-radius: 99px;
  border: 1px solid #262f3d;
  gap: 4px;
  margin-bottom: 8px;
}

.layer-tab {
  background: transparent;
  color: #8b9bb4;
  font-size: 0.8rem;
  padding: 6px 16px;
  border-radius: 99px;
  box-shadow: none;
}

.layer-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transform: none;
  box-shadow: none;
}

.layer-tab--active {
  background: #354152;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.layer-indicator {
  font-size: 0.75rem;
  color: #5cc4ff;
  margin-left: auto;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 640px) {
  .discontinued-modal {
    align-items: flex-start;
    overflow-y: auto;
  }

  .discontinued-modal__dialog {
    padding: 22px;
  }

  .discontinued-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }
}
