:root {
  --brand: #991b1e;
  --brand-hover: #7e171a;
  --bg: #f5f6fa;
  --surface: #fff;
  --text: #182132;
  --muted: #778196;
  --border: #e3e7ef;
  --shadow: 0 2px 5px #18213206;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Noto Sans Lao",
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: none;
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Header */

.header {
  background: white;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1600px;
  margin: auto;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  /* color: white;
  background: var(--brand); 
  border-radius: 50%;
  box-shadow: 0 3px 5px #991b1e20; */
  object-fit: cover;
}
.logo {
  width: 100%;
}

.brand h1 {
  font-size: 16px;
  letter-spacing: -0.5px;
}

.brand p {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  padding: 3px;
  border-radius: 20px;
  border: 1px solid var(--border);
  gap: 2px;
  flex-shrink: 0;
}

.lang-btn {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  line-height: 1;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(24, 33, 50, 0.12);
  font-weight: 750;
}

.flag-icon {
  font-size: 13px;
  line-height: 1;
}

.navigation {
  display: flex;
  gap: 8px;
}

.nav-button {
  min-height: 44px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
}

.nav-button.current {
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 700;
}

/* Mobile-first layout */

.layout {
  max-width: 1600px;
  margin: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

/* show password */


.directory {
  order: 2;
}

.directory-heading {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.directory-heading h2 {
  font-size: 15px;
}

.count {
  font-size: 12px;
  color: var(--muted);
}

.directory-list {
  padding: 0 12px 12px;
  display: grid;
  gap: 10px;
  align-content: start;
  max-height: 410px;
  overflow-y: auto;
}

.shop-card {
  width: 100%;
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-align: left;
  background: white;
  border: 1px solid var(--border);
  border-radius: 13px;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.shop-card:hover {
  background: #fafbfc;
}

.shop-card.selected {
  border-color: #ef9ca7;
  background: #fff8f9;
  box-shadow: 0 0 0 1px #ef9ca725;
}

.shop-logo {
  width: 49px;
  height: 49px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 27px;
  background: var(--logo-bg, #f6eee8);
}
.shop-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.shop-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.shop-text {
  min-width: 0;
}

.shop-title {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.6;
}

.small-badge {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 5px;
  border-radius: 4px;
  background: var(--brand);
  color: white;
  font-size: 10px;
  vertical-align: 1px;
}

.shop-meta {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}

.directory-footer {
  padding: 15px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.link-button {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.empty {
  padding: 30px 15px;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
}

/* Search and map */

.map-column {
  order: 1;
  min-width: 0;
}

.search-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-wrap .icon {
  position: absolute;
  left: 13px;
  top: 14px;
  color: #9099ab;
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 46px;
  padding: 10px 12px 10px 39px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  color: var(--text);
  font-size: 13px;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px #991b1e10;
}

.category-select {
  width: auto;
  min-width: 120px;
  max-width: 220px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  font-size: 12px;
  cursor: pointer;
}
.category-select:focus{
  border-color: var(--brand);
}
.category-select.has-selection {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px #991b1e10;
}
.reset-filter {
  background-color: #fff;
  border: 1px solid var(--border);
  font-size: 12px;
  border-radius: 5px;
  padding: 0 10px;
  width: 92px;
}
.zone-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 13px;
  scrollbar-width: none;
}

.zone-chip {
  min-height: 40px;
  padding: 8px 15px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: white;
  color: #536075;
  font-size: 12px;
  font-weight: 650;
}

.zone-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}



/* ========================================
   MAP
======================================== */

.map-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
}

.map-viewport {
  width: 100%;
  height: 58vh;
  min-height: 390px;
  max-height: 770px;

  overflow: hidden;
  position: relative;

  background: #fff;

  cursor: grab;

  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;

  /*
   * สำคัญสำหรับ Mobile
   * ให้ JavaScript ควบคุม pan / pinch เอง
   */
  touch-action: none;

  overscroll-behavior: auto;
}

.map-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background: rgb(255 255 255 / 82%);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(2px);
}

.map-loading[hidden] {
  display: none;
}

.map-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3c3cc;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: map-loading-spin .75s linear infinite;
}

@keyframes map-loading-spin {
  to { transform: rotate(360deg); }
}


.floor-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.floor-svg text {
  font-family: inherit;
  pointer-events: none;
}

/* ========================================
   MAP BOTTOM
======================================== */

.map-bottom {
  min-height: 66px;

  padding: 10px 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  color: var(--muted);
  font-size: 11px;

  border-top: 1px solid #f1f3f7;

  background: white;
}

/* Legend */

.legend {
  display: flex;
  gap: 12px;
  align-items: center;

  min-width: 0;
}

.legend span {
  display: flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}

.legend-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;

  border-radius: 50%;
  background: #0b9c71;
}

.legend-dot.exit {
  background: #ef476f;
}

/* ========================================
   MAP ACTIONS
======================================== */

.map-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 8px;

  flex-shrink: 0;
}

/* Zoom controls */

.map-controls {
  position: static;

  display: flex;
  align-items: center;

  gap: 4px;

  padding: 3px;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: #fffffff5;

  box-shadow: 0 2px 8px #1821320b;
}

.control-button {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 8px;

  background: white;

  font-size: 21px;
  line-height: 1;

  transition:
    background 0.15s,
    transform 0.15s;
}

.control-button:hover {
  background: #f1f3f7;
}

.control-button:active {
  transform: scale(0.94);
}

.control-button.fit {
  font-size: 16px;
}

/* 100% */

.zoom-value {
  min-width: 48px;

  text-align: center;

  font-size: 11px;
  font-weight: 700;

  color: var(--text);
}



.map-viewport.dragging {
  cursor: grabbing;
}

.floor-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.floor-svg text {
  font-family: inherit;
  pointer-events: none;
}

.booth {
  cursor: pointer;
}

.booth rect,
.booth ellipse,
.booth polygon {
  transition:
    fill 0.15s,
    stroke 0.15s,
    opacity 0.15s;
}

.booth:hover rect,
.booth:hover ellipse,
.booth:hover polygon {
  stroke: var(--brand);
  stroke-width: 2;
}

.booth.selected rect,
.booth.selected ellipse,
.booth.selected polygon {
  fill: var(--brand);
  stroke: #741417;
  stroke-width: 2;
}
.booth.selected {
  filter: drop-shadow(0 3px 6px #991b1e35);
}

/* @keyframes boothPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }

  100% {
    transform: scale(1);
  }
} */

.booth.selected {
  animation: boothPulse 0.35s ease;
}

.booth.selected .booth-label {
  fill: white;
  font-weight: 750;
}

.booth.match:not(.selected) rect,
.booth.match:not(.selected) ellipse,
.booth.match:not(.selected) polygon {
  stroke: var(--brand);
  stroke-width: 2.5;
}

.booth.muted-booth {
  opacity: 0.2;
}

.booth:focus {
  outline: none;
}

.booth:focus-visible rect,
.booth:focus-visible ellipse,
.booth:focus-visible polygon {
  stroke: #182132;
  stroke-width: 3;
}


.control-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: white;
  font-size: 24px;
}

.control-button:hover {
  background: #f1f3f7;
}

.control-button.fit {
  font-size: 17px;
}

.route-notice {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fafafa;
  border: 1.5px dashed #d1d5db;
  color: transparent;
  font-size: 12px;
  line-height: 1.6;
  min-height: 46px;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.route-notice.is-visible {
  background: #fff1e5;
  border: 1.5px solid #f4c08a;
  color: #854c20;
}

/* Detail card */

.desktop-detail {
  display: none;
}

.detail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #eff1f6;
}

.detail-badge {
  background: var(--brand);
  color: white;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 750;
}

.detail-category {
  color: var(--muted);
  font-size: 11px;
}

.detail-body {
  padding: 18px;
}

.detail-body h2 {
  font-size: 22px;
  letter-spacing: -0.6px;
}

.detail-hero {
  height: 170px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #00000005;
  border-radius: 13px;
  background: var(--hero-bg, #f6eee8);
}

.hero-logo {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  font-size: 45px;
  background: #ffffffc9;
  border-radius: 23px;
  box-shadow: 0 5px 20px #00000006;
}

.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero-caption {
  color: #595451;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.detail-section {
  margin-top: 22px;
}

.detail-section h3 {
  margin-bottom: 9px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.description {
  color: #59657a;
  font-size: 12px;
  line-height: 1.85;
}

.detail-facts {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #eff1f6;
  font-size: 12px;
  color: #59657a;
}

.fact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fact .icon {
  color: #98a2b4;
  width: 16px;
  height: 16px;
}

.detail-actions {
  padding: 16px 18px;
  display: grid;
  gap: 9px;
  border-top: 1px solid #eff1f6;
}

.button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  font-size: 12px;
  font-weight: 650;
}

.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.button.primary:hover {
  background: var(--brand-hover);
}


.close-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #f5f6fa;
  font-size: 23px;
}

.info-dialog {
  width: min(450px, calc(100% - 32px));
  padding: 25px;
  border: 0;
  border-radius: 18px;
  color: var(--text);
}

.info-dialog h2 {
  margin-bottom: 12px;
  font-size: 21px;
}

.info-dialog p {
  margin-bottom: 18px;
  color: #59657a;
  font-size: 13px;
  line-height: 1.8;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: #182132;
  color: white;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 5px 20px #0002;
}

footer {
  padding: 22px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* Mobile bottom navigation */
@media (max-width: 639px) {

  /* เว้นพื้นที่ไม่ให้ navigation บังเนื้อหาท้ายหน้า */
  body {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  body:not(.booths-page) #directory {
    display: none;
  }

  /* ย้ายเมนูเดิมจาก Header มาไว้ด้านล่างจอ */
  .navigation {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;

    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 4px;

    width: 100%;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));

    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgb(24 33 50 / 8%);
  }

  /* แต่ละปุ่มกว้างเท่ากัน และวางไอคอนเหนือข้อความ */
  .navigation .nav-button {
    flex: 1;
    min-width: 0;
    min-height: 56px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;

    padding: 8px 4px;
    border: 0;
    border-radius: 10px;

    background: transparent;
    color: var(--muted);
    text-align: center;
  }

  .navigation .nav-button .icon {
    width: 22px;
    height: 22px;
  }

  /* CSS เดิมซ่อนข้อความบนมือถือ จึงเปิดให้แสดงที่แถบล่าง */
  .navigation .nav-label {
    display: block;
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
  }

  .navigation .nav-button.current {
    background: #fff1f2;
    color: var(--brand);
    font-weight: 700;
  }

  .navigation .nav-button:active {
    background: #fff1f2;
    color: var(--brand);
  }

  /* ยกข้อความแจ้งเตือนขึ้น ไม่ให้ทับ navigation */
  .toast {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }
  .map-bottom {
    min-height: auto;

    padding: 9px 10px;

    gap: 8px;
  }

.legend span {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 10px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0b9c71;
}

.legend-dot.exit {
  background: #ef476f;
}

  .map-actions {
    gap: 5px;
  }


  .control-button {
    width: 34px;
    height: 34px;
    border-radius: 7px;

    font-size: 19px;
  }

  .control-button.fit {
    font-size: 14px;
  }

  .zoom-value {
    min-width: 40px;
    font-size: 10px;
  }
}

@media (min-width: 1100px) {
  .layout {
    grid-template-columns: 250px minmax(0, 1fr) 260px;
    align-items: start;
    gap: 16px;
  }

  .directory {
    order: 0;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 170px);
    min-height: 0;
  }

  .directory-list {
    flex: 1;
    max-height: none;
  }

  .map-column {
    order: 0;
  }

  .search-toolbar {
    gap: 7px;
    margin-bottom: 8px;
  }

  .search-wrap input {
    height: 40px;
    border-radius: 10px;
    font-size: 12px;
  }

  .search-wrap .icon {
    left: 12px;
    top: 11px;
  }

  .category-select {
    min-width: 108px;
    max-width: 190px;
    border-radius: 10px;
    font-size: 11px;
  }

  .zone-filters {
    gap: 7px;
    padding: 1px 0 8px;
  }

  .zone-chip {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
  }

  .map-shell {
    height: clamp(438px, calc(100dvh - 261px), 620px);
  }

  .map-viewport {
    height: auto;
    flex: 1;
    min-height: 0;

    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;

    overscroll-behavior: auto;
  }

  .desktop-detail {
    display: block;
    height: calc(100dvh - 170px);
    max-height: none;
    min-height: 0;
    overflow-y: auto;
  }

  .navigation {
    gap: 24px;
  }
   .map-bottom {
    min-height: 62px;
  }

  .map-actions {
    margin-left: auto;
  }

  .control-button {
    width: 40px;
    height: 40px;
  }
}

@media (min-width: 1400px) {
  .layout {
    grid-template-columns: 260px minmax(0, 1fr) 270px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================
Navigation: ซ่อนเป็นค่าเริ่มต้น
======================================== */

/* .navigation {
  display: none;
} */

.navigation .nav-button {
  text-decoration: none;
}

/* ========================================
All Booths page
======================================== */

/* แสดงช่องค้นหาและตัวกรอง แต่ซ่อนตัวแผนผัง */
.booths-page .map-shell,
.booths-page #route-notice {
  display: none;
}

.booths-page .layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.booths-page .map-column {
  order: 0;
  grid-column: 1 / -1;
}

.booths-page .directory {
  order: 1;
  height: auto;
  min-height: 0;
}

.booths-page .directory-list {
  grid-template-columns: minmax(0, 1fr);
  max-height: none;
  overflow: visible;
}

.booths-page .desktop-detail {
  order: 2;
}

/* จอใหญ่ของหน้า All Booths:
รายการด้านซ้าย รายละเอียดด้านขวา */
@media (min-width: 1100px) {

  .booths-page .layout {
    grid-template-columns: minmax(0, 1fr) 310px;
  }

  .booths-page .directory-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1099px) {
  body:not(.booths-page) #directory {
    display: none;
  }
  /* ========================================
   Mobile Booth Detail - Bottom Sheet
======================================== */
 #detail-dialog {
    position: fixed !important;

    inset: auto 0 0 0 !important;

    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;

    width: min(480px, 100%) !important;
    max-width: 480px !important;

    height: auto !important;
    max-height: 85dvh !important;

    margin: 0 auto !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 22px 22px 0 0;

    overflow: hidden;

    transform: translateY(100%);
    opacity: 0;

    transition:
      transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.25s ease;

    z-index: 1000;
  }

  /* #detail-dialog[open], */
  #detail-dialog.is-open {
    transform: translateY(0);
    opacity: 1;
  }

  #detail-dialog.dragging {
    transition: none !important;
  }

  #detail-dialog.closing {
    transform: translateY(100%);
    opacity: 0;
  }

  /*
   * Expanded
   */
  #detail-dialog.expanded {
    height: 95dvh !important;
    max-height: 95dvh !important;
  }

  /*
   * Handle
   */
  .detail-drag-handle {
    width: 42px;
    height: 5px;

    margin: 10px auto 4px;

    border-radius: 999px;

    background: #d6d0cc;

    cursor: grab;

    touch-action: none;
    user-select: none;

    flex-shrink: 0;
  }

  .detail-drag-handle:active {
    cursor: grabbing;
  }

  /*
   * Header
   */
  #detail-dialog .dialog-heading {
    touch-action: none;
    user-select: none;
    cursor: grab;

     position: relative;

  display: flex;
  align-items: center;
  justify-content: space-between;

  width: 100%;

  padding: 6px 15px 10px;

  background: white;

  border-bottom: 1px solid var(--border);

  font-size: 12px;
  font-weight: 700;
  }

  #detail-dialog .dialog-heading:active {
    cursor: grabbing;
  }

  /*
   * Close button ต้องยัง click ได้
   */
  #detail-dialog #close-detail {
    touch-action: manipulation;
    cursor: pointer;
  }

  /*
   * Content
   */
  #mobile-detail {
    max-height: calc(85dvh - 62px);

    overflow-y: auto;

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
  }

  /*
   * Expanded content
   */
  #detail-dialog.expanded #mobile-detail {
    max-height: calc(95dvh - 62px);
  }

  /*
   * Backdrop
   */
  #detail-dialog::backdrop {
    background: rgb(23 32 52 / 0%);

    transition:
      background 0.35s ease;
  }

  #detail-dialog[open]::backdrop {
    background: rgb(23 32 52 / 45%);
  }

  #detail-dialog.closing::backdrop {
    background: rgb(23 32 52 / 0%);
  }
}

