:root {
  color-scheme: dark;
  --background: #050914;
  --background-soft: #09111f;
  --panel: rgba(8, 17, 31, 0.78);
  --panel-strong: rgba(12, 25, 43, 0.94);
  --panel-soft: rgba(255, 255, 255, 0.025);
  --line: rgba(135, 226, 255, 0.14);
  --line-strong: rgba(135, 226, 255, 0.28);
  --text: #f6f9ff;
  --muted: #8595ab;
  --muted-strong: #a9b7c9;
  --accent: #7de8ff;
  --accent-strong: #43c9ff;
  --accent-violet: #8f93ff;
  --safe: #79e7bc;
  --danger: #ff7d8b;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 8%, rgba(67, 201, 255, 0.12), transparent 28rem),
    radial-gradient(circle at 86% 32%, rgba(143, 147, 255, 0.1), transparent 34rem),
    linear-gradient(145deg, #050914 0%, #07101d 52%, #040710 100%);
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
}

body::before {
  opacity: 0.19;
  background-image:
    linear-gradient(rgba(125, 232, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 232, 255, 0.04) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black 0%, rgba(0, 0, 0, 0.6) 55%, transparent 100%);
}

body::after {
  opacity: 0.05;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(255, 255, 255, 0.08) 4px
  );
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 32rem;
  height: 32rem;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(90px);
}

.ambient-one {
  top: -14rem;
  left: -10rem;
  background: rgba(67, 201, 255, 0.11);
}

.ambient-two {
  right: -14rem;
  bottom: 4rem;
  background: rgba(143, 147, 255, 0.08);
}

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 34px;
}

.topbar,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar {
  min-height: 54px;
  padding: 8px 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(125, 232, 255, 0.08), rgba(143, 147, 255, 0.05));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.04),
    0 12px 30px rgba(0, 0, 0, 0.28);
}

.brand-mark::after {
  position: absolute;
  inset: 5px;
  content: "";
  border: 1px solid rgba(125, 232, 255, 0.08);
  border-radius: 8px;
}

.brand-mark img {
  position: relative;
  z-index: 1;
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand strong {
  font-size: 1.02rem;
  letter-spacing: 0.22em;
}

.brand small {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.version-pill,
.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.018);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
}

.version-pill {
  padding: 8px 10px;
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: var(--muted-strong);
}

.status::before {
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: #e9b949;
  box-shadow: 0 0 12px rgba(233, 185, 73, 0.6);
}

.status.online {
  color: #b8f8df;
  border-color: rgba(121, 231, 188, 0.18);
  background: rgba(121, 231, 188, 0.035);
}

.status.online::before {
  background: var(--safe);
  box-shadow: 0 0 14px rgba(121, 231, 188, 0.75);
}

.status.offline {
  color: #ffc2c8;
  border-color: rgba(255, 125, 139, 0.18);
}

.status.offline::before {
  background: var(--danger);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(520px, 1.38fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: center;
  min-height: calc(100vh - 154px);
  padding: 44px 0 36px;
}

.hero {
  position: relative;
  max-width: 500px;
}

.hero::before {
  position: absolute;
  top: 2px;
  left: -22px;
  width: 1px;
  height: 118px;
  content: "";
  background: linear-gradient(to bottom, var(--accent), transparent);
  opacity: 0.55;
}

.hero-index {
  margin-bottom: 36px;
  color: #64768d;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.69rem;
  letter-spacing: 0.15em;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1 {
  display: grid;
  gap: 2px;
  margin: 0;
  font-size: clamp(3.5rem, 6.2vw, 6.7rem);
  line-height: 0.86;
  letter-spacing: -0.065em;
}

.outline-word {
  color: transparent;
  -webkit-text-stroke: 1px rgba(246, 249, 255, 0.68);
  text-stroke: 1px rgba(246, 249, 255, 0.68);
}

.hero-copy {
  max-width: 470px;
  margin: 28px 0 0;
  color: var(--muted-strong);
  font-size: 0.98rem;
  line-height: 1.75;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
}

.system-item {
  display: grid;
  gap: 5px;
  padding: 14px 15px;
  background: rgba(5, 10, 20, 0.86);
}

.system-item span {
  color: #65778d;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.system-item strong {
  color: #d9e6f5;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.hero-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.pulse-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--safe);
  box-shadow: 0 0 14px rgba(121, 231, 188, 0.8);
}

.chat-card {
  position: relative;
  overflow: hidden;
  min-height: 610px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 26%),
    var(--panel);
  box-shadow:
    0 36px 110px rgba(0, 0, 0, 0.46),
    inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
}

.chat-card::before {
  position: absolute;
  top: -1px;
  left: 12%;
  width: 40%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 18px rgba(125, 232, 255, 0.45);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.chat-head > div:first-child {
  display: grid;
  gap: 4px;
}

.chat-kicker {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
}

.chat-head strong {
  font-size: 0.91rem;
  letter-spacing: 0.02em;
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 15px;
}

.signal-bars span {
  display: block;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(125, 232, 255, 0.45);
}

.signal-bars span:nth-child(1) { height: 5px; opacity: 0.4; }
.signal-bars span:nth-child(2) { height: 8px; opacity: 0.6; }
.signal-bars span:nth-child(3) { height: 11px; opacity: 0.78; }
.signal-bars span:nth-child(4) { height: 15px; }

.notice {
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  color: #a8e9d1;
  background: rgba(121, 231, 188, 0.025);
  font-size: 0.72rem;
  line-height: 1.5;
}

.notice-icon {
  margin-right: 8px;
  color: var(--safe);
  font-size: 0.52rem;
  text-shadow: 0 0 12px rgba(121, 231, 188, 0.8);
}

.messages {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 340px;
  max-height: 470px;
  padding: 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 232, 255, 0.22) transparent;
}

.message {
  position: relative;
  width: min(82%, 650px);
  padding: 15px 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 6px 18px 18px 18px;
  background: linear-gradient(145deg, rgba(15, 32, 53, 0.94), rgba(9, 20, 36, 0.92));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
}

.message::before {
  position: absolute;
  top: -1px;
  left: 14px;
  width: 42px;
  height: 1px;
  content: "";
  background: var(--accent);
  opacity: 0.58;
}

.message.user {
  justify-self: end;
  border-radius: 18px 6px 18px 18px;
  border-color: rgba(125, 232, 255, 0.14);
  background: linear-gradient(145deg, rgba(43, 118, 153, 0.24), rgba(22, 58, 90, 0.2));
}

.message.user::before {
  right: 14px;
  left: auto;
  background: #b9efff;
}

.message.error {
  border-color: rgba(255, 125, 139, 0.35);
  background: rgba(82, 25, 34, 0.28);
}

.message.error::before {
  background: var(--danger);
}

.message-label {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.message.user .message-label {
  color: #c3f2ff;
  text-align: right;
}

.message p {
  margin: 0;
  color: #e9f1fb;
  font-size: 0.94rem;
  line-height: 1.62;
  white-space: pre-wrap;
}

form {
  padding: 18px 22px 20px;
  border-top: 1px solid var(--line);
  background: rgba(2, 7, 14, 0.42);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}

.form-row label,
.form-row span {
  margin: 0;
  color: #6f8095;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
}

.composer {
  display: flex;
  gap: 10px;
}

textarea {
  flex: 1;
  min-height: 66px;
  resize: vertical;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  color: var(--text);
  background: rgba(2, 8, 16, 0.72);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  font: inherit;
  line-height: 1.5;
}

textarea::placeholder {
  color: #5f7085;
}

textarea:focus {
  border-color: rgba(125, 232, 255, 0.48);
  box-shadow:
    0 0 0 3px rgba(67, 201, 255, 0.08),
    0 0 28px rgba(67, 201, 255, 0.06);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  align-self: stretch;
  min-width: 126px;
  padding: 0 18px;
  border: 1px solid rgba(149, 239, 255, 0.55);
  border-radius: 15px;
  color: #041018;
  background: linear-gradient(135deg, #8cf1ff 0%, #72dfef 52%, #9ee8d0 100%);
  box-shadow:
    0 12px 28px rgba(70, 200, 226, 0.16),
    inset 0 1px rgba(255, 255, 255, 0.5);
  font: inherit;
  font-size: 0.87rem;
  font-weight: 760;
  cursor: pointer;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.045);
  box-shadow:
    0 15px 34px rgba(70, 200, 226, 0.22),
    inset 0 1px rgba(255, 255, 255, 0.55);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: wait;
  opacity: 0.48;
  transform: none;
}

.form-hint {
  margin: 9px 0 0;
  color: #718197;
  font-size: 0.68rem;
  line-height: 1.45;
}

footer {
  padding: 18px 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.035);
  color: #58697d;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.61rem;
  letter-spacing: 0.09em;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
    gap: 42px;
    align-items: stretch;
    padding-top: 52px;
  }

  .hero {
    max-width: 720px;
  }

  .hero-copy {
    max-width: 650px;
  }

  .system-grid {
    max-width: 560px;
  }

  .chat-card {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1240px);
    padding-top: 10px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand small,
  .version-pill {
    display: none;
  }

  .status {
    max-width: 145px;
    padding: 7px 9px;
    overflow: hidden;
    font-size: 0.63rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace {
    min-height: auto;
    gap: 32px;
    padding: 40px 0 28px;
  }

  .hero::before,
  .hero-index {
    display: none;
  }

  h1 {
    font-size: clamp(3.35rem, 16vw, 5.1rem);
  }

  .hero-copy {
    margin-top: 22px;
    font-size: 0.91rem;
  }

  .system-grid {
    margin-top: 26px;
  }

  .system-item {
    padding: 12px;
  }

  .chat-card {
    border-radius: 20px;
  }

  .chat-head,
  .notice,
  .messages,
  form {
    padding-right: 15px;
    padding-left: 15px;
  }

  .messages {
    min-height: 300px;
  }

  .message {
    width: 91%;
  }

  .composer {
    display: grid;
  }

  button {
    min-height: 50px;
  }

  footer {
    display: grid;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  button {
    transition: none;
  }
}
