*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background-color: #fafafa;
  color: #222;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #333;
}

h2 {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
  color: #444;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: background-color 0.2s, border-color 0.2s;
}

.tab:hover {
  background-color: #f0f0f0;
}

.tab.active {
  background-color: #4a90d9;
  color: #fff;
  border-color: #4a90d9;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.panel {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0 0 4px 4px;
  padding: 1rem;
}

textarea {
  width: 100%;
  height: 150px;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}

textarea:focus {
  outline: 2px solid #4a90d9;
  outline-offset: -1px;
}

textarea[readonly] {
  background-color: #f5f5f5;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.option-group label {
  font-size: 0.875rem;
  color: #555;
}

select,
input[type="number"] {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

select:focus,
input[type="number"]:focus {
  outline: 2px solid #4a90d9;
  outline-offset: -1px;
}

input[type="number"] {
  width: 100px;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  margin: 1rem 0;
  background-color: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #3a7bc8;
}

.btn-primary:active {
  background-color: #2d6bb3;
}

.btn-primary:focus-visible,
.btn-action:focus-visible {
  outline: 2px solid #2d6bb3;
  outline-offset: 2px;
}

.output-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.output-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-action {
  padding: 0.5rem 1rem;
  min-width: 80px;
  background-color: #fff;
  color: #666;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.btn-action:hover {
  background-color: #f5f5f5;
  border-color: #999;
}

.btn-action:active {
  background-color: #eee;
}

.btn-action.copied {
  background-color: #4a90d9;
  color: #fff;
  border-color: #4a90d9;
}

footer {
  margin-top: 2rem;
}

.footer {
  text-align: center;
  padding: 1rem;
  color: #666;
  font-size: 0.875rem;
}

.footer a {
  color: #4a90d9;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (min-width: 600px) {
  .options {
    flex-direction: row;
    align-items: flex-end;
  }

  .option-group {
    flex: 1;
  }

  .btn-primary {
    width: auto;
  }
}
