:root {
  --bg: #0b1020;
  --bg-panel: #121827;
  --bg-panel-soft: #171f31;
  --border: #293249;
  --accent: #4f9cff;
  --accent-soft: rgba(79, 156, 255, 0.15);
  --text: #e4e7ef;
  --muted: #9ba3ba;
  --error: #ff6b81;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.4);
  --font-mono:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New",
    monospace;
  --font-sans:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: radial-gradient(
    circle at top,
    #1c2740 0,
    #050813 45%,
    #020309 100%
  );
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.app {
  max-width: 1200px;
  width: 100%;
  margin: 24px;
  background: linear-gradient(145deg, #050814 0, #0c1325 40%, #050814 100%);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: radial-gradient(
    circle at left,
    rgba(79, 156, 255, 0.2),
    transparent 55%
  );
}

header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
}

header h1 .logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4f9cff, #8f7bff);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.5);
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
  max-width: 420px;
}

.pill {
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.75);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0;
  padding: 16px;
}

@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
}

.panel {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-left {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

@media (max-width: 900px) {
  .panel-left {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title .badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(79, 156, 255, 0.4);
  background: rgba(79, 156, 255, 0.08);
  color: #cbd8ff;
}

.textarea-wrapper {
  position: relative;
  background: radial-gradient(
    circle at top left,
    rgba(79, 156, 255, 0.13),
    transparent 60%
  );
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 10px;
  flex: 1;
  display: flex;
  min-height: 260px;
}

textarea {
  flex: 1;
  width: 100%;
  background: #050814;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 10px 10px 10px 36px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  resize: vertical;
  min-height: 160px;
  outline: none;
  line-height: 1.5;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px rgba(79, 156, 255, 0.8),
    0 0 0 12px rgba(79, 156, 255, 0.08);
}

.textarea-label {
  position: absolute;
  top: 16px;
  left: 20px;
  font-size: 11px;
  color: #64748b;
  pointer-events: none;
}

.helper {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.9);
  border: 1px dashed rgba(148, 163, 184, 0.35);
}

.helper code {
  background: rgba(15, 23, 42, 0.9);
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.output-wrapper {
  background: rgba(79, 156, 255, 0.1);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.output-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.status-pill {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.status-pill.error {
  border-color: #f87171;
  background: rgba(127, 29, 29, 0.9);
  color: #fecaca;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

.status-pill.error .status-dot {
  background: var(--error);
}

button {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 5px 11px;
  font-size: 11px;
  cursor: pointer;
}

button.primary {
  border-color: #4f9cff;
  background: linear-gradient(135deg, #4f9cff, #7c6cff);
  color: #000;
}

pre {
  flex: 1;
  background: #020617;
  border-radius: 10px;
  padding: 10px 10px 10px 36px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  overflow: auto;
  line-height: 1.5;
}

footer {
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.footer-hint code {
  background: rgba(15, 23, 42, 0.95);
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.chip {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.9);
  color: var(--muted);
}
