/* Premium dark UI, responsive, no external dependencies */
:root{
  --bg: #0b0f14;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.08);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --muted2: rgba(255,255,255,0.52);
  --line: rgba(255,255,255,0.12);
  --accent: #36d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --good: #34d399;
  --shadow: 0 18px 40px rgba(0,0,0,0.55);
  --radius: 16px;
  --radius2: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* Respect the HTML `hidden` attribute (author CSS can otherwise override UA styles) */
[hidden]{
  display: none !important;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 700px at 10% 0%, rgba(54,211,153,0.14), transparent 60%),
    radial-gradient(900px 600px at 80% 10%, rgba(251,191,36,0.12), transparent 55%),
    radial-gradient(900px 700px at 60% 90%, rgba(59,130,246,0.10), transparent 50%),
    var(--bg);
  color: var(--text);
}

a{ color:inherit; }
b{ font-weight: 650; }
.nowrap{ white-space: nowrap; }

.topbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  position: sticky;
  top:0;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(11,15,20,0.92), rgba(11,15,20,0.60));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand__mark{
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(54,211,153,0.24), rgba(255,255,255,0.06));
  border: 1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  box-shadow: var(--shadow);
}
.brand__title{ font-size: 15px; font-weight: 720; letter-spacing: .2px; }
.brand__subtitle{ font-size: 12px; color: var(--muted); margin-top: 2px; }

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

.shell{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap: 16px;
  padding: 16px;
  max-width: 1300px;
  margin: 0 auto;
}

.panel{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card--chat{ padding: 0; overflow:hidden; }
.card__title{
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.86);
  margin-bottom: 10px;
  letter-spacing: .2px;
}
.card--chat .card__title{
  padding: 14px 14px 0 14px;
  margin-bottom: 8px;
}

.field{ display:flex; flex-direction:column; gap:6px; margin-bottom: 10px; }
.field__label{ font-size: 12px; color: var(--muted); }
.select, .textarea{
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 10px;
  outline: none;
}
.textarea{ resize: vertical; min-height: 68px; }
.select:focus, .textarea:focus{ border-color: rgba(54,211,153,0.55); box-shadow: 0 0 0 4px rgba(54,211,153,0.10); }

.row{ display:flex; align-items:center; justify-content: space-between; }
.row--gap{ gap: 10px; }
.small{ font-size: 12px; }
.muted{ color: var(--muted); }
.muted2{ color: var(--muted2); }

.btn{
  appearance:none;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 650;
  cursor:pointer;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
}
.btn:active{ transform: translateY(1px); }
.btn--primary{
  background: linear-gradient(145deg, rgba(54,211,153,0.95), rgba(54,211,153,0.70));
  color: #07120d;
  border-color: rgba(54,211,153,0.65);
}
.btn--ghost{
  background: rgba(255,255,255,0.04);
}
.btn--sm{ padding: 8px 10px; border-radius: 10px; font-size: 12px; }

.scenario{
  margin-top: 8px;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.scenario__title{ font-weight: 750; margin-bottom: 6px; }
.scenario__meta{ display:flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pill{
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.80);
}
.pill--accent{ border-color: rgba(54,211,153,0.35); }
.pill--warn{ border-color: rgba(251,191,36,0.35); }

.funnel{
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.fstep{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.16);
}
.fstep__name{ font-weight: 700; font-size: 12px; }
.fstep__desc{ font-size: 11px; color: var(--muted); }
.fstep__tag{
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: rgba(255,255,255,0.78);
  background: rgba(255,255,255,0.04);
}
.fstep--active{ border-color: rgba(54,211,153,0.45); background: rgba(54,211,153,0.10); }
.fstep--done{ opacity: 0.85; }
.fstep--done .fstep__tag{ border-color: rgba(54,211,153,0.35); color: rgba(54,211,153,0.9); }
.fstep--fail{ border-color: rgba(251,113,133,0.38); background: rgba(251,113,133,0.08); }

.stats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat{
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.15);
  border-radius: 14px;
  padding: 10px;
}
.stat__k{ font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.stat__v{ font-size: 16px; font-weight: 800; }

.chat{
  height: min(62vh, 560px);
  overflow:auto;
  padding: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(0,0,0,0.18), rgba(0,0,0,0.10));
}
.bubble{
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin: 8px 0;
  line-height: 1.28;
  white-space: pre-wrap;
}
.bubble--client{
  background: rgba(255,255,255,0.06);
  border-top-left-radius: 6px;
}
.bubble--you{
  margin-left:auto;
  background: rgba(54,211,153,0.10);
  border-color: rgba(54,211,153,0.25);
  border-top-right-radius: 6px;
}
.bubble__who{ font-size: 11px; color: var(--muted); margin-bottom: 4px; }

.stepbox{
  padding: 14px;
}
.stepbox__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.stepbox__title{ font-size: 14px; font-weight: 820; }
.stepbox__goal{ margin-top: 8px; color: rgba(255,255,255,0.86); }
.hints{
  margin-top: 10px;
  border: 1px dashed rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}
.answer{ margin-top: 12px; display:flex; flex-direction:column; gap: 10px; }
.answer__choices{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choice{
  text-align:left;
  flex: 1 1 240px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.16);
  cursor:pointer;
}
.choice:hover{ border-color: rgba(255,255,255,0.22); }
.choice__tag{
  display:inline-block;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: rgba(255,255,255,0.75);
  margin-bottom: 8px;
}
.choice__text{ font-size: 13px; }
.choice__tag--good{ border-color: rgba(52,211,153,0.35); color: rgba(52,211,153,0.95); }
.choice__tag--meh{ border-color: rgba(251,191,36,0.35); color: rgba(251,191,36,0.95); }
.choice__tag--bad{ border-color: rgba(251,113,133,0.35); color: rgba(251,113,133,0.95); }

.compare{
  margin-top: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.14);
  border-radius: 14px;
  padding: 10px;
}
.compare__title{ font-weight: 800; margin-bottom: 8px; }
.compare__model{ color: rgba(255,255,255,0.86); white-space: pre-wrap; }
.compare__tips{ margin-top: 8px; color: var(--muted); font-size: 12px; }

.endbox{
  padding: 14px;
}
.endbox__title{ font-size: 16px; font-weight: 900; margin-bottom: 8px; }
.endbox__summary{ color: rgba(255,255,255,0.86); white-space: pre-wrap; }
.idle{
  padding: 22px 14px 18px 14px;
  display:flex;
  gap: 12px;
  align-items:flex-start;
}
.idle__emoji{ font-size: 28px; }
.idle__text{ line-height: 1.35; }

.modal{
  position: fixed;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 50;
}
.modal__backdrop{
  position:absolute;
  inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(4px);
}
.modal__box{
  position: relative;
  width: min(720px, 92vw);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(16, 23, 33, 0.92);
  box-shadow: var(--shadow);
}
.modal__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.modal__title{ font-weight: 900; }
.modal__body{ padding: 14px; color: rgba(255,255,255,0.86); }
.ol{ margin: 0; padding-left: 18px; }
.ol li{ margin: 8px 0; }

@media (max-width: 980px){
  .shell{ grid-template-columns: 1fr; }
  .chat{ height: min(55vh, 520px); }
}
