/* ---------------------------------------------------------------
   Commart AIFORCE 2026 — COMSET explorer
   ธีมมืด, ตัวอักษรไทยฝังมากับเว็บ (ไม่ต้องพึ่ง Google Fonts)
   --------------------------------------------------------------- */

@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/noto-sans-thai-thai.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/noto-sans-thai-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/noto-sans-thai-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0a0e1a;
  --surface: #0e1626;
  --surface-2: #111a2e;
  --line: #1d2a45;
  --line-soft: #17213a;
  --fg: #e9eefb;
  --fg-dim: #b9c7e2;
  --muted: #93a4c6;
  --accent: #7dd3fc;
  --price: #86efac;
  --radius: 12px;
  --font: "Noto Sans Thai", -apple-system, system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1500px; margin: 0 auto; padding: 28px 18px 64px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- hero */
.hero h1 { font-size: clamp(20px, 2.4vw, 27px); margin: 0 0 10px; letter-spacing: -0.2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: #132038; color: var(--accent); border: 1px solid #1e3350;
}
.lede { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; max-width: 80ch; }
.lede strong { color: var(--fg); }

/* ---------------------------------------------------------------- stats */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.stat {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.stat__label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.stat__value { font-size: 26px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat__meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- insights */
.insights {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 10px; margin: 0 0 22px;
}
.insight {
  display: flex; flex-direction: column; gap: 3px;
  background: #0f1a2d; border: 1px solid var(--line); border-left: 3px solid #3b82f6;
  border-radius: 10px; padding: 10px 12px;
}
.insight__label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.insight__value { color: var(--fg); font-size: 15px; }
.insight__detail { font-size: 12px; color: var(--fg-dim); }

/* ---------------------------------------------------------------- toolbar */
.toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--bg); padding: 10px 0; margin-bottom: 12px;
  border-bottom: 1px solid #16203a;
}
.search { flex: 1 1 240px; display: flex; }
input[type="search"], select {
  width: 100%; padding: 9px 12px; font-family: inherit; font-size: 13.5px;
  color: var(--fg); background: var(--surface-2);
  border: 1px solid #22314f; border-radius: 9px;
}
input[type="search"]::placeholder { color: #7385a6; }
input[type="search"]:focus, select:focus { outline: 2px solid #2563eb; outline-offset: 1px; border-color: #3b82f6; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 7px 14px; font-family: inherit; font-size: 13px; cursor: pointer;
  color: #c7d3ea; background: var(--surface-2);
  border: 1px solid #22314f; border-radius: 999px;
}
.chip:hover { border-color: #3b82f6; color: #fff; }
.chip.is-active { background: #1d4ed8; border-color: #3b82f6; color: #fff; }
.sort { flex: 0 0 auto; }
.toolbar__count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toolbar__link { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.toolbar__link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- table */
.table-wrap {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
table { border-collapse: collapse; width: 100%; min-width: 1180px; font-size: 12.5px; }
thead th {
  background: #111c31; text-align: left; padding: 10px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
  border-bottom: 1px solid #22314f;
}
thead th.is-sortable { cursor: pointer; user-select: none; }
thead th.is-sortable:hover { color: var(--accent); }
thead th[aria-sort="ascending"]::after { content: " ▲"; font-size: 9px; color: var(--accent); }
thead th[aria-sort="descending"]::after { content: " ▼"; font-size: 9px; color: var(--accent); }
tbody td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:hover td { background: #131e33; }
tbody tr.is-hidden { display: none; }

.cell-price { color: var(--price); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-price s { display: block; color: #6b7a99; font-weight: 400; font-size: 10.5px; }
.cell-name { font-weight: 600; min-width: 150px; }
.cell-empty { color: #6b7a99; }

.badge {
  display: inline-block; padding: 2px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.shop--banana { background: #3b2a00; color: #fbbf24; border-color: #6b4b00; }
.shop--jib { background: #0b2f4a; color: #60a5fa; border-color: #155e75; }
.shop--itcity { background: #301040; color: #c084fc; border-color: #5b21b6; }
.shop--speed { background: #3a0f1c; color: #fb7185; border-color: #7f1d1d; }
.shop--generic { background: #1c2436; color: #cbd5e1; border-color: #334155; }

details summary { cursor: pointer; color: var(--accent); font-size: 11.5px; }
details .detail { margin-top: 5px; color: var(--fg-dim); font-size: 11.5px; }
details .detail b { color: var(--fg); font-weight: 600; }

.empty { padding: 26px; text-align: center; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- bands */
.bands { margin-top: 26px; }
.bands h2 { font-size: 15px; margin: 0 0 10px; color: var(--fg-dim); font-weight: 600; }
.bands__table {
  min-width: 0; width: auto; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.bands__table th, .bands__table td { padding: 7px 14px; text-align: right; border-bottom: 1px solid var(--line-soft); }
.bands__table thead th { background: #111c31; }
.bands__table tbody th { text-align: left; font-weight: 500; color: var(--fg-dim); }
.bands__table td { font-variant-numeric: tabular-nums; color: var(--fg-dim); }
.bands__table .bands__total { color: var(--fg); font-weight: 600; }
.bands__table tr:last-child th, .bands__table tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- footer */
.foot { margin-top: 26px; color: #7b8aa8; font-size: 12px; line-height: 1.6; }
.foot a { color: var(--accent); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot__meta { color: #64748b; }

@media (max-width: 720px) {
  .wrap { padding: 18px 12px 48px; }
  .toolbar { position: static; }
  .stat__value { font-size: 22px; }
}
