:root {
  --ink: #101828;
  --muted: #667085;
  --line: rgba(18, 29, 47, 0.1);
  --panel: rgba(255, 255, 255, 0.72);
  --cyan: #31c5f4;
  --blue: #3568ff;
  --violet: #7c5cff;
  --mint: #31d0aa;
  --shadow: 0 24px 80px rgba(32, 48, 78, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f8fbff;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(rgba(24, 62, 115, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 62, 115, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 45% 28%, rgba(49, 197, 244, 0.18), transparent 35%),
    radial-gradient(circle at 78% 12%, rgba(124, 92, 255, 0.12), transparent 28%),
    #fbfdff;
  background-size:
    42px 42px,
    42px 42px,
    auto,
    auto;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.ambient {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(18px);
}

.ambient-a {
  top: 12%;
  left: 12%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(49, 197, 244, 0.18);
}

.ambient-b {
  right: 12%;
  bottom: 12%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(53, 104, 255, 0.12);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 10px 0 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(53, 104, 255, 0.22);
  border-radius: 10px;
  background:
    radial-gradient(circle at 35% 35%, #ffffff 0 18%, transparent 19%),
    conic-gradient(from 120deg, var(--cyan), var(--blue), var(--violet), var(--cyan));
  box-shadow: 0 10px 24px rgba(49, 197, 244, 0.28);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(49, 208, 170, 0.12);
}

.icon-button,
.rail-button,
.round-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: #31435f;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 26px rgba(34, 46, 79, 0.06);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 320px;
  gap: 18px;
  min-height: calc(100vh - 126px);
  padding-top: 10px;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.48);
}

.rail-button {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  transition:
    transform 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.rail-button:hover,
.rail-button.active {
  transform: translateY(-1px);
  border-color: rgba(53, 104, 255, 0.2);
  color: #174cff;
  background: #ffffff;
}

.stage {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto;
  min-width: 0;
  overflow: hidden;
  padding: clamp(20px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(245, 250, 255, 0.72)),
    radial-gradient(circle at center, rgba(49, 197, 244, 0.16), transparent 43%);
}

.stage::before {
  position: absolute;
  inset: 12px;
  content: "";
  border: 1px solid rgba(53, 104, 255, 0.08);
  border-radius: 18px;
  pointer-events: none;
}

.stage-copy {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

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

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(36px, 5vw, 70px);
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stage-copy p:last-child {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.core-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
}

#particle-core {
  width: min(74vw, 620px);
  max-width: 100%;
  aspect-ratio: 1;
  height: auto;
  filter: drop-shadow(0 28px 58px rgba(49, 197, 244, 0.2));
}

.core-label {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(53, 104, 255, 0.14);
  border-radius: 50%;
  color: #1b2c4a;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 20px 60px rgba(49, 197, 244, 0.16);
  backdrop-filter: blur(16px);
}

.core-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.core-label strong {
  font-size: 32px;
}

.promptbar {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 86px;
  gap: 12px;
  align-items: center;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 10px;
  border: 1px solid rgba(23, 76, 255, 0.11);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 54px rgba(43, 62, 102, 0.1);
  backdrop-filter: blur(18px);
}

.round-button {
  width: 46px;
  height: 46px;
  border-radius: 16px;
}

.promptbar input {
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  color: #1b2c4a;
  background: transparent;
  font-size: 15px;
}

.send-button {
  height: 46px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #1f66ff, #27c5ef);
  box-shadow: 0 14px 34px rgba(31, 102, 255, 0.24);
}

.inspector {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: var(--panel);
  box-shadow: 0 16px 48px rgba(32, 48, 78, 0.07);
  backdrop-filter: blur(18px);
}

.hero-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 132px;
  background:
    radial-gradient(circle at 78% 20%, rgba(49, 197, 244, 0.22), transparent 42%),
    rgba(255, 255, 255, 0.78);
}

.hero-panel p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hero-panel h2 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.05;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(49, 208, 170, 0.25);
  border-radius: 999px;
  color: #078469;
  background: rgba(49, 208, 170, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.06);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--mint));
}

.signal-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
}

.signal-list li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.signal-list span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(49, 197, 244, 0.11);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.action-grid button {
  min-width: 0;
  height: 40px;
  border: 1px solid rgba(53, 104, 255, 0.1);
  border-radius: 14px;
  color: #254164;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1060px) {
  .workspace {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .inspector {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .panel {
    min-height: 128px;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 16px, 720px);
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    overflow: hidden;
    min-height: calc(100vh - 16px);
    margin: 8px auto;
    padding: 10px;
    border-radius: 22px;
  }

  .topbar {
    height: 52px;
    padding: 0 6px;
  }

  .nav-actions > span:not(.signal-dot) {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: auto;
    width: 100%;
    overflow: hidden;
  }

  .rail {
    flex-direction: row;
    justify-content: center;
    order: 2;
    padding: 8px;
  }

  .stage {
    order: 1;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    min-height: 640px;
    padding: 20px 14px 14px;
  }

  h1 {
    font-size: 34px;
    line-height: 1.08;
    word-break: break-all;
  }

  .stage-copy p:last-child {
    font-size: 14px;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .core-wrap {
    min-height: 330px;
  }

  .core-label {
    width: 126px;
    height: 126px;
  }

  .core-label strong {
    font-size: 26px;
  }

  .promptbar {
    position: relative;
    display: flex;
    gap: 7px;
    padding: 8px;
    width: calc(100vw - 68px);
    max-width: calc(100vw - 68px);
    overflow: hidden;
  }

  .promptbar input {
    width: 100%;
    padding-right: 62px;
    text-overflow: ellipsis;
    font-size: 13px;
  }

  .send-button {
    position: absolute;
    top: 8px;
    right: 8px;
    flex: 0 0 52px;
    width: 52px;
    min-width: 0;
    height: 44px;
    border-radius: 15px;
  }

  .inspector {
    order: 3;
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
