.tfys-flinks {
    --tfys-cream: #f8f6df;
    --tfys-sage: #5C6652;
    --tfys-sage-dark: #3E4A3A;
    --tfys-ocher: #C28E4D;
    --tfys-text-mid: #6D6560;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px 48px;
    width: 100%;
    margin: 0;
    padding: 18px 24px;
    font-family: 'Montserrat', Arial, sans-serif;
    background: transparent;
  }

  .tfys-flinks *,
  .tfys-flinks *::before,
  .tfys-flinks *::after,
  .tfys-lmodal *,
  .tfys-lmodal *::before,
  .tfys-lmodal *::after { box-sizing: border-box; }

  .tfys-flinks__link {
    margin: 0;
    padding: 4px 2px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none !important;
    color: var(--tfys-sage-dark) !important;
    border: 0;
    background: none;
    cursor: pointer;
    transition: color 0.25s ease, opacity 0.25s ease;
  }

  .tfys-flinks__link:hover,
  .tfys-flinks__link:focus-visible {
    color: var(--tfys-ocher) !important;
    outline: none;
  }

  #tfys-modal-legal.tfys-modal {
    --tfys-cream: #f8f6df;
    --tfys-text: #4A4540;
    --tfys-text-mid: #6D6560;
    --tfys-ocher: #C28E4D;
    --tfys-sage: #5C6652;
    --tfys-sage-dark: #3E4A3A;
    position: fixed;
    inset: 0;
    z-index: 1000020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: 'Montserrat', Arial, sans-serif;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  #tfys-modal-legal.tfys-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  #tfys-modal-legal .tfys-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(62, 74, 58, 0.45);
    cursor: pointer;
  }

  #tfys-modal-legal .tfys-lmodal__dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(82vh, 720px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--tfys-cream);
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(62, 74, 58, 0.22);
    animation: tfys-lmodal-in 0.35s ease;
  }

  @keyframes tfys-lmodal-in {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  #tfys-modal-legal .tfys-modal__topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 8px 18px;
    background: var(--tfys-cream);
    border-bottom: 1px solid rgba(194, 142, 77, 0.22);
    z-index: 5;
  }

  #tfys-modal-legal .tfys-modal__topbar-label {
    margin: 0 !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tfys-ocher);
  }

  #tfys-modal-legal .tfys-modal__close {
    position: relative;
    top: auto;
    right: auto;
    z-index: 3;
    width: 44px;
    height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(92, 102, 82, 0.1);
    color: var(--tfys-sage-dark);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
  }

  #tfys-modal-legal .tfys-modal__close:hover {
    color: var(--tfys-ocher);
    background: rgba(194, 142, 77, 0.2);
  }

  #tfys-modal-legal .tfys-lmodal__content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 22px 28px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  @media (max-width: 760px) {
    #tfys-modal-legal.tfys-modal {
      padding: max(12px, env(safe-area-inset-top, 0px)) 10px max(12px, env(safe-area-inset-bottom, 0px));
      align-items: center;
    }

    #tfys-modal-legal .tfys-lmodal__dialog {
      width: 100%;
      max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
      max-height: calc(100vh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
      border-radius: 16px;
    }
  }

  .tfys-lmodal__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
  }

  .tfys-lmodal__tab {
    padding: 7px 12px;
    border: 1px solid rgba(194, 142, 77, 0.45);
    border-radius: 999px;
    background: transparent;
    color: var(--tfys-sage-dark);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  }

  .tfys-lmodal__tab.is-active,
  .tfys-lmodal__tab:hover {
    background: rgba(194, 142, 77, 0.14);
    border-color: var(--tfys-ocher);
    color: var(--tfys-ocher);
  }

  #tfys-modal-legal .tfys-modal__title {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.45rem, 3vw, 1.85rem);
    font-weight: 400;
    line-height: 1.25;
    color: var(--tfys-sage-dark);
  }

  #tfys-modal-legal .tfys-modal__line {
    display: block;
    width: 44px;
    height: 2px;
    margin: 14px 0 20px;
    background: var(--tfys-ocher);
    border-radius: 2px;
  }

  .tfys-lmodal__body p {
    margin: 0 0 1.05em;
    font-size: 0.92rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--tfys-text-mid);
  }

  .tfys-lmodal__body p:last-child { margin-bottom: 0; }

  .tfys-lmodal__body a {
    color: var(--tfys-sage);
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .tfys-lmodal__body a:hover { color: var(--tfys-ocher); }

  .tfys-lmodal__body strong {
    font-weight: 500;
    color: var(--tfys-text);
  }

  body.tfys-modal-open { overflow: hidden; }

  @media (max-width: 520px) {
    .tfys-flinks { gap: 10px 28px; padding: 14px 16px; }
    .tfys-flinks__link { font-size: 0.66rem; letter-spacing: 0.12em; }
    #tfys-modal-legal .tfys-lmodal__dialog { padding: 24px 18px 28px; max-height: 88vh; }
    .tfys-lmodal__tabs { margin-right: 24px; gap: 6px; }
    .tfys-lmodal__tab { padding: 6px 10px; font-size: 0.62rem; }
  }

/* Legacy double-X / force-x: never show */
.tfys-modal > .tfys-modal__x,
[id$="-force-x"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

