@import url('../components/details/comments-condolences.css');
@import url('../components/details/tribute-modal.css');
@import url('../components/details/flowers-modal.css');
@import url('../components/details/donation-modal.css');
body {
        margin: 0;
        font-family: system-ui, sans-serif;
        background: #0b1220;
      }

      .backdrop {
        position: fixed;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(2, 6, 23, .72);
        padding: 16px;
      }

      .modal {
        width: min(520px, 92vw);
        background: #fff;
        border-radius: 16px;
        padding: 18px 16px;
        box-shadow: 0 25px 80px rgba(0, 0, 0, .35);
        border: 1px solid rgba(0, 0, 0, .08);
        text-align: center;
      }

      .title {
        font-weight: 800;
        font-size: 20px;
        margin: 0 0 6px;
        color: #111827;
      }

      .text {
        margin: 0 0 14px;
        color: #475569;
        line-height: 1.4;
      }

      .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 16px;
        border-radius: 999px;
        border: none;
        cursor: pointer;
        background: #551fbd;
        color: #fff;
        font-weight: 700;
        text-decoration: none;
      }

      .btn:hover {
        filter: brightness(.95);
      }

      .small {
        margin-top: 10px;
        font-size: 12px;
        color: #64748b;
      }

      /* ===== FINAL html2canvas-safe portrait ===== */
      #posterArea.poster-mode .portrait-wrap {
          width: 320px;
          aspect-ratio: 3 / 4;
        }
        

      /* ============ Custom dropdown (input-select style) ============ */
      .custom-select {
        position: relative;
        width: 100%;
        min-width: 0;
      }

      .custom-select-trigger {
        width: 100%;
        height: 44px;
        padding: 10px 40px 10px 12px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: #fff;
        font-size: 14px;
        color: #0f172a;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
      }

      .custom-select:hover .custom-select-trigger {
        box-shadow: 0 2px 6px rgba(15, 23, 42, .10);
      }

      .custom-select.open .custom-select-trigger {
        border-color: rgba(85, 31, 189, .75);
        box-shadow: 0 0 0 4px rgba(85, 31, 189, .14);
      }

      .custom-select-trigger::after {
        content: "";
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 7px solid #64748b;
      }

      .custom-select-text {
        flex: 1;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      /* Menu should match trigger width */
      .custom-options {
        position: absolute;
        left: 0;
        top: calc(100% + 8px);
        width: 100%;
        background: #fff;
        border-radius: 14px;
        border: 1px solid #e5e7eb;
        box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
        max-height: 240px;
        overflow: auto;
        z-index: 30000;
        display: none;
        padding: 6px;
      }

      .custom-select.open .custom-options {
        display: block;
      }

      .custom-select.open-up .custom-options {
        top: auto;
        bottom: calc(100% + 8px);
      }

      .custom-option {
        padding: 10px 12px;
        font-size: 14px;
        color: #111827;
        cursor: pointer;
        border-radius: 10px;
        white-space: nowrap;
      }

      .custom-option:hover {
        background: #f3f4f6;
      }

      .custom-option.is-selected {
        background: #ede9fe;
        color: #4338ca;
        font-weight: 700;
      }

      .native-select-hidden {
        position: absolute;
        opacity: 0;
        pointer-events: none;
        height: 0;
        width: 0;
      }

      /* Phone layout */
      .phone-row {
        display: grid;
        grid-template-columns: 140px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
      }


:root {
      --bg: #ffffff;
      --text: #0f172a;
      --muted: #475569;
      --primary: #551fbd;
      --accent: #69e4f5;
      --card: #f8fafc;
      --border: #e2e8f0;
      --success: #16a34a;
      --btn-main: #551fbd;
      --btn-main-hover: #43209b;
    }

    * {
      box-sizing: border-box
    }

    body {
      margin: 0;
      font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Noto Sans", sans-serif;
      color: var(--text);
      background: var(--bg);
    }

    .container {
      max-width: 1050px;
      margin: 24px auto;
      padding: 16px;
    }

    .btn {
      background: var(--btn-main);
      color: #fff;
      border: none;
      padding: 10px 18px;
      border-radius: 999px;
      cursor: pointer;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
      box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
      text-decoration: none;
    }

    .btn:hover {
      background: var(--btn-main-hover);
      transform: translateY(-1px);
      box-shadow: 0 4px 10px rgba(15, 23, 42, .25);
    }

    .btn-primary {
      background: var(--btn-main);
      color: #fff;
    }

    .btn-accent {
      background: var(--btn-main);
      color: #fff;
    }

    .actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: center;
      margin-top: 14px;
    }

    .hero {
      position: relative;
      display: grid;
      gap: 8px;
      justify-items: center;
      text-align: center;
      padding: 32px 16px 40px;
      border-radius: 16px;
      background:
        radial-gradient(circle at top, rgba(85, 31, 189, 0.35) 0%, transparent 45%),
        linear-gradient(to bottom, #0b0220 0%, #140b3a 60%, #020617 100%);
      color: #f9fafb;
      overflow: hidden;
    }

    .poster-download-btn {
      position: absolute;
      top: 18px;
      right: 22px;
      width: 42px;
      height: 42px;
      border-radius: 999px;
      border: 2px solid #ddd;
      background: #ffffff;
      color: #000000;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
      cursor: pointer;
      transition: 0.2s ease;
    }

    .poster-download-btn:hover {
      background: #f1f5f9;
      color: #000;
      box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
    }

    #posterArea.poster-mode .actions,
    #posterArea.poster-mode .poster-download-btn {
      display: none !important;
    }

    .hero-title {
      font-weight: 800;
      font-size: clamp(22px, 6vw, 34px);
      letter-spacing: .4px;
      color: #fff;
      text-shadow: 0 2px 6px rgba(0, 0, 0, .6);
      margin-bottom: 6px;
    }

    .portrait-area {
      position: relative;
      display: grid;
      place-items: center;
    }

    .portrait-wrap {
      position: relative;
      width: 320px;
      aspect-ratio: 3/4;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .portrait {
  position: absolute;
  z-index: 1;
  width: 72%;
  height: 78%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, .65);
}

    .frame-img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: contain;
      z-index: 2;
      pointer-events: none;
    }

    .date-pill {
      position: absolute;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      min-width: 120px;
      padding: 0;
      border: none;
      background: transparent;
      box-shadow: none;
      color: #f9fafb;
      font-weight: 700;
      font-size: 20px;
      line-height: 1.2;
      text-align: center;
    }

    .date-left,
    .date-right {
      top: 50%;
      transform: translateY(-50%);
    }

    .date-left {
      left: -190px;
    }

    .date-right {
      right: -190px;
    }

    .date-pill div {
      text-align: center;
      line-height: 2.2;
    }

    .hero h1 {
      margin: 0 0 6px;
      color: #f9fafb;
    }

    .hero .meta {
      margin-top: 10px;
      color: #d1d5db;
    }

    .age-badge {
      display: inline-block;
      margin-top: 8px;
      padding: 6px 14px;
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.9);
      color: #f9fafb;
      font-weight: 700;
      font-size: 12px;
      border: 1px solid rgba(105, 228, 245, .5);
    }

    .section {
      margin-top: 26px;
      border: 1px solid var(--border);
      border-radius: 16px;
      background: #fff;
      padding: 18px;
    }

    .about-section {
      margin-top: 0;
    }

    /* === Tribute styles (unchanged) === */
    .tribute-banner {
      margin: 10px 0;
      border-radius: 14px;
      overflow: hidden;
      border: 1px solid var(--border);
      background: #000;
      box-shadow: 0 8px 22px rgba(15, 23, 42, .18);
      position: relative;
    }

    .tribute-banner img {
      width: 100%;
      height: 210px;
      max-height: 330px;
      display: block;
      object-fit: cover;
    }

    .tribute-banner-overlay {
      position: absolute;
      inset: 0;
      padding: 18px 22px 16px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      background: linear-gradient(to right, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.20));
      color: #f9fafb;
    }

    .tb-heading {
      font-size: 18px;
      font-weight: 700;
      color: var(--accent);
      margin-bottom: 6px;
    }

    .tb-message {
      font-size: 24px;
      font-weight: 500;
      line-height: 1.5;
      max-width: 70%;
      display: flex;
      align-items: flex-start;
      gap: 10px;
    }

    .tb-quote-icon-inline {
      font-size: 30px;
      line-height: 1;
      opacity: .45;
      margin-top: 2px;
    }

    .tb-message-text {
      flex: 1;
      font-size: 24px;
      font-weight: 500;
      line-height: 1.45;
      color: #fff;
    }

    .tb-message-inner {
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      word-break: break-word;
    }

    .read-more-inline {
      color: inherit;
      font-size: inherit;
      font-weight: inherit;
      margin-left: 4px;
      text-decoration: none;
      white-space: nowrap;
    }

    .tb-from {
      margin-top: 10px;
      font-size: 14px;
    }

    .tb-meta {
      margin-top: 2px;
      font-size: 12px;
      opacity: .85;
    }

    .tribute-text {
      margin: 10px 0;
      border-radius: 16px;
      overflow: hidden;
      border: 1px solid rgba(0, 0, 0, 0.10);
      background: linear-gradient(135deg, #f5f3ff, #e9e7ff, #ddeafe);
      color: #0f172a;
      box-shadow: 0 6px 20px rgba(15, 23, 42, 0.10);
      padding: 22px 26px 20px;
    }

    .tt-message {
      font-size: 24px;
      line-height: 1.5;
      display: flex;
      align-items: flex-start;
      gap: 12px;
    }

    .tt-quote-icon-inline {
      font-size: 28px;
      opacity: 0.35;
      margin-top: 2px;
    }

    .tt-message-text {
      flex: 1;
    }

    .tt-from {
      margin-top: 14px;
      font-size: 15px;
      font-weight: 600;
      color: #1e293b;
    }

    .tt-meta {
      margin-top: 3px;
      font-size: 13px;
      color: #475569;
    }

    @media (max-width:768px) {

      .tb-message,
      .tt-message {
        max-width: 100%;
        font-size: 20px;
      }
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: rgba(85, 31, 189, .08);
      color: #551fbd;
      border: 1px solid rgba(85, 31, 189, .45);
      border-radius: 999px;
      padding: 4px 10px;
      font-weight: 700;
      font-size: 12px;
    }

    .about-layout {
      margin-top: 26px;
    }

    .about-summary-row {
      display: flex;
      flex-direction: column;
      gap: 18px;
    }

    .about-col {
      display: flex;
      flex-direction: column;
      gap: 18px;
    }

    .summary-col {
      order: 1;
      width: 100%;
      position: static;
      align-self: auto;
      text-align: center;
      /* ✅ add */
    }

    /* ===== FORCE LEFT ALIGN for Summary section ===== */
    .summary-card {
      text-align: left;
    }

    .summary-list {
      padding-left: 0;
    }

    .summary-item {
      display: flex;
      align-items: flex-start;
      justify-content: flex-start;
      /* 👈 important */
      text-align: left;
      /* 👈 important */
    }

    .summary-ico {
      flex-shrink: 0;
    }

    .summary-text {
      text-align: left;
    }

    .summary-text .label,
    .summary-text .value {
      text-align: left;
    }


    .about-col {
      order: 2;
      width: 100%;
    }

    #tributes {
      position: relative;
    }

    #tributes .badge {
      position: absolute;
      top: 18px;
      right: 18px;
      margin: 0;
    }

    .summary-card {
      border: 1px solid var(--border);
      border-radius: 16px;
      background: #fff;
    }

    .summary-head {
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
      font-weight: 800;
      letter-spacing: .3px;
    }

    .summary-list {
      list-style: none;
      margin: 0;
      padding: 0;
    }

    .summary-item {
      display: flex;
      gap: 12px;
      align-items: flex-start;
      padding: 14px 16px;
    }

    .summary-ico {
      width: 32px;
      height: 32px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      background: #f1f5f9;
      border: 1px solid var(--border);
      flex: 0 0 auto;
    }

    .summary-text .label {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 2px;
    }

    .summary-text .value {
      font-weight: 700;
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(2, 6, 23, .68);
      backdrop-filter: blur(2px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 10000;
    }

    .modal {
      position: relative;
      width: min(560px, 92vw);
      background: #fff;
      border-radius: 16px;
      padding: 16px;
      box-shadow: 0 20px 80px rgba(2, 6, 23, .25);
      z-index: 10001;
    }

    .row {
      display: grid;
      gap: 10px;
      margin-top: 8px;
    }

    input[type=text],
    input[type=number],
    textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px 12px;
      font: inherit;
    }

    textarea {
      min-height: 120px;
      resize: vertical;
    }

    .modal-actions {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid #e2e8f0;
    }

    #modalComment .modal-actions .btn {
      background: #f1f5f9;
      color: #0f172a;
      border: 1px solid #cbd5e1;
      box-shadow: none;
    }

    #modalComment .modal-actions .btn:hover {
      background: #e2e8f0;
      transform: none;
    }

    #modalComment .modal-actions .btn-primary {
      background: var(--btn-main) !important;
      color: #fff !important;
      border: none !important;
      box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    }

    #modalComment .modal-actions .btn-primary:hover {
      background: var(--btn-main-hover) !important;
    }

    .modal--flowers {
      padding: 0;
      width: min(1000px, 95vw) !important;
      max-width: 1000px;
      max-height: 92vh;
      overflow-y: auto;
    }

    .flowers-layout {
      display: grid;
      grid-template-columns: minmax(240px, 1.1fr) minmax(280px, 1.4fr);
      gap: 0;
      border-radius: 16px;
      overflow: hidden;
    }

    .flowers-info {
      background: #f5f3ff;
      padding: 20px 22px;
      border-right: 1px solid #e0e7ff;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .donation-info {
      padding: 0 22px 20px 22px !important;
      padding-top: 10px !important;
    }

    .flowers-hotline-label {
      font-size: 13px;
      font-weight: 600;
      color: #4c1d95;
      text-transform: uppercase;
      letter-spacing: .08em;
    }

    .flowers-hotline-number {
      font-size: 26px;
      font-weight: 800;
      color: #111827;
    }

    .flowers-text {
      margin: 4px 0 0;
      font-size: 14px;
      color: #4338ca;
      line-height: 1.4;
    }

    .flowers-note {
      margin-top: auto;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      font-size: 12px;
      color: #4c1d95;
    }

    .flowers-note i {
      margin-top: 2px;
    }

    .flowers-form {
      padding: 24px 20px 16px;
    }

    .flowers-actions {
      justify-content: flex-end;
    }

    #modalFlowers .flowers-btn-secondary {
      background: #f1f5f9 !important;
      color: #0f172a !important;
      border: 1px solid #cbd5e1 !important;
      box-shadow: none !important;
    }

    #modalFlowers .flowers-btn-secondary:hover {
      background: #e2e8f0 !important;
      transform: none;
    }

    #modalFlowers .flowers-btn-primary {
      background: var(--btn-main) !important;
      color: #fff !important;
      border: none !important;
      min-width: 150px;
      box-shadow: 0 2px 6px rgba(0, 0, 0, .15) !important;
    }

    #modalFlowers .flowers-btn-primary:hover {
      background: var(--btn-main-hover) !important;
    }

    .tribute-type-modal {
      max-height: 70vh;
      overflow-y: auto;
      border-radius: 20px;
      padding: 24px 22px 20px;
    }

    .tribute-type-modal .modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 12px;
      margin-top: 18px;
      padding-top: 14px;
      border-top: 1px solid #e2e8f0;
    }

    .tribute-type-modal .modal-actions .btn {
      background: #f1f5f9;
      color: #0f172a;
      border: 1px solid #cbd5e1;
      padding: 10px 18px;
      border-radius: 10px;
      font-weight: 600;
      box-shadow: none;
    }

    .tribute-type-modal .modal-actions .btn:hover {
      background: #e2e8f0;
    }

    .tribute-type-modal .modal-actions .btn-primary {
      background: var(--btn-main);
      color: #fff;
      border: none;
      border-radius: 10px;
      min-width: 140px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
    }

    .tribute-type-modal .modal-actions .btn-primary:hover {
      background: var(--btn-main-hover);
    }

    .modal--donation p {
      font-size: 14px;
      color: #475569;
      margin-top: 4px;
      margin-bottom: 8px;
    }

    .modal--donation h3 {
      margin-top: 0;
      margin-bottom: 4px;
    }

    @media (min-width:769px) {
      .about-summary-row {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 22px;
        align-items: flex-start;
      }

      .about-col {
        order: 1;
      }

      .summary-col {
        order: 2;
        position: sticky;
        top: 24px;
        align-self: flex-start;
      }

      #tributes {
        width: 100%;
        margin-top: 0;
      }
    }

    @media (max-width:720px) {
      .flowers-layout {
        grid-template-columns: 1fr;
      }

      .flowers-info {
        border-right: none;
        border-bottom: 1px solid #e0e7ff;
      }
    }

    @media (max-width:768px) {
      .container {
        padding: 12px;
      }

      .hero {
        padding: 24px 10px 32px;
      }

      .portrait-wrap {
        width: 240px;
      }

      .date-pill {
        font-size: 18px;
      }

      .date-left {
        left: -180px;
      }

      .date-right {
        right: -180px;
      }
    }

    @media (max-width:480px) {
      .container {
        padding-left: 10px;
        padding-right: 6px;
      }

      .hero {
        padding-left: 10px;
        padding-right: 6px;
      }

      .portrait-wrap {
        width: 180px;
      }

      .date-pill {
        font-size: 11px;
      }

      .date-left {
        left: -95px;
      }

      .date-right {
        right: -95px;
      }
    }

    @media (max-width:360px) {

      .date-left,
      .date-right {
        top: 40%;
      }
    }

    .modal--donation {
      padding: 0;
      width: min(900px, 95vw) !important;
      max-width: 900px;
      max-height: 80vh;
      overflow: auto;
    }

    .donation-form {
      max-height: 70vh;
      overflow-y: auto;
      padding-right: 10px;
      scrollbar-width: none;
    }

    .donation-form::-webkit-scrollbar {
      width: 0;
    }

    #modalDonation .btn-primary {
      background: var(--btn-main) !important;
      color: #fff !important;
      border: none !important;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
      border-radius: 12px !important;
    }

    #modalDonation .btn-primary:hover {
      background: var(--btn-main-hover) !important;
    }

    .donation-info .flowers-hotline-label,
    .donation-info h4 {
      font-size: 20px !important;
      font-weight: 800 !important;
      letter-spacing: .5px;
    }

    .donation-form h3 {
      font-size: 22px !important;
      font-weight: 800 !important;
      margin-bottom: 16px;
    }

    .read-more-link {
      font-size: 13px;
      font-weight: 600;
      margin-left: 4px;
      color: #4f46e5;
      text-decoration: none;
      white-space: nowrap;
    }

    .read-more-link:hover {
      text-decoration: underline;
    }

    .watermark {
      display: none;
    }

    @media (max-width:480px) {
      .poster-download-btn {
        right: 12px !important;
        top: 16px;
        transform: scale(0.9);
      }
    }

    /* ✅ Bottom-right toast notifications (stack) */
    .toast-stack {
      position: fixed;
      right: 16px;
      bottom: 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      z-index: 2147483647;
      pointer-events: none;
    }

    .toast-pop {
      pointer-events: auto;
      min-width: 260px;
      max-width: 360px;
      background: #fff;
      border: 1px solid #e5e7eb;
      border-left: 5px solid #6366f1;
      border-radius: 14px;
      padding: 10px 12px;
      box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      transform: translateY(10px);
      opacity: 0;
      transition: all .18s ease;
    }

    .toast-pop.show {
      transform: translateY(0);
      opacity: 1;
    }

    .toast-pop.success {
      border-left-color: #16a34a;
    }

    .toast-pop.error {
      border-left-color: #dc2626;
    }

    .toast-pop.info {
      border-left-color: #6366f1;
    }

    .toast-title {
      font-weight: 800;
      color: #111827;
      font-size: .92rem;
      margin: 0;
    }

    .toast-msg {
      margin: 2px 0 0;
      color: #475569;
      font-size: .88rem;
      line-height: 1.25rem;
    }

    .toast-x {
      border: none;
      background: transparent;
      cursor: pointer;
      color: #64748b;
      font-size: 18px;
      line-height: 18px;
      padding: 0;
    }

    .toast-x:hover {
      color: #0f172a;
    }

    /* ===== Donation modal Cancel button FIX ===== */
    #modalDonation .flowers-btn-secondary {
      background: #ffffff !important;
      /* white background */
      color: #000000 !important;
      /* black text */
      border: 1px solid #cbd5e1 !important;
      box-shadow: 0 2px 6px rgba(0, 0, 0, .12) !important;
      font-weight: 600;
    }

    #modalDonation .flowers-btn-secondary:hover {
      background: #f1f5f9 !important;
      color: #000000 !important;
    }

    /* ===== Currency dropdown (Donate modal) - style only, keep your colors ===== */
    .amount-row {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .amount-row input[type=number] {
      flex: 1 1 auto;
      height: 44px;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px 12px;
      font: inherit;
      background: #fff;
      outline: none;
    }

    .select-wrap {
      position: relative;
      flex: 0 0 110px;
      height: 44px;
    }

    /* Make select look like your input */
    .field-select {
      width: 100%;
      height: 44px;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px 44px 10px 12px;
      /* space for arrow */
      font: inherit;
      background: #fff;
      outline: none;

      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;

      box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
      cursor: pointer;
      line-height: 1.2;
    }

    /* Keep your focus behavior (no color change, uses existing purple ring) */
    .field-select:focus,
    .amount-row input[type=number]:focus {
      border-color: rgba(85, 31, 189, .75);
      box-shadow: 0 0 0 4px rgba(85, 31, 189, .14);
    }

    /* Arrow container */
    .select-caret {
      position: absolute;
      right: 14px;
      top: 50%;
      transform: translateY(-50%);
      width: 28px;
      height: 28px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      pointer-events: none;
    }

    /* Arrow */
    .select-caret::before {
      content: '';
      width: 0;
      height: 0;
      border-left: 6px solid transparent;
      border-right: 6px solid transparent;
      border-top: 7px solid #64748b;
      /* same neutral arrow */
    }

    /* Hover (no color changes, just subtle depth) */
    .field-select:hover {
      box-shadow: 0 2px 6px rgba(15, 23, 42, .10);
    }

    /* Mobile */
    @media (max-width:480px) {
      .select-wrap {
        flex-basis: 98px;
      }
    }

    /* Currency custom dropdown (inside donate modal) */
    .select-wrap {
      flex: 0 0 110px;
    }

    .dd-currency {
      position: relative;
      width: 110px;
    }

    .dd-currency .dd-toggle {
      width: 100%;
      height: 44px;
      padding: 0 40px 0 12px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: #fff;
      font: inherit;
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
    }

    .dd-currency .dd-toggle::after {
      content: '';
      width: 0;
      height: 0;
      border-left: 6px solid transparent;
      border-right: 6px solid transparent;
      border-top: 7px solid #64748b;
    }

    .dd-currency.open .dd-toggle {
      border-color: rgba(85, 31, 189, .75);
      box-shadow: 0 0 0 4px rgba(85, 31, 189, .14);
      background: #fff;
    }

    .dd-currency .dd-menu {
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      width: 100%;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 14px;
      box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
      padding: 6px;
      z-index: 20000;
      display: none;
    }

    .dd-currency.open .dd-menu {
      display: block;
    }

    .dd-currency .dd-item {
      width: 100%;
      border: 0;
      background: transparent;
      padding: 10px 12px;
      border-radius: 10px;
      text-align: left;
      font: inherit;
      cursor: pointer;
    }

    .dd-currency .dd-item:hover {
      background: #f3f4f6;
    }

    .dd-currency .dd-item.active {
      background: #ecfdf5;
      color: #065f46;
    }

    /* make sure these are BELOW watermark */
    .portrait-area,
    .hero-title,
    .meta,
    .age-badge,
    .actions {
      position: relative;
      z-index: 5;
    }

    /* ✅ watermark ON TOP */
    #posterArea.poster-mode .watermark {
      display: flex !important;
      position: absolute;
      inset: 0;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      /* top */
      pointer-events: none;
      user-select: none;
      font-size: 90px;
      font-weight: 800;
      opacity: 0.06;
      color: #fff;
      text-shadow: 0 0 6px rgba(0, 0, 0, .35);
      transform: rotate(-35deg);
      white-space: nowrap;
    }

    /* ===== Responsive font tuning for Tributes (Tablet + Mobile) ===== */

    /* Tablet */
    @media (max-width: 1024px) {
      .tb-heading {
        font-size: 24px;
      }

      .tb-message {
        font-size: 26px;
        line-height: 1.35;
        max-width: 88%;
      }

      .tb-message-text {
        font-size: 26px;
        line-height: 1.35;
      }

      .tb-quote-icon-inline {
        font-size: 30px;
      }

      .tt-message {
        font-size: 24px;
        line-height: 1.35;
      }

      .tt-quote-icon-inline {
        font-size: 30px;
      }

      .tt-from {
        font-size: 22px;
      }

      .tt-meta {
        font-size: 20px;
      }

      .read-more-inline,
      .read-more-link {
        font-size: 21px;
      }
    }

    /* Mobile */
    @media (max-width: 768px) {
      .tb-heading {
        font-size: 21px;
      }

      #tributes .badge {
        display: none !important;
      }

      .tb-message {
        font-size: 20px;
        line-height: 1.3;
        max-width: 100%;
      }

      .tb-message-text {
        font-size: 20px;
        line-height: 1.3;
      }

      .tb-quote-icon-inline {
        font-size: 26px;
      }

      .tt-message {
        font-size: 22px;
        line-height: 1.3;
      }

      .tt-quote-icon-inline {
        font-size: 26px;
      }

      .tt-from {
        font-size: 19px;
      }

      .tt-meta {
        font-size: 17px;
      }

      .read-more-inline,
      .read-more-link {
        font-size: 16px;
      }

      .tb-from {
        font-size: 16px;
        font-weight: 700;
        line-height: 1.25;
      }

      .tb-from strong {
        font-size: 17px;
        font-weight: 800;
      }
    }

    /* Small phones */
    @media (max-width: 480px) {
      .tb-message {
        font-size: 15px;
      }

      .tb-message-text {
        font-size: 15px;
      }

      .tt-message {
        font-size: 15px;
      }
    }

    /* ===== Make Tribute cards smaller on tablet/mobile ===== */

    /* Tablet */
    @media (max-width: 1024px) {
      .tribute-banner {
        border-radius: 12px;
      }

      .tribute-banner img {
        height: 210px;
      }

      /* was 210px */
      .tribute-banner-overlay {
        padding: 14px 16px 12px;
      }

      .tb-message {
        max-width: 95%;
      }

      .tb-message-inner {
        -webkit-line-clamp: 2;
      }

      .tribute-text {
        padding: 16px 18px 14px;
      }
    }

    /* Mobile */
    @media (max-width: 768px) {
      .tribute-banner {
        border-radius: 12px;
        box-shadow: 0 6px 14px rgba(15, 23, 42, .14);
      }

      .tribute-banner img {
        height: 155px;
      }

      /* smaller card */
      .tribute-banner-overlay {
        padding: 12px 14px 10px;
      }

      /* keep message tight so overlay doesn't grow */
      .tb-message {
        max-width: 92%;
        gap: 8px;
      }

      .tb-message-inner {
        -webkit-line-clamp: 2;
      }

      .tb-from {
        margin-top: 6px;
        font-size: 13px;
      }

      .tb-meta {
        font-size: 11px;
      }

      .tribute-text {
        padding: 14px 14px 12px;
      }
    }

    /* Small phones */
    @media (max-width: 480px) {
      .tribute-banner img {
        height: 135px;
      }

      .tribute-banner-overlay {
        padding: 10px 12px 9px;
      }

      .tb-message {
        max-width: 100%;
      }

      .tb-message-inner {
        -webkit-line-clamp: 2;
      }

      .tribute-text {
        padding: 12px 12px 10px;
      }
    }


    /* ===== Hide time meta on tribute banner cards ===== */
    .tribute-banner .tb-meta {
      display: none;
    }

    /* =========================================
   FIX: Scroll the whole Send Flowers modal
   (not only the form)
   ========================================= */
    @media (max-width: 768px) {

      /* Let the modal sit with padding and scroll naturally */
      #modalFlowers.modal-backdrop {
        align-items: flex-start;
        padding: 12px;
      }

      /* Make the modal itself the scroll container */
      #modalFlowers .modal--flowers {
        width: 100% !important;
        max-width: 520px;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        /* ✅ scroll whole modal */
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
      }

      /* Stack left + right vertically */
      #modalFlowers .flowers-layout {
        grid-template-columns: 1fr !important;
      }

      /* Remove internal scroll from the form */
      #modalFlowers .flowers-form {
        max-height: none !important;
        overflow: visible !important;
        padding-bottom: 16px;
        /* space near bottom */
      }

      /* Keep layout borders correct */
      #modalFlowers .flowers-info {
        border-right: none;
        border-bottom: 1px solid #e0e7ff;
      }

      /* Make buttons part of scroll content (NOT sticky) */
      #modalFlowers .modal-actions.flowers-actions {
        position: static !important;
        background: transparent !important;
        border-top: none !important;
        padding-top: 12px;
      }

      /* Buttons full width on mobile */
      #modalFlowers .flowers-actions .btn {
        flex: 1;
        justify-content: center;
      }
    }

    /* ===== Phone layout (like reference) ===== */
    .phone-row {
      display: grid;
      grid-template-columns: 120px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
    }

    /* ===== Custom dropdown (input-select style) ===== */
    .custom-select {
      position: relative;
      width: 100%;
      min-width: 0;
    }

    .custom-select-trigger {
      position: relative;
      width: 100%;
      height: 44px;
      padding: 10px 40px 10px 12px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: #fff;
      font: inherit;
      color: var(--text);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      box-shadow: 0 1px 2px rgba(15, 23, 42, .08);

      /* IMPORTANT: remove default button look */
      appearance: none;
      -webkit-appearance: none;
      outline: none;
    }

    .custom-select:hover .custom-select-trigger {
      box-shadow: 0 2px 6px rgba(15, 23, 42, .10);
    }

    .custom-select.open .custom-select-trigger {
      border-color: rgba(85, 31, 189, .75);
      box-shadow: 0 0 0 4px rgba(85, 31, 189, .14);
    }

    .custom-select-trigger::after {
      content: "";
      position: absolute;
      right: 14px;
      top: 50%;
      transform: translateY(-50%);
      border-left: 6px solid transparent;
      border-right: 6px solid transparent;
      border-top: 7px solid #64748b;
    }

    .custom-select-text {
      flex: 1;
      text-align: left;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* dropdown menu */
    .custom-options {
      position: absolute;
      left: 0;
      top: calc(100% + 8px);
      width: 100%;
      background: #fff;
      border-radius: 14px;
      border: 1px solid #e5e7eb;
      box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
      max-height: 240px;
      overflow: auto;
      z-index: 30000;
      display: none;
      padding: 6px;
    }

    .custom-select.open .custom-options {
      display: block;
    }

    .custom-select.open-up .custom-options {
      top: auto;
      bottom: calc(100% + 8px);
    }

    .custom-option {
      padding: 10px 12px;
      font-size: 14px;
      color: #111827;
      cursor: pointer;
      border-radius: 10px;
      white-space: nowrap;
    }

    .custom-option:hover {
      background: #f3f4f6;
    }

    .custom-option.is-selected {
      background: #ede9fe;
      color: #4338ca;
      font-weight: 700;
    }

    /* hide real select */
    .native-select-hidden {
      position: absolute;
      left: -99999px;
      width: 1px;
      height: 1px;
      opacity: 0;
      pointer-events: none;
    }

    .flowers-layout,
    .flowers-form {
      overflow: visible;
    }

    /* Increase ONLY the dropdown list width */
    .phone-row .custom-options {
      width: 260px;
      /* 👈 increase as you like (240–300px is ideal) */
      max-width: 320px;
      overflow-x: hidden;
      /* no horizontal scrollbar */
    }

    /* .custom-option{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; 
}
.custom-options{ overflow-x: hidden; overflow-y:auto; } */
    /* ===== Sponsored: single card horizontal carousel ===== */
    .ad-card {
      margin-top: 18px;
      border: 1px solid var(--border);
      border-radius: 16px;
      background: #fff;
      overflow: hidden;
      width: 360px;
      /* card width like your screenshot */
      max-width: 100%;
    }

    /* ===== Sponsored header: primary background + white text ===== */
    .ad-head-row {
      background: var(--btn-main);
      /* primary color */
      color: #ffffff;
      border-bottom: none;

      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;

      padding: 14px 16px;
      border-radius: 14px 14px 0 0;
      /* rounded top like card */
    }

    /* Sponsored text */
    .ad-title {
      color: #ffffff;
      font-weight: 800;
      letter-spacing: .4px;
      text-transform: uppercase;
    }

    /* + ADD YOUR AD button */
    .ad-add-btn {
      background: rgba(255, 255, 255, 0.15);
      color: #ffffff;
      border: 1px solid rgba(255, 255, 255, 0.45);

      font-size: 13px;
      font-weight: 700;
      padding: 6px 14px;
      border-radius: 999px;
      text-decoration: none;
      white-space: nowrap;

      transition: background .15s ease, box-shadow .15s ease;
    }

    .ad-add-btn:hover {
      background: rgba(255, 255, 255, 0.25);
      box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    }


    .ad-viewport {
      position: relative;
      /* 👈 REQUIRED */
      width: 100%;
      overflow: hidden;
      padding: 12px;
    }


    .ad-track {
      display: flex;
      gap: 0;
      will-change: transform;
      transition: transform .55s ease;
    }

    .ad-slide {
      flex: 0 0 100%;
      display: flex;
      justify-content: center;
      padding: 0 14px;
      /* 👈 ADDED: left & right inner gap */
    }


    .ad-card-inner {
      width: 100%;
      border-radius: 16px;
      overflow: hidden;
      border: 1px solid rgba(0, 0, 0, .08);
      box-shadow: 0 6px 18px rgba(15, 23, 42, .10);
      background: #fff;
    }

    .ad-img {
      width: 100%;
      aspect-ratio: 1 / 1;
      /* square image like your UI */
      object-fit: cover;
      display: block;
    }

    .ad-actions {
      display: flex;
      gap: 10px;
      padding: 12px;
      justify-content: center;
    }

    .ad-btn {
      flex: 1;
      height: 44px;
      border-radius: 12px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-weight: 700;
      text-decoration: none;
      border: 1px solid rgba(0, 0, 0, .10);
      box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    }

    .ad-btn-wa {
      background: #a7f3d0;
      /* similar “Contact” green vibe */
      color: #064e3b;
    }

    .ad-btn-view {
      background: #551fbd;
      color: #fff;
      border: none;
    }

    .ad-btn-view:hover {
      filter: brightness(.95);
    }

    .ad-btn-wa:hover {
      filter: brightness(.97);
    }

    .ad-dots {
      display: flex;
      justify-content: center;
      gap: 6px;
      padding: 8px 0 14px;
    }

    .ad-dot {
      width: 7px;
      height: 7px;
      border-radius: 999px;
      background: rgba(100, 116, 139, .35);
    }

    .ad-dot.active {
      background: rgba(85, 31, 189, .85);
    }

    /* mobile */
    @media (max-width: 480px) {
      .ad-card {
        width: 100%;
      }
    }



    /* Tablet details page: keep Summary and Sponsored ad side-by-side.
       This only changes the tablet responsive layout; existing card UI/animations stay untouched. */
    @media (min-width: 721px) and (max-width: 768px) {
      .summary-col {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 18px;
        align-items: stretch;
        text-align: left;
      }

      .summary-card,
      .summary-col .ad-card {
        height: 100%;
      }

      .summary-col .ad-card {
        width: 100%;
        margin-top: 0;
      }

      .summary-col .ad-viewport {
        height: calc(100% - 58px);
      }

      .summary-col .ad-track,
      .summary-col .ad-slide,
      .summary-col .ad-card-inner {
        height: 100%;
      }

      .summary-col .ad-card-inner {
        display: flex;
        flex-direction: column;
      }

      .summary-col .ad-img {
        flex: 1 1 auto;
        min-height: 0;
        aspect-ratio: auto;
      }

      .summary-col .ad-actions {
        flex: 0 0 auto;
      }
    }

    /* ===== Carousel Arrows ===== */
    .ad-arrow {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 38px;
      height: 38px;
      border-radius: 999px;
      border: none;
      background: rgba(255, 255, 255, .85);
      box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
      font-size: 20px;
      font-weight: 700;
      cursor: pointer;
      display: grid;
      place-items: center;
      color: #111827;
      z-index: 10;

      /* ✅ hidden by default */
      opacity: 0;
      pointer-events: none;
      transition: opacity .18s ease, transform .18s ease, filter .18s ease;
    }

    /* ✅ show arrows only when hover the ad area */
    .ad-viewport:hover .ad-arrow,
    .ad-card:hover .ad-arrow {
      opacity: 1;
      pointer-events: auto;
    }

    .ad-prev {
      left: 10px;
    }

    .ad-next {
      right: 10px;
    }

    .ad-arrow:hover {
      background: #fff;
      transform: translateY(-50%) scale(1.05);
    }

    /* keep your small size tweak */
    @media (max-width: 380px) {
      .ad-arrow {
        width: 32px;
        height: 32px;
        font-size: 18px;
      }
    }

    /* ===== Sponsored header layout ===== */
    .ad-head-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
    }

    .ad-title {
      font-weight: 800;
      letter-spacing: .3px;
      text-align: left;
    }

    /* Add Advertisement button */
    .ad-add-btn {
      font-size: 13px;
      font-weight: 700;
      padding: 6px 12px;
      border-radius: 999px;
      background: #f1f5f9;
      color: #0f172a;
      border: 1px solid #cbd5e1;
      text-decoration: none;
      white-space: nowrap;
      transition: background .15s ease, box-shadow .15s ease;
    }

    .ad-add-btn:hover {
      background: #e2e8f0;
      box-shadow: 0 2px 6px rgba(15, 23, 42, .15);
    }
    .modal--donation {
      width: min(1000px, 95vw) !important;
      max-width: 1000px;
      max-height: 92vh;
      overflow-y: auto;
    }
    
    .donation-form {
      max-height: none;
      overflow: visible;
    }
    #modalFlowers .flowers-layout,
    #modalDonation .flowers-layout {
      min-height: 780px;
    }


    /* ===== Flowers / Donation modal alignment fix ===== */
    #modalFlowers .modal--flowers,
    #modalDonation .modal--flowers {
      text-align: left !important;
    }

    #modalFlowers .flowers-form,
    #modalDonation .flowers-form {
      text-align: left !important;
      padding-left: 24px;
      padding-right: 24px;
    }

    #modalFlowers .flowers-form h3,
    #modalDonation .flowers-form h3 {
      text-align: left !important;
      margin-left: 0;
    }

    #modalFlowers .row,
    #modalDonation .row {
      text-align: left !important;
      width: 100%;
      gap: 7px;
      margin-top: 12px;
    }

    #modalFlowers .row label,
    #modalDonation .row label {
      display: block;
      text-align: left !important;
      justify-self: start;
      width: 100%;
      margin: 0;
      font-size: 14px;
      font-weight: 600;
      color: #334155;
    }

    #modalFlowers input[type=text],
    #modalFlowers input[type=number],
    #modalFlowers textarea,
    #modalDonation input[type=text],
    #modalDonation input[type=number],
    #modalDonation textarea {
      text-align: left !important;
      display: block;
    }

    #modalFlowers .phone-row,
    #modalDonation .phone-row,
    #modalDonation .amount-row {
      width: 100%;
      text-align: left !important;
    }

    #modalFlowers .custom-select-trigger,
    #modalDonation .custom-select-trigger,
    #modalDonation .dd-currency .dd-toggle {
      text-align: left !important;
    }

    #modalFlowers .custom-select-text,
    #modalDonation .custom-select-text {
      text-align: left !important;
    }

    #modalFlowers .flowers-actions,
    #modalDonation .flowers-actions {
      width: 100%;
      justify-content: flex-end !important;
    }

    @media (max-width: 720px) {
      #modalFlowers .flowers-form,
      #modalDonation .flowers-form {
        padding-left: 18px;
        padding-right: 18px;
      }

      #modalFlowers .phone-row,
      #modalDonation .phone-row {
        grid-template-columns: 110px minmax(0, 1fr);
      }
    }

    @media (max-width: 480px) {
      #modalFlowers .phone-row,
      #modalDonation .phone-row,
      #modalDonation .amount-row {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
      }

      #modalDonation .select-wrap,
      #modalDonation .dd-currency {
        width: 100%;
        flex-basis: auto;
      }
    }

/* Fix: keep the comment/tribute form content aligned to the left inside the modal */
#modalTributeType .tribute-type-modal,
#modalTributeType .tribute-type-modal form,
#modalTributeType .tribute-type-modal .row,
#modalTributeType .tribute-type-modal label,
#modalTributeType .tribute-type-modal input,
#modalTributeType .tribute-type-modal textarea {
  text-align: left !important;
}

#modalTributeType .tribute-type-modal h4 {
  text-align: left !important;
  margin-left: 0 !important;
}

#modalTributeType .tribute-type-modal label {
  display: block !important;
  width: 100% !important;
  margin-bottom: 6px !important;
}

#modalTributeType .tribute-type-modal input,
#modalTributeType .tribute-type-modal textarea {
  display: block !important;
}

#modalTributeType .tribute-type-modal .modal-actions {
  justify-content: flex-end !important;
}


/* OTP modal safety fallback for details page. Keeps OTP hidden until JS opens it. */
#otpModal.otp-backdrop {
  position: fixed !important;
  inset: 0 !important;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2147483646 !important;
}

#otpModal.otp-backdrop .otp-modal {
  position: relative;
  z-index: 2147483647 !important;
}
