:root {
  color-scheme: light dark;
  font-family: "Segoe UI", Tahoma, sans-serif;
  line-height: 1.5;
  font-size: 16px;
  background-color: #f5f7fa;
  color: #1d2433;
}

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

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
}

.app-shell {
  max-width: 720px;
  margin: auto;
  padding: 3rem 1.5rem;
  display: grid;
  gap: 1.5rem;
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
}

header p {
  margin: 0;
  color: #5b6678;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.card label {
  font-weight: 600;
}

.input-group {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.input-group.compact {
  max-width: 220px;
}

.input-group small {
  color: #6c778a;
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #d6dce5;
  background-color: #fdfdfe;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: #3366ff;
  box-shadow: 0 0 0 3px rgba(51, 102, 255, 0.15);
}

textarea {
  resize: vertical;
  min-height: 112px;
}

.primary {
  background-color: #3366ff;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(51, 102, 255, 0.25);
}

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

.mode-switch {
  display: flex;
  gap: 1.5rem;
  margin: 0 0 1rem;
  border: none;
  padding: 0;
}

.mode-switch legend {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-option {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.results-card {
  position: relative;
  padding-top: 1.25rem;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.results-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

#results-output {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 12px;
  overflow-x: auto;
  max-height: 280px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.copy-btn {
  background: #0ea5e9;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.copy-btn:hover {
  background: #0284c7;
  transform: translateY(-1px);
}

.copy-btn:active {
  transform: scale(0.98);
}

.hidden {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root {
    background-color: #0f172a;
    color: #e2e8f0;
  }

  .card {
    background: #111b2f;
    box-shadow: 0 20px 50px rgba(8, 47, 73, 0.35);
  }

  input[type="text"],
  input[type="number"],
  textarea {
    background: #0b1220;
    border-color: #1e293b;
    color: inherit;
  }

  input[type="text"]:focus,
  input[type="number"]:focus,
  textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  }

  #results-output {
    background: #020817;
    color: #cbd5f5;
  }
}

