/*  FILE: style.css */
:root{
  --red:#dc2626; --red-50:#fef2f2; --border:#d1d5db; --muted:#6b7280;
  --bg:#f8fafc; --panel:#ffffff; --chip:#f3f4f6; --title:#111827;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:#111;font:15px/1.5 system-ui,Segoe UI,Roboto,Arial}
/* Cố định bề ngang toàn trang 1200px */
.container{width:1200px;max-width:1200px;margin:0 auto;padding:16px}
.page{display:flex;flex-wrap:nowrap;gap:16px;align-items:flex-start}

/* Vùng dưới toàn trang cho “Đầu - Đuôi Lô tô” */
.page-bottom{ width:1200px; max-width:1200px; margin:0 auto; }

/* 3 cột cố định, không co giãn */
.col-left{  flex:0 0 288px; max-width:288px; }
.col-mid{   flex:0 0 576px; max-width:576px; }
.col-right{ flex:0 0 304px; max-width:304px; display:flex; flex-direction:column; }
.col-right > .card{ width:100%; }
#page-home.book-mode .col-mid{
  flex:0 0 896px;
  max-width:896px;
}
#page-home.book-mode .col-right{
  display:none;
}

/* Topbar */
.topbar{ background:#fff; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:5; }
.menu .menu-item{ text-decoration:none; color:#374151; margin-right:10px; padding:6px 8px; border-radius:8px; }
.menu .menu-item.active, .menu .menu-item:hover{ background:#eef2ff; }

/* Subtitle (đậm hơn) */
.card .header .subtitle, .card .header .subtle, .card .header .desc{ color:#111827; font-weight:700; }

.card{background:var(--panel);border:1px solid var(--border);border-radius:10px;overflow:hidden}
.header{padding:10px 12px;border-bottom:1px solid var(--border);background:#fff}
.body{padding:12px}

/* Tabs */
.tabs{display:flex;gap:0;border-bottom:1px solid var(--border);margin-bottom:10px}
.tab{flex:1;border:none;background:#fff;color:var(--red);padding:10px 8px;font-weight:600;cursor:pointer}
.tab.active{background:var(--red);color:#fff;border-top-left-radius:6px;border-top-right-radius:6px}

/* Tables */
table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--border)}
th,td{border:1px solid var(--border);padding:6px 8px}
th{background:#f3f4f6}
.center{text-align:center}
.right{text-align:right}

/* Text */
.title-xl{font-size:18px;color:var(--red);font-weight:800}
.subtle{color:var(--muted)}
.special{color:var(--red);font-weight:800;font-size:20px}

/* Chips */
.chips{ display:flex; flex-wrap:wrap; gap:5px; align-content:flex-start; }
.chip{
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; min-width:40px; padding:2px 0; font-size:12px; line-height:1;
  text-align:center; border:1px solid var(--border); border-radius:6px;
  background:#f3f4f6; margin-bottom:5px;
}
.chip.sp{ background:#fff1f2; color:#dc2626; border-color:#fecaca; font-weight:700; }

/* REPLACE SECTION: headtail layout */
#headTail .grid{
display:flex;
gap:12px;
flex-wrap:wrap; /* nhiều đài -> xuống dòng */
overflow:visible;
padding-bottom:4px;
}
#headTail .grid .card{
flex:0 0 380px; /* mỗi bảng rộng cố định 380px */
width:380px;
}
#headTail .grid .card .header{ text-align:center; }

/* Bảng 3 cột cố định – cột giữa (Số) nhỏ gọn */
#headTail .grid table{
width:100%;
table-layout:fixed;
border-collapse:collapse;
}
#headTail .grid th, #headTail .grid td{
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
padding:4px 6px;
font-size:15px;
line-height:1.3;
}
#headTail .grid thead th:nth-child(2),
#headTail .grid tbody td:nth-child(2){
width:31px; /* cột Số nhỏ gọn */
text-align:center;
}
#headTail .grid thead th:first-child,
#headTail .grid tbody td:first-child{ text-align:right; }
#headTail .grid thead th:last-child,
#headTail .grid tbody td:last-child{ text-align:left; }
#headTail .grid .sp{
color:#dc2626;
font-weight:800;
}
#headTail .grid sup.hit{
color:#dc2626;
font-size:10px;
margin-left:1px;
}


/* DatePicker (compact) */
.dp{
  background:#fff;border:1px solid var(--border);border-radius:10px;padding:8px;
}
.dp .nav{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.dp .nav .btn{border:none;background:#fff;padding:2px 6px;cursor:pointer;color:#374151}
.dp .nav .title{font-weight:700;cursor:pointer;font-size:13px}
.dp .dow{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-bottom:2px}
.dp .dow div{font-size:11px;text-align:center;color:#374151}
.dp .grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.dp .cell{padding:4px 0;text-align:center;border-radius:5px;cursor:pointer;font-size:12px}
.dp .cell.muted{color:#9ca3af}
.dp .cell:hover{background:#eff6ff}
.dp .cell.today{outline:1px solid #60a5fa}
.dp .cell.selected{background:#2563eb;color:#fff}
.dp .grid-3{grid-template-columns:repeat(3,1fr)}
.dp .foot{text-align:center;margin-top:4px}
.dp .link{color:#2563eb;font-size:11px;cursor:pointer}

/* Login (not used but kept for consistency) */
.fullpage{min-height:100vh;display:flex;align-items:center;justify-content:center;background:#f1f5f9}

/* Inputs */
.form-item{ margin-bottom:12px; }
.form-item label{ display:block; font-weight:600; margin-bottom:6px; }
.select, .input{ width:100%; padding:8px 10px; border:1px solid #ddd; border-radius:8px; outline:none; }
.select:focus, .input:focus{ border-color:#8dc63f; }
.btn{ height:40px; padding:0 12px; border:1px solid #d1d5db; background:#fff; border-radius:10px; cursor:pointer; }
.btn-green{ border:none; background:linear-gradient(180deg,#16a34a 0%,#0f8a3b 100%); color:#fff; font-weight:800; border-radius:10px; }
.btn-block{ display:block; width:100%; }
.btn.is-loading{ opacity:.75; cursor:wait; }

.excel-progress{
  position:fixed;
  inset:0;
  z-index:1200;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(15,23,42,.42);
}
.excel-progress[hidden]{display:none}
.excel-progress-dialog{
  width:360px;
  max-width:100%;
  background:#fff;
  border:1px solid #d1d5db;
  border-radius:8px;
  box-shadow:0 18px 45px rgba(15,23,42,.28);
  overflow:hidden;
}
.excel-progress-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 14px;
  border-bottom:1px solid #e5e7eb;
}
.excel-progress-title{
  color:#111827;
  font-size:16px;
  font-weight:800;
}
.excel-progress-close{
  border:0;
  background:#fff;
  color:#6b7280;
  cursor:pointer;
  font-size:24px;
  line-height:1;
}
.excel-progress-body{
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px;
}
.excel-spinner{
  width:34px;
  height:34px;
  flex:0 0 34px;
  border:4px solid #e5e7eb;
  border-top-color:#16a34a;
  border-radius:50%;
  animation:excel-spin .8s linear infinite;
}
.excel-progress[data-mode="error"] .excel-spinner{
  border-color:#fecaca;
  border-top-color:#dc2626;
  animation:none;
}
.excel-progress-message{
  color:#111827;
  font-weight:800;
}
.excel-progress-detail{
  margin-top:2px;
  color:#6b7280;
  font-size:13px;
}
.excel-progress-track{
  height:9px;
  margin:0 14px;
  background:#e5e7eb;
  border-radius:999px;
  overflow:hidden;
}
.excel-progress-bar{
  width:0;
  height:100%;
  background:#16a34a;
  transition:width .18s ease;
}
.excel-progress[data-mode="error"] .excel-progress-bar{background:#dc2626}
.excel-progress-percent{
  padding:8px 14px 14px;
  color:#374151;
  font-size:13px;
  font-weight:800;
  text-align:right;
}
@keyframes excel-spin{to{transform:rotate(360deg)}}

/* REPLACE SECTION: KQXS table tuning */
:root{
  --row-h: 34px;            /* giữ nguyên chiều cao ô hiện tại */
  --kq-font: 20px;          /* số thường = 20px (match dự án cũ) */
  --kq-db-font: 1.8rem;     /* ĐB/G7/G8 ~28.8px (match dự án cũ) */
  --kq-label-w-mb: 120px;
  --kq-label-w-tn: 96px;    /* trung/nam */
}

.kqxs-wrap{ overflow: hidden; } /* giữ cứng, không trôi ngang */

.kqxs{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;            /* chia đều cột tỉnh */
  background:#fff;
  border:1px solid var(--border);
}

.kqxs th, .kqxs td{
  border:1px solid var(--border);
  padding:4px 6px;
  height:var(--row-h);
  vertical-align:middle;         /* canh giữa theo chiều dọc */
  text-align:center;             /* canh giữa ngang */
}

.kqxs .label{
  font-weight:700;
  background:#f8fafc;
  text-align:left;               /* nhãn giải canh trái */
  white-space:nowrap;
}

.kqxs.mb .label{ width:var(--kq-label-w-mb); }
.kqxs.mt .label, .kqxs.mn .label{ width:var(--kq-label-w-tn); }

.kqxs td:not(.label){
  font-weight:700;               /* từ 800 -> 700 (match dự án cũ) */
  font-size:var(--kq-font);      /* 22px -> 20px */
  color:#0f172a;
  letter-spacing:.3px;
}

.kqxs tr.odd-row td, .kqxs tr.odd-row .label{ background:#f4f6f8; }

.kqxs .db{ color:#dc2626; font-weight:800; }

.kqxs .db-row td:not(.label){
  color:#dc2626;
  font-weight:800;               /* từ 900 -> 800 (match dự án cũ) */
  font-size:var(--kq-db-font);   /* 30px -> 1.8rem */
  line-height:1.05;
}

.kqxs .g7-row td:not(.label),
.kqxs .g8-row td:not(.label){
  color:#dc2626;
  font-weight:800;               /* từ 900 -> 800 */
  font-size:var(--kq-db-font);   /* 30px -> 1.8rem */
  line-height:1.05;
}

/* căn giữa phụ trợ */
.tac{text-align:center}
.vtm{vertical-align:middle}

/* SKQ skin (compact) */
.skq { --skq-border:#e5e7eb; --skq-focus:rgba(22,163,74,.18); --skq-radius:12px; }
.skq .header{ background:#fff; }
.skq .title-xl{ color:#111827; font-size:20px; font-weight:800; letter-spacing:.2px; }

/* Header: tiêu đề trái, nút bên phải */
.skq-header{ display:flex; align-items:center; justify-content:space-between; gap:8px; }

/* Inputs – chiều cao nhỏ lại */
.skq select, .skq input, .skq button { font:inherit; color:inherit; }
.skq .input, .skq .select{
  width:100%; height:34px; padding:6px 10px; border:1px solid var(--skq-border);
  border-radius: var(--skq-radius); background:#fff;
  transition:border-color .15s, box-shadow .15s, background-color .15s;
}
.skq .input::placeholder{ color:#9ca3af; }
.skq .select{
  -webkit-appearance:none; appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 8 10 12 14 8'/></svg>");
  background-repeat:no-repeat; background-position:right 10px center; padding-right:34px;
}
.skq .input:hover, .skq .select:hover{ border-color:#cbd5e1; }
.skq .input:focus, .skq .select:focus{ outline:none; border-color:#16a34a; box-shadow:0 0 0 3px var(--skq-focus); }
.skq .form-item{ margin-bottom:8px; }
.skq .skq-date-line{
  display:flex;
  align-items:center;
  gap:10px;
}
.skq .skq-date-line label{
  flex:0 0 auto;
  margin:0;
  white-space:nowrap;
}
.skq .skq-date-line .input{
  flex:1 1 auto;
  min-width:0;
}

/* Buttons – chiều cao nhỏ lại */
.skq .btn{ height:36px; border-radius: var(--skq-radius); font-weight:800; border:1px solid #d1d5db; background:#fff; }
.skq .btn.btn-green{ border:none; cursor:pointer; background:linear-gradient(180deg,#16a34a 0%,#0f8a3b 100%); color:#fff; letter-spacing:.3px; box-shadow:0 6px 18px rgba(16,185,129,.22); }
.skq .btn.btn-green:hover{ filter:brightness(1.03); }

/* Nút tải kết quả (nhỏ, xanh dương) */
.skq .btn.btn-primary{ border:none; background:linear-gradient(180deg,#3b82f6 0%, #2563eb 100%); color:#fff; box-shadow:0 6px 18px rgba(37,99,235,.22); }
.skq .btn.btn-primary:hover{ filter:brightness(1.03); }
.skq .btn.btn-xs{ height:28px; padding:0 8px; border-radius:10px; display:inline-flex; align-items:center; gap:6px; }
.skq .btn .ico{ display:inline-block; width:16px; height:16px; }


/* Combo (đài) */
.combo{ position:relative; }
.combo .input{ padding-right:76px; }
.combo .combo-clear{
  position:absolute; right:42px; top:50%; transform:translateY(-50%);
  width:26px; height:26px; border-radius:8px; border:1px solid #e5e7eb; background:#fff;
  cursor:pointer; color:#6b7280; font-size:18px; line-height:22px; font-weight:800;
  display:flex; align-items:center; justify-content:center;
}
.combo .combo-clear[hidden]{ display:none; }
.combo .combo-clear:hover{ background:#fef2f2; color:#dc2626; border-color:#fecaca; }
.combo .combo-toggle{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  width:30px; height:30px; border-radius:8px; border:1px solid #e5e7eb; background:#fff;
  cursor:pointer;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 8 10 12 14 8'/></svg>");
  background-repeat:no-repeat; background-position:center;
}
.combo .combo-toggle:hover{ background-color:#f8fafc; }
.combo .combo-list{ position:absolute; left:0; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #e5e7eb; border-radius:12px; box-shadow:0 12px 24px rgba(0,0,0,.08); max-height:280px; overflow:auto; padding:6px 0; z-index:30; }
.combo .combo-list li{ padding:8px 12px; cursor:pointer; font-size:14px; }
.combo .combo-list li:hover, .combo .combo-list li.active{ background:#eef2ff; }
.combo .combo-list li.empty{ color:#9ca3af; cursor:default; }
/* Floater fix */
.combo-floater{ position:fixed; z-index:9999; background:#fff; border:1px solid #e5e7eb; border-radius:12px; box-shadow:0 12px 24px rgba(0,0,0,.10); padding:6px 0; max-height:min(60vh,480px); overflow:auto; }

.book-results{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.book-period-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 304px;
  gap:16px;
  align-items:start;
  content-visibility:auto;
  contain-intrinsic-size:720px;
}
.book-result-side,
.book-headtail-side{
  min-width:0;
}
.book-results .book-card .body{
  padding:0;
}
.book-results .book-card .kqxs-wrap{
  border:0;
}
.book-headtail{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.book-headtail-card .body{
  padding:0;
}
.book-headtail-card .title-xl{
  font-size:16px;
}
.book-headtail-period{
  border:1px solid #e5e7eb;
  border-radius:8px;
  overflow:hidden;
  background:#fff;
}
.book-headtail-period .period-title{
  padding:7px 8px 2px;
  font-weight:800;
  color:#dc2626;
  text-align:center;
}
.book-headtail-period .period-date{
  padding:0 8px 7px;
  color:#6b7280;
  font-size:12px;
  text-align:center;
}
.book-headtail-station{
  border-top:1px solid #e5e7eb;
}
.book-headtail-station:first-child{
  border-top:0;
}
.book-headtail-station .station-title{
  padding:6px 8px;
  background:#f8fafc;
  font-size:13px;
  font-weight:800;
  text-align:center;
}
.book-headtail table{
  width:100%;
  table-layout:fixed;
  border-width:1px 0 0;
}
.book-headtail th,
.book-headtail td{
  padding:3px 4px;
  font-size:12px;
  line-height:1.25;
  vertical-align:top;
  white-space:normal;
  overflow-wrap:anywhere;
}
.book-headtail th:nth-child(2),
.book-headtail td:nth-child(2){
  width:28px;
}
.book-headtail .right{
  text-align:right;
}
.book-headtail .center{
  text-align:center;
}
.book-headtail .sp{
  color:#dc2626;
  font-weight:800;
}
.book-headtail sup{
  color:#dc2626;
  font-size:9px;
  margin-left:1px;
}
.book-headtail-empty{
  color:#6b7280;
  font-size:13px;
}

/* REPLACE SECTION: live badge */
.live-badge{ display:none !important; }

/* REPLACE SECTION: center all titles */
.card>.header{ text-align:center; }
.card>.header .title-xl{ text-align:center; }
/* Phòng trường hợp header lồng nhau */
.card .header .title-xl{ text-align:center; }
/* Nếu có tiêu đề riêng trong bảng KQXS */
.kqxs .title{ text-align:center; }


/* REPLACE SECTION: KQXS header controls (CSS) */
.topbar{background:var(--panel);position:sticky;top:0;z-index:100;box-shadow:0 1px 0 var(--border)}
.topbar .menu{display:flex;gap:1px;flex-wrap:wrap;align-items:center}
.topbar .menu .menu-item{position:relative;display:inline-flex;align-items:center;justify-content:center;height:36px;padding:0 12px;border-radius:12px;text-decoration:none;font-weight:600;color:#111827;background:linear-gradient(#fff,#f9fafb);border:1px solid #e5e7eb;box-shadow:0 1px 1px rgba(0,0,0,.04);transition:transform .15s ease,box-shadow .2s ease,background .2s ease,color .2s ease,border-color .2s ease}
.topbar .menu .menu-item:hover{transform:translateY(-1px);box-shadow:0 6px 16px rgba(2,132,199,.15);border-color:#d1d5db}
.topbar .menu .menu-item:focus-visible{outline:2px solid #0ea5e9;outline-offset:2px}
.topbar .menu .menu-item.active{background:#0ea5e9;color:#fff;border-color:#0ea5e9;box-shadow:0 8px 20px rgba(14,165,233,.35)}
.topbar .menu .menu-item.active::after{content:"";position:absolute;left:10px;right:10px;bottom:-8px;height:3px;border-radius:3px;background:#0ea5e9}
@media (max-width:600px){
  .topbar .menu{gap:5px}
  .topbar .menu .menu-item{height:34px;padding:0 10px;border-radius:10px}
}


/* REPLACE SECTION: footer-styles */
.site-footer{
  display:flex; align-items:center; gap:12px;
}
.site-footer .footer-left{ white-space:nowrap; }
.site-footer .footer-right{
  margin-left:auto; text-align:right; color:#6b7280; font-size:13px;
  display:flex; flex-direction:column; align-items:flex-end; line-height:1.45;
}
.site-footer .vs-title{ font-weight:600; }
.site-footer .vs-line{ white-space:nowrap; }
.site-footer .vs-sep{ display:inline-block; padding:0 6px; opacity:.7; }
.site-footer .vs-time{ opacity:.9; }


/* Tool pages */
.tool-page{
  width:1200px;
  max-width:1200px;
  margin:0 auto;
  position:relative;
}
.tool-page *{box-sizing:border-box}
.tool-kq-sidebar{
  position:sticky;
  top:72px;
  height:0;
  z-index:60;
}
.tool-kq-sidebar-inner{
  width:112px;
  margin-left:calc(100% + 8px);
  padding:8px;
  border:1px solid #fecaca;
  border-top:4px solid #ef4444;
  border-radius:6px;
  background:#fff;
  box-shadow:0 10px 26px rgba(15,23,42,.12);
}
.tool-kq-sidebar label{
  display:block;
  margin:0 0 8px;
  color:#dc2626;
  font:700 19px/1.2 "Segoe UI",Tahoma,Arial,sans-serif;
  text-align:center;
  white-space:nowrap;
}
#tool-kq-input{
  width:100%;
  height:38px;
  padding:4px 8px;
  border:2px solid #ef4444;
  border-radius:5px;
  background:#fff7f7;
  color:#111827;
  font:800 20px/1.2 Arial,Helvetica,sans-serif;
  text-align:center;
  outline:none;
}
#tool-kq-input:focus{
  background:#fff;
  box-shadow:0 0 0 3px rgba(239,68,68,.18);
}
.tool-card{
  background:#fff;
  border:1px solid #d1d5db;
  border-radius:6px;
  padding:10px 12px 12px;
  margin-bottom:12px;
  box-shadow:0 1px 2px rgba(15,23,42,.05);
}
.tool-card h2,
.chao-page h1{
  margin:0 0 8px;
  color:#2563eb;
  font-size:18px;
  font-weight:800;
  text-transform:uppercase;
  border-bottom:2px solid #2563eb;
  padding-bottom:4px;
  letter-spacing:0;
}
.tool-card h3{
  margin:10px 0 8px;
  color:#dc2626;
  font-size:14px;
  font-weight:800;
  border-bottom:1px solid #e5e7eb;
  padding-bottom:4px;
}
.tool-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  margin-bottom:8px;
}
.tool-row.tight{gap:8px;margin-bottom:6px}
.tool-row-split{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.tool-inline{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:5px;
}
.tool-inline label,
.tool-inline span,
.tool-subsection label{
  font-size:12px;
  font-weight:700;
  color:#111827;
}
.tool-page input,
.tool-page select,
.tool-page textarea{
  border:1px solid #d1d5db;
  border-radius:4px;
  color:#111827;
  font:12px/1.35 Arial,Helvetica,sans-serif;
  background:#fff;
}
.tool-page input,
.tool-page select{
  height:26px;
  padding:2px 6px;
}
#td-group-count{width:52px}
#td-number-count{width:64px}
#td-fixed-numbers{width:189px}
.tool-btn{
  border:0;
  border-radius:4px;
  color:#fff;
  cursor:pointer;
  font:700 12px/1.2 Arial,Helvetica,sans-serif;
  min-height:25px;
  padding:5px 10px;
}
.tool-btn.blue{background:#2196f3}
.tool-btn.blue-soft{background:#5b9bd5}
.tool-btn.red{background:#ef4444}
.tool-btn.green{background:#16a34a}
.tool-btn.indigo{background:#4f46e5}
.tool-btn.gray{background:#e5e7eb;color:#111827}
.tool-btn.full{width:100%;height:36px;margin-top:8px}
.tool-btn:hover{filter:brightness(.93)}
.tool-two-textareas{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0;
}
.tool-textarea-wrap{
  position:relative;
  min-height:120px;
}
.dan-highlight-layer{
  position:absolute;
  inset:0;
  z-index:3;
  overflow:hidden;
  pointer-events:none;
  border:1px solid transparent;
  border-radius:4px;
  padding:5px calc(52px + var(--dan-scrollbar-width, 0px)) 5px 6px;
  color:transparent;
  font:12px/1.35 Arial,Helvetica,sans-serif;
  white-space:pre-wrap;
  overflow-wrap:break-word;
}
.dan-highlight-content{
  min-height:100%;
  will-change:transform;
}
.dan-highlight-layer .dan-hit{
  border-radius:2px;
  background:#fde047;
  color:#dc2626;
  font-weight:400;
}
.tool-textarea-wrap textarea{
  position:relative;
  z-index:2;
  width:100%;
  height:100%;
  min-height:300px;
  padding:5px 52px 5px 6px;
  resize:vertical;
  display:block;
}
.tool-textarea-wrap.compact .dan-highlight-layer{font-size:11px}
.tool-textarea-wrap.compact textarea{min-height:150px;font-size:11px}
.tool-textarea-wrap.short{min-height:72px}
.tool-textarea-wrap.short textarea{min-height:72px}
.tool-textarea-wrap.tall{min-height:240px}
.tool-textarea-wrap.tall textarea{min-height:240px}
.tool-textarea-wrap.single-line{min-height:32px}
.tool-textarea-wrap.single-line textarea{min-height:30px;resize:none}
.tool-actions{
  position:absolute;
  right:5px;
  top:5px;
  display:flex;
  flex-direction:column;
  gap:5px;
  z-index:5;
}
.tool-actions button,
.float-copy,
.float-paste,
.float-clear{
  position:absolute;
  right:5px;
  top:5px;
  min-width:42px;
  height:20px;
  border:0;
  border-radius:4px;
  background:rgba(25,120,200,.78);
  color:#fff;
  cursor:pointer;
  font:700 10px/1 Arial,Helvetica,sans-serif;
  z-index:5;
}
.tool-actions button{
  position:static;
}
.tool-actions .danger,
.float-clear{background:rgba(190,30,45,.78)}
.tool-actions button:nth-child(2){background:rgba(25,120,200,.78)}
.float-paste{background:rgba(25,120,200,.78)}
.float-clear{right:53px}
.tool-grid-four{
  display:grid;
  grid-template-columns:repeat(4,1fr);
}
.tool-grid-four>div,
.tool-config-row input{
  border:1px solid #d1d5db;
}
.tool-mini-head>div{
  height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f9fafb;
  font-size:12px;
  font-weight:800;
}
.tool-config-row input{
  width:100%;
  height:24px;
  border-radius:0;
  text-align:center;
}
.tool-cat-areas{height:150px}
.tool-cat-areas .tool-textarea-wrap{min-height:150px}
.tool-subhead{
  margin-top:6px;
  border:1px solid #d1d5db;
  background:#f3f4f6;
  color:#111827;
  font-size:12px;
  font-weight:800;
  text-align:center;
  padding:4px;
}
.tool-ghep-layout{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  align-items:stretch;
  --tool-align-head:25px;
  --tool-align-body:260px;
}
.tool-stack label,
.tool-ghep-layout label{
  display:block;
  margin:0 0 4px;
}
.tool-align-stack,
.tool-result-stack{
  min-width:0;
  display:grid;
  row-gap:4px;
}
.tool-result-stack{
  grid-template-rows:var(--tool-align-head) var(--tool-align-body);
}
.tool-ghep-layout .tool-result-stack .tool-row.tight{
  min-height:var(--tool-align-head);
  margin-bottom:0;
}
.tool-align-stack>label,
.tool-result-stack>label{
  min-height:14px;
  line-height:14px;
  margin:0;
}
.tool-align-stack>label:first-child{
  min-height:var(--tool-align-head);
  display:flex;
  align-items:flex-end;
}
.tool-align-stack .tool-textarea-wrap,
.tool-result-stack .tool-textarea-wrap{
  min-height:0;
}
.tool-align-stack .tool-textarea-wrap textarea,
.tool-result-stack .tool-textarea-wrap textarea{
  min-height:0;
  height:100%;
}
.tool-cang-inputs{
  grid-template-rows:var(--tool-align-head) 32px 14px 32px 14px 1fr;
}
.tool-2so-inputs,
.tool-tach-results{
  grid-template-rows:var(--tool-align-head) 1fr 14px 1fr 14px 1fr;
}
.tool-cang-results .tool-textarea-wrap,
.tool-2so-results .tool-textarea-wrap,
.tool-tach-inputs .tool-textarea-wrap{
  min-height:var(--tool-align-body);
}
.tool-tach-results .tool-textarea-wrap,
.tool-2so-inputs .tool-textarea-wrap{
  min-height:72px;
}
.tool-count{
  color:#111827;
  font-size:12px;
  font-weight:800;
}
.quick-grid{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-bottom:8px;
}
.quick-grid button{
  width:72px;
  height:25px;
  border:0;
  border-radius:4px;
  color:#fff;
  cursor:pointer;
  font:700 11px/1 Arial,Helvetica,sans-serif;
}
.quick-grid .orange{background:#ff5722}
.quick-grid .purple{background:#9c27b0}
.quick-grid .pink{background:#e91e63}
.quick-grid .green{background:#4caf50}
.quick-grid .amber{background:#ff9800}
.quick-grid .indigo{background:#3f51b5}
.quick-grid .slate{background:#607d8b}
.quick-grid .violet{background:#673ab7}
.quick-grid .brown{background:#795548}
.quick-grid .blue{background:#2196f3}
.quick-grid .red{background:#d40c0c}
.lay-output textarea{min-height:84px}

@media (max-width:1475px){
  .tool-kq-sidebar{
    display:none;
  }
}

.chao-page h1{
  margin-bottom:12px;
  border-bottom:0;
  text-transform:none;
  font-size:28px;
}
.chao-layout{
  display:grid;
  grid-template-columns:3fr 1fr;
  gap:16px;
  align-items:start;
}
.chao-table-card,
.chao-form-card{
  background:#fff;
  border:1px solid #d1d5db;
  border-radius:6px;
  overflow:hidden;
  box-shadow:0 1px 2px rgba(15,23,42,.05);
}
.chao-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px;
  border-bottom:1px solid #e5e7eb;
}
.chao-head h2,
.chao-form-card h2{
  margin:0;
  color:#2563eb;
  font-size:18px;
  font-weight:800;
}
.chao-table-wrap{overflow-x:auto}
#chao-table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
}
#chao-table th,
#chao-table td{
  border-bottom:1px solid #e5e7eb;
  padding:9px 12px;
  text-align:left;
  white-space:nowrap;
  font-size:13px;
}
#chao-table th{
  background:#f9fafb;
  color:#6b7280;
  font-size:12px;
  text-transform:uppercase;
}
#chao-table tr.mark{background:#fffbeb}
#chao-table .pos{color:#16a34a;font-weight:800}
#chao-table .neg{color:#dc2626;font-weight:800}
#chao-table .empty{text-align:center;color:#6b7280}
.chao-form-card{padding:14px}
.chao-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:10px;
}
.chao-form-grid label{
  color:#374151;
  font-size:13px;
  font-weight:700;
}
.chao-form-grid input{
  width:100%;
  margin-top:4px;
  height:30px;
  border:1px solid #d1d5db;
  border-radius:5px;
  padding:4px 7px;
  font-size:13px;
}
.tool-error{
  margin-top:10px;
  padding:8px;
  border:1px solid #fecaca;
  border-radius:5px;
  background:#fef2f2;
  color:#dc2626;
  font-size:13px;
}
.chart-modal{
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(0,0,0,.5);
}
.chart-modal[hidden]{display:none}
.chart-dialog{
  width:960px;
  max-height:90vh;
  display:flex;
  flex-direction:column;
  background:#fff;
  border-radius:8px;
  overflow:hidden;
  box-shadow:0 20px 50px rgba(0,0,0,.25);
}
.chart-head,
.chart-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid #e5e7eb;
}
.chart-foot{
  justify-content:flex-end;
  border-top:1px solid #e5e7eb;
  border-bottom:0;
}
.chart-head h2{margin:0;font-size:20px;color:#111827}
.chart-head button{
  border:0;
  background:#fff;
  cursor:pointer;
  color:#6b7280;
  font-size:30px;
  line-height:1;
}
.chart-tabs{
  display:flex;
  border-bottom:1px solid #e5e7eb;
}
.chart-tabs button{
  border:0;
  background:#fff;
  color:#4b5563;
  cursor:pointer;
  font-weight:700;
  padding:10px 14px;
}
.chart-tabs button.active{
  color:#2563eb;
  box-shadow:inset 0 -2px 0 #2563eb;
}
.chart-body{
  height:360px;
  margin:18px;
  padding:8px;
  background:#f9fafb;
  border-radius:6px;
}
.chart-body svg{width:100%;height:100%;display:block}
.empty-chart{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#6b7280;
}
