/* ระบบยานพาหนะ · โรงเรียนประสาทวิทยาคาร — สีประจำโรงเรียน แสด-ขาว */
:root {
  --orange: #F26522;
  --orange-2: #FF8A3D;
  --orange-d: #C9480F;
  --orange-50: #FFF4EC;
  --orange-100: #FFE3D1;
  --gold: #E8A317;
  --ink: #2B1A10;
  --ink-2: #6B5446;
  --line: #F3DCCB;
  --card: rgba(255, 255, 255, .86);
  --red: #E0352B;
  --amber: #F59E0B;
  --green: #16A34A;
  --blue: #2563EB;
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(201, 72, 15, .28), 0 2px 6px rgba(0, 0, 0, .04);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font-family: 'Sarabun', system-ui, sans-serif; font-size: 16px; line-height: 1.55;
  color: var(--ink); background: #FFF8F2;
}
h1, h2, h3, h4, .tabs b, button, .stat b { font-family: 'Prompt', 'Sarabun', sans-serif; }
img { max-width: 100%; }
button { cursor: pointer; font: inherit; }

/* พื้นหลังเบลอ ๆ จาง ๆ มีสีสัน — วางรูปโรงเรียนไว้ที่ assets/school-bg.jpg จะใช้ก่อน */
.bg {
  position: fixed; inset: -40px; z-index: -1;
  background:
    radial-gradient(60% 50% at 10% 10%, rgba(255, 138, 61, .35), transparent 70%),
    radial-gradient(50% 45% at 95% 20%, rgba(232, 163, 23, .25), transparent 70%),
    radial-gradient(55% 50% at 80% 95%, rgba(242, 101, 34, .22), transparent 70%),
    url('assets/school-bg.jpg') center/cover,
    url('assets/bg-banner.jpg') center/cover;
  filter: blur(18px) saturate(1.2);
  opacity: .75;
}
.bg::after { content: ''; position: absolute; inset: 0; background: rgba(255, 250, 245, .42); }

/* ───── Tabs ───── */
.tabs {
  position: sticky; top: 0; z-index: 30; display: flex; gap: 6px; justify-content: center;
  padding: 10px 12px; background: rgba(255, 255, 255, .78); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.tabs button {
  position: relative; display: flex; align-items: center; gap: 6px; border: 0; background: transparent;
  padding: 9px 16px; border-radius: 99px; color: var(--ink-2); font-weight: 500; transition: .2s;
}
.tabs button span { font-size: 18px; }
.tabs button:hover { background: var(--orange-50); color: var(--orange-d); }
.tabs button.active { background: var(--orange); color: #fff; box-shadow: 0 6px 16px -6px rgba(242, 101, 34, .8); }
.badge {
  position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font: 600 11px/18px 'Prompt'; font-style: normal; text-align: center;
  box-shadow: 0 0 0 2px #fff; animation: pulse 2s infinite;
}
@keyframes pulse { 50% { transform: scale(1.15); } }

/* ───── Layout ───── */
main { max-width: 1240px; margin: 0 auto; padding: 20px clamp(12px, 3vw, 28px) 120px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.section-head h2 { margin: 0; font-size: clamp(18px, 2.4vw, 24px); }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(4, 1fr); }
.two { grid-template-columns: 1.4fr 1fr; }
.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  background: var(--card); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.card h3 { margin: 0 0 10px; font-size: 17px; display: flex; align-items: center; gap: 8px; }

.stat { display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden; }
.stat img { width: 52px; height: 52px; flex: none; }
.stat b { display: block; font-size: 30px; line-height: 1; }
.stat small { color: var(--ink-2); }
.stat::after { content: ''; position: absolute; right: -30px; bottom: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--tint, var(--orange-100)); opacity: .6; }
.stat.red { --tint: #FFE0DC; } .stat.red b { color: var(--red); }
.stat.amber { --tint: #FFF0C7; } .stat.amber b { color: #B45309; }
.stat.green { --tint: #D9F5E3; } .stat.green b { color: var(--green); }

/* Vehicle card */
.vcard { cursor: pointer; transition: transform .2s, box-shadow .2s; padding: 0; overflow: hidden; }
.vcard:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -16px rgba(201, 72, 15, .45); }
.vcard .top { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: linear-gradient(135deg, var(--orange-50), #fff); }
.vcard .ico { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: #fff; box-shadow: var(--shadow); flex: none; }
.vcard .ico img { width: 40px; height: 40px; }
.vcard .plate { font: 600 18px 'Prompt'; }
.vcard .meta { color: var(--ink-2); font-size: 14px; }
.vcard .body { padding: 12px 16px 14px; display: grid; gap: 8px; }
.row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.row span:first-child { color: var(--ink-2); }
.bar { height: 8px; border-radius: 99px; background: #F5E8DE; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #4ADE80); }
.bar i.soon { background: linear-gradient(90deg, var(--amber), #FCD34D); }
.bar i.overdue { background: linear-gradient(90deg, var(--red), #F87171); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font: 500 12.5px 'Prompt'; white-space: nowrap; }
.pill.ok, .pill.พร้อมใช้, .pill.เสร็จ, .pill.อนุมัติ { background: #DCFCE7; color: #166534; }
.pill.soon, .pill.ขออนุมัติ, .pill.รออนุมัติ { background: #FEF3C7; color: #92400E; }
.pill.overdue, .pill.ซ่อม, .pill.ด่วน, .pill.แจ้งซ่อม, .pill.ไม่อนุมัติ { background: #FEE2E2; color: #991B1B; }
.pill.กำลังซ่อม { background: #DBEAFE; color: #1E40AF; }
.pill.งดใช้, .pill.จำหน่าย, .pill.nodata { background: #E5E7EB; color: #374151; }

/* Alert list */
.alist { display: grid; gap: 8px; }
.aitem {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px; background: #fff; border-left: 4px solid var(--amber); cursor: pointer;
}
.aitem.overdue { border-left-color: var(--red); background: #FFF7F6; }
.aitem .e { font-size: 26px; text-align: center; }
.aitem b { font-family: 'Prompt'; font-weight: 500; }
.aitem small { display: block; color: var(--ink-2); }
.empty { text-align: center; padding: 28px 10px; color: var(--ink-2); }
.empty img { width: 72px; height: 72px; display: block; margin: 0 auto 8px; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; background: #fff; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #F6E7DC; white-space: nowrap; }
th { background: var(--orange-50); font: 500 13.5px 'Prompt'; color: var(--orange-d); position: sticky; top: 0; }
tr:hover td { background: #FFFBF8; }
td.wrap { white-space: normal; min-width: 200px; }

/* Buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px;
  padding: 10px 16px; font-weight: 500; background: var(--orange); color: #fff; transition: .15s;
  box-shadow: 0 6px 16px -8px rgba(242, 101, 34, .9);
}
.btn:hover { background: var(--orange-d); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: #fff; color: var(--orange-d); border: 1.5px solid var(--orange-100); box-shadow: none; }
.btn.ghost:hover { background: var(--orange-50); }
.btn.sm { padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.danger { background: var(--red); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { flex: 1; min-width: 180px; }

form.f { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 14px; }
form.f .full { grid-column: 1 / -1; }
label.l { display: grid; gap: 4px; font: 500 14px 'Prompt'; color: var(--ink-2); }
input, select, textarea {
  width: 100%; font: 16px 'Sarabun'; color: var(--ink); padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(242, 101, 34, .15); }
textarea { min-height: 80px; resize: vertical; }
fieldset { border: 1.5px dashed var(--line); border-radius: 14px; padding: 10px 14px; margin: 0; }
legend { font: 500 14px 'Prompt'; color: var(--orange-d); padding: 0 6px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.check { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--orange-50); font-size: 14.5px; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); }
.items-table input { padding: 6px 8px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; grid-column: 1 / -1; margin-top: 4px; }

/* ───── Modal ───── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; display: grid; grid-template-columns: minmax(0, 760px); justify-content: center; align-items: center; padding: 16px;
  background: rgba(43, 26, 16, .45); backdrop-filter: blur(6px); animation: fade .2s;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%; min-width: 0; max-height: min(92vh, 920px); display: flex; flex-direction: column;
  background: #fff; border-radius: 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); animation: pop .28s cubic-bezier(.2, 1.4, .4, 1);
}
.modal > header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--orange-50), #fff); border-radius: 22px 22px 0 0;
}
.modal h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 16px 18px 20px; overflow-y: auto; }
.x { border: 0; background: rgba(0, 0, 0, .05); width: 34px; height: 34px; border-radius: 50%; font-size: 15px; color: var(--ink-2); flex: none; }
.x:hover { background: var(--orange-100); color: var(--orange-d); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.96); } }

.subtabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.subtabs button { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px; white-space: nowrap; color: var(--ink-2); }
.subtabs button.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.kv div { padding: 8px 10px; border-radius: 10px; background: var(--orange-50); }
.kv small { display: block; color: var(--ink-2); font-size: 12.5px; }
.kv b { font-weight: 600; word-break: break-all; }

/* ───── Toast ───── */
.toasts { position: fixed; z-index: 100; top: 14px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); }
.toast {
  display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; background: #fff;
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .3); border-left: 5px solid var(--green); animation: slide .35s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
.toast span { font-size: 22px; }
@keyframes slide { from { opacity: 0; transform: translateY(-16px); } }

/* ───── FAB ───── */
.fab-wrap { position: fixed; z-index: 60; right: 20px; bottom: calc(96px + var(--safe-b)); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab {
  width: 58px; height: 58px; border-radius: 50%; border: 0; color: #fff; font-size: 30px; line-height: 1;
  background: linear-gradient(135deg, var(--orange-2), var(--orange-d)); box-shadow: 0 12px 26px -8px rgba(201, 72, 15, .8); transition: transform .25s;
}
.fab-wrap.open .fab { transform: rotate(45deg); }
.fab-menu { display: none; flex-direction: column; align-items: flex-end; gap: 8px; }
.fab-wrap.open .fab-menu { display: flex; }
.fab-menu button {
  border: 0; background: #fff; padding: 10px 16px; border-radius: 99px; box-shadow: var(--shadow); font-weight: 500; white-space: nowrap;
  animation: pop .25s backwards;
}
.fab-menu button:nth-child(2) { animation-delay: .03s; } .fab-menu button:nth-child(3) { animation-delay: .06s; }
.fab-menu button:nth-child(4) { animation-delay: .09s; } .fab-menu button:nth-child(5) { animation-delay: .12s; }
.fab-menu button:hover { background: var(--orange-50); }

/* ───── Chat ───── */
.chat-launch {
  position: fixed; z-index: 61; right: 20px; bottom: calc(24px + var(--safe-b)); width: 60px; height: 60px; border-radius: 50%;
  border: 3px solid #fff; background: linear-gradient(135deg, #fff, var(--orange-100)); box-shadow: 0 12px 26px -8px rgba(201, 72, 15, .7);
  display: grid; place-items: center;
}
.chat-launch .dot { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--red); border: 2px solid #fff; display: none; }
.chat-launch .dot.on { display: block; animation: pulse 1.6s infinite; }
.chat {
  position: fixed; z-index: 90; right: 20px; bottom: calc(96px + var(--safe-b)); width: min(390px, calc(100vw - 24px)); height: min(600px, calc(100vh - 140px));
  display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: #fff; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45);
  animation: pop .3s cubic-bezier(.2, 1.4, .4, 1); transform-origin: bottom right;
}
.chat[hidden] { display: none; }
.chat > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; background: linear-gradient(115deg, var(--orange-d), var(--orange-2)); }
.chat > header div { flex: 1; }
.chat > header small { display: block; opacity: .9; font-size: 12px; }
.chat > header .x { background: rgba(255, 255, 255, .2); color: #fff; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(#FFF8F2, #fff); }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 15px; animation: pop .25s; }
.msg.bot { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--orange); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg ul { margin: 6px 0 0; padding-left: 18px; }
.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--orange-2); animation: typing 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 50% { transform: translateY(-5px); opacity: .4; } }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; }
.chips button { flex: none; border: 1.5px solid var(--orange-100); background: var(--orange-50); color: var(--orange-d); border-radius: 99px; padding: 5px 12px; font-size: 13.5px; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px calc(12px + var(--safe-b)); }
.chat-input input { border-radius: 99px; }
.chat-input button { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--orange); color: #fff; font-size: 18px; }

/* ───── Misc ───── */
.loading { display: grid; place-items: center; gap: 12px; padding: 80px 0; color: var(--ink-2); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--orange-100); border-top-color: var(--orange); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.demo-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: #FEF3C7; color: #92400E; }
.muted { color: var(--ink-2); }
.mt { margin-top: 14px; }
.chart-bars { display: grid; gap: 8px; }
.chart-bars .r { display: grid; grid-template-columns: 110px 1fr 90px; gap: 10px; align-items: center; font-size: 14px; }
.chart-bars .r .bar { height: 14px; }
.chart-bars .r .bar i { background: linear-gradient(90deg, var(--orange), var(--orange-2)); }
.chart-bars .r span:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ───── Responsive: iPad ───── */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
}

/* ───── Responsive: มือถือ ───── */
@media (max-width: 700px) {

  /* แถบเมนูย้ายลงล่างจอ */
  .tabs {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; justify-content: space-around; gap: 0;
    padding: 6px 4px calc(6px + var(--safe-b)); border-top: 1px solid var(--line); border-bottom: 0;
  }
  .tabs button { flex-direction: column; gap: 0; padding: 4px 6px; border-radius: 12px; font-size: 11.5px; min-width: 60px; }
  .tabs button span { font-size: 21px; }
  .tabs button.active { background: var(--orange-50); color: var(--orange-d); box-shadow: none; }
  .badge { right: 8px; top: 0; }
  main { padding-bottom: 170px; }
  .fab-wrap { right: 14px; bottom: calc(150px + var(--safe-b)); }
  .chat-launch { right: 14px; bottom: calc(80px + var(--safe-b)); width: 54px; height: 54px; }
  .chat { right: 0; left: 0; bottom: 0; width: 100%; height: calc(100dvh - 60px); border-radius: 22px 22px 0 0; }
  .modal-backdrop { padding: 0; grid-template-columns: minmax(0, 1fr); align-items: end; }
  .modal { width: 100%; max-height: 94dvh; border-radius: 22px 22px 0 0; }
  form.f { grid-template-columns: 1fr; }
  .stat { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; }
  .stat b { font-size: 24px; }
  .stat small { font-size: 13px; line-height: 1.35; display: block; }
  .stat img { width: 36px; height: 36px; }
  .chart-bars .r { grid-template-columns: 80px 1fr 70px; }
  .aitem { grid-template-columns: 34px 1fr; row-gap: 4px; }
  .aitem > .pill { grid-column: 2; justify-self: start; }
  .vcard .top .pill { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  .bg, .tabs, .fab-wrap, .chat-launch, .chat, .site-foot, .hero-art { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ───── ภาพรถ ───── */
.car-art { display: block; width: 100%; height: auto; }
.car-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.vcard .art {
  position: relative; height: 128px; display: grid; place-items: end center; padding: 8px 16px 2px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 100%, #fff 0%, var(--orange-50) 55%, var(--orange-100) 100%);
}
.vcard .art .car-art { max-width: 270px; transition: transform .35s; }
.vcard:hover .art .car-art { transform: translateX(6px) scale(1.03); }
.vcard .art .car-photo { position: absolute; inset: 0; }
.vcard .art .pill { position: absolute; top: 10px; right: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.type-tag { position: absolute; top: 10px; left: 10px; background: rgba(255, 255, 255, .92); border-radius: 99px; padding: 2px 10px; font: 500 12.5px 'Prompt'; box-shadow: 0 2px 6px rgba(0, 0, 0, .1); }
.vcard .top { padding: 10px 16px 4px; background: none; }
.dot-color { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin: 0 4px 0 2px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.detail-art { max-width: 420px; margin: -4px auto 12px; padding: 8px 20px 0; border-radius: 16px; background: radial-gradient(120% 90% at 50% 100%, #fff, var(--orange-50) 60%, var(--orange-100)); overflow: hidden; }
.detail-art .car-photo { height: 220px; margin: -8px -20px 0; width: calc(100% + 40px); }

/* ───── เลือกสี ───── */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { display: grid; justify-items: center; gap: 2px; cursor: pointer; font-size: 11.5px; color: var(--ink-2); width: 58px; }
.sw input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.sw i { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .18), 0 0 0 1.5px rgba(0, 0, 0, .15); transition: .15s; }
.sw input[type=color] { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 0; overflow: hidden; cursor: pointer; }
.sw input[type=color]::-webkit-color-swatch-wrapper { padding: 0; } .sw input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.sw input:checked + i, .sw input:checked ~ input[type=color] { box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px var(--orange); transform: scale(1.06); }
.sw small { text-align: center; line-height: 1.2; }
.art-preview { margin-top: 10px; max-width: 360px; padding: 6px 16px 0; border-radius: 14px; background: radial-gradient(120% 90% at 50% 100%, #fff, var(--orange-50) 60%, var(--orange-100)); }

/* ───── ตั้งค่า ───── */
.type-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.type-card { display: grid; gap: 4px; padding: 10px 12px 12px; border-radius: 16px; background: #fff; border: 1.5px solid var(--line); }
.type-card.off { opacity: .55; }
.type-card .art { height: 96px; display: grid; place-items: end center; border-radius: 12px; overflow: hidden; background: radial-gradient(120% 90% at 50% 100%, #fff, var(--orange-50) 60%, var(--orange-100)); padding: 4px 10px 0; }
.type-card .art .car-art { max-width: 200px; }
.type-card .toolbar { margin-top: 6px; }
.tpl-table td { padding: 6px 6px; }
.tpl-table input { padding: 7px 8px; font-size: 15px; }
.subtabs button[data-act] { cursor: pointer; }

/* ───── เมนูเพิ่มเติม (มือถือ) ───── */
.m-only { display: none !important; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.more-grid button { display: grid; justify-items: center; gap: 6px; padding: 18px 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--orange-50); font: 500 15px 'Prompt'; color: var(--ink); }
.more-grid button span { font-size: 32px; }
@media (max-width: 700px) {
  .m-hide { display: none !important; }
  .m-only { display: flex !important; }
  .vcard .art { height: 118px; }
  .swatches { gap: 4px; } .sw { width: 52px; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .tabs { overflow-x: auto; justify-content: flex-start; }
  .tabs button { flex: none; padding: 9px 12px; }
}

/* กันตารางกว้างดันคอลัมน์จนล้นจอ */
.grid > * { min-width: 0; }
.two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 1024px) { .two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; } .kv div { padding: 6px 8px; } }
