:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --primary:#2563eb;
  --primary2:#1d4ed8;
  --good:#10b981;
  --warn:#f59e0b;
  --bad:#ef4444;
  --shadow:0 10px 30px rgba(16,24,40,.08);
  --radius:12px;
  --radius2:16px;
  --mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:var(--bg);
}

.app{min-height:100%;display:flex;flex-direction:column}

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:center;
}
.topbar__inner{
  width:100%;
  max-width:1200px;
  display:flex;
  align-items:center;
  gap:24px;
  padding:12px 20px;
}
.topbar__left{display:flex;align-items:center;gap:12px}
.topbar__nav{display:flex;gap:24px;flex:1;justify-content:center}
.topbar__right{display:flex;align-items:center;gap:8px;margin-left:auto}

.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:inherit}
.brand__dot{width:10px;height:10px;border-radius:999px;background:linear-gradient(135deg,var(--primary),#22c55e)}
.brand__text{font-weight:700;letter-spacing:.2px}

.nav__item{
  padding:8px 12px;
  border-radius:999px;
  text-decoration:none;
  color:var(--muted);
  font-weight:600;
  font-size:14px;
}
.nav__item.is-active{color:var(--text);background:#eef2ff}

.btn{
  appearance:none;
  border:1px solid var(--line);
  background:var(--card);
  color:var(--text);
  padding:10px 14px;
  border-radius:10px;
  font-weight:700;
  cursor:pointer;
  font-size:14px;
  line-height:1;
}
.btn:hover{border-color:#d1d5db}
.btn:active{transform:translateY(1px)}
.btn--primary{border-color:transparent;background:var(--primary);color:#fff}
.btn--primary:hover{background:var(--primary2)}
.btn--ghost{border-color:transparent;background:transparent;color:var(--muted)}
.btn--ghost:hover{background:#f3f4f6;color:var(--text)}

.page{padding:18px 16px 88px}

.hero{max-width:1180px;margin:0 auto 14px}
.hero__title{font-size:20px;font-weight:800}
.hero__subtitle{color:var(--muted);margin-top:6px;font-size:14px}

.preset-grid{
  max-width:1180px;
  margin:0 auto;
  display:grid;
  gap:14px;
  grid-template-columns:repeat(3, minmax(0,1fr));
}

.preset-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius2);
  padding:16px;
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  min-height:168px;
}
.preset-card--wide{grid-column:span 3}
.preset-card__head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.preset-card__icon{
  width:38px;height:38px;border-radius:12px;
  display:grid;place-items:center;
  font-weight:900;color:#fff;letter-spacing:1px;
}
.preset-card__icon--blue{background:linear-gradient(135deg,#2563eb,#60a5fa)}
.preset-card__icon--cyan{background:linear-gradient(135deg,#06b6d4,#22c55e)}
.preset-card__icon--green{background:linear-gradient(135deg,#16a34a,#34d399)}
.preset-card__icon--purple{background:linear-gradient(135deg,#7c3aed,#a78bfa)}
.preset-card__icon--orange{background:linear-gradient(135deg,#f97316,#fb7185)}
.preset-card__icon--pink{background:linear-gradient(135deg,#db2777,#fda4af)}
.preset-card__icon--teal{background:linear-gradient(135deg,#14b8a6,#22c55e)}
.preset-card__icon--gray{background:linear-gradient(135deg,#6b7280,#9ca3af)}

.preset-card__title{font-weight:800}
.preset-card__desc{color:var(--muted);font-size:14px;line-height:1.5;margin:0 0 12px}
.preset-card__actions{margin-top:auto;display:flex;justify-content:flex-end}
.preset-card__actions--row{justify-content:flex-start;gap:10px}

.preset-products{display:grid;gap:10px;margin:0 0 10px}
.preset-products__loading{
  color:var(--muted);
  font-size:13px;
  padding:10px 12px;
  border-radius:12px;
  border:1px dashed var(--line);
  background:#f6f7fb;
}
.prod-mini{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
}
.prod-mini__img{
  width:44px;height:44px;border-radius:12px;
  background:#f3f4f6;
  flex:0 0 auto;
  object-fit:cover;
}
.prod-mini__main{min-width:0;flex:1}
.prod-mini__title{
  font-size:13px;
  font-weight:800;
  line-height:1.3;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.prod-mini__meta{margin-top:4px;display:flex;gap:8px;align-items:center}
.badge{
  font-size:12px;
  padding:2px 8px;
  border-radius:999px;
  background:#eef2ff;
  color:#3730a3;
  font-weight:800;
}
.prod-mini__link{
  font-size:12px;
  color:#2563eb;
  text-decoration:none;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:170px;
}
.prod-mini__link:hover{text-decoration:underline}
.prod-mini__actions{display:flex;gap:8px;flex:0 0 auto}
.prod-mini__btn{padding:8px 10px;border-radius:12px}

.custom-form{display:grid;gap:12px}
.field{display:grid;gap:6px}
.field__label{font-size:13px;color:var(--muted);font-weight:700}
.input,.textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  outline:none;
  font-size:14px;
  background:#fff;
  color:var(--text);
}
.textarea{resize:vertical;min-height:110px}
.input:focus,.textarea:focus{border-color:#c7d2fe;box-shadow:0 0 0 4px rgba(99,102,241,.12)}

.admin{max-width:1180px;margin:16px auto 0}
.admin__card{
  margin-top:12px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius2);
  padding:16px;
  box-shadow:var(--shadow);
}
.admin__msg{font-size:13px;color:var(--muted);font-weight:700}

.shell{
  max-width:1400px;
  margin:0 auto;
  display:grid;
  gap:14px;
  grid-template-columns:260px minmax(0,1fr) 360px;
  align-items:stretch;
}

.col{min-width:0}

.panel{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius2);
  box-shadow:var(--shadow);
  overflow:hidden;
  height:calc(100vh - 86px - 40px);
  display:flex;
  flex-direction:column;
}
.panel__head{
  padding:14px 14px 10px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
}
.panel__title{font-weight:900}
.panel__meta{color:var(--muted);font-size:12px;font-weight:700}

.session-list{padding:10px;display:grid;gap:8px;overflow:auto}
.session-item{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  display:grid;
  gap:4px;
  cursor:pointer;
  background:#fff;
}
.session-item:hover{border-color:#d1d5db}
.session-item.is-active{border-color:#c7d2fe;box-shadow:0 0 0 3px rgba(99,102,241,.12)}
.session-item__title{font-weight:900;font-size:13px}
.session-item__sub{font-size:12px;color:var(--muted);display:flex;justify-content:space-between;gap:10px}

.chat{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius2);
  box-shadow:var(--shadow);
  overflow:hidden;
  height:calc(100vh - 86px - 40px);
  display:flex;
  flex-direction:column;
}
.chat__head{
  border-bottom:1px solid var(--line);
  padding:12px 14px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.chat__title{display:flex;align-items:center;gap:10px;font-weight:900}
.chat__stats{display:flex;align-items:center;gap:14px;color:var(--muted);font-size:12px;font-weight:700;flex-wrap:wrap;justify-content:flex-end}
.stat strong{color:var(--text)}

.pill{
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  letter-spacing:.2px;
}
.pill--blue{background:#eef2ff;color:#1d4ed8}

.chat__body{
  padding:14px;
  flex:1;
  overflow:auto;
  background:linear-gradient(180deg,#ffffff,#fbfdff);
}
.msg{display:flex;gap:10px;margin:10px 0}
.msg--left{justify-content:flex-start}
.msg--right{justify-content:flex-end}
.avatar{
  width:34px;height:34px;border-radius:12px;
  background:#e5e7eb;
  display:grid;place-items:center;
  font-weight:900;color:#374151;font-size:12px;
  flex:0 0 auto;
}
.bubble{
  max-width:min(680px, 78%);
  border-radius:14px;
  padding:10px 12px;
  border:1px solid var(--line);
  background:#fff;
}
.msg--right .bubble{background:#eff6ff;border-color:#bfdbfe}
.bubble__meta{color:var(--muted);font-size:12px;font-weight:700;margin-bottom:4px;display:flex;gap:10px;justify-content:space-between}
.bubble__text{white-space:pre-wrap;word-break:break-word;font-size:14px;line-height:1.55}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}
.typing-indicator .typing-dot {
  width: 6px;
  height: 6px;
  background-color: #94a3b8;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}
.typing-indicator .typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}
.typing-indicator .typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}
.typing-indicator .typing-dot:nth-child(3) {
  animation-delay: 0s;
}
@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.p-card{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:10px;
  border-radius:12px;
  border:1px solid #e6eaf0;
  background:#fff;
}
.p-card__img{
  width:72px;height:72px;border-radius:10px;
  object-fit:cover;
  background:#f3f4f6;
  flex:0 0 auto;
}
.p-card__main{min-width:0}
.p-card__title{
  font-weight:900;
  font-size:13px;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.p-card__link{
  display:block;
  margin-top:8px;
  font-size:12px;
  color:#2563eb;
  text-decoration:none;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:340px;
}
.p-card__link:hover{text-decoration:underline}

.chat__composer{
  border-top:1px solid var(--line);
  padding:10px 12px 12px;
  background:#fff;
}
.composer__tools{display:flex;justify-content:space-between;gap:10px;margin-bottom:10px}
.composer__input{display:flex;gap:10px;align-items:flex-end}
.textarea--composer{min-height:46px;max-height:140px;resize:none}
.composer__hint{margin-top:8px;color:var(--muted);font-size:12px;font-weight:700}

.panel__tabs{display:flex;border-bottom:1px solid var(--line);background:#fff}
.tab{
  flex:1;
  padding:12px 10px;
  border:0;
  background:transparent;
  font-weight:900;
  color:var(--muted);
  cursor:pointer;
}
.tab.is-active{color:var(--text);box-shadow:inset 0 -3px 0 0 #6366f1}
.panel__body{padding:12px;overflow:auto;flex:1}
.tabpane{display:none}
.tabpane.is-active{display:block}

.kv{display:grid;gap:10px}
.kv__row{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.kv__k{color:var(--muted);font-weight:800;font-size:12px}
.kv__v{font-weight:800;font-size:12px;text-align:right;max-width:220px}
.tag{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:900}
.tag--green{background:#ecfdf5;color:#047857;border:1px solid #a7f3d0}

.section{margin-top:14px}
.section__title{font-weight:900;margin-bottom:8px}
.section__content{color:var(--muted);font-size:13px;line-height:1.55}
.actions{display:flex;gap:10px;flex-wrap:wrap}

.score-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.score-card{border:1px solid var(--line);border-radius:14px;padding:12px;background:#fff}
.score-card__label{color:var(--muted);font-size:12px;font-weight:900}
.score-card__value{font-size:22px;font-weight:900;margin-top:6px}

.bars{display:grid;gap:8px}
.bar{display:grid;grid-template-columns:90px 1fr 42px;gap:10px;align-items:center}
.bar__label{color:var(--muted);font-size:12px;font-weight:900}
.bar__track{height:10px;border-radius:999px;background:#f3f4f6;overflow:hidden}
.bar__fill{height:100%;border-radius:999px;background:linear-gradient(90deg,#2563eb,#22c55e)}
.bar__value{font-size:12px;font-weight:900;color:var(--muted);text-align:right}

.mobile-dock{
  position:fixed;
  left:0;right:0;bottom:0;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(180%) blur(12px);
  border-top:1px solid var(--line);
  display:none;
  gap:10px;
  z-index:25;
}
.dockbtn{
  flex:1;
  border:1px solid var(--line);
  background:#fff;
  border-radius:12px;
  padding:10px 0;
  font-weight:900;
  color:var(--muted);
  cursor:pointer;
}
.dockbtn.is-active{color:var(--text);border-color:#c7d2fe;box-shadow:0 0 0 3px rgba(99,102,241,.12)}

.modal{position:fixed;inset:0;display:none;z-index:40}
.modal.is-open{display:block}
.modal__backdrop{position:absolute;inset:0;background:rgba(15,23,42,.55)}
.modal__card{
  position:absolute;
  left:50%;top:50%;
  transform:translate(-50%,-50%);
  width:min(720px, calc(100% - 26px));
  max-height:min(80vh, 760px);
  background:#fff;
  border-radius:16px;
  box-shadow:0 30px 80px rgba(0,0,0,.25);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.modal__head{padding:12px 14px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}
.modal__title{font-weight:900}
.iconbtn{border:0;background:transparent;font-size:22px;line-height:1;cursor:pointer;color:var(--muted)}
.modal__body{padding:12px 14px;overflow:auto;flex:1}
.modal__foot{padding:12px 14px;border-top:1px solid var(--line);display:flex;justify-content:flex-end}
.pre{font-family:var(--mono);font-size:12px;white-space:pre-wrap;word-break:break-word;margin:0;color:#0f172a}

.result-head{max-width:1180px;margin:0 auto 24px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.result-head__title{font-size:28px;font-weight:800;color:#1e293b;margin-bottom:4px}
.result-head__subtitle{color:#64748b;font-size:15px}
.result-head__actions{display:flex;gap:12px;flex-wrap:wrap}

.result-grid{
  max-width:1180px;
  margin:0 auto 24px;
  display:grid;
  gap:16px;
  grid-template-columns:repeat(4, minmax(0,1fr));
}
.kpi{
  background:#fff;
  border:none;
  border-radius:20px;
  box-shadow:0 10px 30px rgba(37,99,235,0.05);
  padding:24px;
  transition:transform 0.3s ease;
}
.kpi:hover{transform:translateY(-5px)}
.kpi__label{color:#64748b;font-size:14px;font-weight:600;display:flex;align-items:center;gap:8px}
.kpi__value{font-size:32px;font-weight:800;margin-top:12px;color:#1e293b}
.kpi__hint{color:#94a3b8;font-size:13px;font-weight:500;margin-top:8px}

.result-body{max-width:1180px;margin:0 auto;display:grid;gap:20px}
.card{background:#fff;border:none;border-radius:24px;box-shadow:0 10px 30px rgba(37,99,235,0.05);overflow:hidden}
.card__head{padding:24px;border-bottom:1px solid #f1f5f9;display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;background:#fafaf9}
.card__title{font-size:18px;font-weight:800;color:#1e293b}
.card__meta{color:#64748b;font-size:13px;font-weight:500}
.card__body{padding:24px}

.mentor{display:flex;gap:16px;align-items:flex-start;background:#f8fafc;padding:20px;border-radius:16px}
.mentor__badge{width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,#3b82f6 0%,#60a5fa 100%);color:#fff;display:grid;place-items:center;font-size:18px;font-weight:800;box-shadow:0 4px 12px rgba(59,130,246,0.3);flex-shrink:0}
.mentor__text{font-size:15px;line-height:1.8;color:#334155;font-weight:500}
.divider{height:1px;background:#e2e8f0;margin:20px 0}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:24px}
.mini-title{font-size:16px;font-weight:800;color:#1e293b;margin-bottom:16px;display:flex;align-items:center;gap:8px}

.table{display:grid;gap:12px}
.table__row{display:grid;grid-template-columns:110px 60px 1fr;gap:16px;align-items:center;padding:16px 20px;border:1px solid #e2e8f0;border-radius:16px;background:#fff;transition:box-shadow 0.2s}
.table__row:hover{box-shadow:0 4px 12px rgba(0,0,0,0.02)}
.table__row--head{background:#f8fafc;border:none}
.table__cell{font-size:14px;line-height:1.5;color:#334155}
.table__row--head .table__cell{font-weight:700;color:#64748b}

.insights{margin:0;padding-left:18px;color:#334155}
.insights li{margin:12px 0;line-height:1.7;font-size:14px}
.detail-list{display:grid;gap:16px}
.detail{
  border:1px solid #e2e8f0;
  border-radius:20px;
  padding:24px;
  display:grid;
  gap:16px;
  background:#fff;
  transition:transform 0.2s,box-shadow 0.2s;
}
.detail:hover{transform:translateY(-2px);box-shadow:0 10px 30px rgba(0,0,0,0.03)}
.detail__q{font-size:16px;font-weight:700;color:#1e293b;display:flex;align-items:flex-start;gap:10px}
.detail__q::before{content:'Q';display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;background:#eef2ff;color:#3b82f6;border-radius:6px;font-size:14px;font-weight:800;flex-shrink:0}
.detail__a{color:#475569;font-size:15px;line-height:1.7;white-space:pre-wrap;word-break:break-word;background:#f8fafc;padding:16px;border-radius:12px}
.detail__meta{display:flex;gap:16px;flex-wrap:wrap;color:#94a3b8;font-size:13px;font-weight:600;border-top:1px dashed #e2e8f0;padding-top:16px}

@media (max-width: 1100px){
  .preset-grid{grid-template-columns:repeat(2, minmax(0,1fr))}
  .preset-card--wide{grid-column:span 2}
  .shell{grid-template-columns:240px minmax(0,1fr) 320px}
  .result-grid{grid-template-columns:repeat(2, minmax(0,1fr))}
  .grid2{grid-template-columns:1fr}
}

@media (max-width: 880px){
  .topbar__nav{display:none}
  .shell{grid-template-columns:1fr}
  .col--left,.col--right{display:none}
  .panel,.chat{height:calc(100vh - 86px - 88px)}
  .mobile-dock{display:flex}
  .page{padding-bottom:120px}
}

@media (max-width: 520px){
  .preset-grid{grid-template-columns:1fr}
  .preset-card--wide{grid-column:span 1}
  .score-cards{grid-template-columns:1fr}
  .result-grid{grid-template-columns:1fr}
  .bubble{max-width:88%}
  .chat__stats{gap:10px}
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.admin-tab-btn {
  text-align: left;
  justify-content: flex-start;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: #475569;
  border: none;
  background: transparent;
  width: 100%;
  transition: all 0.2s;
  cursor: pointer;
}
.admin-tab-btn:hover {
  background: #f1f5f9;
}
.admin-tab-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 6px -1px rgba(59,130,246,0.2);
}

body[data-page="train"]{background:#eef2f7}
body[data-page="train"] .topbar{display:none}
body[data-page="train"] .page--train{padding:0}
body[data-page="train"]{overflow:hidden}

.workbench{
  height:100vh;
  display:grid;
  grid-template-columns:68px 280px minmax(0,1fr) 420px;
  gap:0;
}

.wb__sider,.wb__sessions,.wb__chat,.wb__right{min-height:0}

.wb__sider{background:linear-gradient(180deg,#0a67ff,#0a5be1);color:#fff}
.sider{height:100%;display:flex;flex-direction:column;align-items:center;padding:10px 10px}
.sider__brand{
  width:42px;height:42px;border-radius:16px;
  display:grid;place-items:center;
  background:rgba(255,255,255,.16);
  font-weight:800;letter-spacing:.5px;
  margin:6px 0 14px;
}
.sider__menu{display:flex;flex-direction:column;gap:8px;width:100%;margin-top:2px}
.sider__item{
  width:100%;
  border:0;
  background:transparent;
  color:rgba(255,255,255,.86);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:10px 0 8px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
}
.sider__item:hover{background:rgba(255,255,255,.12)}
.sider__item.is-active{background:rgba(255,255,255,.18);color:#fff}
.sider__icon{
  width:24px;height:24px;
  display:grid;place-items:center;
  color:#fff;
}
.sider__icon svg{width:22px;height:22px;display:block}
.sider__label{font-size:12px;letter-spacing:.2px}
.sider__foot{margin-top:auto;padding:10px 0}
.sider__avatar{
  width:40px;height:40px;border-radius:999px;
  display:grid;place-items:center;
  background:rgba(255,255,255,.18);
  font-weight:700;
}

.wb__sessions{background:#fff;border-right:1px solid #e6eaf0}
.sidepanel{height:100%;display:flex;flex-direction:column;min-height:0}
.sidepanel__head{
  padding:12px 12px 10px;
  border-bottom:1px solid #eef2f6;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.sidepanel__status{display:flex;align-items:center;gap:10px;min-width:0}
.sidepanel__userpic{
  width:30px;height:30px;border-radius:10px;
  display:grid;place-items:center;
  background:#e6f0ff;
  color:#0a67ff;
  font-weight:700;
  flex:0 0 auto;
}
.sidepanel__userinfo{display:grid;gap:2px;min-width:0}
.dot{width:8px;height:8px;border-radius:999px;background:#9ca3af}
.dot--green{background:#22c55e}
.sidepanel__name{font-weight:700;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidepanel__state{display:flex;align-items:center;gap:6px;color:#6b7280;font-size:12px;font-weight:600}
.sidepanel__counts{display:flex;gap:10px}
.count{display:grid;place-items:center;min-width:56px}
.count__n{font-weight:700;color:#111827}
.count__t{font-size:12px;color:#6b7280;font-weight:600}
.sidepanel__search{padding:10px 12px;border-bottom:1px solid #eef2f6}
.search{
  width:100%;
  padding:10px 12px 10px 34px;
  border-radius:14px;
  border:1px solid #e5e7eb;
  background:#f6f7fb;
  font-weight:600;
  outline:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M10.8 18.1a7.3 7.3 0 1 1 0-14.6 7.3 7.3 0 0 1 0 14.6Z' stroke='%239CA3AF' stroke-width='1.8'/%3E%3Cpath d='M16.5 16.5 21 21' stroke='%239CA3AF' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:12px center;
  background-size:16px 16px;
}
.search:focus{border-color:#c7d2fe;box-shadow:0 0 0 4px rgba(99,102,241,.12);background:#fff}
.session-list--workbench{padding:10px 8px}
.session-list--workbench .session-item{
  border:0;
  border-radius:10px;
  padding:10px 10px;
  background:#fff;
}
.session-list--workbench .session-item:hover{background:#f3f6fb}
.session-list--workbench .session-item.is-active{background:#e8f1ff}
.session-item{display:flex;align-items:center;gap:10px}
.session-item__avatar{
  width:34px;height:34px;border-radius:12px;
  background:#f1f5f9;
  color:#0f172a;
  display:grid;place-items:center;
  font-weight:700;
  flex:0 0 auto;
}
.session-item__main{min-width:0;flex:1}
.session-item__title{font-weight:700;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.session-item__desc{font-size:12px;color:#9ca3af;margin-top:4px;font-weight:600}
.session-item__meta{display:grid;justify-items:end;gap:4px;flex:0 0 auto}
.session-item__time{font-size:12px;font-weight:700;color:#ef4444}
.session-item__badge{
  font-size:12px;
  font-weight:700;
  color:#6b7280;
}

.wb__chat{background:#f4f6fa}
.chat--workbench{
  height:100%;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:transparent;
  min-height:0;
}
.chat__head--workbench{
  background:#fff;
  border-bottom:1px solid #eef2f6;
  padding:12px 14px;
}
.chat__body{background:#f2f4f7}
.chat__title{font-weight:700}
.pill--blue{background:transparent;color:#1677ff;font-style:italic;font-weight:800;padding:0}
.chat__stats{font-weight:600}
.stat strong{font-weight:700}
body[data-page="train"] .avatar{border-radius:999px;width:32px;height:32px;font-weight:700}
body[data-page="train"] .bubble{border-radius:12px;border-color:#e6eaf0}
body[data-page="train"] .msg--right .bubble{background:#e8f1ff;border-color:#cfe2ff}
body[data-page="train"] .bubble__meta{font-weight:600;color:#9ca3af}
body[data-page="train"] .bubble__text{font-size:14px;line-height:1.6}
.chat__composer--workbench{
  background:#fff;
  border-top:1px solid #eef2f6;
}

.wb__right{background:#fff;border-left:1px solid #e6eaf0}
.rightpanel{height:100%;display:flex;flex-direction:column;min-height:0}
.rightpanel__head{
  padding:14px 14px 0;
  border-bottom:1px solid #eef2f6;
}
.rightpanel__actions{display:flex;gap:10px;align-items:center}
.btn--qn{
  padding:10px 14px;
  border-radius:10px;
  font-weight:700;
  background:#1677ff;
}
.btn--qn:hover{background:#0a67ff}
.btn--qn-ghost{
  padding:10px 14px;
  border-radius:10px;
  font-weight:700;
  color:#6b7280;
}
.rightpanel__tabs{display:flex;gap:18px;margin-top:10px}
.righttab{
  border:0;
  background:transparent;
  padding:10px 2px;
  border-radius:0;
  font-size:14px;
  font-weight:700;
  color:#6b7280;
  cursor:pointer;
}
.righttab.is-active{color:#1677ff;box-shadow:inset 0 -3px 0 0 #1677ff}
.rightpanel__body{padding:12px 14px;overflow:auto;flex:1;background:#f7f9fc}

.block{
  background:#fff;
  border:1px solid #eef2f6;
  border-radius:16px;
  padding:12px;
  box-shadow:0 10px 24px rgba(16,24,40,.06);
  margin-bottom:12px;
}
.block__title{font-weight:700;margin-bottom:10px;color:#111827}
.block__content{color:#6b7280;font-size:13px;line-height:1.6;white-space:pre-wrap;word-break:break-word}
.block__actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.block__footer{margin-top:10px;display:flex;justify-content:flex-end;color:#6b7280;font-weight:600}
.scoreline strong{color:#111827}

.customer__row{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.customer__name{font-weight:700}
.customer__tags{display:flex;gap:8px;flex-wrap:wrap}
.tag--blue{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}
.tag--orange{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa}
.customer__meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:10px}
.meta__item{border:1px solid #eef2f6;border-radius:14px;padding:10px;background:#fbfdff}
.meta__k{display:block;color:#6b7280;font-size:12px;font-weight:700}
.meta__v{display:block;margin-top:6px;color:#111827;font-weight:700;font-size:13px}

.scorebar{
  border-radius:16px;
  padding:12px;
  background:linear-gradient(90deg,#06b6d4,#10b981);
  color:#fff;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.scorebar__item{background:rgba(255,255,255,.14);border-radius:14px;padding:10px}
.scorebar__k{font-size:12px;font-weight:900;opacity:.92}
.scorebar__v{font-size:18px;font-weight:900;margin-top:6px}

.mentorbox{display:flex;gap:10px;align-items:flex-start}
.mentorbox__icon{
  width:34px;height:34px;border-radius:12px;
  background:linear-gradient(135deg,#1677ff,#22c55e);
  box-shadow:0 10px 20px rgba(22,119,255,.25);
  flex:0 0 auto;
}
.mentorbox__text{color:#111827;font-size:13px;line-height:1.65}

@media (max-width: 1200px){
  .workbench{grid-template-columns:68px 260px minmax(0,1fr) 380px}
}

@media (max-width: 980px){
  .workbench{grid-template-columns:68px 240px minmax(0,1fr) 340px}
  .customer__meta{grid-template-columns:1fr}
  .scorebar{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width: 880px){
  body[data-page="train"] .mobile-dock{display:flex}
  .workbench{grid-template-columns:1fr}
  .wb__sider{display:none}
  .wb__sessions,.wb__right{display:none}
  .wb__chat{display:block}
  .chat--workbench{height:calc(100vh - 88px)}
}

/* Warm Prompt */
#warm-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #fff;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
    justify-content: space-between;
}
#warm-prompt.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}
#warm-prompt.hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
    pointer-events: none;
}
#warm-prompt .prompt-content {
    display: flex;
    align-items: center;
    gap: 12px;
}
#warm-prompt .prompt-text {
    color: #334155;
    font-size: 15px;
    font-weight: 500;
}
#warm-prompt .prompt-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s;
}
#warm-prompt .prompt-close:hover {
    background: #f1f5f9;
    color: #475569;
}
