:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede6;
  --ink: #1d1f23;
  --muted: #6a6e76;
  --line: #d9d6cc;
  --accent: #2f5fd0;
  --accent-soft: rgba(47, 95, 208, 0.1);
  --success: #208758;
  --k-trigger: #2f7d5b;
  --k-io: #2f5fd0;
  --k-logic: #8a5a00;
  --k-agent: #a23b72;
  --k-code: #5b6573;
  --k-api: #2f5fd0;
  --k-mcp: #b4540a;
  --k-knowledge: #6a4bb0;
  --wa-bg: #eae6df;
  --wa-header: #075e54;
  --wa-bubble-in: #ffffff;
  --wa-bubble-out: #d9fdd3;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 6px 18px rgba(0,0,0,.05);
  --shadow-lg: 0 12px 28px rgba(0,0,0,.1);
}

:root[data-theme="dark"] {
  --bg: #121418;
  --surface: #1a1d23;
  --surface-2: #242831;
  --ink: #eaecf0;
  --muted: #969da8;
  --line: #323843;
  --accent: #6f97ff;
  --accent-soft: rgba(111, 151, 255, 0.12);
  --success: #3dd68c;
  --k-trigger: #5fcf9d;
  --k-io: #7ea2ff;
  --k-logic: #e0b25a;
  --k-agent: #ee8cc0;
  --k-code: #aab4c3;
  --k-api: #7ea2ff;
  --k-mcp: #f2a35e;
  --k-knowledge: #b9a1f5;
  --wa-bg: #0b141a;
  --wa-header: #1f2c34;
  --wa-bubble-in: #202c33;
  --wa-bubble-out: #005c4b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 3px rgba(0,0,0,.45), 0 6px 20px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121418;
    --surface: #1a1d23;
    --surface-2: #242831;
    --ink: #eaecf0;
    --muted: #969da8;
    --line: #323843;
    --accent: #6f97ff;
    --accent-soft: rgba(111, 151, 255, 0.12);
    --success: #3dd68c;
    --k-trigger: #5fcf9d;
    --k-io: #7ea2ff;
    --k-logic: #e0b25a;
    --k-agent: #ee8cc0;
    --k-code: #aab4c3;
    --k-api: #7ea2ff;
    --k-mcp: #f2a35e;
    --k-knowledge: #b9a1f5;
    --wa-bg: #0b141a;
    --wa-header: #1f2c34;
    --wa-bubble-in: #202c33;
    --wa-bubble-out: #005c4b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 1px 3px rgba(0,0,0,.45), 0 6px 20px rgba(0,0,0,.35);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.muted { color: var(--muted); }
button { font: inherit; color: inherit; cursor: pointer; transition: all 0.15s ease; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top Header Bar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  z-index: 20;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.brand-avatar { font-size: 20px; }
.brand-text strong { font-size: 15px; font-weight: 700; }
.badge-pill {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--accent);
}

/* Tabs Navigation */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.on {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Top Actions */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-tour {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-tour:hover {
  background: var(--accent);
  color: #fff;
}
.lang-switch {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
}
.lang-btn {
  border: 0;
  background: transparent;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  color: var(--muted);
}
.lang-btn.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.ghost {
  border: 1px solid var(--line);
  background: transparent;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.ghost:hover { background: var(--surface-2); }
.mobile-only { display: none; }

/* Floating Guided Tour Banner */
.tour-banner {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-lg);
  border-radius: 12px;
  padding: 12px 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 680px;
  width: calc(100% - 32px);
  animation: slideDown 0.25s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.tour-content { flex: 1; min-width: 0; }
.tour-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.tour-text-wrap h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.tour-text-wrap p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.tour-nav { display: flex; align-items: center; gap: 6px; }
.tour-btn {
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
}
.tour-btn.primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.tour-btn.secondary {
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.tour-btn.ghost {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

/* Main Layout Grid */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr minmax(340px, 460px);
  min-height: 0;
  position: relative;
}

/* ==========================================================================
   VIEW 1: OVERVIEW & BUSINESS IMPACT (Recruiter Friendly)
   ========================================================================== */
.overview-view {
  position: absolute;
  inset: 0;
  background: var(--bg);
  overflow-y: auto;
  z-index: 10;
  padding: 32px 20px 60px;
}
.overview-container {
  max-width: 1060px;
  margin: 0 auto;
}
.hero-block {
  text-align: center;
  padding: 20px 0 36px;
}
.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero-block h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.hero-subtitle {
  font-size: 16px;
  color: var(--muted);
  max-width: 760px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

/* Metrics Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 14px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.metric-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 6px;
}
.metric-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.metric-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { opacity: 0.92; }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
}
.btn-secondary:hover { background: var(--surface-2); }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
}
.btn-outline:hover { background: var(--accent-soft); }

/* Highlights Section */
.highlights-section {
  margin: 40px 0;
}
.highlights-section h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 18px;
  text-align: center;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.highlight-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.hl-icon { font-size: 26px; margin-bottom: 10px; }
.highlight-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
}
.highlight-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

/* Tech Stack Section */
.stack-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}
.stack-section h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 12px;
}
.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stack-badge {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink);
}

/* ==========================================================================
   VIEW 2: LIVE CUSTOMER SIMULATOR
   ========================================================================== */
.simulator-view {
  position: absolute;
  inset: 0;
  background: var(--bg);
  overflow-y: auto;
  z-index: 10;
  padding: 24px 20px 40px;
}
.simulator-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 380px 1fr;
  gap: 18px;
  align-items: start;
}

.simulator-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.simulator-sidebar h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
}
.simulator-sidebar p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.4;
}
.scenario-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scenario-btn {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.scenario-btn:hover {
  background: var(--surface);
  border-color: var(--accent);
}
.scenario-btn.on {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-sm);
}
.scenario-btn-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 2px;
}
.scenario-btn-sub {
  font-size: 11px;
  color: var(--muted);
}
.sim-meta-box {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sim-meta-box h4 {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 6px;
}
.sim-meta-box p {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.btn-sm {
  padding: 6px 10px;
  font-size: 11px;
  width: 100%;
}

/* WhatsApp Phone Mockup */
.simulator-phone-wrap {
  display: flex;
  justify-content: center;
}
.phone-frame {
  width: 100%;
  max-width: 360px;
  height: 620px;
  background: var(--wa-bg);
  border: 6px solid #2b2e36;
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.phone-notch {
  width: 120px;
  height: 18px;
  background: #2b2e36;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}
.wa-header {
  background: var(--wa-header);
  color: #fff;
  padding: 24px 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.wa-back { font-size: 16px; cursor: pointer; }
.wa-avatar {
  width: 34px;
  height: 34px;
  background: #128c7e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.wa-info { flex: 1; min-width: 0; }
.wa-name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.wa-status { font-size: 11px; opacity: 0.85; }

.wa-chat {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-image: radial-gradient(rgba(0,0,0,0.06) 1px, transparent 1px);
  background-size: 16px 16px;
}
.wa-msg {
  max-width: 82%;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  position: relative;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
  animation: fadeInMsg 0.2s ease-out;
}
@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.wa-msg.in {
  align-self: flex-start;
  background: var(--wa-bubble-in);
  color: var(--ink);
  border-top-left-radius: 2px;
}
.wa-msg.out {
  align-self: flex-end;
  background: var(--wa-bubble-out);
  color: var(--ink);
  border-top-right-radius: 2px;
}
.wa-time {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  margin-top: 3px;
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}
.wa-media-card {
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
  border: 1px solid var(--line);
}
.wa-media-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: #333;
}
.wa-link-card {
  background: rgba(0,0,0,0.04);
  border-left: 3px solid var(--accent);
  padding: 6px 8px;
  border-radius: 4px;
  margin: 4px 0;
  font-size: 11px;
}

/* Simulator Real-Time Engine Trace */
.simulator-trace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.trace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.trace-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.trace-section { margin-bottom: 14px; }
.trace-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}
.trace-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.trace-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.trace-chip {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--k-mcp);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.trace-chip:hover { border-color: var(--accent); }
.trace-code {
  font-size: 11px;
  max-height: 180px;
  margin: 4px 0 0;
}
.trace-list {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.trace-list li { margin-bottom: 4px; }

/* ==========================================================================
   VIEW 3 & 4: MAP & RAW CANVAS
   ========================================================================== */
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.viewport {
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: none;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
}
.viewport.drag { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.world svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }

.zoom { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; z-index: 5; }
.zoom button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 12px;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.zoom button:hover { background: var(--surface-2); }
[hidden] { display: none !important; }

.crumb {
  position: absolute;
  left: 12px;
  top: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 12px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 5;
}
.crumb button { border: 0; background: transparent; color: var(--accent); padding: 0; font-weight: 600; }

.legend {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 11px;
  max-width: 75%;
  box-shadow: var(--shadow-sm);
  z-index: 5;
}
.legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Cards in Map */
.stagehead {
  position: absolute;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  width: 250px;
}
.card {
  position: absolute;
  width: 250px;
  height: 98px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--kc, var(--line));
  border-radius: 10px;
  padding: 9px 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow .15s, opacity .15s, transform .15s;
  text-align: left;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card .t { font-weight: 700; font-size: 13px; line-height: 1.25; color: var(--ink); }
.card .s { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.card .m {
  position: absolute;
  left: 12px;
  bottom: 8px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
}
.card .kind { color: var(--kc); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.card.sel {
  box-shadow: 0 0 0 2px var(--accent), var(--shadow);
  transform: translateY(-2px);
}
.card.dim { opacity: .28; }
.card.rel { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent), var(--shadow-sm); }
.card.tour-highlight {
  box-shadow: 0 0 0 3px var(--accent), 0 0 24px rgba(47, 95, 208, 0.4);
  animation: pulseHighlight 1.5s infinite;
}
@keyframes pulseHighlight {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* Raw nodes */
.rnode {
  position: absolute;
  width: 170px;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--kc, var(--line));
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.rnode .tp {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--kc);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.rnode.sel { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }

/* Detail Panel */
.panel {
  border-left: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
  padding: 18px 18px 40px;
  min-height: 0;
  box-shadow: -2px 0 8px rgba(0,0,0,0.03);
}
.panel h1 { font-size: 18px; margin: 0 0 4px; line-height: 1.25; font-weight: 700; }
.panel h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 20px 0 6px;
  font-weight: 700;
}
.panel p { margin: 6px 0; font-size: 13px; line-height: 1.5; }
.panel ul { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.panel li { margin: 3px 0; }
.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--kc, var(--accent));
  border: 1px solid var(--kc, var(--accent));
  background: color-mix(in srgb, var(--kc, var(--accent)) 8%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 8px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
}
.chip.link { cursor: pointer; }
.chip.link:hover { border-color: var(--accent); color: var(--accent); }
.why {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  border-left: 3px solid var(--accent);
}
.btn {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 8px;
  padding: 6px 12px;
  margin: 4px 6px 4px 0;
  font-weight: 600;
  font-size: 12px;
}
.btn.solid { background: var(--accent); color: #fff; }
pre.code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  max-height: 360px;
  overflow: auto;
  font: 11.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 6px 0;
}
details { margin: 6px 0; }
summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.outline { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.outline button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12.5px; }

/* ==========================================================================
   RESPONSIVE DESIGN (Tablets & Mobile)
   ========================================================================== */
@media (max-width: 1024px) {
  .simulator-container {
    grid-template-columns: 1fr 1fr;
  }
  .simulator-sidebar {
    grid-column: 1 / -1;
  }
  .scenario-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex !important; }

  .layout {
    grid-template-columns: 1fr;
  }
  .panel {
    position: absolute;
    right: 0;
    bottom: 0;
    top: 0;
    width: 320px;
    z-index: 30;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .panel.open {
    transform: translateX(0);
    box-shadow: -4px 0 20px rgba(0,0,0,0.25);
  }

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

  .simulator-container {
    grid-template-columns: 1fr;
  }
  .scenario-list {
    grid-template-columns: 1fr;
  }
  .simulator-phone-wrap {
    order: -1;
  }
}

@media (max-width: 540px) {
  .top {
    padding: 6px 10px;
  }
  .tabs {
    font-size: 12px;
  }
  .tab-btn {
    padding: 5px 8px;
  }
  .tab-label {
    display: none;
  }
  .tab-btn.on .tab-label {
    display: inline;
  }
  .hero-block h1 {
    font-size: 24px;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
