:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-2: #111936;
  --panel: rgba(16, 24, 46, 0.82);
  --panel-border: rgba(126, 153, 255, 0.18);
  --text: #e9edff;
  --muted: #a8b2d9;
  --accent: #7c9cff;
  --accent-2: #5dd6c2;
  --danger: #ff7c8a;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 156, 255, 0.28), transparent 34%),
    radial-gradient(circle at 85% 10%, rgba(93, 214, 194, 0.18), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
}

body {
  padding: 32px;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.subhead {
  margin: 16px 0 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--panel-border);
  background: rgba(10, 15, 32, 0.55);
  border-radius: 18px;
  box-shadow: var(--shadow);
  min-width: 250px;
}

.status-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 8px rgba(93, 214, 194, 0.12);
}

.workspace {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.panel {
  min-height: 640px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  font-size: 0.96rem;
  font-weight: 700;
}

textarea {
  flex: 1;
  width: 100%;
  resize: none;
  border: 1px solid rgba(124, 156, 255, 0.18);
  border-radius: 18px;
  padding: 18px;
  background: rgba(5, 10, 24, 0.72);
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  outline: none;
}

textarea:focus {
  border-color: rgba(124, 156, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.14);
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--accent), #9d7cff);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.response {
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

#model-badge {
  font-size: 0.84rem;
  color: var(--muted);
}

.output {
  flex: 1;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: rgba(5, 10, 24, 0.72);
  border: 1px solid rgba(124, 156, 255, 0.18);
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--text);
}

.meta {
  min-height: 22px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 960px) {
  body {
    padding: 18px;
  }

  .hero,
  .workspace,
  .actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .status-card {
    min-width: 0;
  }

  .panel {
    min-height: 540px;
  }
}
