:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;

  --text: #172033;
  --muted: #667085;

  --line: #e6eaf0;

  --accent: #3157d5;
  --accent-dark: #2443aa;
  --accent-soft: #eef2ff;

  --success: #16845b;
  --success-soft: #eaf8f2;

  --warning: #b86b13;
  --warning-soft: #fff7e8;

  --danger: #b42318;
  --danger-soft: #fff1f0;

  --purple: #7446b8;
  --purple-soft: #f3ecff;

  --topbar-height: 72px;
}

* {
  box-sizing: border-box;
}

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

  font-family:
    Inter,
    Pretendard,
    "Noto Sans KR",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: var(--text);
  background: var(--bg);
}

body {
  overflow: hidden;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}


/* =========================================================
   Landing
========================================================= */

.landing-view {
  height: 100vh;
  overflow-y: auto;

  background:
    radial-gradient(
      circle at 82% 18%,
      rgba(49, 87, 213, 0.13),
      transparent 25%
    ),
    radial-gradient(
      circle at 15% 78%,
      rgba(90, 111, 217, 0.08),
      transparent 28%
    ),
    linear-gradient(
      180deg,
      #fbfcff 0%,
      #f4f6fb 100%
    );
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 20;

  height: 76px;
  padding: 0 5vw;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom:
    1px solid rgba(225, 230, 239, 0.85);

  background:
    rgba(255, 255, 255, 0.88);

  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;

  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;

  border-radius: 10px;

  display: grid;
  place-items: center;

  background: var(--accent);
  color: white;

  font-weight: 800;
}

.prototype-badge,
.section-label {
  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.13em;

  color: var(--muted);
}

.hero {
  width: min(1080px, 90vw);

  margin: 0 auto;

  padding:
    13vh
    0
    8vh;
}

.hero-eyebrow {
  display: inline-flex;

  padding: 8px 12px;

  border: 1px solid #dfe5f6;
  border-radius: 999px;

  color: var(--accent);
  background:
    rgba(255, 255, 255, 0.72);

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.hero h1 {
  margin: 26px 0 22px;

  max-width: 820px;

  font-size:
    clamp(52px, 7vw, 88px);

  line-height: 1.03;
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  margin: 0;

  font-size: 19px;
  line-height: 1.8;

  color: var(--muted);
}

.primary-button {
  margin-top: 38px;

  border: 0;
  border-radius: 14px;

  padding: 16px 22px;

  background: var(--accent);
  color: white;

  font-weight: 750;

  box-shadow:
    0 12px 30px
    rgba(49, 87, 213, 0.24);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button span {
  display: inline-block;
  margin-left: 24px;
}

.capability-row {
  margin-top: 11vh;

  display: grid;
  grid-template-columns:
    repeat(4, 1fr);

  border-top:
    1px solid var(--line);
}

.capability-row div {
  padding: 22px 18px 0 0;

  display: flex;
  flex-direction: column;
  gap: 7px;
}

.capability-row strong {
  font-size: 12px;
  color: var(--accent);
}

.capability-row span {
  font-size: 14px;
  font-weight: 700;
}


/* =========================================================
   Workspace fixed shell
========================================================= */

.workspace-view {
  position: fixed;
  inset: 0;

  height: 100vh;
  width: 100vw;

  overflow: hidden;

  background: #f7f8fb;
}

.topbar {
  position: fixed;

  top: 0;
  left: 0;
  right: 0;

  z-index: 100;

  height: var(--topbar-height);
  padding: 0 28px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom:
    1px solid var(--line);

  background:
    rgba(255, 255, 255, 0.96);

  backdrop-filter: blur(14px);
}

.topbar .brand > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar .brand small {
  color: var(--muted);

  font-size: 10px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;

  color: var(--muted);

  font-size: 12px;
}

.connection-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: #24a36b;

  box-shadow:
    0 0 0 4px #e7f7f0;
}

.ghost-button {
  margin-left: 12px;

  padding: 8px 12px;

  border:
    1px solid var(--line);

  border-radius: 9px;

  background: white;
  color: var(--text);

  font-weight: 650;
}

.workspace {
  position: fixed;

  top: var(--topbar-height);
  left: 0;
  right: 0;
  bottom: 0;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    500px;

  overflow: hidden;
}


/* =========================================================
   Chat area
========================================================= */

.chat-panel {
  min-width: 0;
  min-height: 0;

  display: grid;

  grid-template-rows:
    minmax(0, 1fr)
    auto
    auto;

  overflow: hidden;

  background: white;
}

.messages {
  min-height: 0;

  overflow-y: auto;
  overscroll-behavior: contain;

  padding:
    34px
    max(32px, 6vw)
    22px;
}

.message-row {
  display: flex;
  gap: 12px;

  margin-bottom: 26px;
}

.message-row.user {
  justify-content: flex-end;
}

.message-content {
  max-width:
    min(720px, 78%);
}

.message-row.user
.message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.avatar {
  width: 34px;
  height: 34px;

  flex: 0 0 34px;

  border-radius: 10px;

  display: grid;
  place-items: center;

  font-size: 11px;
  font-weight: 800;
}

.ai-avatar {
  background: var(--accent-soft);
  color: var(--accent);
}

.message-meta {
  margin: 1px 0 7px;

  font-size: 11px;
  font-weight: 750;

  color: var(--muted);
}

.bubble {
  padding: 13px 15px;

  border:
    1px solid #edf0f5;

  border-radius:
    5px 16px 16px 16px;

  background:
    var(--surface-soft);

  font-size: 14px;
  line-height: 1.65;

  white-space: pre-wrap;
  word-break: break-word;
}

.message-row.user .bubble {
  border: 0;

  border-radius:
    16px 5px 16px 16px;

  background: var(--accent);
  color: white;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin-top: 12px;
}

.suggestions button {
  padding: 8px 11px;

  border:
    1px solid #dfe5f0;

  border-radius: 999px;

  background: white;
  color: #475467;

  font-size: 12px;
}

.suggestions button:hover {
  border-color: #b9c5ed;
  color: var(--accent);
}

.typing {
  display: inline-flex;
  gap: 5px;

  align-items: center;
}

.typing span {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: #98a2b3;

  animation:
    bounce
    1.1s
    infinite
    ease-in-out;
}

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

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

@keyframes bounce {
  0%,
  70%,
  100% {
    transform:
      translateY(0);

    opacity: 0.45;
  }

  35% {
    transform:
      translateY(-4px);

    opacity: 1;
  }
}

.approval-box {
  margin:
    0
    max(32px, 6vw)
    12px;

  padding: 14px 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  border:
    1px solid #f1d7ad;

  border-radius: 14px;

  background:
    var(--warning-soft);
}

.approval-box > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.approval-box strong {
  font-size: 13px;
}

.approval-box span {
  color: #7a5a2b;
  font-size: 11px;
}

.approval-actions {
  display: flex;
  gap: 8px;
}

.approval-actions button {
  padding: 9px 12px;

  border-radius: 9px;

  font-size: 12px;
  font-weight: 750;
}

.reject-button {
  border:
    1px solid #e7c9c5;

  background: white;
  color: var(--danger);
}

.approve-button {
  border: 0;

  background: var(--accent);
  color: white;
}

.composer {
  position: relative;

  margin:
    0
    max(32px, 6vw)
    22px;

  padding:
    8px 54px 23px 14px;

  border:
    1px solid #dfe4ec;

  border-radius: 16px;

  background: white;

  box-shadow:
    0 8px 26px
    rgba(16, 24, 40, 0.06);
}

.composer:focus-within {
  border-color: #aebbea;

  box-shadow:
    0 0 0 3px #f0f3ff;
}

.composer textarea {
  width: 100%;

  min-height: 42px;
  max-height: 130px;

  padding: 9px 0 0;

  resize: none;

  border: 0;
  outline: 0;

  color: var(--text);
  background: transparent;

  line-height: 1.45;
}

.composer button {
  position: absolute;

  right: 11px;
  top: 11px;

  width: 38px;
  height: 38px;

  border: 0;
  border-radius: 11px;

  background: var(--accent);
  color: white;

  font-size: 20px;
  font-weight: 800;
}

.composer button:disabled {
  opacity: 0.45;
  cursor: default;
}

.composer-hint {
  position: absolute;

  left: 14px;
  bottom: 7px;

  color: #98a2b3;

  font-size: 9px;
}


/* =========================================================
   Agent Execution fixed panel
========================================================= */

.execution-panel {
  min-width: 0;
  min-height: 0;

  border-left:
    1px solid var(--line);

  background: #fafbfc;

  overflow: hidden;
}

.execution-panel-inner {
  height: 100%;

  overflow-y: auto;
  overscroll-behavior: contain;

  padding:
    28px 26px 36px;
}

.execution-header {
  position: sticky;

  top: -28px;

  z-index: 10;

  margin:
    -28px
    -26px
    0;

  padding:
    28px
    26px
    15px;

  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 16px;

  border-bottom:
    1px solid
    rgba(230, 234, 240, 0.82);

  background:
    rgba(250, 251, 252, 0.96);

  backdrop-filter: blur(12px);
}

.execution-header h2 {
  margin: 5px 0 0;

  font-size: 22px;
  letter-spacing: -0.03em;
}

.status-badge {
  padding: 7px 9px;

  border-radius: 7px;

  font-size: 11px;
  font-weight: 850;

  letter-spacing: 0.06em;
}

.status-badge.idle {
  color: #667085;
  background: #eef0f3;
}

.status-badge.running {
  color: var(--accent);
  background: var(--accent-soft);
}

.status-badge.completed {
  color: var(--success);
  background: var(--success-soft);
}

.status-badge.waiting {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-badge.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.execution-description {
  margin: 19px 0 15px;

  color: var(--muted);

  font-size: 13px;
  line-height: 1.7;
}

.trace-controls {
  display: flex;
  justify-content: flex-end;

  gap: 7px;

  margin-bottom: 20px;
}

.trace-controls button {
  padding: 7px 10px;

  border:
    1px solid var(--line);

  border-radius: 7px;

  background: white;
  color: #475467;

  font-size: 11px;
  font-weight: 700;
}


/* =========================================================
   Trace Cards
========================================================= */

.timeline {
  position: relative;
}

.empty-trace {
  min-height: 260px;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  text-align: center;

  color: var(--muted);
}

.trace-icon {
  width: 46px;
  height: 46px;

  margin-bottom: 13px;

  display: grid;
  place-items: center;

  border-radius: 14px;

  background: #eef1f5;

  font-size: 24px;
}

.empty-trace strong {
  margin-bottom: 6px;

  color: #475467;

  font-size: 14px;
}

.empty-trace span {
  max-width: 250px;

  font-size: 12px;
  line-height: 1.6;
}

.trace-card {
  position: relative;

  margin-bottom: 14px;

  border:
    1px solid #e5e9ef;

  border-radius: 13px;

  background: white;

  overflow: hidden;
}

.trace-card-head {
  width: 100%;

  padding:
    14px 14px;

  display: grid;

  grid-template-columns:
    31px
    minmax(0, 1fr)
    auto;

  gap: 11px;

  align-items: center;

  border: 0;

  background: white;

  text-align: left;
}

.trace-card-head:hover {
  background: #fbfcfe;
}

.trace-number {
  width: 31px;
  height: 31px;

  display: grid;
  place-items: center;

  border-radius: 9px;

  background: var(--accent-soft);
  color: var(--accent);

  font-size: 12px;
  font-weight: 800;
}

.trace-title-wrap {
  min-width: 0;
}

.trace-title {
  font-size: 14px;
  font-weight: 800;

  line-height: 1.35;

  color: var(--text);
}

.trace-subtitle {
  margin-top: 5px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.4;
}

.trace-card-status {
  font-size: 10px;
  font-weight: 850;

  letter-spacing: 0.04em;
}

.trace-card-status.success {
  color: var(--success);
}

.trace-card-status.warning {
  color: var(--warning);
}

.trace-card-status.error {
  color: var(--danger);
}

.trace-card-status.running {
  color: var(--accent);
}

.trace-card-body {
  display: none;

  padding:
    2px
    14px
    16px
    56px;

  border-top:
    1px solid #f0f2f5;

  background: #fcfdff;
}

.trace-card.open
.trace-card-body {
  display: block;
}


/* =========================================================
   Process explanation blocks
========================================================= */

.process-explanation {
  margin-top: 13px;

  padding: 12px 13px;

  border: 1px solid #e6eaf0;
  border-left-width: 4px;
  border-radius: 9px;

  background: white;
}

.process-explanation.llm {
  border-left-color: #3157d5;
  background: #f8f9ff;
}

.process-explanation.db {
  border-left-color: #16845b;
  background: #f7fcfa;
}

.process-explanation.vector {
  border-left-color: #7446b8;
  background: #fbf8ff;
}

.process-explanation.human {
  border-left-color: #b86b13;
  background: #fffaf2;
}

.process-explanation.system {
  border-left-color: #667085;
  background: #fafbfc;
}

.process-actor {
  margin-bottom: 5px;

  font-size: 11px;
  font-weight: 850;

  letter-spacing: 0.05em;

  color: #344054;
}

.process-explanation.llm
.process-actor {
  color: var(--accent);
}

.process-explanation.db
.process-actor {
  color: var(--success);
}

.process-explanation.vector
.process-actor {
  color: var(--purple);
}

.process-explanation.human
.process-actor {
  color: var(--warning);
}

.process-text {
  color: #344054;

  font-size: 13px;
  line-height: 1.65;
}


/* =========================================================
   Trace detail
========================================================= */

.trace-section {
  margin-top: 14px;
}

.trace-section-label {
  margin-bottom: 7px;

  color: #667085;

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.07em;

  text-transform: uppercase;
}

.trace-value {
  color: #344054;

  font-size: 12px;
  line-height: 1.65;

  word-break: break-word;
  white-space: pre-wrap;
}

.trace-kv-grid {
  display: grid;

  grid-template-columns:
    120px
    minmax(0, 1fr);

  border:
    1px solid #edf0f4;

  border-radius: 8px;

  overflow: hidden;
}

.trace-kv-key,
.trace-kv-value {
  padding: 9px 10px;

  border-bottom:
    1px solid #edf0f4;

  font-size: 11px;
  line-height: 1.5;
}

.trace-kv-key {
  background: #f8fafc;

  color: #667085;

  font-weight: 750;
}

.trace-kv-value {
  background: white;

  color: #344054;

  word-break: break-word;
  white-space: pre-wrap;
}

.trace-kv-grid
> div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.code-block {
  max-height: 250px;

  overflow: auto;

  padding: 12px;

  border:
    1px solid #e8ebf1;

  border-radius: 8px;

  background: #101828;
  color: #e7ecf3;

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;

  font-size: 11px;
  line-height: 1.6;

  white-space: pre-wrap;
  word-break: break-word;
}

.document-block {
  max-height: 200px;

  overflow: auto;

  padding: 11px;

  border:
    1px solid #e8ebf1;

  border-radius: 8px;

  background: white;

  color: #475467;

  font-size: 11px;
  line-height: 1.65;

  white-space: pre-wrap;
}

.trace-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trace-pill {
  padding: 6px 8px;

  border-radius: 999px;

  background: var(--accent-soft);
  color: var(--accent);

  font-size: 10px;
  font-weight: 750;
}


/* =========================================================
   Responsive
========================================================= */

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

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .workspace-view {
    position: static;

    height: auto;
    min-height: 100vh;

    overflow: visible;
  }

  .topbar {
    position: sticky;
  }

  .workspace {
    position: static;

    min-height:
      calc(
        100vh
        - var(--topbar-height)
      );

    grid-template-columns: 1fr;

    overflow: visible;
  }

  .chat-panel {
    min-height: 75vh;
  }

  .execution-panel {
    border-left: 0;

    border-top:
      1px solid var(--line);
  }

  .execution-panel-inner {
    height: auto;

    overflow: visible;
  }

  .capability-row {
    grid-template-columns:
      repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .hero {
    padding-top: 9vh;
  }

  .hero h1 {
    font-size: 48px;
  }

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

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

  .prototype-badge {
    display: none;
  }

  .messages {
    padding-left: 18px;
    padding-right: 18px;
  }

  .composer,
  .approval-box {
    margin-left: 18px;
    margin-right: 18px;
  }

  .message-content {
    max-width: 88%;
  }
}
