@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #0b0c0d;
  --panel: rgba(21, 23, 23, 0.86);
  --panel-strong: #171919;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f4f4ef;
  --muted: #929892;
  --muted-bright: #bdc2bc;
  --accent: #b8f24b;
  --accent-strong: #91d61b;
  --accent-soft: rgba(184, 242, 75, 0.1);
  --danger: #ff7474;
  --radius: 24px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 50% -10%, #20271c 0%, var(--bg) 38%);
  background-size: 48px 48px, 48px 48px, auto;
  font-family: "DM Sans", system-ui, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(120px);
  opacity: 0.08;
  pointer-events: none;
}

.ambient-one {
  top: 12%;
  right: -120px;
  background: var(--accent);
}

.ambient-two {
  bottom: 3%;
  left: -180px;
  background: #75e9ff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(184, 242, 75, 0.24);
  border-radius: 13px;
  background: var(--accent-soft);
}

.brand-mark svg {
  width: 32px;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand-mark .spark {
  fill: var(--accent);
  stroke: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font: 800 17px/1.15 "Manrope", sans-serif;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.service-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-bright);
  background: rgba(14, 15, 15, 0.7);
  font-size: 12px;
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #e5b84d;
  box-shadow: 0 0 0 4px rgba(229, 184, 77, 0.1);
}

.service-status.online .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.service-status.offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 116, 116, 0.1);
}

main {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  max-width: 800px;
  padding: 66px 0 58px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow-line {
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  margin: 0;
  font: 700 clamp(42px, 6vw, 78px)/0.98 "Manrope", sans-serif;
  letter-spacing: -0.06em;
}

.hero h1 em {
  color: var(--muted);
  font-style: normal;
}

.hero p {
  max-width: 630px;
  margin: 27px 0 0;
  color: var(--muted-bright);
  font-size: 17px;
  line-height: 1.7;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.compose-panel {
  padding: 30px;
}

.response-panel {
  display: flex;
  min-height: 720px;
  flex-direction: column;
}

.response-panel > .panel-heading {
  padding: 30px 30px 0;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.panel-heading > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.panel-heading h2 {
  margin: 0;
  font: 700 18px/1.2 "Manrope", sans-serif;
  letter-spacing: -0.02em;
}

.step {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.text-button {
  padding: 5px;
  border: 0;
  color: var(--muted);
  background: none;
  cursor: pointer;
  font-size: 13px;
}

.text-button:hover {
  color: var(--text);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 0.78fr;
  gap: 14px;
}

.field-row.single-field {
  grid-template-columns: 1fr;
}

.field {
  display: block;
}

.field > span,
.examples > span {
  display: block;
  margin: 0 0 9px 2px;
  color: var(--muted-bright);
  font-size: 12px;
  font-weight: 600;
}

.input-shell,
.textarea-shell {
  border: 1px solid var(--line);
  background: rgba(9, 10, 10, 0.72);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-shell:focus-within,
.textarea-shell:focus-within {
  border-color: rgba(184, 242, 75, 0.55);
  box-shadow: 0 0 0 3px rgba(184, 242, 75, 0.07);
}

.input-shell {
  display: flex;
  height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 13px;
}

.input-shell > svg {
  width: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 13px;
}

.input-shell button {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.input-shell button:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.input-shell button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.message-field {
  margin-top: 18px;
}

.textarea-shell {
  overflow: hidden;
  border-radius: 16px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 255px;
  resize: vertical;
  border: 0;
  outline: 0;
  padding: 18px;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  line-height: 1.62;
}

textarea::placeholder,
input::placeholder {
  color: #555a56;
}

.textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  color: #676c68;
  font-size: 11px;
}

.language-hint {
  color: #7c827d;
}

.examples {
  margin-top: 18px;
}

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

.example-buttons button {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-bright);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  font-size: 11px;
  transition: 150ms ease;
}

.example-buttons button:hover {
  border-color: rgba(184, 242, 75, 0.35);
  color: var(--accent);
  background: var(--accent-soft);
}

.primary-button {
  display: flex;
  width: 100%;
  height: 54px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 25px;
  border: 0;
  border-radius: 15px;
  color: #15180e;
  background: var(--accent);
  box-shadow: 0 14px 30px rgba(145, 214, 27, 0.16);
  cursor: pointer;
  font-weight: 800;
  transition: transform 150ms ease, background 150ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: #c4fa5d;
}

.primary-button:disabled {
  transform: none;
  opacity: 0.55;
  cursor: wait;
}

.primary-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.model-badge {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-family: ui-monospace, monospace;
  font-size: 10px;
}

.response-stage {
  display: grid;
  flex: 1;
  padding: 0 30px 28px;
  place-items: center;
}

.empty-state,
.loading-state,
.error-state {
  max-width: 360px;
  text-align: center;
}

.empty-visual {
  position: relative;
  display: grid;
  width: 116px;
  height: 116px;
  margin: 0 auto 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 36px;
  background: linear-gradient(145deg, rgba(184, 242, 75, 0.08), rgba(255, 255, 255, 0.02));
  transform: rotate(-4deg);
}

.empty-visual svg {
  width: 64px;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  transform: rotate(4deg);
}

.empty-visual .spark {
  fill: var(--accent);
  stroke: none;
}

.bubble {
  position: absolute;
  border-radius: 999px;
  background: var(--accent);
}

.bubble-one {
  top: -8px;
  right: 10px;
  width: 8px;
  height: 8px;
}

.bubble-two {
  right: -12px;
  bottom: 22px;
  width: 5px;
  height: 5px;
  opacity: 0.45;
}

.empty-state h3,
.loading-state h3,
.error-state h3 {
  margin: 0;
  font: 700 20px/1.3 "Manrope", sans-serif;
}

.empty-state p,
.loading-state p,
.error-state p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.loader {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 23px;
}

.loader span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  animation: bounce 1s infinite ease-in-out;
}

.loader span:nth-child(2) {
  animation-delay: 0.12s;
}

.loader span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-8px); opacity: 1; }
}

.result-state {
  width: 100%;
  align-self: start;
  padding-top: 16px;
}

.result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
}

.result-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
}

.result-status > span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.result-status.ignored {
  color: #e5b84d;
}

.result-status.ignored > span {
  background: #e5b84d;
  box-shadow: 0 0 0 4px rgba(229, 184, 77, 0.1);
}

.reply-card {
  position: relative;
  padding: 24px 24px 24px 72px;
  border: 1px solid rgba(184, 242, 75, 0.18);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(184, 242, 75, 0.07), rgba(255, 255, 255, 0.02));
}

.reply-avatar {
  position: absolute;
  top: 22px;
  left: 22px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #15180e;
  background: var(--accent);
  font: 800 13px "Manrope", sans-serif;
}

.reply-card p {
  margin: 0;
  color: #e1e4dd;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
}

.secondary-button {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.secondary-button:hover {
  border-color: rgba(184, 242, 75, 0.35);
  background: var(--accent-soft);
}

.secondary-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.error-icon {
  display: grid;
  width: 50px;
  height: 50px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 16px;
  color: var(--danger);
  background: rgba(255, 116, 116, 0.1);
  font-weight: 800;
}

.error-state .secondary-button {
  margin: 20px auto 0;
}

.guardrails {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  background: rgba(9, 10, 10, 0.36);
}

.guardrails > div {
  display: flex;
  gap: 11px;
  padding: 18px 20px;
}

.guardrails > div + div {
  border-left: 1px solid var(--line);
}

.guardrails svg {
  width: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.guardrails span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.guardrails strong {
  display: block;
  margin-bottom: 2px;
  color: var(--muted-bright);
  font-size: 11px;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 38px;
  color: #5d625e;
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 12px 16px;
  border: 1px solid rgba(184, 242, 75, 0.25);
  border-radius: 12px;
  color: var(--text);
  background: #20241b;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .response-panel {
    min-height: 620px;
  }
}

@media (max-width: 640px) {
  .topbar,
  main,
  footer {
    width: min(100% - 28px, 1320px);
  }

  .topbar {
    padding: 18px 0;
  }

  .brand small {
    display: none;
  }

  .service-status {
    padding: 8px 10px;
  }

  .hero {
    padding: 42px 0 38px;
  }

  .hero h1 {
    font-size: clamp(38px, 12vw, 56px);
  }

  .hero p {
    font-size: 15px;
  }

  .compose-panel,
  .response-panel > .panel-heading,
  .response-stage {
    padding-left: 20px;
    padding-right: 20px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .guardrails {
    grid-template-columns: 1fr;
  }

  .guardrails > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .reply-card {
    padding: 65px 20px 20px;
  }

  .result-actions,
  footer {
    gap: 14px;
    align-items: flex-start;
    flex-direction: column;
  }
}
