:root {
  --bg: #0a0d0f;
  --bg2: #111418;
  --bg3: #181d22;
  --panel: #1a2028;
  --border: #2a3540;
  --amber: #f5a623;
  --amber-dim: #a06b10;
  --cyan: #00d4ff;
  --cyan-dim: #006880;
  --green: #39d98a;
  --red: #ff4d4d;
  --text: #d4dde6;
  --text-dim: #6a7d8e;
  --text-muted: #3d4f5c;
  --mono: 'Share Tech Mono', monospace;
  --sans: 'Barlow', sans-serif;
  --cond: 'Barlow Condensed', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
}

header {
  background: var(--bg2);
  border-bottom: 2px solid var(--amber);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo-badge {
  background: var(--amber);
  color: #000;
  font-family: var(--cond);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 4px 10px;
  clip-path: polygon(0 0,100% 0,95% 100%,0 100%);
}
header h1 {
  font-family: var(--cond);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 1px;
  color: #fff;
}
header h1 span { color: var(--amber); }
.header-sub {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
  line-height: 1.6;
}

.tabs {
  display: flex;
  gap: 0;
  padding: 0 32px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-dim);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.5px;
  padding: 14px 24px 11px;
  cursor: pointer;
  transition: all .2s;
  text-transform: uppercase;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--amber); border-bottom-color: var(--amber); }

.main { padding: 28px 32px; max-width: 1300px; margin: 0 auto; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.is-hidden { display: none; }
.mt-24 { margin-top: 24px; }

.section-title {
  font-family: var(--cond);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.overview-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber);
  padding: 20px 24px;
  margin-bottom: 28px;
  border-radius: 2px;
}
.overview-card p { font-size: 15px; line-height: 1.7; color: var(--text); }
.overview-card strong { color: var(--amber); font-weight: 700; }

.flow-wrapper {
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 28px;
}
.flow-pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: max-content;
}
.flow-step {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-right: none;
  padding: 14px 18px;
  cursor: pointer;
  transition: all .2s;
  min-width: 130px;
  position: relative;
}
.flow-step:last-child { border-right: 1px solid var(--border); }
.flow-step:hover, .flow-step.active {
  background: var(--panel);
  border-color: var(--amber);
}
.flow-step.active { border-color: var(--amber); }
.flow-step.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--amber);
}
.step-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber-dim);
  margin-bottom: 4px;
}
.step-name {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
}
.flow-arrow {
  display: flex;
  align-items: center;
  color: var(--amber-dim);
  font-size: 18px;
  padding: 0 2px;
}

.step-detail {
  background: var(--panel);
  border: 1px solid var(--amber);
  border-radius: 2px;
  padding: 24px;
  margin-bottom: 28px;
  min-height: 180px;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from {opacity: 0; transform: translateY(-6px)} to {opacity: 1; transform: translateY(0)} }

.step-detail h3 {
  font-family: var(--cond);
  font-weight: 900;
  font-size: 20px;
  color: #fff;
  margin-bottom: 6px;
}
.step-detail .step-role {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  margin-bottom: 16px;
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-block h4 {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.detail-block ul { list-style: none; }
.detail-block ul li {
  font-size: 14px;
  color: var(--text);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.detail-block ul li::before {
  content: '▸';
  color: var(--amber);
  flex-shrink: 0;
  margin-top: 1px;
}
.term-badge {
  display: inline-block;
  background: rgba(245,166,35,.12);
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 2px;
  margin: 2px 2px 2px 0;
  cursor: pointer;
  transition: background .15s;
}
.term-badge:hover { background: rgba(245,166,35,.25); }

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.glossary-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: 2px;
  transition: border-color .2s;
}
.glossary-card:hover { border-color: var(--amber-dim); }
.glossary-card .term {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  margin-bottom: 6px;
  font-weight: 700;
}
.glossary-card .def {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}
.glossary-card .card-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .4px;
  text-decoration: none;
}
.glossary-card .card-link:hover {
  color: #7be8ff;
}

.coach-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.coach-header {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.coach-dot {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.coach-header span {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--text);
}
.coach-header .coach-mode {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
}

.chat-area {
  height: 340px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-thumb { background: var(--border); }

.msg {
  max-width: 85%;
  animation: fadeIn .2s ease;
}
.msg.user { align-self: flex-end; }
.msg.ai { align-self: flex-start; }

.msg-bubble {
  padding: 12px 16px;
  border-radius: 2px;
  font-size: 14px;
  line-height: 1.6;
}
.msg.user .msg-bubble {
  background: rgba(245,166,35,.15);
  border: 1px solid var(--amber-dim);
  color: var(--text);
  border-radius: 2px 0 2px 2px;
}
.msg.ai .msg-bubble {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0 2px 2px 2px;
}
.msg-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding: 0 4px;
}
.msg.user .msg-label { text-align: right; }

.typing-indicator {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 14px 16px;
}
.typing-indicator span {
  width: 7px;
  height: 7px;
  background: var(--amber-dim);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 2px;
  resize: none;
  outline: none;
  transition: border-color .2s;
  max-height: 120px;
}
.chat-input:focus { border-color: var(--amber-dim); }
.chat-input::placeholder { color: var(--text-muted); }

.send-btn {
  background: var(--amber);
  border: none;
  color: #000;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 2px;
  transition: opacity .2s;
  align-self: flex-end;
  white-space: nowrap;
}
.send-btn:hover { opacity: .85; }
.send-btn:disabled { opacity: .4; cursor: not-allowed; }

.quick-prompts {
  padding: 0 16px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.qp-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 2px;
  transition: all .2s;
}
.qp-btn:hover { border-color: var(--amber-dim); color: var(--amber); }

.integration-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 28px;
  border-radius: 2px;
}
.int-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.int-node {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 12px 16px;
  text-align: center;
  border-radius: 2px;
  min-width: 110px;
}
.int-node.highlight { border-color: var(--amber); }
.int-node .n-label {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
  letter-spacing: .5px;
}
.int-node .n-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 3px;
}
.int-arrow {
  color: var(--amber-dim);
  font-size: 20px;
  flex-shrink: 0;
}
.integration-divider {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  color: var(--amber-dim);
  font-size: 20px;
}
.placeholder-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 60px 20px;
}
.placeholder-msg span { display: block; font-size: 20px; margin-bottom: 8px; letter-spacing: 2px; }

@media (max-width: 860px) {
  header {
    padding: 18px 20px;
    flex-wrap: wrap;
  }

  .header-sub {
    margin-left: 0;
    width: 100%;
    text-align: left;
  }

  .tabs,
  .main {
    padding-left: 20px;
    padding-right: 20px;
  }

  .tabs {
    overflow-x: auto;
  }
}

@media (max-width: 560px) {
  .chat-input-area {
    flex-direction: column;
    align-items: stretch;
  }

  .send-btn {
    align-self: stretch;
  }
}
