:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --line:#e5e7eb;
  --primary:#1d66ff;
  --primary2:#00b7ff;
  --dark:#0f172a;
  --danger:#e5484d;
  --green:#14a46c;
  --shadow:0 18px 45px rgba(15,23,42,.08);
  --radius:22px;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif}
a{text-decoration:none;color:inherit}
button,input,textarea,select{font-family:inherit}
.app-shell{display:flex;min-height:100vh}
.sidebar{width:270px;background:#0b1220;color:#fff;padding:24px 18px;position:fixed;left:0;top:0;bottom:0;display:flex;flex-direction:column;gap:26px}
.brand{display:flex;align-items:center;gap:12px;padding:4px 4px 20px;border-bottom:1px solid rgba(255,255,255,.1)}
.brand-logo{width:46px;height:46px;border-radius:16px;background:linear-gradient(135deg,var(--primary),var(--primary2));display:flex;align-items:center;justify-content:center;font-weight:800;letter-spacing:.5px;box-shadow:0 10px 30px rgba(29,102,255,.38)}
.brand-name{font-size:18px;font-weight:800}
.brand-sub{font-size:12px;color:#93a4bd;margin-top:3px}
.nav{display:flex;flex-direction:column;gap:8px}
.nav-item{height:48px;border-radius:15px;display:flex;align-items:center;gap:12px;padding:0 14px;color:#aebbd0;transition:.2s;background:transparent}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:linear-gradient(135deg,rgba(29,102,255,.95),rgba(0,183,255,.85));color:#fff;box-shadow:0 14px 34px rgba(29,102,255,.28)}
.nav-icon{width:24px;height:24px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.11)}
.side-card{margin-top:auto;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.09);border-radius:20px;padding:16px}
.side-card-title{font-size:13px;color:#aebbd0}
.side-card-value{font-size:17px;font-weight:800;margin-top:7px}
.side-card-desc{font-size:12px;color:#91a0b7;line-height:1.55;margin-top:8px}
.main{margin-left:270px;width:calc(100% - 270px);padding:28px;max-width:1500px}
.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;gap:16px}
.topbar h1{font-size:28px;margin:0 0 8px;letter-spacing:-.5px}
.topbar p{margin:0;color:var(--muted);font-size:14px}
.top-action{background:#fff;border:1px solid var(--line);border-radius:14px;padding:11px 16px;font-size:14px;font-weight:700;box-shadow:0 8px 24px rgba(15,23,42,.05)}
.hero{position:relative;overflow:hidden;border-radius:30px;padding:32px;background:radial-gradient(circle at 20% 10%,rgba(0,183,255,.25),transparent 28%),linear-gradient(135deg,#102447,#123a84 55%,#0da7df);color:#fff;margin-bottom:22px;display:grid;grid-template-columns:1.5fr .8fr;gap:26px;box-shadow:var(--shadow)}
.hero.kb-hero{background:radial-gradient(circle at 20% 10%,rgba(90,255,196,.25),transparent 28%),linear-gradient(135deg,#102447,#16415f 55%,#14a46c)}
.eyebrow{text-transform:uppercase;font-size:12px;letter-spacing:1.6px;color:#bddcff;font-weight:800}
.hero h2{font-size:30px;margin:10px 0 12px;line-height:1.2}
.hero p{margin:0;color:rgba(255,255,255,.82);font-size:15px;line-height:1.7;max-width:720px}
.hero-tags{display:flex;flex-wrap:wrap;gap:9px;margin-top:18px}
.hero-tags span,.category-list span{padding:7px 11px;border-radius:999px;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.16);font-size:12px}
.hero-panel{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18);border-radius:24px;padding:20px;backdrop-filter:blur(12px);position:relative}
.pulse{width:74px;height:74px;border-radius:50%;background:rgba(255,255,255,.15);position:absolute;right:22px;top:20px}
.pulse:after{content:"";position:absolute;left:15px;top:15px;width:44px;height:44px;border-radius:50%;background:linear-gradient(135deg,#fff,#8bdcff);box-shadow:0 0 35px rgba(255,255,255,.55)}
.hero-panel-title{font-weight:800;margin-bottom:14px}
.timeline{display:flex;flex-direction:column;gap:13px;margin-top:8px}
.timeline div{display:flex;align-items:center;gap:10px}
.timeline b{width:32px;height:32px;border-radius:11px;background:rgba(255,255,255,.16);display:flex;align-items:center;justify-content:center;font-size:12px}
.timeline span{font-size:14px;color:rgba(255,255,255,.86)}
.category-list{display:flex;flex-wrap:wrap;gap:10px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin-bottom:22px}
.grid-main{grid-template-columns:1fr 1.12fr}
.card{background:var(--card);border:1px solid rgba(229,231,235,.8);border-radius:var(--radius);padding:22px;box-shadow:var(--shadow)}
.card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:18px}
.card h3{margin:4px 0 0;font-size:19px}
.section-kicker{font-size:12px;color:var(--primary);font-weight:800;text-transform:uppercase;letter-spacing:1.2px}
.status-pill{display:inline-flex;align-items:center;height:28px;padding:0 10px;border-radius:999px;background:#eaf2ff;color:var(--primary);font-size:12px;font-weight:800;white-space:nowrap}
.status-pill.muted{background:#f3f4f6;color:#6b7280}
label{display:block;font-size:13px;color:#4b5563;font-weight:700;margin:12px 0 7px}
input,textarea,select{width:100%;border:1px solid #d8dee8;border-radius:15px;padding:13px 14px;background:#fff;color:var(--text);font-size:14px;outline:none;transition:.18s}
input:focus,textarea:focus,select:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(29,102,255,.1)}
textarea{min-height:155px;resize:vertical;line-height:1.65}
.quick-prompts{display:flex;flex-wrap:wrap;gap:8px;margin:13px 0 4px}
.quick-prompts button{border:1px solid #dfe7f2;background:#f8fbff;color:#35516f;border-radius:999px;padding:8px 10px;font-size:12px;cursor:pointer}
.primary-btn,.secondary-btn,.danger-btn{border:0;cursor:pointer;border-radius:16px;font-weight:800;transition:.18s}
.primary-btn{width:100%;margin-top:14px;padding:14px 16px;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;display:flex;align-items:center;justify-content:center;gap:10px;box-shadow:0 14px 26px rgba(29,102,255,.22)}
.primary-btn:hover{transform:translateY(-1px);box-shadow:0 18px 32px rgba(29,102,255,.28)}
.primary-btn.compact{width:auto;padding:13px 18px}
.secondary-btn{background:#f3f6fb;color:#34465f;border:1px solid #e2e8f0;padding:11px 14px}
.secondary-btn.small{padding:8px 12px;font-size:13px}
.danger-btn{background:#fff0f1;color:var(--danger);border:1px solid #ffd6d9;padding:11px 14px}
.answer-box{min-height:260px;border-radius:18px;background:#f8fbff;border:1px solid #dfeaff;padding:16px;line-height:1.75;white-space:pre-wrap;font-size:14px}
.answer-box.empty{color:#718096}
.result-actions{display:flex;gap:10px;margin-top:12px;flex-wrap:wrap}
.chunk-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}
.chunk-item{border:1px solid #e7edf6;background:#fbfdff;border-radius:17px;padding:14px}
.chunk-meta{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:8px}
.badge{display:inline-flex;align-items:center;height:24px;border-radius:999px;padding:0 8px;background:#eef5ff;color:#1d66ff;font-size:12px;font-weight:800}
.chunk-title{font-weight:800;margin-bottom:6px}
.chunk-preview{font-size:13px;line-height:1.65;color:#5b6677}
.empty-state{grid-column:1/-1;min-height:96px;border:1px dashed #d8e1ef;border-radius:18px;display:flex;align-items:center;justify-content:center;gap:10px;color:#7a8799;background:#fbfdff;text-align:center;padding:16px}
.empty-icon{width:34px;height:34px;border-radius:12px;background:#eef4ff;color:#1d66ff;display:flex;align-items:center;justify-content:center}
.form-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.mini-result{margin-top:14px;border-radius:16px;background:#f8fafc;border:1px solid #e5e7eb;padding:13px;color:#5b6677;font-size:13px;line-height:1.65;white-space:pre-wrap;word-break:break-all}
.upload-box{border:1px dashed #b8c8df;background:#f8fbff;border-radius:18px;padding:18px;display:flex;align-items:center;gap:14px;cursor:pointer;transition:.2s}
.upload-box:hover{border-color:var(--primary);background:#f4f8ff}
.upload-icon{width:46px;height:46px;border-radius:15px;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:800}
.upload-box p{margin:5px 0 0;color:#7a8799;font-size:12px}
.hidden-file{display:none}
.docs-list{display:flex;flex-direction:column;gap:10px}
.doc-item{display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid #e7edf6;border-radius:17px;padding:14px;background:#fbfdff}
.doc-main{min-width:0}
.doc-title{font-weight:800;margin-bottom:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.doc-sub{font-size:12px;color:#7a8799}
.doc-actions{display:flex;gap:8px;flex-shrink:0}
.doc-actions button{border:0;border-radius:12px;padding:8px 10px;font-weight:800;cursor:pointer;background:#fff0f1;color:var(--danger);border:1px solid #ffd6d9}
.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%) translateY(20px);background:#111827;color:#fff;padding:12px 16px;border-radius:14px;box-shadow:0 18px 35px rgba(0,0,0,.24);opacity:0;pointer-events:none;transition:.25s;z-index:99;font-size:14px}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
@media(max-width:1080px){
  .sidebar{position:relative;width:100%;height:auto;bottom:auto;flex-direction:row;align-items:center;padding:14px;gap:12px}
  .brand{border:0;padding:0}.brand-sub,.side-card{display:none}
  .nav{flex-direction:row;margin-left:auto}.nav-item{height:42px}
  .app-shell{display:block}.main{margin-left:0;width:100%;padding:18px}
  .hero,.grid,.grid-main{grid-template-columns:1fr}
  .form-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:640px){
  .topbar{align-items:flex-start;flex-direction:column}.top-action{width:100%;text-align:center}
  .sidebar{align-items:flex-start;flex-direction:column}.nav{width:100%;margin-left:0}.nav-item{flex:1}
  .hero{padding:22px;border-radius:22px}.hero h2{font-size:23px}
  .card{padding:17px;border-radius:18px}
  .form-grid{grid-template-columns:1fr}
  .doc-item{align-items:flex-start;flex-direction:column}
}

/* v2: wizard steps + ticket photos */
.wizard-box{border:1px solid #dfeaff;background:#f8fbff;border-radius:18px;padding:14px;min-height:260px}
.wizard-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.wizard-title b{font-size:15px}
.wizard-progress{font-size:12px;color:#64748b;font-weight:800}
.wizard-step{display:flex;align-items:flex-start;gap:10px;border:1px solid #e7edf6;background:#fff;border-radius:15px;padding:12px;margin-bottom:10px;cursor:pointer;transition:.18s}
.wizard-step:hover{border-color:#bdd2ff;box-shadow:0 8px 20px rgba(29,102,255,.08)}
.wizard-step.done{background:#f0fff8;border-color:#b8eed8}
.wizard-step input{width:18px;height:18px;margin-top:2px;accent-color:#14a46c}
.wizard-step-main{flex:1;min-width:0}
.wizard-step-title{font-weight:800;font-size:14px;margin-bottom:4px}
.wizard-step-desc{font-size:13px;color:#64748b;line-height:1.6}
.wizard-nav{display:flex;gap:10px;justify-content:flex-end;margin-top:12px;flex-wrap:wrap}
.wizard-nav button{border:0;border-radius:13px;padding:10px 13px;font-weight:800;cursor:pointer}
.wizard-nav .prev{background:#f1f5f9;color:#334155}
.wizard-nav .next{background:#1d66ff;color:#fff}
.wizard-nav .finish{background:#14a46c;color:#fff}
.raw-answer{display:none;margin-top:12px;border-radius:16px;background:#fff;border:1px solid #e5e7eb;padding:13px;white-space:pre-wrap;line-height:1.7;font-size:13px;color:#526071}
.raw-answer.show{display:block}
.photo-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:12px}
.photo-field{border:1px dashed #b8c8df;background:#f8fbff;border-radius:16px;padding:13px}
.photo-field b{display:block;font-size:13px;margin-bottom:8px}
.photo-field p{margin:6px 0 0;color:#7a8799;font-size:12px;line-height:1.5}
.photo-field input{padding:10px;background:#fff}
.photo-preview{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.photo-preview img{width:58px;height:58px;border-radius:12px;object-fit:cover;border:1px solid #e5e7eb}
@media(max-width:900px){.photo-grid{grid-template-columns:1fr}}


/* workflow ticket page */
.ticket-layout{display:grid;grid-template-columns:380px 1fr;gap:22px;align-items:start}
.ticket-list-card,.ticket-detail-card{min-height:680px}
.filter-row{margin-bottom:12px}
.ticket-list{display:flex;flex-direction:column;gap:10px;max-height:690px;overflow:auto;padding-right:4px}
.ticket-row{border:1px solid #e7edf6;background:#fbfdff;border-radius:17px;padding:13px;cursor:pointer;transition:.18s}
.ticket-row:hover,.ticket-row.active{border-color:#bcd2ff;box-shadow:0 10px 24px rgba(29,102,255,.08);background:#f7fbff}
.ticket-row-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.ticket-row-top b{font-size:14px;line-height:1.45}
.ticket-row-sub{font-size:13px;color:#64748b;margin-top:7px}
.ticket-row-meta{display:flex;justify-content:space-between;gap:8px;color:#8a96a8;font-size:12px;margin-top:9px}
.ticket-status{display:inline-flex;align-items:center;justify-content:center;min-height:25px;padding:0 9px;border-radius:999px;font-size:12px;font-weight:900;white-space:nowrap;background:#eef2f7;color:#475569}
.ticket-status.big{min-height:31px;padding:0 12px}
.ticket-status.s0{background:#fff7ed;color:#ea580c}
.ticket-status.s1{background:#eaf2ff;color:#1d66ff}
.ticket-status.s2{background:#fff1f2;color:#e11d48}
.ticket-status.s3{background:#ecfdf5;color:#059669}
.ticket-status.s4{background:#f1f5f9;color:#475569}
.ticket-status.s9{background:#fef2f2;color:#dc2626}
.detail-empty{min-height:560px}
.detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:18px}
.detail-head h3{margin:4px 0 0;font-size:21px}
.workflow-bar{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:18px}
.wf-item{position:relative;background:#f8fafc;border:1px solid #e2e8f0;border-radius:16px;padding:12px;text-align:center;color:#94a3b8}
.wf-item span{width:28px;height:28px;border-radius:50%;background:#e2e8f0;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:900;margin-bottom:7px}
.wf-item b{display:block;font-size:12px}
.wf-item.on{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}
.wf-item.on span{background:#1d66ff;color:#fff}
.wf-item.current{box-shadow:0 10px 24px rgba(29,102,255,.14)}
.detail-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:18px;padding:14px;margin-bottom:16px}
.detail-grid label{margin:0 0 5px;color:#64748b;font-size:12px}
.detail-grid div div{font-weight:800;font-size:13px}
.detail-section{margin-top:16px}
.detail-section h4{margin:0 0 10px;font-size:16px}
.detail-section pre{white-space:pre-wrap;word-break:break-word;background:#f8fbff;border:1px solid #dfeaff;border-radius:16px;padding:13px;line-height:1.65;color:#405066;max-height:360px;overflow:auto}
.file-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px}
.file-card{border:1px solid #e7edf6;background:#fbfdff;border-radius:16px;padding:10px;display:flex;gap:10px;align-items:center;min-width:0}
.file-card img,.file-icon{width:62px;height:62px;border-radius:13px;object-fit:cover;background:#eef4ff;display:flex;align-items:center;justify-content:center;color:#1d66ff;font-weight:900;font-size:12px}
.file-card b{font-size:13px;display:block;margin-bottom:5px}
.file-card span{font-size:12px;color:#7a8799;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}
.action-row{display:grid;grid-template-columns:1fr 2fr;gap:10px;margin-bottom:10px}
.action-buttons{display:flex;gap:10px;flex-wrap:wrap}
.action-buttons button{border:0;border-radius:14px;padding:11px 14px;background:#1d66ff;color:#fff;font-weight:900;cursor:pointer}
.action-buttons button.warn{background:#fff0f1;color:#e5484d;border:1px solid #ffd6d9}
.message-form{display:grid;grid-template-columns:1fr 180px;gap:10px;margin-bottom:10px}
.detail-two{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.timeline-list{border-left:2px solid #e5e7eb;margin-left:9px;padding-left:17px}
.tl-item{position:relative;margin-bottom:16px}
.tl-item>span{position:absolute;left:-27px;top:3px;width:16px;height:16px;border-radius:50%;background:#1d66ff;border:3px solid #fff;box-shadow:0 0 0 1px #bfdbfe}
.tl-item b{font-size:14px}
.tl-item p{margin:4px 0;color:#64748b;font-size:12px}
.tl-item em{display:block;background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;padding:8px;font-style:normal;color:#526071;font-size:12px;line-height:1.5}
.message-list{display:flex;flex-direction:column;gap:10px}
.msg-item{background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px;padding:11px}
.msg-item b{font-size:13px}
.msg-item span{float:right;color:#94a3b8;font-size:12px}
.msg-item p{clear:both;margin:8px 0 0;line-height:1.6;font-size:13px;color:#405066}
.msg-item.rd{background:#fff7ed;border-color:#fed7aa}
.msg-item.field{background:#f0fdf4;border-color:#bbf7d0}
.muted-text{color:#94a3b8;font-size:13px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px;padding:12px}
@media(max-width:1200px){.ticket-layout{grid-template-columns:1fr}.ticket-list-card,.ticket-detail-card{min-height:auto}.ticket-list{max-height:none}.detail-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:700px){.workflow-bar{grid-template-columns:1fr}.detail-grid,.detail-two,.action-row,.message-form{grid-template-columns:1fr}}


/* message media attachments */
.message-upload{margin:10px 0 12px;border:1px dashed #b8c8df;background:#f8fbff;border-radius:16px;padding:12px}
.message-upload input{background:#fff}
.message-file-preview,.message-media-list{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.message-file-preview img,.message-media-list img{width:86px;height:86px;border-radius:14px;object-fit:cover;border:1px solid #e5e7eb;background:#fff}
.message-file-preview video,.message-media-list video{width:180px;max-width:100%;height:110px;border-radius:14px;border:1px solid #e5e7eb;background:#000}
.message-media-list a{display:inline-flex}


/* vNext: parallel solution cards with probabilities */
.solution-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}
.solution-head b{font-size:16px}
.solution-head p{margin:6px 0 0;color:#64748b;font-size:13px;line-height:1.55}
.solution-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px}
.solution-card{display:block;border:1px solid #e5ecf6;background:#fff;border-radius:18px;padding:14px;cursor:pointer;transition:.18s;min-height:190px}
.solution-card:hover{border-color:#bcd2ff;box-shadow:0 12px 26px rgba(29,102,255,.08);transform:translateY(-1px)}
.solution-card.done{background:#f0fff8;border-color:#a7f3d0}
.solution-card-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.solution-card input{width:18px;height:18px;accent-color:#14a46c}
.prob{display:inline-flex;align-items:center;justify-content:center;height:32px;min-width:58px;border-radius:999px;font-weight:900;font-size:13px}
.prob.high{background:#ecfdf5;color:#059669}
.prob.mid{background:#fff7ed;color:#ea580c}
.prob.low{background:#f1f5f9;color:#64748b}
.solution-title{font-weight:900;font-size:15px;line-height:1.45;margin-bottom:9px;color:#1f2937}
.solution-apply,.solution-action{font-size:13px;line-height:1.65;color:#526071;margin-top:8px}
.solution-apply b,.solution-action b{color:#334155}
@media(max-width:640px){.solution-head{display:block}.solution-grid{grid-template-columns:1fr}}
