* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Barlow", sans-serif;
  background: #282a36;
  color: #f8f8f2;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 3rem 1rem;
}

.container {
  width: 100%;
  max-width: 1100px;
}

h1 {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-align: center;
  margin-bottom: 2rem;
  color: #bd93f9;
}

.controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

select,
button {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border: 1px solid #6272a4;
  border-radius: 6px;
  background: #44475a;
  color: #f8f8f2;
  cursor: pointer;
  transition: border-color 0.15s;
}

select:hover,
button:hover {
  border-color: #bd93f9;
}

.panels {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.swap-wrap {
  display: flex;
  align-items: center;
}

textarea {
  width: 100%;
  flex: 1;
  min-height: 240px;
  padding: 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  border: 1px solid #6272a4;
  border-radius: 6px;
  background: #383a4a;
  color: #f8f8f2;
  resize: vertical;
  transition: border-color 0.15s;
}

textarea:focus {
  outline: none;
  border-color: #bd93f9;
}

.output-wrap {
  position: relative;
  flex: 1;
  display: flex;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.35rem;
  cursor: pointer;
  color: #6272a4;
  transition:
    color 0.15s,
    border-color 0.15s;
  line-height: 0;
}

.copy-btn:hover {
  color: #f8f8f2;
  border-color: #6272a4;
}

.copy-btn svg {
  width: 16px;
  height: 16px;
}

.swap-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 0.75rem;
  background: none;
  border: none;
  border-radius: 6px;
  color: #6272a4;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1;
}

.swap-btn:hover,
.swap-btn:focus {
  color: #bd93f9;
  outline: none;
}

.swap-icon-h {
  display: block;
}

.swap-icon-v {
  display: none;
}

.status {
  text-align: center;
  font-size: 0.8rem;
  color: #ff79c6;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

@media (max-width: 768px) {
  .container {
    max-width: 640px;
  }

  .panels {
    flex-direction: column;
  }

  .swap-wrap {
    justify-content: center;
  }

  .swap-btn {
    padding: 0.5rem 0;
    flex-direction: row;
    gap: 0.5rem;
  }

  .swap-icon-h {
    display: none;
  }

  .swap-icon-v {
    display: block;
  }

  textarea {
    min-height: 160px;
  }
}
