/* Place / country / city detail panel */
.sg-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.sg-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: 400px;
  max-width: 100%;
  background: #fff;
  box-shadow: -8px 0 40px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}

.sg-panel[hidden] { display: none !important; }
.sg-panel.is-visible { transform: translateX(0); }
.sg-panel.is-closing { transform: translateX(100%); }

.sg-panel__handle {
  display: none;
  width: 36px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 4px;
  margin: 8px auto 4px;
  flex-shrink: 0;
}

.sg-panel__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-panel__body {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
}

.sg-loading {
  padding: 24px 16px;
  color: #64748b;
  font-size: 14px;
  margin: 0;
}

/* —— Panel content (API + fallback) —— */
.sg-panel__body .sg-place-header {
  padding: 14px 44px 0 14px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: #0f172a;
}

.sg-panel__body .sg-place-header--copy {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sg-panel__body .sg-place-header--copy:active {
  opacity: 0.72;
}

.sg-panel__body .sg-place-hero {
  position: relative;
  margin: 10px 14px 12px;
  border-radius: 12px;
  overflow: hidden;
  height: 180px;
  background: #e2e8f0;
}
.sg-panel__body .sg-place-hero.is-custom {
  background: linear-gradient(145deg, #0f172a, #1e293b);
}

.sg-panel__body .sg-place-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sg-panel__body .sg-place-hero-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.sg-panel__body .sg-place-hero-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.sg-panel__body .sg-place-hero-play span {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.sg-panel__body .sg-place-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 10px;
  flex-wrap: wrap;
}

.sg-panel__body .sg-place-actions button,
.sg-panel__body .sg-place-actions a {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  font-size: 16px;
}

.sg-panel__body .sg-place-actions .is-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.sg-panel__body .sg-place-actions .is-on {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}

.sg-panel__body .sg-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 4px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

.sg-panel__body .sg-tabs button {
  flex: 1;
  border: 0;
  background: none;
  padding: 10px 2px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.sg-panel__body .sg-tabs button i {
  margin-right: 4px;
  font-size: 13px;
}

.sg-panel__body .sg-tabs button.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.sg-panel__body .sg-tab-loading {
  padding: 20px 14px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.sg-panel__body .sg-tab-html {
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
}

.sg-panel__body .sg-tab-html a {
  color: #2563eb;
}

.sg-panel__body .sg-tab-panel {
  padding: 12px 14px 16px;
  display: none;
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
}

.sg-panel__body .sg-tab-panel.is-active { display: block; }

.sg-panel__body .sg-place-meta {
  margin: 0 0 10px;
  font-size: 13px;
  color: #64748b;
}

.sg-panel__body .sg-place-desc {
  margin: 0 0 12px;
  font-size: 14px;
  color: #475569;
}

.sg-panel__body .sg-desc-wrap {
  margin: 0 0 14px;
}

.sg-panel__body .sg-desc-text {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
}

.sg-panel__body .sg-desc-text.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sg-panel__body .sg-read-more,
.sg-panel__body .sg-read-less {
  color: #2563eb;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  font-size: 14px;
  display: inline-block;
}

.sg-panel__body .sg-read-less {
  margin-top: 4px;
}

.sg-panel__body .sg-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sg-panel__body .sg-info-hours-wrap {
  margin: 12px 0;
}

.sg-panel__body .sg-info-hours-wrap .sg-info-grid {
  margin: 0;
}

.sg-panel__body .sg-info-box {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  color: #0f172a;
}

.sg-panel__body .sg-info-box .sg-info-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.sg-panel__body .sg-info-box .is-closed-text { color: #dc2626; font-weight: 600; }
.sg-panel__body .sg-info-box .is-open-text { color: #16a34a; font-weight: 600; }

.sg-panel__body .sg-info-box--hours {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sg-panel__body .sg-info-box--hours.sg-hours-toggle:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.sg-panel__body .sg-hours-toggle__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 20px;
}

.sg-panel__body .sg-hours-toggle__status {
  flex: 1;
  font-size: 13px;
  line-height: 1.35;
  min-width: 0;
}

.sg-panel__body .sg-hours-toggle__detail {
  color: #64748b;
  font-weight: 400;
}

.sg-panel__body .sg-hours-toggle__icon {
  flex-shrink: 0;
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.sg-panel__body .sg-info-hours-wrap .sg-hours-weekly {
  margin-top: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.sg-panel__body .sg-hours-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 13px;
}

.sg-panel__body .sg-hours-row.is-today {
  font-weight: 600;
}

.sg-panel__body .sg-hours-row__day {
  color: #0f172a;
}

.sg-panel__body .sg-hours-row__times {
  color: #475569;
  text-align: right;
}

.sg-panel__body .sg-cta-green {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background-color: #16a34a;
  background-image: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  text-align: left;
  cursor: pointer;
  margin: 12px 0;
}

.sg-panel__body .sg-cta-green[data-cta-bg] {
  background-image: none;
}

.sg-panel__body .sg-cta-green strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.sg-panel__body .sg-cta-green span {
  display: block;
  font-size: 12px;
  opacity: 0.92;
  margin-top: 2px;
}

.sg-panel__body .sg-cta-green i:last-child {
  margin-left: auto;
  font-size: 14px;
}

.sg-panel__body .sg-tip-box {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #475569;
  display: flex;
  gap: 8px;
  margin-top: 10px;
  line-height: 1.45;
}

.sg-panel__body .sg-tip-box i {
  color: #2563eb;
  margin-top: 2px;
}

.sg-panel__body .sg-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
}

.sg-panel__body .sg-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.sg-panel__body .sg-card__body {
  padding: 10px 12px;
  font-size: 14px;
}

/* API panel HTML compatibility */
.sg-panel__body > h1,
.sg-panel__body > h2,
.sg-panel__body > h3,
.sg-panel__body > h4,
.sg-panel__body .sg-place-header {
  padding: 14px 44px 0 14px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: #0f172a;
  margin: 0;
}

.sg-panel__body .sg-place-header--copy {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sg-panel__body img:not(.sg-place-hero img) {
  max-width: 100%;
  border-radius: 12px;
}

/* Audio overlay */
.sg-audio {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sg-audio__inner {
  width: min(640px, 100%);
  background: #0f172a;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
}

.sg-audio__player:empty { display: none; }
.sg-audio__inner:has(.sg-audio__player:empty) { display: none; }
.sg-audio:has(.sg-audio__player:empty) {
  background: transparent;
  pointer-events: none;
}

.sg-audio__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
}

.sg-audio iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .sg-panel {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    transform: translateX(100%);
  }

  .sg-panel.is-visible {
    transform: translateX(0);
  }

  .sg-panel.is-closing {
    transform: translateX(100%);
  }

  .sg-panel__handle {
    display: block;
  }

  .sg-panel__body .sg-place-hero {
    height: 200px;
  }
}
