@font-face {
  font-family: Kanit;
  src: url("fonts/Kanit-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Kanit;
  src: url("fonts/Kanit-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* พื้นหลังเทาเย็น, เมนูสีหมึก, เขียวมะนาวของแบรนด์ใช้เป็นสัญญาณ "ดี/คุ้ม" เท่านั้น */
  --ink: #141a2e;
  --signal: #c8f169;
  --bg: #f2f4f8;
  --surface: #fff;
  --surface-2: #eef1f6;
  --border: #dfe4ec;
  --text: #141a2e;
  --text-2: #475069;
  --text-3: #687089;
  --accent: #3d47c9;
  --accent-soft: #e7e9fb;
  --bar: #5964dc;
  --bar-track: #e8ebf5;
  --drop: #cf4529;
  --drop-soft: #fbe9e4;
  --good: #46a316;
  --good-text: #2b6e0b;
  --good-soft: #eaf6dd;
  --wait: #a06500;
  --wait-soft: #fbf1da;
  --shadow: 0 1px 0 rgba(20, 26, 46, .04), 0 1px 3px rgba(20, 26, 46, .05);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #0b0f1c;
    --bg: #0f1322; --surface: #171c2f; --surface-2: #20263c; --border: #2c3350;
    --text: #eef0f8; --text-2: #c3c8dc; --text-3: #9097b2;
    --accent: #9aa3ff; --accent-soft: #262c52; --bar: #8790f5; --bar-track: #2a3050;
    --drop: #ef7a62; --drop-soft: #3a2019; --good: #7fcf4f; --good-text: #9be06d; --good-soft: #1d3016;
    --wait: #e2ad48; --wait-soft: #352a12;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #0b0f1c;
  --bg: #0f1322; --surface: #171c2f; --surface-2: #20263c; --border: #2c3350;
  --text: #eef0f8; --text-2: #c3c8dc; --text-3: #9097b2;
  --accent: #9aa3ff; --accent-soft: #262c52; --bar: #8790f5; --bar-track: #2a3050;
  --drop: #ef7a62; --drop-soft: #3a2019; --good: #7fcf4f; --good-text: #9be06d; --good-soft: #1d3016;
  --wait: #e2ad48; --wait-soft: #352a12;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 Kanit, "Leelawadee UI", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.brand small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--text-3); }
.brand > span:last-child { line-height: 1.15; }
.sidenav .brand-mark, .center .brand-mark { position: relative; background: #ceff91; color: #15182f; width: 38px; height: 38px; }
.brand-mark::before, .brand-mark::after { content: ''; position: absolute; top: 17px; left: 9px; width: 20px; height: 4px; border-radius: 3px; background: currentColor; transform: rotate(45deg); }
.brand-mark::after { transform: rotate(-45deg); }
.center .brand-mark { margin-bottom: 14px; }
.wrap .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 22px; }
.wrap .page-heading h1 { font-size: clamp(29px, 4.2vw, 49px); font-weight: 600; letter-spacing: -.025em; }
.dashboard-heading {
  position: relative; isolation: isolate; overflow: hidden; padding: clamp(26px, 4vw, 48px);
  border-radius: 24px; color: #fff; background: linear-gradient(115deg, #151732 25%, #382578 100%);
}
.dashboard-heading::before {
  content: ''; position: absolute; z-index: -1; inset: 0 0 0 43%;
  background: repeating-radial-gradient(ellipse at 84% 122%, transparent 0 23px, #b39cff48 24px 25px);
  mask-image: linear-gradient(90deg, transparent, #000 45%);
}
.dashboard-heading .sub { color: #d9daf0; margin-top: 8px; }
.dashboard-heading .btn.primary { display: inline-flex; align-items: center; gap: 14px; padding: 10px 15px; background: #ceff91; color: #1c2637; border-color: transparent; font-size: 14px; font-weight: 600; }
.dashboard-heading .btn.primary:hover { background: #e3ffc5; }
.flow-heading .btn { padding: 8px 14px; }
.wrap .kpi { min-width: 0; padding: 17px 19px; box-shadow: var(--shadow); }
.wrap .kpi .value { margin: 8px 0 4px; font-size: clamp(24px, 2.7vw, 37px); font-weight: 600; overflow-wrap: anywhere; }
.wrap .kpi:nth-child(3) { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 27%, var(--border)); }
.wrap .kpi:nth-child(3) .value { color: var(--accent); }
.overview-funnel { padding: 20px; margin-bottom: 28px; }
.overview-funnel h2, .ad-section-heading h2 { margin: 0 0 2px; font-size: 20px; }
.overview-stages { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.overview-stage { display: flex; flex-direction: column; gap: 7px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 13px; }
.overview-stage > span { font-size: 13px; min-height: 42px; }
.overview-stage > strong { font-size: 23px; line-height: 1; margin-top: auto; }
.overview-stage small { color: var(--text-2); }
.overview-stage .track { margin: 2px 0; background: var(--bar-track); }
.overview-stage .fill { background: linear-gradient(90deg, var(--bar), var(--accent)); }
.ad-section-heading, .detail-links { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.ad-section-heading .search { width: min(100%, 280px); }
.flow-board { overflow: hidden; border-radius: 19px; }
.flow-toolbar { background: var(--surface-2); }
.flow-toolbar, .flow-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
.flow-toolbar label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; max-width: 100%; }
.flow-toolbar select { min-width: 0; max-width: min(260px, 63vw); background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; }
.flow-viewport {
  overflow: auto; min-height: 310px; max-height: 65vh; border-block: 1px solid var(--border);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, var(--border)) 1px, transparent 1px) 0 0 / 19px 19px, var(--bg);
}
.flow-viewport:focus-visible { outline-offset: -3px; }
.flow-map { display: flex; align-items: center; width: max-content; min-height: 310px; padding: 32px 28px 25px; }
.flow-source, .flow-step, .flow-result { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow); }
.flow-source { width: 172px; overflow: hidden; border-color: var(--accent); }
.flow-source .thumb { width: 100%; height: 100px; border: 0; border-radius: 0; background: var(--accent-soft); color: var(--accent); font-size: 32px; }
.flow-source-copy { display: flex; flex-direction: column; padding: 11px 12px; overflow-wrap: anywhere; }
.flow-branches { display: block; flex: none; overflow: visible; }
.flow-branches path { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.flow-lane { display: flex; align-items: center; height: 94px; }
.flow-step, .flow-result { min-height: 68px; padding: 9px 11px; display: grid; align-content: center; gap: 3px; }
.flow-step { width: 113px; font-size: 12px; }
.flow-step .node-badge { justify-self: start; }
.flow-wire { width: 21px; height: 1px; background: var(--text-3); position: relative; }
.flow-wire::after { content: ''; position: absolute; right: 1px; top: -3px; width: 6px; height: 6px; border: solid var(--text-3); border-width: 1px 1px 0 0; transform: rotate(45deg); }
.flow-result { min-width: 132px; font-size: 12px; background: var(--surface-2); }
.flow-result strong { font-size: 18px; line-height: 1.2; }
.flow-result.purchased { color: var(--good-text); background: var(--good-soft); }
.flow-result.dropped, .flow-result.closed { color: var(--drop); background: var(--drop-soft); }
.flow-result.active { color: var(--wait); background: var(--wait-soft); }
.flow-empty { padding: 35px 22px; color: var(--text-2); }
.flow-footer { justify-content: space-between; }
.zoom-controls, .flow-pages { display: flex; align-items: center; gap: 6px; }
.flow-footer button:disabled { opacity: .45; cursor: default; }
.flow-footer #zoomReset { min-width: 66px; }
@media (max-width: 760px) {
  .overview-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-stage > span { min-height: 0; }
}
@media (max-width: 420px) {
  .flow-toolbar label { flex-wrap: wrap; }
  .flow-map { padding-inline: 14px; }
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* แถบหัวหน้า + เมนูข้าง: ดูท้ายไฟล์ */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; }
.range { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.range button { border: 0; background: none; padding: 5px 11px; border-radius: 8px; cursor: pointer; color: var(--text-2); }
.range button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text-2); }
.icon-btn:hover { color: var(--text); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 24px; }
h1 { font-size: 24px; margin: 0 0 4px; line-height: 1.3; }
h2 { font-size: 17px; margin: 0 0 12px; }
.sub { color: var(--text-2); margin: 0; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 20px 0; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { color: var(--text-2); font-size: 13px; }
.kpi .value { font-size: 26px; font-weight: 700; line-height: 1.2; margin-top: 2px; }
.kpi .hint { color: var(--text-3); font-size: 12px; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 16px; }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; cursor: pointer; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.search { padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); min-width: 200px; }

/* ad cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.ad-card { display: flex; flex-direction: column; padding: 16px; gap: 14px; transition: border-color .15s; }
.ad-card:hover { border-color: var(--accent); box-shadow: 0 8px 22px #5140ab18; }
.ad-head { display: flex; gap: 12px; align-items: flex-start; }
.thumb {
  flex: none; width: 64px; height: 64px; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-2);
  font-weight: 700; font-size: 20px; border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.lg { width: 120px; height: 120px; font-size: 34px; }
.ad-title { font-weight: 700; font-size: 16px; line-height: 1.35; }
.ad-title .unnamed { color: var(--text-3); font-weight: 600; }
.ad-id { color: var(--text-3); font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.ad-post { color: var(--text-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }

.ad-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.stat .l { font-size: 12px; color: var(--text-2); }
.stat .v { font-size: 19px; font-weight: 700; line-height: 1.25; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--text-3); }

/* mini funnel */
.mf { display: grid; gap: 5px; }
.mf-row { display: grid; grid-template-columns: 22px 1fr 44px 70px; align-items: center; gap: 8px; font-size: 13px; }
.node-badge { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; }
.track { height: 10px; background: var(--bar-track); border-radius: 4px; overflow: hidden; }
.fill { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.mf-row .n { text-align: right; color: var(--text-2); }
.drop-chip { justify-self: end; font-size: 12px; color: var(--drop); white-space: nowrap; }
.drop-chip.zero { color: var(--text-3); }
.mf-row.top .drop-chip { background: var(--drop-soft); padding: 1px 7px; border-radius: 6px; font-weight: 700; }

.alert {
  display: flex; gap: 8px; align-items: center; font-size: 13px;
  border-radius: 10px; padding: 8px 10px; background: var(--drop-soft); color: var(--text);
}
.alert .ic { color: var(--drop); flex: none; }
.alert.good { background: var(--good-soft); }
.alert.good .ic { color: var(--good-text); }
.card-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--accent); font-weight: 600; margin-top: auto; }

/* detail */
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); margin-bottom: 12px; }
.detail-head { display: flex; gap: 18px; align-items: flex-start; padding: 18px; }
.detail-head .meta { flex: 1; min-width: 0; }
.name-input {
  width: 100%; font-size: 22px; font-weight: 700; border: 1px solid transparent; background: transparent;
  border-radius: 8px; padding: 2px 6px; margin-left: -6px;
}
.name-input:hover { border-color: var(--border); }
.name-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.note-input { width: 100%; min-height: 40px; resize: vertical; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; background: var(--surface); font-size: 13px; }
.post-full { white-space: pre-wrap; color: var(--text-2); font-size: 14px; margin: 6px 0; }
.thumb-btn { position: relative; cursor: pointer; }
.thumb-btn .edit { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; text-align: center; padding: 3px; }
.btn { border: 1px solid var(--border); background: var(--surface); padding: 6px 12px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.saved { color: var(--good-text); font-size: 13px; }

.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
.panel { padding: 18px; }
.panel h2 { display: flex; align-items: baseline; gap: 8px; }
.panel h2 .muted { font-size: 13px; font-weight: 400; }

/* big funnel */
.bf { display: block; }
.bf-row { display: grid; grid-template-columns: 170px 1fr 104px 104px; gap: 12px; align-items: center; padding: 6px 0; }
.bf-count { font-size: 13px; text-align: right; }
.bf-count b { font-size: 15px; }
.bf-label { display: flex; gap: 8px; align-items: center; }
.bf-label .t { font-weight: 600; font-size: 14px; line-height: 1.2; }
.bf-label .s { font-size: 12px; color: var(--text-3); }
.bf-bar { position: relative; height: 28px; background: var(--bar-track); border-radius: 6px; overflow: hidden; }
.bf-bar .fill { border-radius: 0 6px 6px 0; }
.bf-right { text-align: right; font-size: 13px; }
.bf-right .drop { color: var(--drop); font-weight: 600; }
.bf-right .wait { color: var(--wait); }
.bf-step { font-size: 12px; color: var(--text-3); padding-left: 182px; margin: -2px 0; }
.bf-row.buy .fill { background: var(--good); }
.bf-row.buy .node-badge { background: var(--good-soft); color: var(--good-text); }

/* drop bars (vertical) */
.vb { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 180px; padding-top: 18px; }
.vb-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.vb-bar { width: 70%; max-width: 56px; background: var(--drop); border-radius: 4px 4px 0 0; min-height: 2px; }
.vb-bar.dim { opacity: .45; }
.vb-val { font-size: 13px; font-weight: 600; }
.vb-axis { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; border-top: 1px solid var(--border); padding-top: 6px; text-align: center; font-size: 12px; color: var(--text-2); }
.insight { margin-top: 12px; font-size: 14px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }

/* paths */
.paths { display: grid; gap: 10px; }
.path-row { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center; }
.path-chips { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.pc { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; }
.pc.end-drop { background: var(--drop-soft); color: var(--drop); }
.pc.end-buy { background: var(--good-soft); color: var(--good-text); }
.arrow { color: var(--text-3); font-size: 11px; }
.path-meta { font-size: 12px; color: var(--text-2); text-align: right; }
.share { height: 6px; background: var(--bar-track); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.share > div { height: 100%; background: var(--bar); }
.share.drop > div { background: var(--drop); }
.share.good > div { background: var(--good); }

/* table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
td.r, th.r { text-align: right; }
.status { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.status.purchased { background: var(--good-soft); color: var(--good-text); }
.status.dropped, .status.closed { background: var(--drop-soft); color: var(--drop); }
.status.active { background: var(--wait-soft); color: var(--wait); }
.status.no_node { background: var(--surface-2); color: var(--text-2); }

/* compare heat table */
.heat td.cell { text-align: center; font-weight: 600; min-width: 84px; }
.heat td.cell .sub2 { display: block; font-size: 11px; font-weight: 400; color: var(--text-2); }
.heat td.cell.top { outline: 2px solid var(--drop); outline-offset: -2px; border-radius: 6px; }
.heat .adcell { display: flex; gap: 10px; align-items: center; min-width: 220px; }
.heat .adcell .thumb { width: 40px; height: 40px; font-size: 14px; border-radius: 9px; }
.legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin: 10px 0 0; }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }

/* drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface); z-index: 41; overflow-y: auto; padding: 20px; box-shadow: -8px 0 24px rgba(0,0,0,.12); }
.tl { list-style: none; margin: 16px 0 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl li { position: relative; padding: 0 0 16px 34px; }
.tl .dot { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.tl .dot.order { background: var(--good-soft); color: var(--good-text); }
.tl .dot.drop { background: var(--drop-soft); color: var(--drop); }
.tl .dot.contact { background: var(--surface-2); color: var(--text-2); }
.tl .t { font-weight: 600; font-size: 14px; }
.tl .w { font-size: 12px; color: var(--text-3); }

/* login & empty */
.center { max-width: 420px; margin: 10vh auto; padding: 28px; }
.center input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); margin: 12px 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.err { color: var(--drop); font-size: 14px; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.loading { padding: 48px; text-align: center; color: var(--text-3); }

.tip {
  position: fixed; z-index: 60; pointer-events: none; max-width: 260px;
  background: var(--text); color: var(--surface); font-size: 12px; line-height: 1.45;
  padding: 7px 9px; border-radius: 8px;
}

@media (max-width: 960px) {
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .range { flex: 1; }
  .range button { flex: 1; padding: 5px 4px; }
  .wrap { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  .bf-row { grid-template-columns: 1fr 78px 86px; gap: 8px; }
  .bf-label { grid-column: 1 / -1; }
  .bf-step { padding-left: 0; }
  .detail-head { flex-direction: column; }
  .thumb.lg { width: 88px; height: 88px; }
  .path-row { grid-template-columns: 1fr; }
  .path-meta { text-align: left; }
  .search { min-width: 0; width: 100%; }
}

/* ข้อมูล ads จาก Facebook */
.fb-info { margin: 6px 0 2px; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.fb-info a { color: var(--accent); }
.fb-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--accent-soft); color: var(--text-2); }
.fb-pill.on { color: var(--accent); font-weight: 600; }
.settings { max-width: 760px; }
.settings p { margin: 8px 0; }
.settings .ok { color: var(--accent); }
.small { font-size: 12px; }
.settings .tok { font-size: 14px; font-weight: 400; width: 100%; padding: 10px 12px; margin: 6px 0 12px; border: 1px solid var(--border); background: var(--surface); color: inherit; border-radius: 10px; }
.settings + .settings { margin-top: 16px; }
.settings ol { margin: 6px 0 14px; padding-left: 20px; line-height: 1.8; }
.settings code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
details.settings summary { cursor: pointer; margin-bottom: 10px; }
.settings .row-btns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.settings .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 640px) { .settings .grid2 { grid-template-columns: 1fr; } }
.settings input[type=file] { margin-top: 4px; }

/* ---------- Ads ทั้งบัญชี ---------- */
.fbt-wrap { padding: 0; overflow-x: auto; margin-bottom: 10px; }
.fbt { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 820px; }
.fbt th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-3, #6b7090); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.fbt td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.fbt tr:last-child td { border-bottom: 0; }
.fbt .r { text-align: right; white-space: nowrap; }
.fbt-ad { display: flex; gap: 10px; align-items: center; min-width: 260px; }
.fbt-name { font-weight: 600; line-height: 1.35; }
.thumb.sm { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 10px; font-size: 13px; }
.thumb.sm img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.acc-list label { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 14px; }

/* เส้นทาง ads ก่อนทัก */
.type-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.type-chip.t-AVT { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.type-chip.t-DI { background: var(--good-soft); color: var(--good-text); border-color: transparent; }
.type-chip.t-IN { background: var(--wait-soft); color: var(--wait); border-color: transparent; }
.paths { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.path-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 250px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.path-row:last-child { border-bottom: 0; }
.path-row.ad-path { grid-template-columns: minmax(0, 1fr) 250px; }
.path-num { text-align: right; }
.path-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.path-arrow { color: var(--text-3); }
.path-bar { height: 10px; background: var(--bar-track); border-radius: 999px; overflow: hidden; }
.path-bar span { display: block; height: 100%; background: var(--bar); border-radius: 999px; }
.path-num { font-size: 13px; white-space: nowrap; }
.path-ad { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; max-width: 260px; min-width: 0; }
.path-ad > span:not(.type-chip) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.path-ad:hover { border-color: var(--accent); }
.thumb.sm { width: 28px; height: 28px; font-size: 11px; flex: none; border-radius: 7px; }
@media (max-width: 640px) {
  .path-row, .path-row.ad-path { grid-template-columns: 1fr; gap: 6px; }
  .path-num { white-space: normal; text-align: left; }
}

.path-ad.cur { border-color: var(--accent); background: var(--accent-soft); cursor: default; }
.touch-card { margin-top: 16px; }
.touch-card h3 { font-size: 14px; margin: 0 0 8px; }
.touch-grid { display: grid; grid-template-columns: 1fr minmax(220px, .8fr) 1fr; gap: 16px; margin-top: 12px; align-items: start; }
.touch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.touch-list li { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.touch-mid { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.touch-big { font-size: 28px; font-weight: 700; }
@media (max-width: 760px) { .touch-grid { grid-template-columns: 1fr; } .touch-mid { order: -1; } }

/* กล่อง ads ที่เจอมาก่อน ในแผนผัง */
.flow-before { position: relative; display: flex; flex-direction: column; flex: none; }
.flow-before-title { position: absolute; top: -20px; left: 2px; white-space: nowrap; }
.flow-before-box { box-sizing: border-box; width: 190px; height: 72px; margin: 6px 0; padding: 7px 9px; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); max-width: none; font-size: 12px; }
.flow-before-box.path-ad { cursor: pointer; }
.flow-before-box .fbb-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.flow-before-box .fbb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; min-width: 0; }
.flow-before-box .fbb-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--text-2); }
.flow-before-box.first-box { border-style: dashed; border-color: var(--accent); background: var(--accent-soft); }
.flow-before-box.muted-box { background: var(--surface-2); }
.flow-branches.before { flex: none; }

/* หน้ารวมเส้นทางลูกค้า */
.j-banner { margin: 12px 0; padding: 10px 14px; border-radius: 12px; background: var(--wait-soft); color: var(--text); font-size: 14px; }
.j-banner.demo { background: var(--accent-soft); }
.j-banner.plain { background: none; padding: 0; text-align: right; }
.j-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin: 14px 0; }
.j-stat { font-size: 15px; color: var(--text-2); }
.j-stat .num { font-size: 26px; font-weight: 700; color: var(--text); margin-right: 4px; }
.seg { margin-left: auto; display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 8px 14px; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
.j-flow-wrap { overflow-x: auto; }
.j-flow { display: block; width: 100%; min-width: 680px; height: auto; }
.j-col { font-size: 13px; font-weight: 700; fill: var(--text-2); }
.j-link { fill: var(--bar); fill-opacity: .3; stroke: none; transition: fill-opacity .15s; cursor: pointer; }
.j-link.t-AVT { fill: var(--accent); } .j-link.t-DI { fill: var(--good); } .j-link.t-IN { fill: var(--wait); } .j-link.t-other { fill: var(--text-3); }
.j-link.buy { fill: var(--good); fill-opacity: .38; } .j-link.no { fill: var(--text-3); fill-opacity: .16; }
.j-link.pass { fill-opacity: .1; }
.j-flow:not(.focus) .j-link:hover { fill-opacity: .55; }
.j-flow.focus .j-links .j-link { fill-opacity: .06; }
.j-hl .j-link { fill-opacity: .75; pointer-events: none; }
.j-hl .j-link.no { fill-opacity: .45; }
.j-bar { cursor: pointer; }
.j-bar rect { fill: var(--bar); transition: opacity .15s; }
.j-bar.t-AVT rect { fill: var(--accent); } .j-bar.t-DI rect { fill: var(--good); } .j-bar.t-IN rect { fill: var(--wait); } .j-bar.t-other rect { fill: var(--text-3); }
.j-bar.buy rect { fill: var(--good); } .j-bar.no rect { fill: var(--text-3); }
.j-bar.end rect { fill-opacity: .25; stroke-dasharray: 3 3; stroke-width: 1.2px; }
.j-bar.end.buy rect { stroke: var(--good); } .j-bar.end.no rect { stroke: var(--text-3); }
.j-bar.end .lb { font-weight: 600; fill: var(--text-2); font-size: 12.5px; }
.j-flow.focus .j-bar:not(.on) { opacity: .3; }
.j-bar .lb { font-size: 14px; font-weight: 700; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.j-bar .vb { font-size: 12px; font-weight: 500; fill: var(--text-2); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.j-info { min-height: 22px; margin: 0 0 6px; font-size: 13.5px; color: var(--text-2); }
.j-info b { color: var(--text); }
.j-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--text-2); }
.j-legend span { display: inline-flex; align-items: center; gap: 6px; }
.j-legend .sw { width: 14px; height: 10px; border-radius: 3px; display: inline-block; background: var(--bar); }
.j-legend .sw.t-AVT { background: var(--accent); } .j-legend .sw.t-DI { background: var(--good); } .j-legend .sw.t-IN { background: var(--wait); }
.j-legend .sw.buy { background: var(--good); opacity: .5; } .j-legend .sw.no { background: var(--text-3); opacity: .35; }
.j-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.j-sum { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
.j-top-paths { display: grid; gap: 12px; }
.j-tp { display: grid; gap: 5px; }
.j-tp-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.j-pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.j-pill.t-AVT { background: var(--accent-soft); color: var(--accent); } .j-pill.t-DI { background: var(--good-soft); color: var(--good-text); }
.j-pill.t-IN { background: var(--wait-soft); color: var(--wait); } .j-pill.buy { background: var(--good); color: #fff; }
.j-tp-bar { height: 8px; border-radius: 999px; background: var(--bar-track); overflow: hidden; }
.j-tp-bar span { display: block; height: 100%; background: var(--good); border-radius: 999px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 800px) { .j-two { grid-template-columns: minmax(0, 1fr); } .seg { margin-left: 0; } }

/* กำไร / ทุนสินค้า หน้า Ads ทั้งหมด */
.fbt .th-sub { font-weight: 400; font-size: 11px; }
.fbt .td-sub { font-size: 11.5px; color: var(--text-3, #6b7090); font-weight: 400; }
.fbt { min-width: 1080px; }
.num.pos, .fbt td.pos { color: var(--good-text, #11801a); }
.num.neg, .fbt td.neg { color: var(--drop); }
.cost-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 3px 8px; cursor: pointer; font: inherit; font-size: 12.5px; white-space: nowrap; }
.cost-btn:hover { border-color: var(--accent); }
.cost-btn.empty { border-style: dashed; color: var(--text-2); }
.cost-dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 20px 22px; width: min(440px, 92vw); box-shadow: var(--shadow); }
.cost-dialog::backdrop { background: rgba(10, 14, 24, .45); }
.cost-dialog h2 { margin: 0 0 2px; font-size: 18px; }
.cost-field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 0; }
.cost-field label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.cost-input { display: flex; align-items: center; gap: 8px; }
.cost-input input { width: 160px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2, var(--surface)); }
.cost-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.kpis.money { margin-top: -8px; }
.wrap .kpis.money .kpi:nth-child(3) { background: var(--surface); border-color: var(--border); }
.wrap .kpis.money .kpi:nth-child(3) .value { color: inherit; }
.wrap .kpis.money .kpi .value.pos { color: var(--good-text, #11801a); }
.wrap .kpis.money .kpi .value.neg { color: var(--drop); }

/* ตารางเส้นทางทั้งหมด หน้าเส้นทางลูกค้า */
.jp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.jp-head .search { width: min(100%, 280px); }
.jp-table { min-width: 900px; }
.jp-table td { vertical-align: middle; }
.jp-table .j-tp-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.jp-table .td-sub { font-size: 11.5px; color: var(--text-3, #6b7090); }
.jp-table .j-pill { white-space: nowrap; cursor: default; }
.j-pill.no { background: var(--surface-2); color: var(--text-3, #6b7090); border: 1px dashed var(--border); }
.jp-bar { height: 4px; width: 64px; margin: 4px 0 0 auto; border-radius: 999px; background: var(--bar-track, var(--surface-2)); overflow: hidden; }
.jp-bar span { display: block; height: 100%; background: var(--good); }
#jpMore { margin-top: 10px; }

/* แผนผัง Ads: ทุก ads ในช่องเดียว */
.flow-viewport.flow-all { max-height: 78vh; }
.flow-stack { width: max-content; min-width: 100%; }
.flow-stack .flow-ad { min-height: 0; padding: 22px 28px; border-bottom: 1px dashed var(--border); }
.flow-stack .flow-ad:last-child { border-bottom: 0; }
.flow-stack .flow-ad.focus { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.flow-stack .flow-source { display: block; color: inherit; text-decoration: none; flex: none; align-self: center; }
.flow-stack .flow-source:hover { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.flow-stack .flow-source-copy { gap: 2px; }
.flow-toolbar .search { min-width: 220px; }
.flow-stack .flow-ad.tall { align-items: flex-start; }
.flow-stack .flow-ad.tall .flow-source { align-self: flex-start; position: sticky; top: 8px; }
.flow-stack a.flow-source:not([href]):hover { box-shadow: var(--shadow); cursor: default; }

/* กล่องอธิบาย AVT / DI / IN */
.type-guide { margin: 12px 0 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.type-guide summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.type-guide .tg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0 8px; }
.type-guide .tg-item { display: grid; gap: 4px; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); }
.type-guide .tg-item .small { color: var(--text-2); }

/* ปุ่มลบแท็กในประวัติลูกค้า */
.tl .t { display: flex; align-items: center; gap: 8px; }
.tl-del { margin-left: auto; border: 1px solid transparent; background: none; color: var(--text-3); font: inherit; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 7px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.tl li:hover .tl-del, .tl-del:focus-visible, .tl-del.confirm { opacity: 1; }
.tl-del:hover { color: var(--drop); border-color: var(--border); }
.tl-del.confirm { color: #fff; background: var(--drop); }
@media (hover: none) { .tl-del { opacity: 1; } }
.tl-note { margin-top: 4px; }
.tl-edit:hover { color: var(--accent); }
.tl .w.edited { color: var(--accent); }
.order-edit { flex-wrap: wrap; font-weight: 500; }
.order-edit input { width: 110px; font: inherit; padding: 4px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); }

/* =========================================================
   โครงหน้าใหม่: เมนูข้างสีหมึก + แถบหัวหน้า (ชื่อหน้า + ช่วงเวลา)
   ========================================================= */
body { font-size: 15px; }
h1, h2, h3, .kpi .value, .num { font-variant-numeric: tabular-nums; }
.sidenav {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: 232px;
  display: flex; flex-direction: column; padding: 18px 14px 14px;
  background: var(--ink); color: #c9cee4; overflow-y: auto;
}
.sidenav .brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 6px; color: #fff; font-size: 19px; font-weight: 600; }
.sidenav .brand small { color: #8f96b4; letter-spacing: 0; font-weight: 400; font-size: 11.5px; }
.sidenav .brand-mark { flex: none; border-radius: 10px; }
.nav-group { margin: 22px 10px 6px; font-size: 12px; color: #7d84a3; }
.sidenav .tabs { display: flex; flex-direction: column; gap: 2px; }
.sidenav .tabs a, .side-btn {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 8px; background: none;
  color: #c9cee4; font-weight: 500; text-align: left; cursor: pointer;
}
.sidenav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidenav .tabs a:hover, .side-btn:hover { background: #1e2541; color: #fff; }
.sidenav .tabs a.on { background: #242c4d; color: #fff; }
.sidenav .tabs a.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--signal); }
.sidenav .tabs a.on svg { color: var(--signal); }
.sidenav a:focus-visible, .side-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid #262d4a; display: flex; flex-direction: column; gap: 2px; }
.side-btn { font-size: 14px; color: #a7aecb; }

.shell { margin-left: 232px; min-height: 100vh; }
.pagebar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px clamp(16px, 3vw, 36px); border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px);
}
.pagebar-title { margin-right: auto; font-weight: 600; color: var(--text-2); font-size: 14px; }
.pagebar .range { background: var(--surface); border: 1px solid var(--border); }
.pagebar .range button.on { background: var(--ink); color: #fff; box-shadow: none; }
:root[data-theme="dark"] .pagebar .range button.on { background: var(--accent-soft); color: var(--text); }
.menu-btn { display: none; }
.wrap { max-width: 1240px; padding: 26px clamp(16px, 3vw, 36px) 56px; }
body.no-chrome .chrome { display: none; }
body.no-chrome .shell { margin-left: 0; }

/* หัวข้อหน้า: เล็กลง ให้เนื้อหาเป็นพระเอก */
.wrap .page-heading { margin: 0 0 20px; }
.wrap .page-heading h1 { font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -.01em; line-height: 1.25; }
.wrap .page-heading .sub { margin-top: 4px; max-width: 70ch; }
.card { border-radius: var(--radius); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #262e4f; }
:root[data-theme="dark"] .btn.primary { background: var(--accent); border-color: var(--accent); color: #0f1322; }
.wrap .kpi:nth-child(3) { background: var(--surface); border-color: var(--border); }
.wrap .kpi:nth-child(3) .value { color: inherit; }

@media (max-width: 900px) {
  .sidenav { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.nav-open .sidenav { transform: none; }
  .nav-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(10, 14, 26, .45); }
  .shell { margin-left: 0; }
  .menu-btn { display: grid; }
  .pagebar { flex-wrap: wrap; padding: 8px 12px; }
  .pagebar .range { order: 3; width: 100%; }
  .pagebar .range button { flex: 1; padding: 5px 4px; }
}
@media (prefers-reduced-motion: reduce) { .sidenav { transition: none; } }

/* ---------- Dashboard: สรุปเป็นประโยค ---------- */
.brief { margin: 4px 0 26px; }
.brief-lead {
  margin: 0; max-width: 34em; font-size: clamp(22px, 2.5vw, 31px); line-height: 1.45; font-weight: 400;
  color: var(--text-2); text-wrap: pretty;
}
.brief-lead b { color: var(--text); font-weight: 600; white-space: nowrap; }
.brief-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; margin: 22px 0 0; border-top: 1px solid var(--border); }
.brief-facts > div { padding: 14px 18px 2px 0; }
.brief-facts > div + div { padding-left: 18px; border-left: 1px solid var(--border); }
.brief-facts dt { font-size: 13px; color: var(--text-3); }
.brief-facts dd { margin: 2px 0 0; }
.brief-facts dd.num { font-size: 26px; font-weight: 600; line-height: 1.2; }
.brief-facts .best dd:nth-of-type(1) { font-weight: 600; font-size: 16px; line-height: 1.35; margin-top: 4px; }
.brief-facts .best a { background: linear-gradient(transparent 62%, var(--signal) 62%); }
:root[data-theme="dark"] .brief-facts .best a { background: none; color: var(--signal); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 18px; }
.section-head .search { width: min(100%, 280px); align-self: center; }

/* ---------- ขั้นที่ลูกค้าไปถึง (แถบเดียว) ---------- */
.funnel-strip { padding: 18px 20px 16px; margin-bottom: 30px; }
.fs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.fs li { padding: 4px 14px 2px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fs li:first-child { padding-left: 0; }
.fs li + li { border-left: 1px solid var(--border); }
.fs-name { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); min-height: 36px; line-height: 1.3; }
.fs-name .node-badge { flex: none; }
.fs-n { font-size: 24px; font-weight: 600; line-height: 1.1; }
.fs-bar { height: 6px; border-radius: 99px; background: var(--bar-track); overflow: hidden; }
.fs-bar span { display: block; height: 100%; background: var(--bar); border-radius: inherit; }
.fs-foot { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; }
.fs-drop { color: var(--drop); }
.fs li.worst .fs-drop { font-weight: 600; background: var(--drop-soft); padding: 0 6px; border-radius: 6px; }

/* ---------- ตารางผลงานราย Ads ---------- */
.lb { padding: 0; overflow: hidden; }
.lb-row {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: minmax(220px, 2.4fr) 72px 104px 104px minmax(150px, 1.2fr) minmax(140px, 1fr);
  padding: 12px 18px; border-bottom: 1px solid var(--border); color: inherit;
}
.lb.has-spend .lb-row { grid-template-columns: minmax(220px, 2.4fr) 72px 104px 104px 116px minmax(150px, 1.2fr) minmax(140px, 1fr); }
.lb-row:last-child { border-bottom: 0; }
.lb-head { padding-block: 10px; font-size: 12.5px; color: var(--text-3); background: var(--surface-2); }
a.lb-row:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
a.lb-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lb-row .r { text-align: right; }
.lb-row small { display: block; font-size: 12px; }
.lb-l { display: none; }
.lb-ad { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lb-name { display: flex; flex-direction: column; min-width: 0; }
.lb-title { font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lb-name .ad-id { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.best-tag { align-self: flex-start; margin: 3px 0 2px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--signal); color: #1c2a06; }
.lb-row.is-best { box-shadow: inset 3px 0 0 var(--signal); }
.roas.pos { color: var(--good-text); }
.roas.neg { color: var(--drop); }
.minis { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; height: 44px; align-items: end; }
.mini { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 2px; }
.mini i { display: block; width: 100%; max-width: 18px; background: var(--bar); border-radius: 3px 3px 1px 1px; opacity: .85; }
.mini b { font-size: 10.5px; font-weight: 500; color: var(--text-3); line-height: 1; }
.mini.top i { background: var(--drop); opacity: 1; }
.mini.top b { color: var(--drop); font-weight: 600; }
.lb-drop { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.lb-drop .drop-chip { font-weight: 600; }
.lb-drop .small { line-height: 1.3; }
.lb-empty { padding: 24px 18px; margin: 0; }

@media (max-width: 1100px) {
  .lb-row, .lb.has-spend .lb-row { grid-template-columns: minmax(200px, 2fr) 64px 96px 100px minmax(130px, 1fr); }
  .lb.has-spend .lb-row { grid-template-columns: minmax(200px, 2fr) 64px 96px 100px 108px; }
  .lb-row .minis, .lb-head span:nth-last-child(2) { display: none; }
  .lb.has-spend .lb-row .lb-drop, .lb.has-spend .lb-head span:last-child { display: none; }
}
@media (max-width: 760px) {
  .fs { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .fs li:nth-child(3n+1) { padding-left: 0; border-left: 0; }
  .brief-facts > div + div { border-left: 0; padding-left: 0; }
  .brief-facts > div { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
  .lb-head { display: none; }
  .lb-row, .lb.has-spend .lb-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 14px 16px; }
  .lb.has-spend .lb-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lb-row .lb-ad { grid-column: 1 / -1; }
  .lb-row .r { text-align: left; }
  .lb-l { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 400; }
  .lb-row .minis { display: none; }
  .lb-row .lb-drop, .lb.has-spend .lb-row .lb-drop { display: flex; grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; }
}
@media (max-width: 760px) {
  .fs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fs li:nth-child(3n+1) { padding-left: 14px; border-left: 1px solid var(--border); }
  .fs li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .fs-name { min-height: 0; }
  .toolbar .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .toolbar .seg button { white-space: nowrap; }
  .section-head .search { width: 100%; }
}

/* ล้างข้อมูลลูกค้า */
.danger-zone { border-color: color-mix(in srgb, var(--drop) 40%, var(--border)); }
.danger-zone h2 { color: var(--drop); }
.danger-zone p { max-width: 70ch; }
.dz-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.dz-row input { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-width: 180px; font: inherit; }
.btn.danger { background: var(--drop); border-color: var(--drop); color: #fff; }
.btn.danger:disabled { opacity: .45; cursor: not-allowed; }
.danger-zone { padding: 18px 20px; margin-top: 16px; }

/* ---------- ตรวจข้อมูล + นับยอดขายตาม ---------- */
.basis-bar { margin: 4px 0 0; }
.basis-bar .seg { margin-left: 0; }
.basis-note { flex: 1 1 320px; }
.hc-list { list-style: none; padding: 0; margin: 18px 0 8px; display: grid; gap: 8px; }
.hc-item { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); padding: 12px 14px; }
.hc-item.ok { border-left-color: var(--good-text, #11801a); }
.hc-item.warn { border-left-color: #d08a00; }
.hc-item.bad { border-left-color: var(--drop); }
.hc-item.info { border-left-color: var(--border); }
.hc-level { flex: none; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); min-width: 52px; text-align: center; }
.hc-item.ok .hc-level { color: var(--good-text, #11801a); }
.hc-item.warn .hc-level { color: #a86e00; }
.hc-item.bad .hc-level { color: var(--drop); }
.hc-title { font-weight: 600; }
.fbt.hc-table { min-width: 640px; }
.hc-errors { margin: 10px 0 0; font-size: 13px; }
.hc-table-wrap, .hc-errors, .hc-list { margin-bottom: 28px; }
@media (max-width: 700px) { .fbt.hc-table { min-width: 520px; } }
.hc-errors summary { cursor: pointer; color: var(--text-2); }
.hc-errors li { margin: 6px 0; overflow-wrap: anywhere; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.linkish:hover { text-decoration: underline; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.mv-select { width: 100%; margin-top: 8px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.cost-dialog .search { width: 100%; }

/* ---------- หน้าวิเคราะห์ ----------
   .card ของระบบไม่มี padding ในตัว ทุกกล่องในหน้านี้ใส่ padding เอง และทุกแถวมี min-width: 0 กันล้นกรอบ */
.an-note { color: var(--text-2); margin: 4px 0 14px; max-width: 80ch; }
.an-warn { background: var(--drop-soft); color: var(--drop); padding: 10px 14px; border-radius: 10px; margin: 0 0 14px; }
.an-warn a { color: inherit; font-weight: 600; }
.an-acc { padding: 18px 20px 6px; margin-bottom: 20px; min-width: 0; }
.an-acc > .section-head { margin-bottom: 4px; }
.an-acc > .section-head .muted { overflow-wrap: anywhere; }
.an-group { margin-top: 16px; }
.an-gh { font-size: 15px; font-weight: 600; margin: 0 0 4px; display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.an-gh .small { font-weight: 400; flex-basis: 100%; padding-left: 32px; }
details.an-group > summary { cursor: pointer; padding: 6px 0; }
.an-badge { flex: none; width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 12px; background: var(--surface-2); color: var(--text-2); }
.an-badge.v-scale { background: var(--good-soft); color: var(--good-text); }
.an-badge.v-fix, .an-badge.v-stop { background: var(--drop-soft); color: var(--drop); }
.an-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(0, 400px); gap: 10px 16px; align-items: start;
  padding: 14px 0; border-top: 1px solid var(--border); color: inherit; text-decoration: none; min-width: 0; }
a.an-row:hover .an-name { text-decoration: underline; }
.an-row .thumb { width: 52px; height: 52px; font-size: 15px; }
.an-main { min-width: 0; }
.an-name { font-weight: 600; overflow-wrap: anywhere; }
.an-reasons { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.an-reasons li + li { margin-top: 3px; }
.an-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 12px; margin: 0; text-align: right; min-width: 0; }
.an-nums > div { min-width: 0; }
.an-nums dt { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.an-nums dd { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) {
  .an-row { grid-template-columns: 52px minmax(0, 1fr); }
  .an-nums { grid-column: 2 / -1; text-align: left; }
}
@media (max-width: 560px) {
  .an-acc { padding: 14px 14px 4px; }
  .an-row { grid-template-columns: 40px minmax(0, 1fr); gap: 8px 12px; }
  .an-row .thumb { width: 40px; height: 40px; font-size: 13px; }
  .an-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-gh .small { padding-left: 0; }
}

/* ---------- A/B Testing ---------- */
.seg.ab-tabs { margin: 0 0 16px; }
.seg.ab-tabs a { padding: 6px 14px; border-radius: 8px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.seg.ab-tabs a.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.ab-list { padding: 0 20px; }
.ab-list .empty { padding: 40px 0; }
.ab-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.ab-item:first-child { border-top: 0; }
.ab-item > div { min-width: 0; }
.ab-item .muted { overflow-wrap: anywhere; }
.ab-item:hover .an-name { text-decoration: underline; }
.ab-res { text-align: right; }
.ab-win { color: var(--good-text); }
@media (max-width: 640px) { .ab-item { grid-template-columns: minmax(0, 1fr); } .ab-res { text-align: left; } .ab-list { padding: 0 14px; } }

.ab-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; padding: 20px; align-items: end; }
.ab-form label { display: grid; gap: 5px; font-size: 13px; color: var(--text-2); min-width: 0; }
.ab-form .full { grid-column: 1 / -1; }
.ab-form input, .ab-form select, .ab-end textarea { width: 100%; min-width: 0; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); }
.ab-pick-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.ab-pick-head .search { width: min(100%, 320px); min-width: 0; }
.ab-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; max-height: 440px; overflow: auto; padding: 2px; }
.ab-card { display: flex; gap: 10px; align-items: center; min-width: 0; text-align: left; font: inherit; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; cursor: pointer; }
.ab-card > span { min-width: 0; overflow-wrap: anywhere; }
.ab-card .thumb { width: 44px; height: 44px; font-size: 13px; }
.ab-card.on { border-color: var(--accent); background: var(--accent-soft); }
.ab-card:disabled { opacity: .4; cursor: not-allowed; }
.ab-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .ab-form { grid-template-columns: minmax(0, 1fr); padding: 16px; } }

.ab-hyp { margin: -8px 0 14px; color: var(--text-2); }
.ab-verdict { padding: 16px 20px; margin-bottom: 14px; font-size: 16px; }
.ab-verdict .muted { margin-top: 6px; font-size: 13px; }
.ab-verdict.win { border-left: 4px solid var(--good-text); }
.ab-variants { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 14px; margin: 0 0 14px; }
.ab-var { display: flex; flex-direction: column; gap: 8px; padding: 14px; min-width: 0; }
.ab-var.best { border-color: var(--good-text); box-shadow: 0 0 0 1px var(--good-text), var(--shadow); }
.ab-var .thumb { width: 100%; height: 170px; font-size: 24px; }
.ab-var .thumb.ph { height: 64px; }
.ab-var .an-name, .ab-var details, .ab-var .small { overflow-wrap: anywhere; }
.ab-var details summary { cursor: pointer; color: var(--text-2); }
.ab-label { font-weight: 700; color: var(--accent); }
.ab-table-card { padding: 0; margin-bottom: 14px; }
.ab-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ab-table tbody th { width: 34%; }
.ab-table th, .ab-table td { padding: 9px 16px; border-top: 1px solid var(--border); }
.ab-table thead th { border-top: 0; font-size: 13px; color: var(--text-2); }
.ab-table tbody th { text-align: left; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.ab-table td { white-space: nowrap; }
.ab-table td.best { background: var(--good-soft); }
.ab-end { padding: 18px 20px; }
.ab-end h2 { margin: 0 0 10px; font-size: 18px; }
.ab-end form { display: grid; gap: 10px; max-width: 680px; }
.ab-end label:not(.ab-radio) { display: grid; gap: 5px; font-size: 13px; color: var(--text-2); }
.ab-radio { display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.ab-radio input { margin-top: 4px; flex: none; }
.ab-end .ab-actions { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); justify-content: space-between; align-items: center; }
.ab-del { opacity: 1; border-color: var(--border); }

.ab-learn { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 16px; margin-bottom: 12px; }
.ab-learn.no-img { grid-template-columns: minmax(0, 1fr); }
.ab-learn .thumb { width: 72px; height: 72px; }
.ab-learn > div { min-width: 0; overflow-wrap: anywhere; }
.ab-learn-t { font-size: 15px; font-weight: 600; margin: 4px 0 6px; }
.ab-filters select { min-width: 0; max-width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; }
@media (max-width: 560px) { .ab-learn { grid-template-columns: 48px minmax(0, 1fr); padding: 14px; } .ab-learn .thumb { width: 48px; height: 48px; } }
@media (max-width: 560px) {
  .ab-variants { gap: 10px; }
  .ab-var { padding: 10px; gap: 6px; }
  .ab-var .thumb { height: 110px; }
  .ab-var .thumb.ph { height: 48px; }
  .ab-table { font-size: 13px; }
  .ab-table th, .ab-table td { padding: 8px 10px; }
  .ab-table tbody th { width: auto; white-space: normal; }
  .ab-verdict, .ab-end { padding: 14px 16px; }
}

/* ---------- สรุปลูกค้า ---------- */
.au-acc { padding: 18px 20px; margin-bottom: 20px; min-width: 0; }
.au-acc h3 { font-size: 15px; margin: 18px 0 8px; }
.au-acc .section-head + .au-grid h3 { margin-top: 4px; }
.au-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; }
.au-bars, .au-courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.au-bars li { display: grid; grid-template-columns: minmax(64px, 90px) minmax(0, 1fr) 44px minmax(36px, auto); gap: 10px; align-items: center; font-size: 14px; }
.au-k { overflow-wrap: anywhere; }
.au-v { text-align: right; font-weight: 600; }
.au-n { text-align: right; }
.au-bar { display: block; height: 8px; border-radius: 99px; background: var(--bar-track); overflow: hidden; min-width: 0; }
.au-bar i { display: block; height: 100%; background: var(--bar); border-radius: inherit; }
.au-note { color: var(--text-2); margin: 10px 0 0; }
.au-courses { counter-reset: c; }
.au-courses li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 190px; gap: 6px 14px; align-items: center; font-size: 14px; }
.au-cname { font-weight: 600; overflow-wrap: anywhere; }
.au-courses li::before { counter-increment: c; content: counter(c) '.'; position: absolute; margin-left: -22px; color: var(--text-3); }
.au-courses { padding-left: 22px; }
.au-courses li { position: relative; }
.au-cnum { white-space: nowrap; color: var(--text-2); text-align: right; }
@media (max-width: 760px) {
  .au-grid { grid-template-columns: minmax(0, 1fr); }
  .au-courses li { grid-template-columns: minmax(0, 1fr) auto; }
  .au-courses .au-bar { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 560px) { .au-acc { padding: 14px; } }

/* ---------- มือถือ: ทั้งระบบ ----------
   ตารางหลายคอลัมน์ = การ์ดบนจอแคบ, ตารางเทียบจุดหลุด = ล็อกคอลัมน์ชื่อ ads, ปุ่ม/ช่องกรอกใหญ่พอกดด้วยนิ้ว */
@media (max-width: 760px) {
  .fbt-wrap.fbt-cards { overflow: visible; background: none; border: 0; box-shadow: none; }
  .fbt-cards .fbt { min-width: 0; display: block; }
  .fbt-cards .fbt thead { display: none; }
  .fbt-cards .fbt tbody { display: grid; gap: 12px; }
  .fbt-cards .fbt tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 14px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
  .fbt-cards .fbt td { display: block; padding: 0; border: 0; text-align: left; white-space: normal; min-width: 0; }
  .fbt-cards .fbt td:first-child { grid-column: 1 / -1; }
  .fbt-cards .fbt td.c-status { grid-column: 1 / -1; margin-top: -4px; }
  .fbt-cards .fbt td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 500; color: var(--text-3, #6b7090); margin-bottom: 2px; }
  .fbt-cards .fbt-ad { min-width: 0; }
  .fbt-cards .fbt td[colspan] { grid-column: 1 / -1; }

  .heat th:first-child, .heat td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
  .heat .adcell { min-width: 132px; max-width: 160px; gap: 8px; }
  .heat .adcell .thumb { width: 30px; height: 30px; font-size: 11px; }
  .heat .adcell .ad-id { display: none; }
  .heat td.cell { min-width: 64px; }

  .btn, .seg button, .seg a { min-height: 38px; }
  .btn { display: inline-flex; align-items: center; justify-content: center; }
  .seg button, .seg a { display: inline-flex; align-items: center; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 40px; font-size: 16px; }
  .tl-del, .cost-btn, .linkbtn, .back { min-height: 32px; display: inline-flex; align-items: center; }
  .tl-del { padding: 4px 10px; }
  .drawer { padding: 16px; }
}

/* เส้นทางลูกค้า: กลุ่มไม่ทราบ ads */
.j-link.t-unknown, .j-bar.t-unknown rect { fill: var(--text-3); }

/* ตรวจทุกหน้า 30 พ.ย. */
.path-row { grid-template-columns: minmax(0, 1fr) 180px; }
.bf-label .node-badge { flex: none; }
.post-full { max-height: 260px; overflow-y: auto; }
.fb-pill { white-space: nowrap; }
.heat th { white-space: normal; vertical-align: bottom; }
@media (min-width: 901px) {
  .fbt { min-width: 1000px; }
  .fbt th, .fbt td { padding-left: 8px; padding-right: 8px; }
  .fbt .fbt-ad { min-width: 170px; max-width: 260px; }
  .heat td, .heat th { padding-left: 6px; padding-right: 6px; }
  .heat td.cell { min-width: 64px; }
  .heat .adcell { min-width: 170px; }
}
@media (max-width: 700px) { .path-row { grid-template-columns: 1fr; gap: 6px; } }
.seg button.on .muted { color: inherit; opacity: .8; }
body:not(.nav-open) .sidenav { box-shadow: none; }
.toolbar .seg:first-child { margin-left: 0; }

/* ---------- Log จาก CRMixer ---------- */
.lg-tools select { min-width: 0; max-width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; }
.lg-tools .search { flex: 1 1 240px; }
.lg-when { white-space: nowrap; }
.lg-sum { overflow-wrap: anywhere; max-width: 420px; }
.lg-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.lg-pill.ok { background: var(--good-soft); color: var(--good-text); }
.lg-pill.wait { background: var(--wait-soft); color: var(--wait); }
.lg-pill.bad { background: var(--drop-soft); color: var(--drop); }
.lg-dh { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.lg-dh h2 { margin: 0; }
.lg-meta { margin: 6px 0 0; }
.lg-fields { margin: 16px 0; }
.lg-fields > div { padding: 10px 0; border-top: 1px solid var(--border); }
.lg-fields dt { font-size: 12.5px; color: var(--text-2); }
.lg-fields dd { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow-y: auto; }
.lg-fields code, .lg-ftable code { font-size: 11.5px; color: var(--text-3); }
.lg-raw summary { cursor: pointer; color: var(--text-2); }
.lg-raw pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; background: var(--surface-2); padding: 12px; border-radius: 9px; max-height: 320px; overflow-y: auto; }
.lg-ftable { table-layout: fixed; }
.fbt.lg-ftable { min-width: 640px; }
.lg-table td, .lg-ftable td { vertical-align: top; }
.fbt.lg-table { min-width: 720px; }
@media (max-width: 700px) {
  .fbt.lg-table { min-width: 0; display: block; }
  .lg-table thead { display: none; }
  .lg-table tbody { display: block; }
  .lg-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .lg-table td { display: block; padding: 0 !important; border: 0; max-width: none; text-align: left; }
  .lg-table td:nth-child(1) { order: 3; color: var(--text-2); font-size: 12.5px; align-self: center; }
  .lg-table td:nth-child(2) { order: 1; font-weight: 600; }
  .lg-table td:nth-child(3) { order: 5; grid-column: 1 / -1; }
  .lg-table td:nth-child(4) { order: 6; grid-column: 1 / -1; }
  .lg-table td:nth-child(5) { order: 2; }
  .lg-table td:nth-child(6) { order: 4; }
  .lg-table td[colspan] { grid-column: 1 / -1; }
}
