:root {
  color-scheme: dark;
  --bg: #111316;
  --panel: #192026;
  --panel-2: #25313a;
  --text: #f4f0e8;
  --muted: #a7acb4;
  --line: #343a43;
  --accent: #efc66a;
  --accent-2: #76c5c4;
  --danger: #f09a8d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(14, 20, 25, 0.44), rgba(14, 20, 25, 0.78)),
    url("https://images.unsplash.com/photo-1519608487953-e999c86e7455?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 18px;
  align-items: center;
}

.workspace,
.result-pane {
  background: rgba(24, 27, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.workspace {
  border-radius: 8px;
  padding: 22px;
}

.result-pane {
  border-radius: 8px;
  padding: 22px;
  min-height: 660px;
}

.topbar,
.result-header,
.actions,
.prompt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-2);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 44px;
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
}

h3 {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--accent);
}

.status,
#mode {
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.status.connected {
  color: var(--accent-2);
}

.composer {
  margin-top: 44px;
  display: grid;
  gap: 18px;
}

.settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.settings summary small {
  color: var(--muted);
  font-weight: 700;
}

.settings[open] summary {
  margin-bottom: 14px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.58);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

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

input:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(118, 197, 196, 0.16);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  border-color: var(--accent);
}

#submit {
  background: var(--accent);
  color: #17130a;
  border-color: var(--accent);
}

.empty {
  min-height: 520px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  padding: 32px;
}

.hidden {
  display: none;
}

.result {
  margin-top: 28px;
}

.summary {
  color: #d9dde3;
  line-height: 1.75;
  border-left: 3px solid var(--accent-2);
  padding-left: 14px;
}

.suggestions {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.suggestion {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.suggestion strong {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--accent);
}

.suggestion p,
.block p {
  color: #c9ced6;
  line-height: 1.65;
  margin-bottom: 0;
}

.block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  color: #25110e;
  background: var(--danger);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.prompt-row {
  align-items: stretch;
}

code {
  flex: 1;
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #0b0d10;
  color: #f7dc98;
  line-height: 1.55;
}

.sources {
  display: grid;
  gap: 8px;
}

.sources a {
  color: var(--accent-2);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 16px 0;
  }

  .result-pane {
    min-height: auto;
  }

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

  h1 {
    font-size: 36px;
  }
}
