/* ═══ หน้าความเร็วบอทแบบสด (/speed.php) — prefix sp- ═════════════════════
   มาตรวัดเข็ม · ตัวเลขวินาทีใหญ่ · จำลองส่งข้อความจับเวลา · แท่งแยกส่วนเวลา · กราฟ 60 นาที · การกระจาย · ฮีตแมป 7 วัน
   ══════════════════════════════════════════════════════════════════════ */
.sp { --sp-out: cubic-bezier(.22, 1, .36, 1); overflow-x: clip; }
.sp-sec { padding-top: 52px; padding-bottom: 52px; }
.sp-note { color: var(--muted); font-size: .8rem; margin: 12px 0 0; }

/* hero */
.sp-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; padding-top: 52px; padding-bottom: 20px; }
.sp-hero h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.18; margin: 0 0 14px; }
.sp-lead { color: var(--muted); font-size: 1.04rem; max-width: 560px; margin: 0 0 20px; }
.sp-wins { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(4, 11, 9, .6); border: 1px solid var(--border); margin-bottom: 18px; }
.sp-wins button { border: 0; background: none; color: var(--muted); padding: 7px 14px; border-radius: 10px; font-size: .86rem; transition: .2s; }
.sp-wins button.on { background: linear-gradient(135deg, rgba(33, 160, 64, .5), rgba(182, 240, 156, .25)); color: #fff; box-shadow: 0 0 16px rgba(102, 221, 79, .3); }
.sp-big { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sp-bigc { padding: 16px 18px; border-radius: 18px; border: 1px solid var(--border); background: rgba(10, 24, 19, .7); display: grid; gap: 4px; }
.sp-bigc.ours { border-color: rgba(182, 240, 156, .45); background: radial-gradient(120% 120% at 0 0, rgba(102, 221, 79, .22), transparent 60%), rgba(10, 24, 19, .75); box-shadow: 0 0 30px rgba(102, 221, 79, .18); }
.sp-bigc span { font-size: .84rem; color: var(--muted); }
.sp-bigc em { font-style: normal; font-size: .74rem; color: var(--dim); }
.sp-bigc b { display: flex; align-items: baseline; gap: 8px; }
.sp-bigc b i { font-style: normal; font-family: var(--mono); font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; color: #fff; }
.sp-bigc.ours b i { color: var(--accent); text-shadow: 0 0 24px rgba(182, 240, 156, .55); }
.sp-bigc small { color: var(--muted); font-size: .9rem; }
.sp-chips { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: .86rem; }
.sp-chips li { display: flex; align-items: center; gap: 6px; }
.sp-chips b { color: #fff; font-family: var(--mono); }
.sp-chips .ico { color: var(--accent); }

.sp-gauge-wrap { position: relative; justify-self: center; width: 100%; max-width: 440px; }
.sp-gauge { width: 100%; height: auto; display: block; overflow: visible; }
.sp-g-track { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 22; stroke-linecap: round; }
.sp-g-arc { fill: none; stroke-width: 14; stroke-linecap: round; stroke-dasharray: 377; stroke-dashoffset: 377; animation: sp-draw 1.6s var(--sp-out) .2s forwards; }
@keyframes sp-draw { to { stroke-dashoffset: 0; } }
.sp-g-ticks line { stroke: rgba(230, 235, 234, .45); stroke-width: 2; }
.sp-g-needle { transform-origin: 160px 180px; transform: rotate(-90deg); transition: transform 1.2s var(--sp-out); }
.sp-g-needle line { stroke: #eef3f1; stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(182, 240, 156, .9)); }
.sp-g-needle circle { fill: #0c1a15; stroke: #b6f09c; stroke-width: 3; }
.sp-g-pulse { fill: none; stroke: rgba(182, 240, 156, .5); transform-origin: 160px 180px; animation: sp-pulse 2s ease-out infinite; }
@keyframes sp-pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
.sp-g-read { text-align: center; display: grid; margin-top: 6px; }
.sp-g-read b { font-family: var(--mono); font-size: clamp(1.8rem, 4vw, 2.5rem); color: #fff; text-shadow: 0 0 20px rgba(102, 221, 79, .6); }
.sp-g-read span { font-size: .8rem; color: var(--muted); }
.sp-g-scale { display: flex; justify-content: space-between; padding: 0 8%; margin-top: -14px; font-size: .76rem; color: var(--dim); }

/* ลองส่ง */
.sp-try { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.sp-phone { padding: 0; display: flex; flex-direction: column; min-height: 380px; }
.sp-phone > * { position: relative; z-index: 1; }
.sp-ph-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: rgba(4, 11, 9, .5); }
.sp-ph-top b { flex: 1; font-size: .9rem; }
.sp-watch { font-family: var(--mono); font-size: 1.05rem; color: #ffe08a; padding: 4px 10px; border-radius: 10px; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35); min-width: 92px; text-align: center; }
.sp-watch.done { animation: sp-flash .8s var(--sp-out); }
@keyframes sp-flash { 30% { background: rgba(182, 240, 156, .35); color: #fff; transform: scale(1.08); } }
.sp-chat { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; background: linear-gradient(180deg, #8aa6c9, #7c98bb); }
.sp-hint { margin: auto; color: rgba(255, 255, 255, .9); font-size: .86rem; }
.sp-msg { display: flex; animation: sp-in .35s var(--sp-out); }
.sp-msg span { max-width: 80%; padding: 8px 12px; border-radius: 16px; font-size: .88rem; line-height: 1.45; display: grid; gap: 2px; }
.sp-msg.me { justify-content: flex-end; }
.sp-msg.me span { background: #8fe381; color: #10231a; border-bottom-right-radius: 4px; }
.sp-msg.bot span { background: #fff; color: #10231a; border-bottom-left-radius: 4px; }
.sp-msg.bot small { color: #2f8a45; font-weight: 700; font-size: .72rem; }
.sp-msg.typing span { display: flex; gap: 4px; padding: 12px 14px; }
.sp-msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa8a3; animation: sp-dot 1s infinite; }
.sp-msg.typing i:nth-child(2) { animation-delay: .15s; }
.sp-msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sp-dot { 50% { transform: translateY(-4px); opacity: .5; } }
@keyframes sp-in { from { opacity: 0; transform: translateY(8px); } }
.sp-send { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: rgba(4, 11, 9, .5); flex-wrap: wrap; }
.sp-send button { flex: 1; min-width: 90px; padding: 10px 12px; border-radius: 12px; border: 0; font-weight: 700; color: #04140b; background: linear-gradient(135deg, #66dd4f, #b6f09c); box-shadow: 0 0 16px rgba(102, 221, 79, .35); transition: transform .2s; }
.sp-send button:hover { transform: translateY(-2px); }
.sp-lane { padding: 18px; }
.sp-lane > * { position: relative; z-index: 1; }
.sp-lane h3 { margin: 0 0 12px; font-size: 1.05rem; }
.sp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; position: relative; }
.sp-steps::before { content: ""; position: absolute; left: 21px; top: 20px; bottom: 20px; width: 2px; background: rgba(110, 224, 90, .2); }
.sp-steps li { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px 10px 0; border-radius: 14px; transition: background .3s; }
.sp-steps li > span { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.2rem; background: var(--surface-solid); border: 1px solid var(--border); position: relative; z-index: 1; transition: .3s; }
.sp-steps li div { display: grid; }
.sp-steps small { color: var(--muted); font-size: .76rem; }
.sp-steps em { font-style: normal; font-family: var(--mono); font-size: 1.1rem; color: #fff; }
.sp-steps li.line em { color: #a9b8b2; }
.sp-steps li.ours em { color: var(--accent); }
.sp-steps li.on { background: rgba(102, 221, 79, .1); }
.sp-steps li.on > span { border-color: var(--accent); box-shadow: 0 0 18px rgba(102, 221, 79, .6); }
.sp-steps li.done > span { background: rgba(33, 160, 64, .35); border-color: rgba(182, 240, 156, .5); }

/* แท่งแยกส่วน */
.sp-break { padding: 22px; }
.sp-break > * { position: relative; z-index: 1; }
.sp-stack { display: flex; height: 54px; border-radius: 16px; overflow: hidden; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--border); }
.sp-seg { flex: 0 0 var(--w); background: var(--c); display: grid; place-items: center; color: #04140b; font-family: var(--mono); font-size: .86rem; transform-origin: left; animation: sp-grow .9s var(--sp-out) var(--d) both; border-right: 2px solid rgba(4, 11, 9, .6); }
.sp-seg.sp-l { color: #eef3f1; background: repeating-linear-gradient(135deg, #5d6f68 0 10px, #6c7f78 10px 20px); }
@keyframes sp-grow { from { transform: scaleX(0); } }
.sp-legend { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.sp-legend li { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .03); font-size: .84rem; }
.sp-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.sp-legend span { display: grid; }
.sp-legend small { color: var(--muted); font-size: .7rem; }
.sp-legend b { font-family: var(--mono); }
.sp-share { margin: 14px 0 0; color: var(--muted); font-size: .9rem; }
.sp-share b.ours { color: var(--accent); }

/* แผงคู่ */
.sp-grid2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.sp-panel { padding: 16px 18px; }
.sp-panel > * { position: relative; z-index: 1; }
.sp-panel h4 { margin: 0 0 12px; font-size: .95rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sp-panel h4 small { color: var(--muted); font-weight: 400; font-size: .76rem; }
.sp-lg { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: .72rem; color: var(--muted); font-weight: 400; }
.sp-lg i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.sp-lg i.t { background: #b6f09c; }
.sp-lg i.t9 { background: repeating-linear-gradient(90deg, #fbbf24 0 4px, transparent 4px 7px); }
.sp-lg i.p { background: #2aabee; }
.sp-line { width: 100%; height: 220px; display: block; }
.sp-line .gl { stroke: rgba(110, 224, 90, .1); stroke-width: 1; }
.sp-line text { fill: var(--dim); font-size: 11px; font-family: var(--mono); }
.sp-line .vol { fill: rgba(182, 240, 156, .12); }
.sp-line path { fill: none; stroke-width: 2.4; vector-effect: non-scaling-stroke; }
.sp-line path.area { fill: url(#spa); stroke: none; }
.sp-line .t { stroke: #b6f09c; filter: drop-shadow(0 0 5px rgba(182, 240, 156, .7)); }
.sp-line .t9 { stroke: #fbbf24; stroke-dasharray: 5 5; stroke-width: 1.6; opacity: .85; }
.sp-line .p { stroke: #2aabee; filter: drop-shadow(0 0 4px rgba(42, 171, 238, .7)); }
.sp-line .now { fill: #fff; stroke: #66dd4f; stroke-width: 3; animation: sp-blink 1.2s ease-in-out infinite; }
@keyframes sp-blink { 50% { opacity: .35; } }
.sp-xaxis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--dim); margin-top: 4px; }
.sp-hist { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; height: 200px; align-items: end; padding-bottom: 18px; background: linear-gradient(rgba(110, 224, 90, .08) 1px, transparent 1px) 0 0 / 100% 50px; }
.sp-hist span { position: relative; height: 100%; display: flex; align-items: flex-end; }
.sp-hist i { width: 100%; height: var(--h); border-radius: 4px 4px 1px 1px; transform-origin: bottom; animation: sp-up .9s var(--sp-out) var(--d) both; }
.sp-hist .ok i { background: linear-gradient(180deg, #b6f09c, #21a040); box-shadow: 0 0 10px rgba(102, 221, 79, .4); }
.sp-hist .mid i { background: linear-gradient(180deg, #ffe08a, #f59e0b); }
.sp-hist .slow i { background: linear-gradient(180deg, #ffb3c0, #fb7185); }
.sp-hist em { position: absolute; bottom: -17px; left: -6px; right: -6px; text-align: center; font-style: normal; font-size: .62rem; color: var(--dim); font-family: var(--mono); }
@keyframes sp-up { from { transform: scaleY(0); } }
.sp-histnote { margin: 12px 0 0; font-size: .9rem; color: var(--muted); }
.sp-histnote b { color: var(--accent); font-family: var(--mono); }

.sp-heat { display: grid; grid-template-columns: 52px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; font-size: .66rem; color: var(--muted); }
.sp-heat > em { font-style: normal; font-family: var(--mono); font-size: .6rem; color: var(--dim); white-space: nowrap; overflow: visible; }
.sp-heat > b { font-weight: 500; white-space: nowrap; }
.sp-heat i { aspect-ratio: 1; border-radius: 3px; background: var(--c); box-shadow: 0 0 6px color-mix(in srgb, var(--c) 50%, transparent); animation: sp-pop .5s var(--sp-out) both; }
.sp-heat i.none { background: rgba(255, 255, 255, .04); box-shadow: none; }
@keyframes sp-pop { from { transform: scale(.3); opacity: 0; } }
.sp-heatlg { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .74rem; color: var(--muted); }
.sp-heatlg i { width: 110px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, hsl(130 75% 52%), hsl(60 75% 50%), hsl(5 75% 48%)); }
.sp-heatlg em { margin-left: auto; font-style: normal; color: var(--dim); }
.sp-cmds { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sp-cmds li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 62px; gap: 10px; align-items: center; font-size: .82rem; animation: sp-in .5s var(--sp-out) var(--d) both; }
.sp-cmds li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-cmds li i { position: relative; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.sp-cmds li em { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, #21a040, #b6f09c); box-shadow: 0 0 10px rgba(102, 221, 79, .5); z-index: 1; }
.sp-cmds li em.p9 { background: rgba(251, 191, 36, .28); box-shadow: none; z-index: 0; }
.sp-cmds li b { font-family: var(--mono); text-align: right; color: var(--accent); }
.sp-cmds li.empty { display: block; color: var(--muted); }
.sp-dailyp { margin-top: 16px; }
.sp-daily { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; height: 140px; align-items: end; padding-bottom: 16px; }
.sp-daily span { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.sp-daily i { width: 40%; height: var(--h); border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, #b6f09c, #21a040); }
.sp-daily i.p { height: var(--h2); background: linear-gradient(180deg, #7fd0ff, #2aabee); }
.sp-daily em { position: absolute; bottom: -15px; font-style: normal; font-size: .62rem; color: var(--dim); }

.sp-how { max-width: 860px; margin: 0 auto; padding: 22px 24px; border-radius: 18px; border: 1px dashed var(--border-hi); background: rgba(33, 160, 64, .06); }
.sp-how h3 { margin: 0 0 10px; }
.sp-how ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); font-size: .92rem; }
.sp-how b { color: #fff; }

/* ส่วนบนหน้าแรก */
.sp-home { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.3fr; gap: 12px; align-items: stretch; }
.sp-hk { padding: 18px; display: grid; gap: 4px; align-content: center; }
.sp-hk > * { position: relative; z-index: 1; }
.sp-hk span { color: var(--muted); font-size: .82rem; }
.sp-hk b { font-family: var(--mono); font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.1; color: #fff; }
.sp-hk b small { font-family: var(--font); font-size: .9rem; color: var(--muted); margin-left: 4px; }
.sp-hk.ours b { color: var(--accent); text-shadow: 0 0 20px rgba(182, 240, 156, .5); }
.sp-hk em { font-style: normal; font-size: .74rem; color: var(--dim); }
.sp-hspark { padding: 14px 16px; display: grid; gap: 6px; }
.sp-hspark > * { position: relative; z-index: 1; }
.sp-hspark svg { width: 100%; height: 90px; display: block; }
.sp-hspark path { fill: none; stroke: #b6f09c; stroke-width: 2.2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 5px rgba(182, 240, 156, .7)); }
.sp-hspark path.p { stroke: #2aabee; }
.sp-hspark a { justify-self: start; color: var(--accent); font-weight: 600; font-size: .86rem; }

@media (max-width: 1000px) {
  .sp-hero { grid-template-columns: 1fr; text-align: center; }
  .sp-lead { margin-left: auto; margin-right: auto; }
  .sp-chips { justify-content: center; }
  .sp-big { text-align: left; }
  .sp-try, .sp-grid2 { grid-template-columns: 1fr; }
  .sp-home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-hspark { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .sp-big { grid-template-columns: 1fr; }
  .sp-wins { display: flex; }
  .sp-wins button { flex: 1; padding: 7px 4px; }
  .sp-heat { grid-template-columns: 40px repeat(24, minmax(0, 1fr)); gap: 2px; }
  .sp-cmds li { grid-template-columns: minmax(0, 1fr) 70px 54px; }
  .sp-stack { height: 44px; }
  .sp-home { grid-template-columns: 1fr 1fr; }
  .sp-hk:first-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .sp *, .sp *::before, .sp-home * { animation: none !important; }
  .sp-g-arc { stroke-dashoffset: 0; }
}

/* รายงานรายเดือน */
.sp-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.sp-month { padding: 16px; display: grid; gap: 10px; animation: sp-in .6s var(--sp-out) var(--d) both; }
.sp-month > * { position: relative; z-index: 1; }
.sp-month.cur { border-color: rgba(182, 240, 156, .5); box-shadow: 0 0 30px rgba(102, 221, 79, .2); }
.sp-month header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sp-month header em { font-style: normal; font-size: .74rem; color: var(--muted); }
.sp-ring { position: relative; width: 132px; height: 132px; margin: 0 auto; }
.sp-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sp-ring .trk { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 11; }
.sp-ring .val { fill: none; stroke: #66dd4f; stroke-width: 11; stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: calc(314 - 314 * var(--p) / 100); filter: drop-shadow(0 0 6px rgba(102, 221, 79, .7)); transition: stroke-dashoffset 1.2s var(--sp-out); }
.sp-ring span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.sp-ring b { font-family: var(--mono); font-size: 1.45rem; color: var(--accent); }
.sp-ring small { font-size: .72rem; color: var(--muted); }
.sp-month ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .84rem; }
.sp-month li { display: flex; justify-content: space-between; gap: 8px; }
.sp-month li span { color: var(--muted); }
.sp-month li b { font-family: var(--mono); }
.sp-d30p { margin-top: 16px; }
.sp-d30 { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; height: 150px; align-items: end; padding-bottom: 16px; }
.sp-d30 span { position: relative; height: 100%; display: flex; align-items: flex-end; }
.sp-d30 i { width: 100%; height: var(--h); border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, #b6f09c, #21a040); transform-origin: bottom; animation: sp-up .8s var(--sp-out) var(--d) both; }
.sp-d30 u { position: absolute; left: 50%; bottom: var(--y); width: 7px; height: 7px; margin: 0 0 -3px -3.5px; border-radius: 50%; background: #2aabee; box-shadow: 0 0 8px #2aabee; }
.sp-d30 em { position: absolute; bottom: -15px; left: 0; right: 0; text-align: center; font-style: normal; font-size: .58rem; color: var(--dim); }
.sp-print { text-align: center; margin-top: 18px; }
@media print {
  .nav-wrap, .fab, .fx-bg, .foot, .sp-hero, .sp-sec:not(#monthly), .sp-print { display: none !important; }
  body { background: #fff; color: #111; }
  .sp-month, .sp-panel { background: #fff !important; border: 1px solid #ccc !important; box-shadow: none !important; color: #111; }
  .sp-month li span, .sp-month header em { color: #555; }
}
