/* ==========================================================================
   Phân tích video — phong cách workspace chung + phiếu editorial (port từ
   "01. Mẫu phiếu phân tích video.html" trong vault, scope dưới .phieu-sheet)
   ========================================================================== */
*{box-sizing:border-box}
body{margin:0;font-family:'Be Vietnam Pro',system-ui,sans-serif;font-size:14px;color:#232323;line-height:1.5}
button,input,select,textarea{font:inherit}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.45}
[hidden]{display:none!important}
.appnav,.navtab,.navuser{display:flex}.navtab{align-items:center;text-decoration:none}.applogo{text-decoration:none}
a{color:#b7102b;text-decoration:none}
h1,h2,h3,p{margin:0}
.page-phan-tich .workspace-main{padding:28px 26px;min-height:100vh}
.masthead{display:flex}
.page-phan-tich .brand h1{font-size:clamp(24px,2.35vw,36px);font-weight:800}
.brand p{margin-top:4px;color:#77717a}
.header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.header-actions input[type=search]{width:230px}
.button,.text-button,.icon-button{border-radius:7px;min-height:40px;padding:9px 14px;background:#fff;color:#b7102b;border:1px solid #eed5da;font-weight:500;display:inline-flex;align-items:center;gap:7px}
.button:hover,.text-button:hover{background:#fff2f4}
.button.primary{background:#c8102e;color:#fff;border-color:#c8102e}
.button.primary:hover{background:#a90e27}
.button.danger{color:#a01026;border-color:#f3c5cf}
.small-button{min-height:34px;padding:6px 10px;font-size:12px}
.text-button{border:0;background:none;padding:4px 8px;min-height:0}
.icon-button{color:#68646b;border-color:#e6e2e5;font-size:12px}
input,select,textarea{min-height:40px;padding:9px 11px;border:1px solid #e0dce2;border-radius:7px;background:#fff;color:#303038;max-width:100%}
textarea{width:100%;resize:vertical;min-height:90px}
.small{font-size:12px}
.muted{color:#7a7480}
.notice{background:#f8f5fa;color:#62596a;border:1px solid #ebe5ef;border-radius:7px;padding:9px 13px;font-size:12px;margin-bottom:17px}
.notice.error,.form-error{color:#a01026}
.notice.error{background:#fff2f3;border-color:#f3c5cf}
.notice a{text-decoration:underline}
.empty{color:#9c94a4;font-size:13px;text-align:center;padding:50px 10px;background:#fff;border:1px dashed #e5dfe6;border-radius:12px}
.badge{display:inline-block;max-width:100%;font-size:10px;line-height:1.5;padding:3px 8px;border-radius:20px;background:#f3effa;color:#7242c9}
.badge.amber{background:#fff2dc;color:#a96908}
.badge.green{background:#e9faef;color:#087c35}
.badge.blue{background:#edf3ff;color:#2459c9}
.badge.red{background:#fff0f2;color:#c8102e}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.form-error{font-size:12px;margin:0;padding:0 22px 18px;white-space:pre-wrap}
.form-error:empty{padding:0}
dialog{width:min(720px,94vw);max-height:90vh;padding:0;border:1px solid #e8dfe7;border-radius:13px;box-shadow:0 25px 100px #30202a35;color:#2c2730}
dialog::backdrop{background:#21151e66}
.dialog-header{display:flex;justify-content:space-between;gap:15px;padding:20px 23px;border-bottom:1px solid #e9e2e8;position:sticky;top:0;background:#fff;z-index:4}
.dialog-header h2{font-size:21px}
.eyebrow{font-size:10px;text-transform:uppercase;letter-spacing:.7px;color:#a195a0;margin-bottom:4px}
#dlgBody{padding:20px 23px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.field{display:flex;flex-direction:column;gap:6px;font-size:12px}
.field.full{grid-column:1/-1}
.field>span{font-weight:500}
.field input,.field select{width:100%}
.form-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:20px}
.form-actions small{color:#837987}

/* ---------- Banner resume ---------- */


/* ---------- KPI strip ---------- */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-bottom:22px}
.kpi{background:var(--card);border-radius:12px;padding:15px 17px;box-shadow:0 2px 8px #231E1905}
.kpi .l{font-size:11.5px;font-weight:600;color:var(--muted)}
.kpi .v{font-size:clamp(21px,1.9vw,28px);font-weight:800;letter-spacing:-.6px;line-height:1.3}
.kpi .s{font-size:11px;color:var(--muted)}

/* ---------- Lưới phiếu ---------- */
.grid-phieu{display:grid;grid-template-columns:repeat(auto-fill,minmax(285px,1fr));gap:16px}
.pcard{background:#fff;border:1px solid #ece6eb;border-radius:14px;overflow:hidden;cursor:pointer;display:flex;flex-direction:column;transition:transform .15s ease,box-shadow .15s ease,border-color .15s}
.pcard:hover{transform:translateY(-2px);box-shadow:0 10px 28px #3d17221a;border-color:#e3cdd4}
.pcard-thumb{position:relative;aspect-ratio:16/9;background:linear-gradient(135deg,#2a1c22,#4a1524);overflow:hidden}
.pcard-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.pcard-thumb .no-img{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#ffffff80}
.pcard-thumb .no-img .ui-icon{width:34px;height:34px}
.pcard-loai{position:absolute;top:10px;left:10px;font-size:10px;font-weight:700;letter-spacing:.5px;padding:4px 9px;border-radius:20px;backdrop-filter:blur(6px)}
.pcard-loai.a{background:#c8102ee6;color:#fff}
.pcard-loai.b{background:#fffffff0;color:#1d4ed8}
.pcard-score{position:absolute;right:10px;bottom:10px;background:#000000b8;color:#fff;font-size:11px;font-weight:700;padding:4px 10px;border-radius:20px;backdrop-filter:blur(6px)}
.pcard-del{position:absolute;top:10px;right:10px;width:26px;height:26px;border:0;border-radius:50%;background:#0000008a;color:#fff;font-size:12px;font-weight:700;line-height:1;cursor:pointer;backdrop-filter:blur(6px);opacity:0;transition:opacity .15s,background .15s}
.pcard:hover .pcard-del,.pcard-del:focus-visible{opacity:1}
.pcard-del:hover{background:#C8102E}
@media(hover:none){.pcard-del{opacity:1}}
.pcard-body{padding:14px 16px 13px;display:flex;flex-direction:column;gap:8px;flex:1}
.pcard-title{font-weight:700;font-size:14.5px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pcard-hook{font-size:12px;color:#837987;line-height:1.55;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pcard-stats{display:flex;gap:11px;font-size:11px;color:#8a8290;flex-wrap:wrap;margin-top:auto}
.pcard-stats b{color:#4a4450;font-weight:700}
.pcard-foot{display:flex;justify-content:space-between;gap:8px;align-items:center;border-top:1px solid #f2edf1;padding-top:9px;font-size:10.5px;color:#9a93a2}
.pcard-foot .nguoi{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dots{display:flex;gap:3px}
.dots i{width:7px;height:7px;border-radius:50%;background:#e3dde2}
.dots i.dat{background:#1a7f4b}
.dots i.mot_phan{background:#d99a1b}
.dots i.khong_dat{background:#cfc8cf}

/* ---------- Detail top bar ---------- */
.detail-top{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:18px}
.detail-tags{display:flex;gap:7px;flex-wrap:wrap;flex:1;min-width:0}
.detail-actions{display:flex;gap:8px;margin-left:auto}
.detail-actions .button{min-height:36px;font-size:12px}

/* ==========================================================================
   PHIẾU — port nguyên thiết kế editorial từ mẫu phiếu vault
   ========================================================================== */
.phieu-sheet{
  --paper:#FBFAF6;--card:#FFFFFF;--ink:#17171B;--muted:#70707A;--hairline:#E7E4DC;
  --accent:#D8222B;--accent-soft:#FBEBEC;--amber:#B07617;--amber-soft:#FCF3E3;
  --serif:'Playfair Display',Georgia,'Times New Roman',serif;
  --sans:'Inter',-apple-system,'Segoe UI',Roboto,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,'SF Mono',Consolas,monospace;
  background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:15px;line-height:1.65;
  border:1px solid var(--hairline);border-radius:16px;box-shadow:0 8px 40px #231e190d;
  max-width:920px;margin:0 auto;padding:50px 44px 70px;-webkit-font-smoothing:antialiased;
}
.phieu-sheet .eyebrow{font-family:var(--mono);font-size:11px;font-weight:700;letter-spacing:.18em;text-transform:uppercase;color:var(--accent);display:flex;align-items:center;gap:10px;margin-bottom:10px}
.phieu-sheet .eyebrow::before{content:"";width:22px;height:2px;background:var(--accent);flex:none}
.phieu-sheet h2{font-family:var(--serif);font-size:30px;font-weight:700;letter-spacing:-.01em;margin-bottom:18px;color:var(--ink)}
.phieu-sheet section{margin-top:64px}
.phieu-sheet .hero .eyebrow{justify-content:flex-start}
.phieu-sheet .hero h1{font-family:var(--serif);font-weight:700;font-size:clamp(34px,4.5vw,50px);line-height:1.1;letter-spacing:-.015em;margin:6px 0 20px}
.phieu-sheet .hero h1 em{font-style:italic;font-weight:600;color:var(--accent)}
.phieu-sheet .hero .hook{font-size:18px;font-weight:600;line-height:1.5;max-width:640px;margin-bottom:14px}
.phieu-sheet .hero .summary{color:var(--muted);max-width:680px;margin-bottom:22px}
.phieu-sheet .link-goc{display:inline-flex;align-items:center;gap:8px;font-family:var(--mono);font-size:12.5px;font-weight:500;color:var(--ink);border:1px solid var(--ink);border-radius:999px;padding:8px 18px;transition:background .15s,color .15s}
.phieu-sheet .link-goc:hover{background:var(--ink);color:#fff}
.phieu-sheet .link-goc .dot{width:8px;height:8px;border-radius:50%;background:var(--accent);flex:none;animation:pulse 1.6s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.35}}
.phieu-sheet .meta-grid{margin-top:32px;border-top:1px solid var(--hairline);display:grid;grid-template-columns:repeat(3,1fr)}
.phieu-sheet .meta-item{padding:16px 18px 16px 0;border-bottom:1px solid var(--hairline)}
.phieu-sheet .meta-item .label{font-family:var(--mono);font-size:10.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin-bottom:5px}
.phieu-sheet .meta-item .value{font-size:14px;font-weight:500;line-height:1.5}
.phieu-sheet .why-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.phieu-sheet .why-card{background:var(--card);border:1px solid var(--hairline);border-radius:12px;padding:22px 24px;position:relative;overflow:hidden}
.phieu-sheet .why-card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--accent)}
.phieu-sheet .why-card .label{font-family:var(--mono);font-size:10.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.phieu-sheet .why-card .keyword{font-family:var(--serif);font-style:italic;font-size:24px;font-weight:600;color:var(--accent);margin:4px 0 8px}
.phieu-sheet .why-card .desc{font-size:13.5px;line-height:1.6}
.phieu-sheet .stats{display:grid;grid-template-columns:repeat(5,1fr);border:1px solid var(--hairline);border-radius:12px;overflow:hidden;background:var(--card)}
.phieu-sheet .stat{padding:22px 18px;border-left:1px solid var(--hairline)}
.phieu-sheet .stat:first-child{border-left:none}
.phieu-sheet .stat .num{font-family:var(--mono);font-size:22px;font-weight:700;letter-spacing:-.02em}
.phieu-sheet .stat .lbl{font-size:12px;color:var(--muted);margin-top:4px}
.phieu-sheet .scene{margin-top:44px}
.phieu-sheet .scene-head{display:flex;align-items:baseline;gap:16px;padding-bottom:14px;border-bottom:2px solid var(--ink);flex-wrap:wrap}
.phieu-sheet .scene-no{font-family:var(--serif);font-size:38px;font-weight:700;color:var(--accent);line-height:1}
.phieu-sheet .scene-range{font-family:var(--mono);font-size:12px;font-weight:700;background:var(--ink);color:#fff;border-radius:999px;padding:4px 12px}
.phieu-sheet .scene-title{font-family:var(--serif);font-size:21px;font-weight:700;flex:1;min-width:200px}
.phieu-sheet .scene-desc{color:var(--muted);font-size:14px;margin-top:12px;max-width:700px}
.phieu-sheet .frames{margin-top:20px;position:relative;padding-left:26px}
.phieu-sheet .frames::before{content:"";position:absolute;left:7px;top:8px;bottom:8px;width:1px;background:var(--hairline)}
.phieu-sheet .frame{position:relative;margin-bottom:22px;background:var(--card);border:1px solid var(--hairline);border-radius:12px;padding:22px 24px}
.phieu-sheet .frame::before{content:"";position:absolute;left:-26px;top:26px;width:9px;height:9px;border-radius:50%;background:var(--accent);border:2px solid var(--paper);transform:translateX(3.5px)}
.phieu-sheet .frame-top{display:flex;gap:20px;align-items:flex-start}
.phieu-sheet .thumb{flex:none;width:104px;aspect-ratio:9/16;border-radius:8px;overflow:hidden;background:#111114;color:#fff;display:flex;align-items:center;justify-content:center;font-family:var(--mono);font-size:15px;font-weight:700;position:relative}
.phieu-sheet .thumb img{width:100%;height:100%;object-fit:cover;display:block}
.phieu-sheet .thumb .rec{position:absolute;top:8px;left:8px;width:7px;height:7px;border-radius:50%;background:var(--accent)}
.phieu-sheet .frame-body{flex:1;min-width:0}
.phieu-sheet .tcode{font-family:var(--mono);font-size:11.5px;font-weight:700;color:var(--accent);letter-spacing:.06em;margin-bottom:6px}
.phieu-sheet .frame-cap{font-size:15px;font-weight:600;margin-bottom:5px}
.phieu-sheet .frame-note{font-size:13.5px;color:var(--muted);line-height:1.6}
.phieu-sheet .voice{margin-top:14px;border-left:3px solid var(--accent);background:var(--accent-soft);border-radius:0 8px 8px 0;padding:10px 16px}
.phieu-sheet .voice .vlabel{font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--accent);margin-bottom:3px}
.phieu-sheet .voice .vtext{font-family:var(--serif);font-style:italic;font-size:15.5px;line-height:1.55}
.phieu-sheet .detail-grid{margin-top:16px;display:grid;grid-template-columns:1fr 1fr;gap:0;border-top:1px solid var(--hairline)}
.phieu-sheet .detail{padding:10px 14px 10px 0;border-bottom:1px solid var(--hairline);font-size:13px;line-height:1.55}
.phieu-sheet .detail .dlabel{font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin-bottom:2px}
.phieu-sheet .cam-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
.phieu-sheet .cam-tag{font-family:var(--mono);font-size:11px;background:var(--paper);border:1px solid var(--hairline);border-radius:6px;padding:2px 8px}
.phieu-sheet .cam-tag b{color:var(--accent);font-weight:700}
.phieu-sheet table.checklist{width:100%;border-collapse:collapse;background:var(--card);border:1px solid var(--hairline);border-radius:12px;overflow:hidden}
.phieu-sheet .checklist th{font-family:var(--mono);font-size:10.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);text-align:left;padding:14px 18px;border-bottom:2px solid var(--ink);background:var(--paper);position:static}
.phieu-sheet .checklist td{padding:16px 18px;border-bottom:1px solid var(--hairline);font-size:13.5px;vertical-align:top}
.phieu-sheet .checklist tr:last-child td{border-bottom:none}
.phieu-sheet .crit{display:flex;align-items:flex-start;gap:10px;font-weight:600;font-size:14px}
.phieu-sheet .crit-no{flex:none;width:24px;height:24px;border-radius:50%;border:1.5px solid var(--accent);color:var(--accent);font-family:var(--mono);font-size:11.5px;font-weight:700;display:flex;align-items:center;justify-content:center;margin-top:1px}
.phieu-sheet .bdg{font-family:var(--mono);font-size:11px;font-weight:700;letter-spacing:.06em;border-radius:999px;padding:4px 12px;white-space:nowrap}
.phieu-sheet .bdg--dat{background:var(--accent);color:#fff}
.phieu-sheet .bdg--motphan{background:var(--amber-soft);color:var(--amber);border:1px solid #E4C98F}
.phieu-sheet .bdg--khong{background:#EFEFEC;color:var(--muted);border:1px solid var(--hairline)}
.phieu-sheet .checklist .note{color:var(--muted)}
.phieu-sheet .fix-list{display:flex;flex-direction:column;gap:14px}
.phieu-sheet .fix-card{background:var(--card);border:1px solid var(--hairline);border-left:4px solid var(--amber);border-radius:0 12px 12px 0;padding:20px 24px}
.phieu-sheet .fix-head{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap;margin-bottom:6px}
.phieu-sheet .fix-no{font-family:var(--mono);font-weight:700;color:var(--amber);font-size:12px}
.phieu-sheet .fix-title{font-weight:700;font-size:15px}
.phieu-sheet .fix-tc{font-family:var(--mono);font-size:11px;background:var(--amber-soft);color:var(--amber);border-radius:6px;padding:2px 8px}
.phieu-sheet .fix-harm{font-size:13.5px;color:var(--muted);margin-bottom:10px;line-height:1.6}
.phieu-sheet .fix-sol{background:var(--paper);border:1px dashed var(--hairline);border-radius:8px;padding:10px 14px;font-size:13.5px;line-height:1.6}
.phieu-sheet .fix-sol b{color:var(--accent)}
.phieu-sheet .formula-block{margin-top:22px}
.phieu-sheet .formula-block .flabel{font-family:var(--mono);font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin-bottom:10px}
.phieu-sheet .chain{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.phieu-sheet .chain .step{background:var(--card);border:1px solid var(--hairline);border-radius:8px;padding:8px 14px;font-size:13px;font-weight:500}
.phieu-sheet .chain .arrow{font-family:var(--mono);color:var(--accent);font-weight:700}
.phieu-sheet .verdict{margin-top:28px;background:var(--card);border:1px solid var(--hairline);border-left:4px solid var(--accent);border-radius:0 12px 12px 0;padding:22px 26px}
.phieu-sheet .verdict p{font-family:var(--serif);font-size:16.5px;line-height:1.7;font-style:italic}
.phieu-sheet .banks{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.phieu-sheet .bank{background:var(--card);border:1px solid var(--hairline);border-radius:12px;padding:24px}
.phieu-sheet .bank h3{font-family:var(--serif);font-size:19px;font-weight:700;margin-bottom:14px}
.phieu-sheet .bank ul{list-style:none;margin:0;padding:0}
.phieu-sheet .bank li{position:relative;padding:10px 0 10px 22px;border-bottom:1px dashed var(--hairline);font-size:13.5px;line-height:1.6}
.phieu-sheet .bank li:last-child{border-bottom:none}
.phieu-sheet .bank li::before{content:"—";position:absolute;left:0;color:var(--accent);font-weight:700}
.phieu-sheet .bank--quotes li{font-family:var(--serif);font-style:italic;font-size:14.5px}
.phieu-sheet .phieu-foot{margin-top:60px;padding-top:24px;border-top:1px solid var(--hairline);font-family:var(--mono);font-size:11px;letter-spacing:.08em;color:var(--muted);display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}

/* ---------- Khối "Bạn muốn phân tích gì" (kiểu trang mở đầu AI) ---------- */
.ask{position:relative;max-width:680px;margin:0 auto;padding:38px 12px 52px}
.ask::before{content:"";position:absolute;top:-46px;left:50%;transform:translateX(-50%);width:min(640px,90vw);height:380px;background:radial-gradient(closest-side,#c8102e12,transparent);pointer-events:none}
.ask>*{position:relative}
.ask-hero{text-align:center;margin-bottom:30px}
.ask-mark{display:inline-block;margin-bottom:18px}
.ask-mark .logo-crop{width:78px}
.ask-title{font-family:'Playfair Display',Georgia,serif;font-size:clamp(28px,3.4vw,40px);font-weight:700;letter-spacing:-.5px;line-height:1.25;color:var(--ink)}
.ask-title em{font-style:italic;color:#c8102e}
.ask-sub{margin-top:12px;font-size:15px;color:var(--muted)}
.askbox{display:flex;align-items:center;gap:14px;width:100%;background:#fff;border:1.5px solid #ece3ea;border-radius:18px;padding:14px 14px 14px 16px;cursor:pointer;text-align:left;box-shadow:0 10px 34px #3d172214;transition:border-color .15s,box-shadow .15s,transform .15s}
.askbox:hover{border-color:#e5a9b4;box-shadow:0 14px 40px #c8102e1a;transform:translateY(-1px)}
.askbox.over{border-color:#c8102e;background:#fdf2f4;border-style:dashed}
.askbox-ic{flex:none;width:42px;height:42px;border-radius:13px;background:#fdf0f2;display:flex;align-items:center;justify-content:center}
.askbox-ic .ui-icon{width:20px;height:20px;color:#c8102e}
.askbox-text{flex:1;min-width:0;font-size:15px;color:#9a93a2}
.askbox-go{flex:none;background:linear-gradient(135deg,#e01635,#b7102b);color:#fff;font-size:13.5px;font-weight:700;padding:11px 22px;border-radius:999px;box-shadow:0 6px 16px #c8102e3d}
.askbox:hover .askbox-go{box-shadow:0 8px 22px #c8102e55}
.ask-hint{text-align:center;font-size:11.5px;color:#a79eaa;margin-top:12px}
.ask-chips{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:16px}
.ask-chips .chip{font-size:11px;color:#837987;background:#fff;border:1px solid #eee4ea;border-radius:999px;padding:5px 13px}
.ask-meta{margin-top:14px}
.ask-meta summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:center;gap:7px;font-size:12.5px;color:#8a8290;font-weight:500;padding:10px;border-radius:12px}
.ask-meta summary:hover{color:#c8102e}
.ask-meta summary::-webkit-details-marker{display:none}
.ask-meta summary em{color:#b3aab5;font-style:normal}
.ask-meta summary::after{content:"";width:7px;height:7px;border-right:1.5px solid #a79eaa;border-bottom:1.5px solid #a79eaa;transform:rotate(45deg);transition:transform .15s;margin-top:-3px}
.ask-meta[open] summary::after{transform:rotate(225deg);margin-top:3px}
.ask-form{margin-top:8px;background:#fff;border:1px solid #ece4ea;border-radius:14px;padding:18px}
.ask-actions{flex-direction:column;align-items:stretch;text-align:center}
.ask-actions small{color:#a79eaa;font-size:11.5px}
.ask-start{justify-content:center;min-height:48px;font-size:15px;font-weight:700;border-radius:12px}
.picked{display:flex;gap:14px;align-items:center;border:1px solid #ece4ea;border-radius:12px;padding:12px;background:#fff;margin-top:16px}
.picked video{width:72px;aspect-ratio:9/16;object-fit:cover;border-radius:8px;background:#111}
.picked-info{min-width:0;display:flex;flex-direction:column;gap:3px;font-size:12px}
.picked-info b{font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.picked-info span{color:#837987}
.picked-info .text-button{align-self:flex-start;color:#b7102b}
#metaForm{margin-top:16px}
.manual-box{margin-top:22px;text-align:center}
.manual-box[open]{text-align:left}
.manual-box summary{cursor:pointer;font-size:12px;color:#a79eaa;font-weight:500;list-style:none;display:inline-block}
.manual-box summary::before{content:"＋ "}
.manual-box[open] summary::before{content:"− "}
.manual-box textarea{margin-top:12px;font-family:ui-monospace,monospace;font-size:11.5px;min-height:120px}
.pipeline{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-direction:column;gap:4px;background:#fff;border:1px solid #ece4ea;border-radius:14px;padding:14px}
.pipeline li{display:flex;gap:14px;align-items:flex-start;padding:11px 12px;border-radius:10px;color:#9a93a2}
.pipeline li i{flex:none;width:22px;height:22px;border-radius:50%;border:2px solid #e0d8de;margin-top:1px;position:relative}
.pipeline li b{display:block;font-size:13.5px;font-weight:600}
.pipeline li span{font-size:11.5px}
.pipeline li.cur{background:#fdf2f4;color:#3d3339}
.pipeline li.cur i{border-color:#c8102e}
.pipeline li.cur i::after{content:"";position:absolute;inset:4px;border-radius:50%;background:#c8102e;animation:pulse 1.2s infinite}
.pipeline li.ok{color:#3d3339}
.pipeline li.ok i{border-color:#1a7f4b;background:#1a7f4b}
.pipeline li.ok i::after{content:"";position:absolute;left:7px;top:3.5px;width:5px;height:9px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(42deg)}
.pipeline li.loi{color:#a01026}
.pipeline li.loi i{border-color:#a01026}
.pipeline li.loi i::after{content:"×";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#a01026;font-size:14px;font-weight:700;font-style:normal}

/* ---------- Lịch sử phân tích ---------- */
.history-head{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin:6px 0 16px;padding-top:22px;border-top:1px solid #ece4ea}
.history-head h2{font-size:19px;font-weight:800;letter-spacing:-.3px}
.history-tools{display:flex;gap:10px;margin-left:auto;flex-wrap:wrap}
.history-tools input[type=search]{width:230px}
.history-tools select{max-width:220px}

/* ---------- Responsive ---------- */
@media(max-width:1200px){
  .masthead{align-items:flex-start!important;flex-wrap:wrap}
  .header-actions{margin-top:4px}
}
@media(max-width:820px){
  .brand p{font-size:12px}
  .page-phan-tich .brand h1{font-size:25px}
  .history-tools{width:100%;margin-left:0}
  .history-tools input[type=search]{flex:1;min-width:140px}
  .history-tools select{max-width:150px}
  .grid-phieu{grid-template-columns:1fr}
  .detail-top{gap:9px}
  .detail-actions{margin-left:0;width:100%}
  .phieu-sheet{padding:32px 18px 48px}
  .phieu-sheet .meta-grid{grid-template-columns:1fr 1fr}
  .phieu-sheet .why-grid{grid-template-columns:1fr}
  .phieu-sheet .stats{grid-template-columns:repeat(2,1fr)}
  .phieu-sheet .stat{border-top:1px solid var(--hairline)}
  .phieu-sheet .stat:nth-child(-n+2){border-top:none}
  .phieu-sheet .stat:nth-child(odd){border-left:none}
  .phieu-sheet .frame-top{flex-direction:column}
  .phieu-sheet .thumb{width:88px}
  .phieu-sheet .detail-grid{grid-template-columns:1fr}
  .phieu-sheet .banks{grid-template-columns:1fr}
  .phieu-sheet .checklist th:nth-child(3),.phieu-sheet .checklist td:nth-child(3){display:none}
  .dialog-header,#dlgBody{padding:16px}
  .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
@media print{
  .page-phan-tich .appnav,.detail-top,.masthead,.notice{display:none!important}
  .workspace-main{margin:0!important;padding:0!important}
  .phieu-sheet{border:0;box-shadow:none;border-radius:0;max-width:100%;padding:0}
  .phieu-sheet section{margin-top:36px}
  .phieu-sheet .frame,.phieu-sheet .why-card,.phieu-sheet .bank{break-inside:avoid}
}
