:root {
  color-scheme: dark;
  --bg:#111111;
  --panel:#1b1b1b;
  --panel-soft:rgba(26,26,26,0.94);
  --panel-border:rgba(255,255,255,0.08);
  --text:#ffffff;
  --muted:#c8c8c8;
  --brand:#ff6268;
  --field:#141414;
  --field-border:rgba(255,255,255,0.12);
  --shadow:0 18px 40px rgba(0,0,0,0.28);
}

* { box-sizing:border-box; }

body {
  margin:0;
  min-height:100vh;
  font-family:Inter, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.06), transparent 34%),
    linear-gradient(180deg, #161616 0%, #111111 100%);
  color:var(--text);
}

.topbar {
  position:fixed;
  top:0;
  left:0;
  right:0;
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:10px 22px;
  background:var(--panel-soft);
  border-bottom:1px solid var(--panel-border);
  box-shadow:var(--shadow);
  backdrop-filter:blur(14px);
  z-index:10;
}

.brand {
  color:var(--brand);
  font-family:Cinzel, Georgia, serif;
  font-size:21px;
  font-weight:700;
  letter-spacing:0;
  text-decoration:none;
  white-space:nowrap;
}

.brand:hover,
.brand:focus { color:var(--brand); }

.topbarMeta {
  color:var(--muted);
  font-size:14px;
  font-weight:500;
}

.appBackLink {
  color:var(--text);
  display:inline-flex;
  align-items:center;
  font-size:14px;
  font-weight:500;
  line-height:1;
  min-height:34px;
  padding:0 12px;
  border-radius:6px;
  text-decoration:none;
}

.appBackLink:hover,
.appBackLink:focus {
  background:rgba(255,255,255,.06);
  color:var(--text);
}

.appShell {
  width:min(980px, calc(100% - 36px));
  margin:0 auto;
  padding:92px 0 56px;
}

.queryPanel,
.answerPanel {
  background:rgba(27,27,27,0.92);
  border:1px solid var(--panel-border);
  border-radius:8px;
  box-shadow:0 12px 30px rgba(0,0,0,0.22);
}

.queryPanel { padding:24px; }
.answerPanel { margin-top:18px; overflow:hidden; }

.panelHeader {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:22px;
}

.eyebrow {
  margin:0 0 6px;
  color:var(--brand);
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
}

h1 {
  margin:0;
  font-size:30px;
  line-height:1.15;
  font-weight:700;
}

.modePill {
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:5px 10px;
  border:1px solid rgba(255,98,104,0.34);
  border-radius:999px;
  color:#ffd4d6;
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  white-space:nowrap;
}

.inputRow {
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:10px;
}

input,
button { font:inherit; }

input {
  width:100%;
  height:42px;
  border:1px solid var(--field-border);
  background:var(--field);
  color:var(--text);
  padding:9px 12px;
  border-radius:8px;
  outline:none;
}

input:focus {
  border-color:rgba(255,98,104,0.55);
  box-shadow:0 0 0 3px rgba(255,98,104,0.12);
}

button {
  min-height:38px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.04);
  color:#ffffff;
  padding:8px 14px;
  border-radius:8px;
  cursor:pointer;
  transition:background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

button:hover:not(:disabled) {
  background:rgba(255,255,255,0.08);
  border-color:rgba(255,255,255,0.2);
  transform:translateY(-1px);
}

button:disabled {
  opacity:0.5;
  cursor:not-allowed;
  transform:none;
}

#submitButton {
  height:42px;
  min-width:118px;
  background:#050505;
  border-color:rgba(255,255,255,0.2);
  font-weight:700;
}

.hintRow {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.exampleButton {
  min-height:30px;
  padding:5px 10px;
  color:var(--muted);
  font-size:13px;
}

.answerBox {
  min-height:330px;
  padding:26px 30px 34px;
  color:#f4f4f4;
  font-size:17px;
  line-height:1.7;
}

.answerBox.empty { color:var(--muted); }

.answerBox h2 {
  margin:24px 0 8px;
  color:#ffffff;
  font-size:17px;
  line-height:1.35;
  font-weight:700;
}

.answerBox h2:first-child { margin-top:0; }
.answerBox p { margin:0 0 14px; }
.answerBox .error { color:#ffb4b8; }

.disclaimer {
  margin:12px 2px 0;
  color:rgba(255,255,255,0.58);
  font-size:12px;
  line-height:1.5;
}

.settingsControl {
  display:flex;
  align-items:center;
  gap:8px;
  margin:10px 2px 0;
  color:rgba(255,255,255,0.62);
  font-size:12px;
}

.settingsControl select {
  height:28px;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:8px;
  background:#141414;
  color:#ffffff;
  padding:2px 8px;
  font:inherit;
}

@media (max-width: 680px) {
  .topbar {
    min-height:54px;
    padding:10px 16px;
  }

  .brand { font-size:18px; }

  .appShell {
    width:calc(100% - 24px);
    padding-top:82px;
  }

  .queryPanel { padding:18px; }
  .panelHeader { flex-direction:column; margin-bottom:18px; }
  h1 { font-size:25px; }

  .inputRow { grid-template-columns:1fr; }
  #submitButton { width:100%; }

  .answerBox { padding:22px 20px 28px; font-size:16px; }
}
