:root {
  --bg: #0f172a;
  --panel: #111827;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2933;
  --danger: #f97373;
  --radius: 10px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(circle at top, #1f2937 0, #020617 55%, #000 100%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.app {
  width: 100%;
  max-width: 960px;
  background: linear-gradient(135deg, #020617 0, #020617 40%, #020617 100%);
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr);
}

@media (max-width: 840px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
}

.left,
.right {
  padding: 24px 28px;
}

.left {
  border-right: 1px solid rgba(15, 23, 42, 0.9);
}

@media (max-width: 840px) {
  .left {
    border-right: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.9);
  }
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.7rem;
  color: var(--muted);
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.8);
}

textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 14px 14px 40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: radial-gradient(circle at top left, #020617 0, #020617 40%, #020617 100%);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9);
}

textarea::placeholder {
  color: #4b5563;
}

.textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.char-count {
  opacity: 0.8;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #0b1120;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.45);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(56, 189, 248, 0.6);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.btn-secondary:hover {
  background: rgba(15, 23, 42, 1);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed rgba(75, 85, 99, 0.7);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.btn-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.status {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.2em;
}

.status.error {
  color: var(--danger);
}

.status.ok {
  color: #4ade80;
}

.right-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.right-section-title span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.field-group {
  margin-bottom: 14px;
}

.field-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

select,
input[type="range"] {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 7px 12px;
  font-size: 0.85rem;
  outline: none;
}

select:focus,
input[type="range"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
}

input[type="range"] {
  padding: 0;
  background: transparent;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-value {
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 32px;
  text-align: right;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pill {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: var(--muted);
}

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

.hint strong {
  font-weight: 600;
  color: #e5e7eb;
}

.accent-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.accent-note span {
  color: var(--accent);
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.download-link:hover {
  text-decoration: underline;
}
