/**
 * Hải Sơn Kim survey — scoped to .hk-srv-root only (tránh CSS theme / WP).
 * Palette: #1f365c / #f4a214
 */

@font-face {
  font-family: "HKArial";
  src: url("../fonts/ARIAL.TTF") format("truetype");
  font-weight: 400;
  font-style: normal;
}

/* ---- Root: tách khỏi theme ---- */
.hk-srv-root {
  --hk-srv-primary: #1f365c;
  --hk-srv-accent: #f4a214;
  --hk-srv-page-bg: #e8ecf2;
  --hk-srv-card-bg: #ffffff;
  --hk-srv-text: #1a1d21;
  --hk-srv-muted: #5c6570;
  --hk-srv-border: #c5ced9;
  --hk-srv-radius: 10px;
  --hk-srv-radius-sm: 6px;
  --hk-srv-shadow: 0 12px 40px rgba(31, 54, 92, 0.08);
  --hk-srv-font: HKArial, Helvetica, Arial, Verdana, sans-serif;

  isolation: isolate;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1024px;
  margin: 2rem auto;
  padding: 0 1rem;
  font-family: var(--hk-srv-font) !important;
  font-size: 18px !important;
  line-height: 1.65 !important;
  color: var(--hk-srv-text) !important;
  background: var(--hk-srv-page-bg) !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: var(--hk-srv-radius) !important;
}

/* Theme presets via shortcode theme="" */
.hk-srv-root.hk-srv-theme-default {
  --hk-srv-primary: #1f365c;
  --hk-srv-accent: #f4a214;
  --hk-srv-page-bg: #e8ecf2;
}

.hk-srv-root.hk-srv-theme-emerald {
  --hk-srv-primary: #0f5132;
  --hk-srv-accent: #86efac;
  --hk-srv-page-bg: #eaf8f1;
  --hk-srv-border: #b8d9c8;
}

.hk-srv-root.hk-srv-theme-sunset {
  --hk-srv-primary: #7c2d12;
  --hk-srv-accent: #fdba74;
  --hk-srv-page-bg: #fff1e8;
  --hk-srv-border: #e9c3ad;
}

.hk-srv-root.hk-srv-theme-royal {
  --hk-srv-primary: #312e81;
  --hk-srv-accent: #a5b4fc;
  --hk-srv-page-bg: #edf0ff;
  --hk-srv-border: #c6ceef;
}

.hk-srv-root *,
.hk-srv-root *::before,
.hk-srv-root *::after {
  box-sizing: border-box !important;
}

.hk-srv-root .hk-srv-card {
  background: var(--hk-srv-card-bg) !important;
  border-radius: 14px !important;
  box-shadow:
    0 16px 40px rgba(31, 54, 92, 0.12),
    0 4px 10px rgba(31, 54, 92, 0.08) !important;
  border: 1px solid rgba(31, 54, 92, 0.08) !important;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

.hk-srv-root .hk-srv-card-inner {
  padding: 1.75rem 1.75rem 0;
}

@media (min-width: 640px) {
  .hk-srv-root .hk-srv-card-inner {
    padding: 2rem 2.25rem 0;
  }
}

/* Typography trong scope */
.hk-srv-root h2,
.hk-srv-root h3,
.hk-srv-root p,
.hk-srv-root label,
.hk-srv-root span,
.hk-srv-root div {
  font-family: inherit !important;
  color: inherit;
}

.hk-srv-root .hk-srv-heading {
  margin: 0 0 1.75rem !important;
  padding: 0 !important;
  text-align: center !important;
  font-family: var(--hk-srv-font) !important;
  font-size: clamp(1.65rem, 3.2vw, 2rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--hk-srv-primary) !important;
  line-height: 1.2 !important;
  border: none !important;
  background: transparent !important;
}

.hk-srv-root .hk-srv-section-heading {
  margin: 1.75rem 0 0.75rem !important;
  padding: 0 !important;
  text-align: center !important;
  font-family: var(--hk-srv-font) !important;
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  color: var(--hk-srv-primary) !important;
  line-height: 1.3 !important;
  border: none !important;
  background: transparent !important;
}

/* Form reset — chỉ trong plugin */
.hk-srv-root .hk-srv-form {
  margin: 0 !important;
  padding: 0 0 1.5rem !important;
  border: none !important;
  background: transparent !important;
  width: 100% !important;
  max-width: none !important;
}

.hk-srv-root .hk-srv-progress {
  position: sticky !important;
  top: 0.5rem;
  z-index: 4;
  margin: 0 0 1rem !important;
  padding: 0.6rem 0.75rem !important;
  border: 1px solid rgba(31, 54, 92, 0.14) !important;
  border-radius: var(--hk-srv-radius-sm) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(3px);
}

.hk-srv-root .hk-srv-progress-track {
  width: 100% !important;
  height: 0.6rem !important;
  border-radius: 999px !important;
  background: #dce3ec !important;
  overflow: hidden !important;
}

.hk-srv-root .hk-srv-progress-fill {
  display: block !important;
  width: 0 !important;
  height: 100% !important;
  border-radius: inherit !important;
  background: linear-gradient(90deg, #f4a214 0%, #ffd56c 100%) !important;
  transition: width 0.25s ease !important;
}

.hk-srv-root .hk-srv-progress-text {
  margin-top: 0.35rem !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: var(--hk-srv-primary) !important;
  text-align: right !important;
}

.hk-srv-root .hk-srv-progress-meta {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 0.7rem !important;
  margin-top: 0.2rem !important;
}

.hk-srv-root .hk-srv-btn.hk-srv-btn--top {
  margin: 0 !important;
  padding: 0.42rem 1rem !important;
  font-size: 0.76rem !important;
  letter-spacing: 0.04em !important;
  box-shadow: 0 3px 10px rgba(244, 162, 20, 0.35) !important;
}

.hk-srv-root .hk-srv-btn.hk-srv-btn--ghost {
  background: #eef2f8 !important;
  color: var(--hk-srv-primary) !important;
  box-shadow: none !important;
}

.hk-srv-root .hk-srv-progress-errors {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.25rem !important;
  margin: 0 !important;
  padding: 0.3rem 0.55rem !important;
  border: 1px solid #ef9a9a !important;
  border-radius: 999px !important;
  background: #ffebee !important;
  color: #b71c1c !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

.hk-srv-root .hk-srv-alert--inline {
  margin-top: 0.5rem !important;
}

.hk-srv-root .hk-srv-error-msg {
  margin: 0.3rem 0 0 !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: #c62828 !important;
  line-height: 1.35 !important;
}

.hk-srv-root .hk-srv-field--error .hk-srv-input,
.hk-srv-root .hk-srv-field--error .hk-srv-textarea,
.hk-srv-root .hk-srv-field--error .hk-srv-input-confirm {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.18) !important;
}

.hk-srv-root .hk-srv-likert--error {
  border: 1px solid #ef9a9a !important;
  box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.14) !important;
}

.hk-srv-root .hk-srv-binary-choice--error {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.14) !important;
}

.hk-srv-root .hk-srv-section {
  margin: 1.5rem 0 0.85rem !important;
  padding: 0.8rem 1.2rem !important;
  background: var(--hk-srv-primary) !important;
  color: var(--hk-srv-accent) !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  border: none !important;
  border-radius: var(--hk-srv-radius-sm) !important;
  line-height: 1.35 !important;
  box-shadow: none !important;
}

.hk-srv-root .hk-srv-subsection {
  margin: 1.15rem 0 0.65rem !important;
  padding: 0.65rem 1rem !important;
  background: var(--hk-srv-primary) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 0.92rem !important;
  border: none !important;
  border-radius: var(--hk-srv-radius-sm) !important;
  line-height: 1.35 !important;
}

.hk-srv-root .hk-srv-section,
.hk-srv-root .hk-srv-subsection,
.hk-srv-root .hk-srv-likert,
.hk-srv-root .hk-srv-feedback,
.hk-srv-root .hk-srv-binary-choice,
.hk-srv-root .hk-srv-confirm-strip {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease !important;
}

.hk-srv-root .hk-srv-section.is-visible,
.hk-srv-root .hk-srv-subsection.is-visible,
.hk-srv-root .hk-srv-likert.is-visible,
.hk-srv-root .hk-srv-feedback.is-visible,
.hk-srv-root .hk-srv-binary-choice.is-visible,
.hk-srv-root .hk-srv-confirm-strip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hk-srv-root .hk-srv-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1.15rem 1.35rem !important;
  margin: 0 0 0.25rem !important;
  padding: 0 !important;
  border: none !important;
  width: 100% !important;
}

@media (max-width: 640px) {
  .hk-srv-root .hk-srv-grid {
    grid-template-columns: 1fr !important;
  }
}

.hk-srv-root .hk-srv-field {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.hk-srv-root .hk-srv-label {
  display: block !important;
  margin: 0 0 0.35rem !important;
  padding: 0 !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  color: var(--hk-srv-primary) !important;
  line-height: 1.3 !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
}

.hk-srv-root .hk-srv-req {
  color: #c62828 !important;
  font-weight: 700 !important;
}

.hk-srv-root .hk-srv-input,
.hk-srv-root .hk-srv-form textarea.hk-srv-textarea,
.hk-srv-root .hk-srv-form input.hk-srv-input-confirm {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0.78rem 0.9rem !important;
  font-family: var(--hk-srv-font) !important;
  font-size: 1.02rem !important;
  line-height: 1.45 !important;
  color: var(--hk-srv-text) !important;
  background: #fff !important;
  border: 1px solid #b4c0ce !important;
  border-radius: var(--hk-srv-radius-sm) !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease !important;
}

.hk-srv-root .hk-srv-input:focus,
.hk-srv-root .hk-srv-form textarea.hk-srv-textarea:focus,
.hk-srv-root .hk-srv-form input.hk-srv-input-confirm:focus {
  border-color: var(--hk-srv-primary) !important;
  box-shadow: 0 0 0 3px rgba(31, 54, 92, 0.15) !important;
  transform: translateY(-1px);
}

.hk-srv-root .hk-srv-input::placeholder,
.hk-srv-root .hk-srv-form textarea::placeholder,
.hk-srv-root .hk-srv-form input.hk-srv-input-confirm::placeholder {
  color: #8a939e !important;
  opacity: 1 !important;
}

/* ---- Likert: câu trái + cột thang (legend + sao) ---- */
.hk-srv-root .hk-srv-likert {
  display: flex !important;
  /* Always stack: question on top, rating below */
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 0.85rem !important;
  margin: 0 0 0.6rem !important;
  padding: 0.75rem 1rem !important;
  background: var(--hk-srv-primary) !important;
  color: #fff !important;
  border-radius: var(--hk-srv-radius-sm) !important;
  border: none !important;
  min-height: 3.6rem !important;
  transition:
    transform 0.14s ease,
    box-shadow 0.18s ease !important;
}

.hk-srv-root .hk-srv-likert:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12) !important;
}

@media (max-width: 520px) {
  .hk-srv-root .hk-srv-likert {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.55rem !important;
    padding: 0.7rem 0.75rem !important;
  }

  .hk-srv-root .hk-srv-likert-side {
    min-width: 100% !important;
  }

  .hk-srv-root .hk-srv-likert-legend {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    column-gap: 0.2rem !important;
    row-gap: 0 !important;
    font-size: 0.6rem !important;
    line-height: 1.12 !important;
  }

  .hk-srv-root .hk-srv-likert-legend span {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    text-align: center !important;
    min-height: 2.45em !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .hk-srv-root .hk-srv-stars {
    margin-top: 0.1rem !important;
  }
}

/* Phones/tablets (touch): show labels aligned with stars (2 rows, 5 columns) */
@media (hover: none) and (pointer: coarse) {
  .hk-srv-root .hk-srv-likert {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .hk-srv-root .hk-srv-likert-side {
    min-width: 100% !important;
    gap: 0.25rem !important;
  }

  .hk-srv-root .hk-srv-likert-legend {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    column-gap: 0.25rem !important;
    font-size: 0.62rem !important;
    line-height: 1.12 !important;
  }

  .hk-srv-root .hk-srv-likert-legend span {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 2.2em !important;
  }

  .hk-srv-root .hk-srv-stars {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    justify-items: center !important;
    align-items: center !important;
    gap: 0.15rem !important;
    margin-top: 0 !important;
    justify-content: space-around;
  }

  .hk-srv-root .hk-srv-star-wrap .hk-srv-star-label {
    font-size: 1.65rem !important;
  }

  /* Neighbor: hide the big scale table on touch (labels are shown per row) */
  .hk-srv-root.hk-srv-form-neighbor .hk-srv-neighbor-scale {
    display: none !important;
  }
}

/* Tablet / desktop hẹp (có sidebar) vẫn cần legend xuống dòng */
@media (min-width: 641px) and (max-width: 980px) {
  .hk-srv-root .hk-srv-likert {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .hk-srv-root .hk-srv-likert-side {
    min-width: 100% !important;
  }

  .hk-srv-root .hk-srv-likert-legend {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    column-gap: 0.25rem !important;
    font-size: 0.64rem !important;
    line-height: 1.12 !important;
  }

  .hk-srv-root .hk-srv-likert-legend span {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 2.2em !important;
  }
}

@media (max-width: 390px) {
  .hk-srv-root .hk-srv-likert-legend {
    font-size: 0.56rem !important;
  }

  .hk-srv-root .hk-srv-star-wrap .hk-srv-star-label {
    font-size: 1.34rem !important;
  }
}

.hk-srv-root .hk-srv-likert-q {
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0.15rem 0.25rem 0 0 !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  color: #fff !important;
  align-self: center !important;
  border: none !important;
  background: transparent !important;
}

.hk-srv-root .hk-srv-likert-side {
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  min-width: 100% !important;
  gap: 0.2rem !important;
}

@media (min-width: 521px) {
  .hk-srv-root .hk-srv-likert-side {
    min-width: 15.5rem !important;
  }
}

.hk-srv-root .hk-srv-likert-legend {
  display: flex !important;
  justify-content: space-between !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 0.05rem !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  color: rgba(255, 255, 255, 0.88) !important;
  text-align: center !important;
  gap: 0 !important;
  border: none !important;
  background: transparent !important;
}

@media (min-width: 480px) {
  .hk-srv-root .hk-srv-likert-legend {
    font-size: 0.72rem !important;
  }
}

.hk-srv-root .hk-srv-likert-legend span {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  padding: 0 0.05rem !important;
  margin: 0 !important;
  white-space: nowrap !important;
  border: none !important;
  background: transparent !important;
  color: inherit !important;
}

.hk-srv-root .hk-srv-stars {
  display: flex !important;
  justify-content: space-around;
  align-items: center !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0.08rem !important;
  border: none !important;
  background: transparent !important;
}

/* Neighbor: put stars first, labels under stars (avoid long-label overlap) */
.hk-srv-root.hk-srv-form-neighbor .hk-srv-stars {
  order: 1 !important;
}
.hk-srv-root.hk-srv-form-neighbor .hk-srv-likert-legend {
  order: 2 !important;
}

.hk-srv-root.hk-srv-form-neighbor .hk-srv-likert-legend {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  column-gap: 0.25rem !important;
  font-size: 0.58rem !important;
  line-height: 1.12 !important;
}

.hk-srv-root.hk-srv-form-neighbor .hk-srv-likert-legend span {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  text-align: center !important;
}

/* Touch devices: force 2-row 5-column alignment (place AFTER base .hk-srv-stars) */
@media (hover: none) and (pointer: coarse) {
  .hk-srv-root .hk-srv-stars {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    justify-items: center !important;
    align-items: center !important;
    gap: 0.15rem !important;
  }

  .hk-srv-root .hk-srv-star-wrap {
    width: auto !important;
    text-align: center !important;
  }
}

.hk-srv-root .hk-srv-star-wrap {
  position: relative !important;
  display: block !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.hk-srv-root .hk-srv-stars input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  clip: rect(0, 0, 0, 0) !important;
}

.hk-srv-root .hk-srv-star-wrap .hk-srv-star-label {
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0.14rem 0.09rem !important;
  font-size: 1.62rem !important;
  line-height: 1 !important;
  color: rgba(255, 255, 255, 0.32) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
  transition:
    color 0.12s ease,
    transform 0.12s ease !important;
  user-select: none !important;
}

.hk-srv-root .hk-srv-star-wrap .hk-srv-star-label:hover {
  color: var(--hk-srv-accent) !important;
  transform: scale(1.12) rotate(-5deg);
}

.hk-srv-root .hk-srv-stars input:focus + .hk-srv-star-label {
  outline: 2px solid var(--hk-srv-accent) !important;
  outline-offset: 2px !important;
  border-radius: 4px !important;
}

.hk-srv-root
  .hk-srv-stars[data-value="1"]
  .hk-srv-star-wrap:nth-child(-n + 1)
  .hk-srv-star-label,
.hk-srv-root
  .hk-srv-stars[data-value="2"]
  .hk-srv-star-wrap:nth-child(-n + 2)
  .hk-srv-star-label,
.hk-srv-root
  .hk-srv-stars[data-value="3"]
  .hk-srv-star-wrap:nth-child(-n + 3)
  .hk-srv-star-label,
.hk-srv-root
  .hk-srv-stars[data-value="4"]
  .hk-srv-star-wrap:nth-child(-n + 4)
  .hk-srv-star-label,
.hk-srv-root
  .hk-srv-stars[data-value="5"]
  .hk-srv-star-wrap:nth-child(-n + 5)
  .hk-srv-star-label {
  color: var(--hk-srv-accent) !important;
  text-shadow: 0 0 0.5px rgba(0, 0, 0, 0.15);
}

.hk-srv-root
  .hk-srv-stars[data-preview="1"]
  .hk-srv-star-wrap:nth-child(-n + 1)
  .hk-srv-star-label,
.hk-srv-root
  .hk-srv-stars[data-preview="2"]
  .hk-srv-star-wrap:nth-child(-n + 2)
  .hk-srv-star-label,
.hk-srv-root
  .hk-srv-stars[data-preview="3"]
  .hk-srv-star-wrap:nth-child(-n + 3)
  .hk-srv-star-label,
.hk-srv-root
  .hk-srv-stars[data-preview="4"]
  .hk-srv-star-wrap:nth-child(-n + 4)
  .hk-srv-star-label,
.hk-srv-root
  .hk-srv-stars[data-preview="5"]
  .hk-srv-star-wrap:nth-child(-n + 5)
  .hk-srv-star-label {
  color: var(--hk-srv-accent) !important;
  opacity: 0.92;
}

/* ---- Ý kiến 2 cột ---- */
.hk-srv-root .hk-srv-feedback {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1rem !important;
  margin: 0.5rem 0 0 !important;
  padding: 0 !important;
  border: none !important;
  width: 100% !important;
}

@media (max-width: 700px) {
  .hk-srv-root .hk-srv-feedback {
    grid-template-columns: 1fr !important;
  }
}

.hk-srv-root .hk-srv-feedback-col {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  display: flex !important;
  flex-direction: column !important;
}

.hk-srv-root .hk-srv-feedback-col--full {
  grid-column: 1 / -1 !important;
}

.hk-srv-root .hk-srv-feedback--spaced {
  margin-top: 1rem !important;
}

.hk-srv-root .hk-srv-binary-choice {
  margin-top: 1rem !important;
  padding: 0.8rem 1rem !important;
  border: 1px solid var(--hk-srv-border) !important;
  border-radius: var(--hk-srv-radius-sm) !important;
  background: #fff !important;
}

.hk-srv-root .hk-srv-binary-choice-options {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
}

.hk-srv-root .hk-srv-choice-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  margin: 0 !important;
  padding: 0.45rem 0.85rem !important;
  border: 1px solid #b4c0ce !important;
  border-radius: 999px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--hk-srv-primary) !important;
  background: #f8fafc !important;
  cursor: pointer !important;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.12s ease !important;
}

.hk-srv-root .hk-srv-choice-pill:hover {
  border-color: var(--hk-srv-primary) !important;
  background: #eef2f8 !important;
  transform: translateY(-1px);
}

.hk-srv-root .hk-srv-choice-pill input[type="radio"] {
  margin: 0 !important;
  accent-color: var(--hk-srv-primary);
}

.hk-srv-root .hk-srv-binary-choice-options--stack {
  flex-direction: column !important;
  align-items: flex-start !important;
}

.hk-srv-root .hk-srv-hint {
  margin: 0 0 0.85rem !important;
  padding: 0 !important;
  font-size: 0.88rem !important;
  line-height: 1.5 !important;
  color: var(--hk-srv-muted) !important;
  border: none !important;
  background: transparent !important;
}

.hk-srv-root .hk-srv-neighbor-scale {
  margin: 0 0 1rem !important;
  padding: 0.5rem !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  background: #fff !important;
  border: 1px solid var(--hk-srv-border) !important;
  border-radius: var(--hk-srv-radius-sm) !important;
}

.hk-srv-root .hk-srv-scale-table {
  width: 100% !important;
  min-width: 520px !important;
  border-collapse: collapse !important;
  font-size: 0.72rem !important;
  background: #fff !important;
  border: 1px solid var(--hk-srv-border) !important;
}

.hk-srv-root .hk-srv-scale-table th,
.hk-srv-root .hk-srv-scale-table td {
  border: 1px solid var(--hk-srv-border) !important;
  padding: 0.35rem 0.25rem !important;
  text-align: center !important;
  vertical-align: middle !important;
  color: var(--hk-srv-text) !important;
}

.hk-srv-root .hk-srv-scale-table th {
  background: #eef2f8 !important;
  font-weight: 700 !important;
  color: var(--hk-srv-primary) !important;
}

.hk-srv-root .hk-srv-check-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.55rem !important;
  margin: 0 0 0.5rem !important;
  padding: 0 !important;
  border: none !important;
}

.hk-srv-root .hk-srv-check-pill {
  display: inline-flex !important;
  align-items: flex-start !important;
  gap: 0.4rem !important;
  margin: 0 !important;
  padding: 0.45rem 0.75rem !important;
  border: 1px solid #b4c0ce !important;
  border-radius: var(--hk-srv-radius-sm) !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: var(--hk-srv-primary) !important;
  background: #f8fafc !important;
  cursor: pointer !important;
}

.hk-srv-root .hk-srv-check-pill input[type="checkbox"] {
  margin: 0.15rem 0 0 !important;
  accent-color: var(--hk-srv-primary);
  flex-shrink: 0 !important;
}

.hk-srv-root .hk-srv-panel-head {
  margin: 0 !important;
  padding: 0.8rem 0.95rem !important;
  min-height: 3.8rem !important;
  display: flex !important;
  align-items: center !important;
  background: var(--hk-srv-primary) !important;
  color: #fff !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  border: none !important;
  border-radius: var(--hk-srv-radius-sm) var(--hk-srv-radius-sm) 0 0 !important;
}

.hk-srv-root .hk-srv-form textarea.hk-srv-textarea {
  min-height: 180px !important;
  resize: vertical !important;
  border-radius: 0 0 var(--hk-srv-radius-sm) var(--hk-srv-radius-sm) !important;
  border-top: none !important;
  margin-top: 0 !important;
}

.hk-srv-root .hk-srv-confirm-strip {
  margin: 1.5rem 0 0.75rem !important;
  padding: 0.75rem 1.1rem !important;
  background: var(--hk-srv-primary) !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 0.95rem !important;
  text-align: center !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  border: none !important;
  border-radius: var(--hk-srv-radius-sm) !important;
}

.hk-srv-root .hk-srv-actions {
  margin: 1.5rem 0 0 !important;
  padding: 0 0 1.75rem !important;
  text-align: center !important;
  border: none !important;
  background: transparent !important;
}

.hk-srv-root .hk-srv-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  padding: 0.85rem 2.7rem !important;
  font-family: var(--hk-srv-font) !important;
  font-size: 1.02rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  line-height: 1.2 !important;
  color: var(--hk-srv-primary) !important;
  background: var(--hk-srv-accent) !important;
  border: none !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(244, 162, 20, 0.45) !important;
  transition:
    filter 0.15s ease,
    transform 0.12s ease !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.hk-srv-root .hk-srv-btn:hover {
  filter: brightness(1.04) !important;
  transform: translateY(-2px) scale(1.01);
}

.hk-srv-root .hk-srv-btn:active {
  transform: translateY(0);
}

.hk-srv-root .hk-srv-foot {
  margin: 0 !important;
  padding: 1.15rem 1.25rem 1.35rem !important;
  background: var(--hk-srv-primary) !important;
  color: #fff !important;
  text-align: center !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  border: none !important;
  border-radius: 0 0 var(--hk-srv-radius) var(--hk-srv-radius) !important;
}

.hk-srv-root .hk-srv-foot p {
  margin: 0.5rem 0 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: inherit !important;
  font-size: inherit !important;
}

.hk-srv-root .hk-srv-foot a {
  color: var(--hk-srv-accent) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(244, 162, 20, 0.5) !important;
  padding-bottom: 1px !important;
}

.hk-srv-root .hk-srv-foot a:hover {
  color: #ffc14d !important;
  border-bottom-color: currentColor !important;
}

@media (max-width: 640px) {
  .hk-srv-root {
    font-size: 16px !important;
    line-height: 1.55 !important;
  }

  .hk-srv-root .hk-srv-heading {
    font-size: clamp(1.45rem, 5.8vw, 1.7rem) !important;
    margin-bottom: 1.2rem !important;
  }

  .hk-srv-root .hk-srv-section {
    font-size: 0.92rem !important;
    padding: 0.68rem 0.95rem !important;
  }

  .hk-srv-root .hk-srv-subsection {
    font-size: 0.84rem !important;
  }

  .hk-srv-root .hk-srv-label {
    font-size: 0.86rem !important;
  }

  .hk-srv-root .hk-srv-input,
  .hk-srv-root .hk-srv-form textarea.hk-srv-textarea,
  .hk-srv-root .hk-srv-form input.hk-srv-input-confirm {
    font-size: 0.95rem !important;
  }

  .hk-srv-root .hk-srv-likert-q {
    font-size: 0.88rem !important;
  }

  .hk-srv-root .hk-srv-likert-side {
    min-width: 100% !important;
  }

  .hk-srv-root .hk-srv-star-wrap .hk-srv-star-label {
    font-size: 1.48rem !important;
  }

  .hk-srv-root .hk-srv-progress {
    top: 0.2rem;
    padding: 0.55rem 0.6rem !important;
  }

  .hk-srv-root .hk-srv-progress-meta {
    flex-wrap: wrap !important;
  }

  .hk-srv-root .hk-srv-btn.hk-srv-btn--top {
    width: 100% !important;
    justify-content: center !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hk-srv-root .hk-srv-section,
  .hk-srv-root .hk-srv-subsection,
  .hk-srv-root .hk-srv-likert,
  .hk-srv-root .hk-srv-feedback,
  .hk-srv-root .hk-srv-binary-choice,
  .hk-srv-root .hk-srv-confirm-strip,
  .hk-srv-root .hk-srv-btn,
  .hk-srv-root .hk-srv-input,
  .hk-srv-root .hk-srv-form textarea.hk-srv-textarea,
  .hk-srv-root .hk-srv-star-wrap .hk-srv-star-label {
    transition: none !important;
  }
}

/* Hard override against aggressive theme typography rules */
#hk-survey-form .hk-srv-heading,
#hk-survey-form h2.hk-srv-heading,
#hk-survey-form .hk-srv-section-heading {
  font-family: var(--hk-srv-font) !important;
}

/* Force Likert stacking (override theme/elementor) */
#hk-survey-form .hk-srv-likert {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
}

#hk-survey-form .hk-srv-likert-q,
#hk-survey-form .hk-srv-likert-side {
  width: 100% !important;
  min-width: 100% !important;
}

@media (max-width: 520px) {
  /* Avoid floating contact buttons covering the stars */
  /* .hk-srv-root.hk-srv-form-neighbor .hk-srv-likert {
    padding-right: 4.25rem !important;
  } */
}

/* Neighbor (touch): question on top, stars below, labels under stars */
@media (hover: none) and (pointer: coarse) {
  .hk-srv-root.hk-srv-form-neighbor .hk-srv-likert {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .hk-srv-root.hk-srv-form-neighbor .hk-srv-likert-side {
    min-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
  }

  /* Stars first */
  .hk-srv-root.hk-srv-form-neighbor .hk-srv-stars {
    order: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    justify-items: center !important;
    align-items: center !important;
    gap: 0.15rem !important;
  }

  /* Labels under stars */
  .hk-srv-root.hk-srv-form-neighbor .hk-srv-likert-legend {
    order: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    column-gap: 0.25rem !important;
    font-size: 0.58rem !important;
    line-height: 1.12 !important;
  }

  .hk-srv-root.hk-srv-form-neighbor .hk-srv-likert-legend span {
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }
}

/* Neighbor (narrow layouts): same as touch (avoid relying on pointer/hover) */
@media (max-width: 980px) {
  .hk-srv-root.hk-srv-form-neighbor .hk-srv-likert {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .hk-srv-root.hk-srv-form-neighbor .hk-srv-likert-side {
    min-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
  }

  .hk-srv-root.hk-srv-form-neighbor .hk-srv-stars {
    order: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    justify-items: center !important;
    align-items: center !important;
    gap: 0.15rem !important;
  }

  .hk-srv-root.hk-srv-form-neighbor .hk-srv-likert-legend {
    order: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    column-gap: 0.25rem !important;
    font-size: 0.58rem !important;
    line-height: 1.12 !important;
  }

  .hk-srv-root.hk-srv-form-neighbor .hk-srv-likert-legend span {
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }
}

/* Alerts */
.hk-srv-root .hk-srv-alert {
  margin: 0 0 1.25rem !important;
  padding: 0.85rem 1rem !important;
  font-size: 0.9rem !important;
  line-height: 1.45 !important;
  border-radius: var(--hk-srv-radius-sm) !important;
  border: 1px solid transparent !important;
  font-weight: 600 !important;
}

.hk-srv-root .hk-srv-alert--ok {
  background: #e8f5e9 !important;
  color: #1b5e20 !important;
  border-color: #a5d6a7 !important;
}

.hk-srv-root .hk-srv-alert--err {
  background: #ffebee !important;
  color: #b71c1c !important;
  border-color: #ef9a9a !important;
}

.hk-srv-root .hk-srv-alert--warn {
  background: #fff8e1 !important;
  color: #e65100 !important;
  border-color: #ffe082 !important;
}

.hk-srv-root .hk-srv-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Honeypot — ẩn khỏi layout */
.hk-srv-root .hk-srv-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
}
