:root {
  --bg-top: #edf3f6;
  --bg-bottom: #d9e4ea;
  --ink: #d7e9ff;
  --muted: #9cc4ea;
  --line: rgba(184, 220, 255, 0.18);
  --panel: rgba(5, 6, 8, 0.94);
  --panel-strong: #050608;
  --shadow: 0 24px 60px rgba(16, 30, 40, 0.12);
  --accent: #8dbbf0;
  --accent-soft: rgba(141, 187, 240, 0.12);
  --baby-blue: #8dbbf0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-y: auto;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.matrix-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.matrix-column {
  position: absolute;
  top: -160vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--baby-blue);
  font: 700 30px/1 monospace;
  text-shadow: 0 0 12px rgba(141, 187, 240, 0.22);
  animation-name: matrix-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

.matrix-column span {
  opacity: 0.92;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0 28px;
}

.ticker-panel {
  overflow: hidden;
  border: 1px solid rgba(141, 187, 240, 0.18);
  border-radius: 24px;
  background: #050608;
  box-shadow: var(--shadow);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-move 24s linear infinite;
}

.ticker-copy {
  display: flex;
  align-items: center;
  gap: 52px;
  padding: 18px 30px;
  white-space: nowrap;
  font-size: clamp(1.7rem, 2.8vw, 2.8rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--baby-blue);
}

.workspace {
  display: grid;
  gap: 22px;
  margin-top: 22px;
  align-items: start;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
}

.card {
  border-radius: 30px;
  border: 1px solid rgba(141, 187, 240, 0.18);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.input-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.output-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.card-head h1,
.card-head h2 {
  margin: 0;
  color: var(--baby-blue);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.02;
}

.card-head h1 {
  font-size: clamp(2.6rem, 4vw, 4rem);
}

.lead,
.server-state,
.info-text,
.field span,
.info-title,
.footer-stats span,
.entry-head {
  color: var(--muted);
}

.lead {
  margin: 16px 0 0;
  line-height: 1.55;
  font-size: 1rem;
}

.card-head-inline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.status-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.server-state {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.field {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.field textarea {
  width: 100%;
  min-height: 84px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #07111a;
  color: var(--baby-blue);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  resize: vertical;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field textarea::placeholder {
  color: rgba(141, 187, 240, 0.5);
}

.field textarea:focus {
  border-color: rgba(141, 187, 240, 0.42);
  box-shadow: 0 0 0 4px rgba(141, 187, 240, 0.08);
}

.info-box {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(141, 187, 240, 0.14);
  background: rgba(141, 187, 240, 0.05);
}

.info-title {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-text {
  margin: 0;
  line-height: 1.55;
}

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

.button {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.button-primary {
  background: var(--baby-blue);
  color: #050608;
}

.button-secondary {
  background: rgba(141, 187, 240, 0.08);
  color: var(--baby-blue);
  border-color: rgba(141, 187, 240, 0.18);
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(141, 187, 240, 0.08);
  border: 1px solid rgba(141, 187, 240, 0.18);
  color: var(--baby-blue);
  font-size: 0.9rem;
  font-weight: 800;
}

.response-field {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  min-height: 520px;
  max-height: 520px;
  overflow: auto;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(141, 187, 240, 0.14);
  background: rgba(7, 17, 26, 0.82);
}

.empty-state {
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state.hidden {
  display: none;
}

.response-field.is-hidden {
  display: none;
}

.entry {
  border-radius: 22px;
  padding: 18px;
  border: 1px solid rgba(141, 187, 240, 0.12);
}

.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.entry-answer {
  margin: 0;
  line-height: 1.65;
  color: var(--baby-blue);
}

.entry-answer + .entry-answer {
  margin-top: 10px;
}

.entry-user {
  background: rgba(141, 187, 240, 0.03);
}

.entry-ai {
  background: rgba(141, 187, 240, 0.06);
}

.footer-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding: 0 4px;
}

.footer-stats strong {
  color: var(--baby-blue);
  font-size: 1.2rem;
}

@keyframes ticker-move {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes matrix-fall {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, 260vh, 0);
  }
}

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

  .card-head-inline {
    flex-direction: column;
  }

  .status-wrap {
    align-items: flex-start;
  }
}
