/* Chapter tip banner + modal — scoped to chapter reader */

[data-chapter-tip-header]:disabled {
  background-color: transparent !important;
  border-color: var(--Icon-Brand-disabled, #ffc4b6) !important;
  color: var(--Icon-Brand-disabled, #ffc4b6) !important;
  cursor: not-allowed;
  opacity: 1;
}

[data-chapter-tip-header]:disabled :is(i, svg, span) {
  color: var(--Icon-Brand-disabled, #ffc4b6) !important;
}

.chapter-tip-banner {
  background-color: var(--chapter-surface);
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 24px;
  padding: 24px;
  position: relative;
}

.chapter-tip-banner.mt-4 {
  margin-top: 24px !important;
}

.chapter-tip-banner__head {
  align-items: flex-start;
  display: flex;
  gap: 4px;
  justify-content: space-between;
}

.chapter-tip-banner__copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.chapter-tip-banner__title-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.chapter-tip-banner__title {
  color: var(--chapter-text);
  font-family: var(--Title-Page-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin: 0;
}

.chapter-tip-banner__subtitle {
  color: var(--chapter-text);
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  margin: 0;
}

.chapter-tip-banner__info-icon {
  display: block;
  flex-shrink: 0;
  height: 20px;
  width: 20px;
}

.chapter-tip-banner__info-trigger {
  align-items: center;
  background: transparent;
  border: 0;
  cursor: help;
  display: inline-flex;
  flex-shrink: 0;
  height: 20px;
  justify-content: center;
  line-height: 1;
  margin: 0;
  padding: 0;
  position: relative;
  width: 20px;
}

.chapter-tip-banner__info-trigger:focus-visible {
  border-radius: var(--twl-radius-full, 999px);
  outline: 2px solid var(--Border-Brand-default, #ff775f);
  outline-offset: 2px;
}

.chapter-tip-banner__tooltip {
  background-color: var(--Base-bg-raised, #ffffff);
  border-radius: var(--twl-radius-lg, 8px);
  box-shadow: 0 4px 20px rgba(7, 7, 8, 0.05);
  color: var(--Text-Neutral-primary, #070708);
  display: block;
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  font-weight: 500;
  left: auto;
  line-height: 21px;
  max-width: min(261px, calc(100vw - 48px));
  opacity: 0;
  padding: 16px;
  pointer-events: none;
  position: absolute;
  right: 0;
  text-align: left;
  top: -12px;
  transform: translateY(-100%);
  transition: opacity 0.16s ease, visibility 0.16s ease;
  visibility: hidden;
  white-space: normal;
  width: 261px;
  word-wrap: break-word;
  z-index: 20;
}

.chapter-tip-banner__info-trigger:hover .chapter-tip-banner__tooltip,
.chapter-tip-banner__info-trigger:focus-visible .chapter-tip-banner__tooltip,
.chapter-tip-banner__info-trigger:focus .chapter-tip-banner__tooltip {
  opacity: 1;
  visibility: visible;
}

.chapter-tip-banner__cta {
  flex-shrink: 0;
  height: 44px;
  min-width: 180px;
  padding: 10px 24px;
}

.chapter-tip-banner__cta-group {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 12px;
}

.chapter-tip-banner__status-icon {
  color: var(--chapter-text-muted);
  display: block;
  font-size: 20px;
  line-height: 1;
}

.chapter-tip-banner__cta:disabled {
  background-color: var(--Background-Brand-disabled, #ffc4b6);
  border-color: var(--Border-Brand-disabled, #ffc4b6);
  color: var(--Text-Brand-on-brand-disabled, #ff8e76);
  cursor: not-allowed;
  opacity: 1;
}

.chapter-tip-banner__content {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 436px) auto minmax(0, 408px);
  position: relative;
  transition: max-height 0.3s ease-out;
}

.chapter-tip-banner__mobile-tabs {
  display: none;
}

.chapter-tip-banner:not(.is-expanded) .chapter-tip-banner__content {
  max-height: 261px;
  overflow: hidden;
}

.chapter-tip-banner.is-expanded .chapter-tip-banner__content {
  max-height: none;
  overflow: visible;
}

@media (prefers-reduced-motion: reduce) {
  .chapter-tip-banner__content {
    transition: none !important;
  }
}

.chapter-tip-banner__items {
  min-width: 0;
}

.chapter-tip-banner__section-title {
  color: var(--chapter-text);
  font-family: var(--Heading-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 16px;
  text-align: center;
}

.chapter-tip-banner__divider {
  background-color: var(--chapter-border-soft);
  height: auto;
  width: 1px;
}

.chapter-tip-banner__rank {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.chapter-tip-banner__rank > .chapter-tip-banner__section-title {
  margin-bottom: 0;
}

.chapter-tip-rank-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  width: 100%;
}

.chapter-tip-rank-item {
  align-items: center;
  border-bottom: none;
  display: flex;
  gap: 4px;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 8px;
  position: relative;
  width: 100%;
}

.chapter-tip-rank-list .chapter-tip-rank-item ~ .chapter-tip-rank-item {
  border-top: 1px solid var(--chapter-border-soft);
}

.chapter-tip-rank-item.is-current-user {
  background-color: var(--Background-Brand-subtle, #fff3f0);
  overflow: hidden;
}

.chapter-tip-rank-item__left {
  align-items: center;
  display: flex;
  gap: 16px;
  min-width: 0;
}

.chapter-tip-rank-item__order {
  align-items: center;
  display: inline-flex;
  flex-shrink: 0;
  height: 29px;
  justify-content: center;
  overflow: hidden;
  position: relative;
  width: 32px;
}

.chapter-tip-rank-item__order img {
  display: block;
  height: 29px;
  object-fit: contain;
  width: 32px;
}

.chapter-tip-rank-item__index {
  color: var(--chapter-text);
  font-family: var(--Action-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  min-width: 32px;
  text-align: center;
}

.chapter-tip-rank-item__avatar {
  border-radius: 50%;
  flex-shrink: 0;
  height: 48px;
  object-fit: cover;
  width: 48px;
}

.chapter-tip-rank-item__text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.chapter-tip-rank-item__name-row {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.chapter-tip-rank-item__name {
  color: var(--chapter-text);
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-tip-rank-item__badge {
  align-items: center;
  background-color: var(--Background-Brand-default, #ff775f);
  border-radius: 4px;
  color: var(--Base-on-color, #fff);
  display: inline-flex;
  flex-shrink: 0;
  font-family: var(--Action-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 14px;
  font-weight: 700;
  justify-content: center;
  line-height: 1;
  min-height: 20px;
  padding: 4px 8px;
  text-align: center;
}

.chapter-tip-rank-item__coin,
.chapter-tip-modal__coin {
  align-items: center;
  color: var(--chapter-brand-strong);
  display: inline-flex;
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.chapter-tip-rank-item__coin {
  gap: 2px;
}

.chapter-tip-modal__coin {
  gap: 4px;
}

.chapter-tip-rank-item__coin img,
.chapter-tip-modal__coin img {
  flex-shrink: 0;
  height: 12px !important;
  max-height: 12px;
  max-width: 12px;
  object-fit: contain;
  width: 12px !important;
}

.chapter-tip-count {
  align-items: center;
  display: inline-flex;
  flex-shrink: 0;
  gap: 4px;
  height: 32px;
}

.chapter-tip-count img {
  height: 32px;
  object-fit: contain;
  width: 32px;
}

.chapter-tip-count__qty {
  align-items: center;
  color: var(--Text-Neutral-tertiary, #6d7078);
  display: inline-flex;
  font-family: var(--Action-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.chapter-tip-count__x {
  display: inline-block;
  text-align: center;
  width: 8px;
}

.chapter-tip-count__n {
  display: inline-block;
}

.chapter-tip-my-summary {
  align-items: center;
  align-self: stretch;
  background-color: var(--Background-Brand-subtle, #fff3f0);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  padding: 16px;
}

.chapter-tip-my-summary__visual {
  flex-shrink: 0;
}

.chapter-tip-my-summary__gift-stack {
  flex-shrink: 0;
  width: 96px;
}

.chapter-tip-my-summary__gift-figure {
  margin: 0 auto;
  min-height: 75px;
  position: relative;
  width: 68px;
}

.chapter-tip-my-summary__gift-circle {
  align-items: center;
  background-color: var(--Base-bg-base, #fff);
  border-radius: var(--twl-radius-full, 999px);
  display: inline-flex;
  justify-content: center;
  padding: 10px;
}

.chapter-tip-my-summary__gift-img {
  display: block;
  height: 48px;
  object-fit: contain;
  width: 48px;
}

.chapter-tip-my-summary__qty-badge {
  background-color: var(--Base-bg-base, #fff);
  border: 1px solid var(--Border-Neutral-subtle, #e4e5e7);
  border-radius: var(--twl-radius-full, 999px);
  bottom: 0;
  color: var(--Text-Neutral-tertiary, #6d7078);
  font-family: var(--Action-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  min-width: 32px;
  padding: 2px 8px;
  position: absolute;
  right: -12px;
  text-align: center;
  z-index: 1;
}

.chapter-tip-my-summary__message {
  color: var(--Text-Neutral-primary, #070708);
  flex: 1 1 auto;
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  margin: 0;
  min-width: 0;
  white-space: pre-line;
}

.chapter-tip-items-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 96px);
}

.chapter-tip-item {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 96px;
  text-align: center;
}

.chapter-tip-item.is-clickable {
  cursor: pointer;
}

.chapter-tip-item.is-clickable:focus-visible {
  border-radius: var(--twl-radius-md, 8px);
  outline: 2px solid var(--Border-Brand-default, #ff775f);
  outline-offset: 4px;
}

.chapter-tip-item__visual {
  position: relative;
}

.chapter-tip-item__visual img {
  display: block;
  height: 48px;
  object-fit: contain;
  width: 48px;
}

.chapter-tip-item__visual span {
  background-color: var(--chapter-surface);
  border: 1px solid var(--chapter-border-soft);
  border-radius: var(--twl-radius-full, 999px);
  bottom: -9px;
  color: var(--chapter-text-muted);
  font-family: var(--Action-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  min-width: 32px;
  padding: 2px 8px;
  position: absolute;
  right: -24px;
}

.chapter-tip-item__label {
  color: var(--chapter-text);
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  margin-top: 21px;
}

.chapter-tip-item.is-empty {
  opacity: 0.3;
}

/* Empty tip state — centered column, Figma 956px container */
.chapter-tip-empty {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  text-align: center;
  width: 100%;
  max-width: 956px;
  margin: 0 auto;
}

.chapter-tip-empty__head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.chapter-tip-empty__head .chapter-tip-banner__title {
  font-size: 32px;
}

.chapter-tip-empty__subtitle {
  color: var(--chapter-text);
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  margin: 0;
}

.chapter-tip-empty__icons {
  align-items: center;
  display: flex;
  gap: 32px;
  justify-content: center;
  min-height: 48px;
}

.chapter-tip-empty__icon {
  display: block;
  flex-shrink: 0;
  height: 48px;
  object-fit: contain;
  opacity: 0.2;
  width: 48px;
}

.chapter-tip-empty__icon--placeholder {
  display: block;
  height: 48px;
  width: 48px;
}

.chapter-tip-empty__icon--hidden {
  display: none !important;
}

.chapter-tip-empty__cta-text {
  color: var(--chapter-text);
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  margin: 0;
}

.chapter-tip-empty__cta {
  flex-shrink: 0;
  height: 44px;
  min-width: 180px;
  padding: 10px 24px;
}

.chapter-tip-empty__cta:disabled {
  background-color: var(--Background-Brand-disabled, #ffc4b6);
  border-color: var(--Border-Brand-disabled, #ffc4b6);
  color: var(--Text-Brand-on-brand-disabled, #ff8e76);
  cursor: not-allowed;
  opacity: 1;
}

@media (max-width: 767px) {
  .chapter-tip-empty__icons {
    gap: 16px;
    flex-wrap: nowrap;
    overflow: hidden;
    max-width: 100%;
  }
  .chapter-tip-empty__cta {
    min-width: 180px;
  }
}

.chapter-tip-banner__empty {
  color: var(--chapter-text-muted);
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  margin: 0;
}

.chapter-tip-banner__toggle {
  align-items: center;
  align-self: stretch;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--Base-bg-base, #ffffff) 90%, transparent) 50%, color-mix(in srgb, var(--Base-bg-base, #ffffff) 90%, transparent) 100%);
  border: none;
  color: var(--chapter-brand-strong);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--Action-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 20px;
  font-weight: 500;
  gap: 2px;
  height: 107px;
  justify-content: center;
  line-height: 1;
  margin-top: -139px;
  padding: 71px 0 0;
  position: relative;
  z-index: 1;
}

.chapter-tip-banner__toggle i {
  font-size: 20px;
  line-height: 1;
}

.chapter-tip-banner.is-expanded .chapter-tip-banner__toggle {
  background: transparent;
  height: 24px;
  margin-top: -8px;
  padding-top: 0;
}

/* ลูกศรสลับผ่าน icon-tunwalai-line-down / line-up ใน JS — ห้าม rotate ซ้ำไม่งั้น «ซ่อน» ชี้ผิดทิศ */
.chapter-tip-banner.is-expanded .chapter-tip-banner__toggle i {
  transform: none;
}

/* Tip modal */
.modal-backdrop.show:has(+ .chapter-tip-modal),
body:has(.chapter-tip-modal.show) .modal-backdrop.show {
  opacity: 0.2;
}

.chapter-tip-modal .modal-dialog {
  max-width: 440px;
  width: 440px;
}

.chapter-tip-modal .modal-content {
  background-color: var(--Base-bg-raised, #ffffff);
  border: none;
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  padding: 0;
}

.chapter-tip-modal .modal-body {
  padding: 32px;
  position: relative;
}

.chapter-tip-modal__close {
  position: absolute;
  right: 32px;
  top: 32px;
  z-index: 2;
}

.chapter-tip-modal__select,
.chapter-tip-modal__set-price {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.chapter-tip-modal__main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 16px;
  width: 100%;
}

.chapter-tip-modal__header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  text-align: center;
}

.chapter-tip-modal__title {
  color: var(--chapter-text);
  font-family: var(--Title-Page-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  text-align: center;
}

.chapter-tip-modal__subtitle {
  color: var(--chapter-text);
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  margin: 0;
  text-align: center;
}

.chapter-tip-modal__grid {
  column-gap: 0;
  display: grid;
  grid-template-columns: repeat(4, 84px);
  justify-content: space-between;
  margin: 0;
  row-gap: 16px;
  width: 100%;
}

.chapter-tip-modal__radio {
  clip: rect(0, 0, 0, 0);
  position: absolute;
}

.chapter-tip-modal__item {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 4px;
  text-align: center;
  transition: border-color 0.2s, background-color 0.2s;
  width: 84px;
}

.chapter-tip-modal__item .chapter-tip-modal__coin {
  justify-content: center;
  width: 100%;
}

/* รูปของขวัญ 48px — ไม่รวมไอคอน coin ใน .chapter-tip-modal__coin (Figma 12×12) */
.chapter-tip-modal__item>img {
  height: 48px;
  max-height: none;
  max-width: none;
  object-fit: contain;
  width: 48px;
}

.chapter-tip-modal__item-title {
  color: var(--chapter-text);
  display: block;
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  /* 14px ใน Figma แต่ในเซลล์ 76px เบราว์เซอร์ wrap — 13px + nowrap ให้ตรงภาพ Figma บรรทัดเดียว */
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
  width: 100%;
}

.chapter-tip-modal__radio:checked+.chapter-tip-modal__item,
.chapter-tip-modal__item:hover {
  background-color: var(--Background-Brand-subtle-active, #ffe0d9);
  border-color: var(--chapter-brand);
}

.chapter-tip-modal__header--set-price {
  padding: 0 16px;
}

.chapter-tip-modal__selected-item {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.chapter-tip-modal__selected-image {
  height: 120px;
  object-fit: contain;
  width: 120px;
}

.chapter-tip-modal__selected-label {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
  text-align: center;
  width: 84px;
}

.chapter-tip-modal__item-title--selected {
  align-self: stretch;
  font-size: 14px;
  line-height: 21px;
  overflow: visible;
  text-align: center;
  text-overflow: clip;
  white-space: normal;
}

.chapter-tip-modal__selected-label .chapter-tip-modal__coin {
  justify-content: center;
}

.chapter-tip-modal__quantity-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.chapter-tip-modal__quantity-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.chapter-tip-modal__balance-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.chapter-tip-quantity {
  align-items: center;
  display: flex;
  gap: 4px;
  justify-content: center;
  width: 90px;
}

.chapter-tip-quantity__button {
  align-items: center;
  background-color: var(--chapter-brand, var(--Background-Brand-default, #ff775f));
  border: none;
  border-radius: var(--twl-radius-full, 999px);
  color: var(--Base-on-color, #fff);
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  height: 24px;
  justify-content: center;
  padding: 2px;
  width: 24px;
}

.chapter-tip-quantity__icon {
  display: block;
  flex-shrink: 0;
}

.chapter-tip-quantity__button:disabled {
  background-color: var(--Background-Brand-disabled, #ffc4b6);
  color: var(--Icon-Brand-on-brand-disabled, #ff8e76);
  cursor: not-allowed;
}

.chapter-tip-quantity__value {
  color: var(--chapter-text);
  flex: 1 1 auto;
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 21px;
  text-align: center;
}

.chapter-tip-modal__price-summary {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chapter-tip-modal__total {
  align-items: center;
  color: var(--chapter-brand-strong);
  display: inline-flex;
  font-family: var(--Action-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: var(--Action-font-size-lg, 20px);
  font-weight: 700;
  gap: 4px;
  line-height: 1;
}

.chapter-tip-modal__total img {
  height: 24px;
  width: 24px;
}

.chapter-tip-modal__balance {
  align-items: center;
  background: var(--chapter-surface, #fff);
  border: 1px solid var(--chapter-border, var(--Border-Neutral-default, #cacbce));
  border-radius: var(--twl-radius-full, 999px);
  display: inline-flex;
  gap: 4px;
  height: 28px;
  padding: 4px 8px;
}

.chapter-tip-modal__balance-add {
  align-items: center;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  height: 12px;
  justify-content: center;
  text-decoration: none;
  width: 12px;
}

.chapter-tip-modal__balance-add svg {
  display: block;
  height: 12px;
  width: 12px;
}

.chapter-tip-modal__form-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.chapter-tip-modal__message-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chapter-tip-modal__message-label {
  color: var(--chapter-text);
  display: block;
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  margin-bottom: 0;
}

.chapter-tip-modal__message {
  border: 1px solid var(--chapter-border, var(--Border-Neutral-default, #cacbce));
  border-radius: 8px;
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  height: 44px;
  line-height: 21px;
  margin-bottom: 0;
  padding: 8px 12px;
  width: 100%;
}

.chapter-tip-modal__message:focus {
  border-color: var(--chapter-brand-strong, var(--Text-Brand-default, #e85d45));
  outline: none;
}

.chapter-tip-modal__anonymous {
  align-items: center;
  color: var(--chapter-text);
  cursor: pointer;
  display: flex;
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  font-weight: 500;
  gap: 12px;
  line-height: 21px;
  margin-bottom: 0;
}

.chapter-tip-modal__anonymous input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  background: var(--chapter-surface, #fff);
  border: 1px solid var(--chapter-brand, #ff775f);
  border-radius: 4px;
  box-sizing: border-box;
  flex-shrink: 0;
  height: 20px;
  margin: 0;
  position: relative;
  width: 20px;
}

.chapter-tip-modal__anonymous input[type="checkbox"]:checked {
  background-color: var(--chapter-brand, #ff775f);
  border-color: var(--chapter-brand, #ff775f);
}

.chapter-tip-modal__anonymous input[type="checkbox"]:checked::after {
  border: solid var(--Text-Static-white, #ffffff);
  border-width: 0 2px 2px 0;
  content: "";
  height: 9px;
  left: 6px;
  position: absolute;
  top: 2px;
  transform: rotate(45deg);
  width: 5px;
}

.chapter-tip-modal__anonymous input {
  accent-color: var(--chapter-brand);
}

.chapter-tip-modal__next,
.chapter-tip-modal__submit {
  height: 44px;
  width: 100%;
}

.chapter-tip-modal__next:disabled {
  opacity: 1;
}

.chapter-tip-modal__submit {
  gap: 8px;
}

.chapter-tip-modal__submit.is-loading:disabled {
  background-color: var(--Background-Brand-default, #ff775f);
  border-color: var(--Border-Brand-default, #ff775f);
  color: var(--Text-Static-white, #ffffff);
  cursor: wait;
  opacity: 1;
}

.chapter-tip-button-spinner {
  animation: chapter-tip-button-spin 0.75s linear infinite;
  border: 2px solid color-mix(in srgb, var(--Text-Static-white, #ffffff) 55%, transparent);
  border-radius: 999px;
  border-top-color: var(--Text-Static-white, #ffffff);
  display: inline-block;
  flex: 0 0 auto;
  height: 16px;
  margin-right: 8px;
  width: 16px;
}

@keyframes chapter-tip-button-spin {
  to {
    transform: rotate(360deg);
  }
}

.chapter-tip-modal__submit-coin {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.chapter-tip-modal__submit-coin img {
  height: 12px;
  width: 12px;
}

@media (max-width: 767px) {
  .chapter-tip-banner .chapter-tip-item {
    min-width: 0;
  }
  .chapter-tip-banner__toggle {
    display: none;
  }

  .chapter-tip-banner [data-chapter-tip-panel="rank"] .chapter-tip-rank-item:nth-child(n + 6) {
    display: none;
  }

  .chapter-tip-banner {
    gap: 24px;
    padding-inline: 16px;
  }

  .chapter-tip-banner__mobile-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .chapter-tip-banner__mobile-tab {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--Text-Neutral-primary, #070708);
    font-family: var(--Action-font-family, "DB HelvethaicaMon X", sans-serif);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    min-width: 0;
    padding: 8px 4px;
    text-align: center;
    white-space: nowrap;
  }

  .chapter-tip-banner__mobile-tab.is-active {
    border-bottom-color: var(--Border-Brand-default, #ff775f);
    color: var(--Text-Brand-default, #e85d45);
    font-weight: 700;
  }

  .chapter-tip-banner [data-chapter-tip-panel].is-mobile-hidden {
    display: none;
  }

  .chapter-tip-banner__content .chapter-tip-banner__divider,
  .chapter-tip-banner__content .chapter-tip-banner__section-title {
    display: none;
  }

  .chapter-tip-banner__head {
    flex-direction: column;
  }

  .chapter-tip-banner__head > .chapter-tip-banner__cta-group {
    width: 100%;
  }

  .chapter-tip-banner__head > .chapter-tip-banner__cta-group .chapter-tip-banner__cta {
    flex: 1;
    min-width: 0;
  }

  .chapter-tip-banner__content {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .chapter-tip-banner:not(.is-expanded) .chapter-tip-banner__content {
    max-height: 560px;
  }

  .chapter-tip-banner__divider {
    height: 1px;
    width: 100%;
  }

  .chapter-tip-items-grid {
    grid-template-columns: repeat(4, 1fr);
    row-gap: 28px;
  }

  .chapter-tip-modal .modal-dialog {
    margin-left: auto;
    margin-right: auto;
    max-width: calc(100% - 32px);
    width: calc(100% - 32px);
  }

  .chapter-tip-modal .modal-body {
    padding: 24px 16px;
  }

  .chapter-tip-modal__close {
    right: 16px;
    top: 24px;
  }

  .chapter-tip-modal__grid {
    gap: 12px 8px;
    grid-template-columns: repeat(4, 84px);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    width: auto;
  }

  .chapter-tip-modal__grid::-webkit-scrollbar {
    display: none;
  }
}

/* Tip success overlay (fullscreen) — artboard 414×661.5 ตาม Figma */
.chapter-tip-success {
  align-items: center;
  background: transparent;
  box-sizing: border-box;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 0;
  position: fixed;
  z-index: 100080;
}

.chapter-tip-success__scrim {
  background: var(--Static-Opacity-Black-80, rgba(7, 7, 8, 0.8));
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.chapter-tip-success__confetti-layer {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.chapter-tip-success[hidden] {
  display: none !important;
}

/* กรอบเนื้อหาเท่า Figma (414 × 661.5) กึ่งกลางจอ */
.chapter-tip-success__artboard {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: min(661.5px, 100dvh);
  justify-content: center;
  max-width: 414px;
  min-height: min(661.5px, 100dvh);
  padding: 24px;
  position: relative;
  width: 100%;
  z-index: 2;
}

/* คอลัมน์กลาง Figma: gap 24 ระหว่าง 3 บล็อก */
.chapter-tip-success__stack {
  align-items: stretch;
  display: inline-flex;
  flex-direction: column;
  gap: 24px;
  max-width: 100%;
  width: max-content;
}

.chapter-tip-success__head {
  align-items: center;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.chapter-tip-success__title {
  color: var(--Text-Static-white, #fff);
  font-family: var(--Title-Page-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

.chapter-tip-success__subtitle {
  color: var(--Text-Static-white, #fff);
  font-family: var(--Body-font-family, "Bai Jamjuree", sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  margin: 0;
  text-align: center;
}

/* บล็อกรูป + ชื่อไอเทม (Figma คอลัมน์เดียว ไม่มี gap ระหว่างรูปกับชื่อ) */
.chapter-tip-success__visual {
  align-items: center;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 48px;
}

.chapter-tip-success__hero {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  height: 120px;
  justify-content: center;
  margin-bottom: 0;
  position: relative;
  width: 200px;
}

.chapter-tip-success__flare {
  height: 200px;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  will-change: transform, opacity;
}

.chapter-tip-success__item-image {
  height: 120px;
  object-fit: contain;
  position: relative;
  transform-origin: center center;
  width: 120px;
  will-change: transform, opacity;
  z-index: 1;
}

/* flare: scale แล้วหมุนต่อเนื่อง | รูปทิป: scale pop */
@keyframes chapter-tip-success-flare-scale {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes chapter-tip-success-flare-rotate {
  from {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) scale(1) rotate(360deg);
  }
}

@keyframes chapter-tip-success-item-scale {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }

  70% {
    opacity: 1;
    transform: scale(1.1);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.chapter-tip-success--enter .chapter-tip-success__flare {
  animation:
    chapter-tip-success-flare-scale 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    chapter-tip-success-flare-rotate 14s linear 0.55s infinite;
}

.chapter-tip-success--enter .chapter-tip-success__item-image {
  animation: chapter-tip-success-item-scale 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

@media (prefers-reduced-motion: reduce) {

  .chapter-tip-success--enter .chapter-tip-success__flare,
  .chapter-tip-success--enter .chapter-tip-success__item-image {
    animation: none;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  .chapter-tip-success--enter .chapter-tip-success__item-image {
    transform: scale(1);
  }
}

.chapter-tip-success__meta {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 48px;
  text-align: center;
}

.chapter-tip-success__item-title,
.chapter-tip-success__quantity {
  color: var(--Text-Static-white, #fff);
  font-family: var(--Title-Page-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin: 0;
}

.chapter-tip-success__done {
  align-self: stretch;
  border-radius: var(--twl-radius-full, 999px);
  box-sizing: border-box;
  display: flex;
  font-size: 20px;
  font-weight: 700;
  justify-content: center;
  margin: 0;
  padding: 10px 24px;
  width: 100%;
}

.chapter-tip-modal__select [data-insufficient-redirect] {
  border-radius: var(--twl-radius-full, 999px);
  font-family: var(--Action-font-family, "DB HelvethaicaMon X", sans-serif);
  font-size: 20px;
  font-weight: 700;
}
