/* RabbitX AI · Work Surface — โทเคนและอีลิเมนต์ตาม "มาตรฐานไอคอนและอีลิเมนต์ v1"
   ทุกค่าอยู่บนสเกลชุดเดียว: ไอคอน 14/16/18/20/24 · กรอบไอคอน 28→8 32→9 36→10 40→12 44→13 52→15 · ปุ่ม 24/34/36/38/44/52 · รัศมี 9/12/16/22/999 */

:root {
  /* RabbitXAI Brand Identity Guideline v1.0 — ตัวอักษร: Manrope (EN) + IBM Plex Sans Thai (TH) · สี: AI Orange / Vivid Orange / Rabbit Black / Graphite / Titanium Silver / Cloud Gray */
  --f: 'IBM Plex Sans Thai', 'Manrope', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Thonburi', sans-serif;
  --f-en: 'Manrope', 'IBM Plex Sans Thai', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --o: #ff6a00; /* AI Orange — Energy / Highlight */
  --o-deep: #e05d00;
  --o-vivid: #ff8a00; /* Vivid Orange — Accent / CTA */
  --o-tint: #fff2e8;
  --o-tint-2: #ffe3cc;
  --o-line: #ffc39c;
  --ok: #0e9e70;
  --ok-tint: #e6f6f0;
  --warn: #b45309;
  --warn-tint: #fdf3e2;
  --bad: #b42318;
  --bad-tint: #fdecea;

  --ink: #0b0b0d; /* Rabbit Black — Primary */
  --ink-2: #2e3238; /* Graphite — Secondary */
  --mute: #5f6670;
  --faint: #8b929b;
  --line: #e4e8ed;
  --line-2: #c9ced6; /* Titanium Silver — Tech / Robot */
  --paper: #f4f6f8; /* Cloud Gray — Background */
  --bg-soft: #f9fafb;
  --bg: #ffffff;

  --r-sm: 9px;
  --r: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --pill: 999px;

  --sh-1: 0 1px 2px rgba(11, 11, 13, 0.05), 0 1px 6px rgba(11, 11, 13, 0.04);
  --sh-2: 0 4px 14px rgba(11, 11, 13, 0.08), 0 1px 3px rgba(11, 11, 13, 0.05);
  --sh-3: 0 18px 50px rgba(11, 11, 13, 0.18), 0 4px 12px rgba(11, 11, 13, 0.08);

  --wrap: 1120px;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 500 15px/1.55 var(--f);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--o-deep);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--o);
  outline-offset: 2px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: clamp(18px, 4vw, 34px);
}
kbd {
  font: 600 11px/1 var(--mono);
  color: var(--mute);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 3px 5px;
}

/* ---------- icons ---------- */
.ico {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  vertical-align: middle;
  color: currentColor;
}
.ico svg {
  display: block;
}
.ico-14 {
  width: 14px;
  height: 14px;
}
.ico-16 {
  width: 16px;
  height: 16px;
}
.ico-18 {
  width: 18px;
  height: 18px;
}
.ico-20 {
  width: 20px;
  height: 20px;
}
.ico-24 {
  width: 24px;
  height: 24px;
}

/* ---------- icon tiles (ขนาดคู่กับรัศมีเสมอ) ---------- */
.tile {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--paper);
  color: var(--ink-2);
}
.tile-28 {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.tile-32 {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.tile-36 {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.tile-40 {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.tile-44 {
  width: 44px;
  height: 44px;
  border-radius: 13px;
}
.tile-52 {
  width: 52px;
  height: 52px;
  border-radius: 15px;
}
.tile-o {
  background: var(--o-tint-2);
  color: var(--o-deep);
}
.tile-ok {
  background: var(--ok-tint);
  color: var(--ok);
}
.tile-warn {
  background: var(--warn-tint);
  color: var(--warn);
}

/* ---------- controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s, transform 0.08s;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}
.btn-p {
  background: var(--o-vivid);
  color: #fff;
}
.btn-p:hover:not(:disabled) {
  background: var(--o);
}
.btn-o {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-o:hover:not(:disabled) {
  border-color: var(--o-line);
  background: var(--o-tint);
  color: var(--o-deep);
}
.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: var(--r-sm);
}
.btn-ghost {
  background: transparent;
  color: var(--mute);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--paper);
  color: var(--ink);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 10px;
  border-radius: var(--pill);
  background: #fff;
  border: 1px solid var(--line-2);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.chip .d {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-2);
  flex: 0 0 auto;
}
.chip:hover,
.chip.on {
  border-color: var(--o-line);
  background: var(--o-tint);
  color: var(--o-deep);
}
.chip.on .d {
  background: var(--o);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--pill);
  font: 600 11.5px/1 var(--f);
  white-space: nowrap;
}
.b-local {
  background: var(--ok-tint);
  color: var(--ok);
}
.b-server {
  background: var(--warn-tint);
  color: var(--warn);
}
.b-soon {
  background: var(--paper);
  color: var(--mute);
}

.seg {
  display: inline-flex;
  height: 38px;
  padding: 3px;
  border-radius: var(--r);
  background: var(--paper);
  gap: 2px;
  width: 100%;
}
.seg button {
  flex: 1;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--mute);
  padding: 0 10px;
}
.seg button.on {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--sh-1);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > label {
  font: 700 11px/1 var(--f);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.field input[type='text'],
.field input[type='number'],
.field select,
.field textarea {
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: #fff;
  width: 100%;
  font-size: 15px;
}
.field textarea {
  height: auto;
  min-height: 88px;
  padding: 12px 14px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--o);
  outline: none;
  box-shadow: 0 0 0 3px var(--o-tint-2);
}
.field .hint {
  font-size: 12.5px;
  color: var(--mute);
}
input[type='range'] {
  width: 100%;
  accent-color: var(--o);
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 34px);
  height: 62px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand:hover {
  text-decoration: none;
}
.brand-m {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.brand-m img,
.brand-m svg {
  width: 32px;
  height: 32px;
  display: block;
}
.brand-t em {
  font-style: normal;
  color: var(--o);
}
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
}
.nav-links a:hover {
  background: var(--paper);
  text-decoration: none;
}
.nav-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-k {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--mute);
  font-size: 13.5px;
  font-weight: 600;
}
.nav-k:hover {
  border-color: var(--o-line);
  color: var(--o-deep);
}
.kbd-k {
  font: 600 10.5px/1 var(--mono);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 3px 5px;
  color: var(--faint);
}
.lang {
  position: relative;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-2);
}
.lang-btn:hover {
  background: var(--paper);
}
.lang-btn .cc {
  font: 600 10.5px/1 var(--mono);
  color: var(--faint);
}
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-2);
  padding: 6px;
  display: none;
}
.lang-menu.open {
  display: block;
}
.lang-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
}
.lang-menu button:hover,
.lang-menu button.on {
  background: var(--o-tint);
  color: var(--o-deep);
}

@media (max-width: 720px) {
  .nav-links,
  .nav-k span,
  .nav-k .kbd-k,
  .lang-btn .nm {
    display: none;
  }
  .nav-k {
    padding: 0 10px;
  }
}

/* ---------- work surface ---------- */
.surface {
  background: linear-gradient(180deg, var(--bg-soft) 0%, #fff 70%);
  padding: clamp(36px, 6vw, 72px) 0 40px;
}
.s-lede {
  max-width: 640px;
  margin-bottom: 26px;
}
.s-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--o-deep);
  background: var(--o-tint);
  border: 1px solid var(--o-line);
  padding: 6px 10px 6px 6px;
  border-radius: var(--pill);
  margin-bottom: 16px;
}
.s-eyebrow img,
.s-eyebrow svg {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}
.s-lede h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.14;
}
.s-lede h1 em {
  font-style: normal;
  color: var(--o);
}
.s-sub {
  margin-top: 14px;
  font-size: 16px;
  color: var(--mute);
  line-height: 1.6;
  max-width: 56ch;
}

.drop {
  position: relative;
  border: 2px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: #fff;
  padding: clamp(28px, 5vw, 44px) 24px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.drop:hover,
.drop:focus-visible {
  border-color: var(--o-line);
  box-shadow: var(--sh-1);
}
.drop.over {
  border-color: var(--o);
  background: var(--o-tint);
  box-shadow: var(--sh-2);
}
.drop-ic {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: var(--o-tint-2);
  color: var(--o-deep);
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.drop-t {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.drop-s {
  font-size: 14px;
  color: var(--mute);
  max-width: 48ch;
}
.drop-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--faint);
  font-size: 13.5px;
}
.drop-or button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.drop-or button:hover {
  border-color: var(--o-line);
  color: var(--o-deep);
  background: var(--o-tint);
}
.drop-types {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}
.drop-types span {
  font: 600 10.5px/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--faint);
  background: var(--paper);
  border-radius: 6px;
  padding: 5px 7px;
}
.promise {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--mute);
}
.promise .ico {
  color: var(--ok);
}

.recent {
  margin-top: 30px;
}
.recent[hidden] {
  display: none;
}
.recent-h {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font: 700 11px/1 var(--f);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}
.recent-h button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--mute);
  font: 600 12.5px/1 var(--f);
  letter-spacing: 0;
  text-transform: none;
}
.recent-h button:hover {
  color: var(--o-deep);
}
.recent-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- panel (พื้นที่ทำงานของเครื่องมือ) ---------- */
.panel {
  margin-top: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  overflow: hidden;
}
.panel[hidden] {
  display: none;
}
.p-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.p-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.p-t {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.p-s {
  font-size: 12.5px;
  color: var(--mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--mute);
  display: grid;
  place-items: center;
}
.p-close:hover {
  background: var(--paper);
  color: var(--ink);
}
.p-body {
  padding: 20px 16px;
  display: grid;
  gap: 18px;
}
.p-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.p-foot:empty {
  display: none;
}
.p-foot .grow {
  flex: 1;
}
.p-foot .stat {
  font: 600 12.5px/1.4 var(--mono);
  color: var(--mute);
}
.p-foot .stat b {
  color: var(--ink);
  font-weight: 600;
}
.p-foot .stat .ok {
  color: var(--ok);
}

/* เลือกเครื่องมือสำหรับไฟล์ที่วาง */
.tool-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.tool-pick button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}
.tool-pick button:hover {
  border-color: var(--o-line);
  background: var(--o-tint);
  box-shadow: var(--sh-1);
}
.tool-pick button:hover .tile {
  background: #fff;
  color: var(--o-deep);
}
.tool-pick .tp-t {
  display: block;
  font-weight: 700;
  font-size: 14.5px;
}
.tool-pick .tp-s {
  display: block;
  font-size: 12.5px;
  color: var(--mute);
}

/* พรีวิว + ผลลัพธ์ */
.preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.preview figure {
  margin: 0;
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.preview figure img,
.preview figure video,
.preview figure canvas {
  max-width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: contain;
  border-radius: 10px;
  background: repeating-conic-gradient(#ecebe9 0 25%, #fff 0 50%) 0 0/16px 16px;
  margin-inline: auto;
}
.preview figcaption {
  font: 600 12px/1.4 var(--mono);
  color: var(--mute);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.preview figcaption b {
  color: var(--ink);
  font-weight: 600;
}
.opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  align-items: end;
}
.result {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--ok-tint);
  color: var(--ok);
  font-weight: 600;
}
.result.warn {
  background: var(--warn-tint);
  color: var(--warn);
}
.result.bad {
  background: var(--bad-tint);
  color: var(--bad);
}
.calc-out {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.calc-out div {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.calc-out label {
  display: block;
  font: 700 11px/1 var(--f);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}
.calc-out output {
  display: block;
  font: 600 22px/1.2 var(--mono);
  color: var(--ink);
  letter-spacing: -0.02em;
}
.calc-out div.hi {
  background: var(--o-tint);
}
.calc-out div.hi output {
  color: var(--o-deep);
}
.rec-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 14px/1 var(--mono);
  color: var(--mute);
}
.rec-status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-2);
}
.rec-status.live .dot {
  background: var(--bad);
  animation: blink 1s infinite;
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rec-status.live .dot {
    animation: none;
  }
}

/* ---------- tools directory ---------- */
.tools {
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
}
.t-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.t-head h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.022em;
}
.t-head p {
  margin-top: 6px;
  color: var(--mute);
  font-size: 14.5px;
}
.t-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.cat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cat-h {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cat-h h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.cat-h p {
  font-size: 13px;
  color: var(--mute);
}
.cat ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat li button,
.cat li a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}
.cat li button:hover,
.cat li a:hover {
  background: var(--o-tint);
  color: var(--o-deep);
  text-decoration: none;
}
.cat li .ico {
  color: var(--mute);
}
.cat li button:hover .ico,
.cat li a:hover .ico {
  color: var(--o-deep);
}
.cat li .nm {
  flex: 1;
}
.cat li .badge {
  height: 22px;
  font-size: 11px;
}
.cat li.soon button {
  color: var(--faint);
  cursor: default;
}
.cat li.soon button:hover {
  background: transparent;
  color: var(--faint);
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 36px 0 28px;
}
.foot {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.foot-note {
  max-width: 62ch;
  font-size: 14px;
  color: var(--mute);
  line-height: 1.7;
}
.foot-note b {
  color: var(--ink);
}
.foot-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.foot-links a {
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
}
.foot-b {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font: 600 12px/1.4 var(--mono);
  color: var(--faint);
}

/* ---------- command palette ---------- */
.pal-bg {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(26, 21, 18, 0.42);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.pal-bg.open {
  display: flex;
}
.pal {
  width: 100%;
  max-width: 600px;
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  overflow: hidden;
}
.pal-in {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--mute);
}
.pal-in input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 16px;
  font-weight: 500;
  background: transparent;
  min-width: 0;
}
.pal-list {
  max-height: 46vh;
  overflow-y: auto;
  padding: 8px;
}
.pal-list button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
}
.pal-list button .pl-t {
  display: block;
  font-weight: 700;
  font-size: 14.5px;
}
.pal-list button .pl-s {
  display: block;
  font-size: 12.5px;
  color: var(--mute);
}
.pal-list button.on,
.pal-list button:hover {
  background: var(--o-tint);
}
.pal-list button.on .pl-t {
  color: var(--o-deep);
}
.pal-list .pl-cat {
  margin-left: auto;
  font: 600 10.5px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.pal-empty {
  padding: 22px;
  text-align: center;
  color: var(--mute);
  font-size: 14px;
}
.pal-foot {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 12px;
  color: var(--mute);
}

@media (max-width: 640px) {
  .preview {
    grid-template-columns: 1fr;
  }
  .p-body {
    padding: 16px 12px;
  }
}

/* จอแคบ: ซ่อนป้ายในแถบหัวพาเนล ให้ชื่อเครื่องมือมีที่พอ */
.p-t {
  overflow-wrap: anywhere;
}
@media (max-width: 560px) {
  #p-badge {
    display: none;
  }
}

/* ---------- ตารางรายการใบเสนอราคา ---------- */
.inv-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.inv-items th {
  text-align: left;
  font: 700 11px/1 var(--f);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 6px 8px;
}
.inv-items td {
  padding: 4px 6px 4px 0;
  vertical-align: middle;
}
.inv-items td:last-child {
  padding-right: 0;
}
.inv-items input {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: #fff;
  width: 100%;
  font-size: 14px;
}
.inv-items input:focus {
  border-color: var(--o);
  outline: none;
  box-shadow: 0 0 0 3px var(--o-tint-2);
}
.inv-items .amt {
  text-align: right;
  white-space: nowrap;
  color: var(--ink-2);
}
@media (max-width: 640px) {
  .inv-items th:nth-child(4), .inv-items td:nth-child(4) { display: none; }
}

/* ---------- drop zone แบบกะทัดรัด (v2 ปรับใหม่): ไอคอน | ข้อความ | ชนิดไฟล์ | ปุ่ม ---------- */
.drop {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
}
.drop .drop-ic {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  margin: 0;
}
.drop-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 200px;
}
.drop .drop-t {
  font-size: 17px;
}
.drop .drop-s {
  font-size: 13px;
  max-width: none;
}
.drop .drop-types {
  margin: 0;
  justify-content: flex-start;
}
.drop .drop-or {
  margin: 0;
  flex-wrap: nowrap;
}
@media (max-width: 860px) {
  .drop {
    flex-wrap: wrap;
  }
  .drop .drop-types {
    order: 3;
    flex-basis: 100%;
  }
  .drop .drop-or {
    order: 4;
    flex-basis: 100%;
    flex-wrap: wrap;
  }
  .drop .drop-or button {
    flex: 1;
    justify-content: center;
  }
}

/* ---------- แถบกรองหมวดเครื่องมือ ติดใต้ nav ---------- */
.tools {
  padding-top: 0;
}
.fbar {
  position: sticky;
  top: 62px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.fbar-in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 10px clamp(18px, 4vw, 34px);
  display: flex;
  align-items: center;
  gap: 14px;
}
.fchips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  padding: 2px 0;
}
.fchips::-webkit-scrollbar {
  display: none;
}
.fchips .chip {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px 0 10px;
  font-size: 13px;
}
.fbar .t-legend {
  flex: 0 0 auto;
}
@media (max-width: 720px) {
  .fbar .t-legend {
    display: none;
  }
}
.cats .cat[hidden] {
  display: none;
}
@media (max-width: 720px) {
  .drop-or .kbd-k {
    display: none;
  }
}

/* ---------- หน้าเครื่องมือแบบ static (SEO) ---------- */
.seo-page {
  padding-bottom: 56px;
}
.crumbs {
  font-size: 13px;
  color: var(--mute);
  margin-bottom: 18px;
}
.crumbs a {
  color: var(--mute);
}
.seo-page .s-lede {
  max-width: 760px;
}
.seo-page h1 {
  font-size: clamp(28px, 4vw, 40px);
}
.cta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.cta-note {
  font-size: 13px;
  color: var(--mute);
}
.seo-body {
  max-width: 760px;
  margin-top: 34px;
  font-size: 16px;
  line-height: 1.75;
}
.seo-body .lead {
  font-size: 17px;
  color: var(--ink-2);
}
.seo-body h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 30px 0 10px;
}
.seo-body .steps {
  padding-left: 0;
  list-style: none;
  counter-reset: st;
  display: grid;
  gap: 8px;
}
.seo-body .steps li {
  counter-increment: st;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.seo-body .steps li::before {
  content: counter(st);
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--o);
  color: #fff;
  font: 700 13px/28px var(--mono);
  text-align: center;
}
.seo-body .faq {
  margin: 0;
}
.seo-body .faq dt {
  font-weight: 700;
  margin-top: 14px;
}
.seo-body .faq dd {
  margin: 4px 0 0;
  color: var(--ink-2);
}
.seo-body .rel {
  padding-left: 18px;
}
.seo-body .rel li {
  margin: 6px 0;
}
/* รายการ static ในหน้าแรก (ก่อน JS วาดทับ) ให้ดูเหมือนปุ่ม */
.cat li a {
  text-decoration: none;
}

/* โลโก้ Shut up PDF ในหน้าหมวด PDF */
.brand-logo {
  margin: 0 0 10px;
}
.brand-logo img {
  width: min(320px, 70vw);
  height: auto;
}

/* ---------- โลโก้แบรนด์ RabbitXAI (ไฟล์ทางการ) ---------- */
.brand-h {
  height: 44px;
  width: auto;
  display: block;
}
@media (max-width: 720px) {
  .brand-h {
    height: 36px;
  }
}

/* ---------- ตัวอักษรตามไกด์ไลน์: Manrope สำหรับหัวข้อ/ตัวเลข, IBM Plex Sans Thai สำหรับข้อความ ---------- */
h1,
h2,
h3,
.btn,
.chip,
.badge,
.nav-links a,
.drop-t,
.p-t,
.calc-out output,
.pl-t {
  font-family: var(--f-en);
}
.seo-page h1,
.cat-h h3 {
  letter-spacing: -0.025em;
}
