
  #r3nl-root {
    position: fixed; inset: 0; z-index: 10050;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #1D1D1F; text-align: left;
  }
  #r3nl-root[hidden] { display: none; }
  html.r3nl-open kepleroai-chat,
  html.r3nl-open .c3r-launcher { display: none !important; }
  #r3nl-root *, #r3nl-root *::before, #r3nl-root *::after { box-sizing: border-box; }

  #r3nl-root .r3nl-backdrop {
    position: absolute; inset: 0;
    background: rgba(29, 29, 31, .42);
    opacity: 0; transition: opacity .28s ease;
    touch-action: none;
  }
  #r3nl-root .r3nl-panel {
    position: relative; width: 100%; max-width: 400px;
    max-height: calc(100% - 8px); overflow: auto; overscroll-behavior: contain;
    background: #FFFFFF; border-radius: 24px; padding: 14px 14px 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
    opacity: 0; transform: translateY(12px) scale(.98);
    transition: opacity .28s ease, transform .34s cubic-bezier(.2, .8, .2, 1);
    outline: none;
  }
  #r3nl-root.is-open .r3nl-backdrop { opacity: 1; }
  #r3nl-root.is-open .r3nl-panel { opacity: 1; transform: none; }

  /* Buono */
  #r3nl-root .r3nl-ticket {
    position: relative; overflow: hidden;
    background: #0071E3; color: #FFFFFF; border-radius: 16px;
  }
  #r3nl-root .r3nl-x {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 32px; height: 32px; padding: 0; margin: 0;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .18); color: #FFFFFF; cursor: pointer;
    transition: background .2s ease;
  }
  #r3nl-root .r3nl-x:hover { background: rgba(255, 255, 255, .28); }
  #r3nl-root .r3nl-t-top { padding: 26px 22px 18px; }
  #r3nl-root .r3nl-amount {
    font-size: 60px; line-height: 1; font-weight: 700; letter-spacing: -.04em;
  }
  #r3nl-root .r3nl-amount-sub {
    margin-top: 8px; font-size: 15px; line-height: 1.35; opacity: .88;
  }
  #r3nl-root .r3nl-t-cut {
    position: relative; height: 0; margin: 0 16px;
    border-top: 1.5px dashed rgba(255, 255, 255, .45);
  }
  #r3nl-root .r3nl-t-cut::before,
  #r3nl-root .r3nl-t-cut::after {
    content: ""; position: absolute; top: -10px;
    width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF;
  }
  #r3nl-root .r3nl-t-cut::before { left: -26px; }
  #r3nl-root .r3nl-t-cut::after { right: -26px; }
  #r3nl-root .r3nl-t-bottom {
    display: flex; align-items: center; gap: 12px; padding: 15px 18px 16px 22px; min-height: 64px;
  }
  #r3nl-root .r3nl-t-label { font-size: 13px; opacity: .75; }
  #r3nl-root .r3nl-code {
    position: relative; flex: 1; min-height: 26px;
    display: flex; align-items: center;
    font-size: 19px; font-weight: 600; letter-spacing: .06em;
  }
  #r3nl-root .r3nl-mask,
  #r3nl-root .r3nl-real { transition: opacity .4s ease, transform .4s ease, filter .4s ease; }
  #r3nl-root .r3nl-mask { letter-spacing: .12em; opacity: .7; }
  #r3nl-root .r3nl-real {
    position: absolute; left: 0; user-select: all; -webkit-user-select: all;
    opacity: 0; transform: translateY(6px); filter: blur(4px);
  }
  #r3nl-root .is-unlocked .r3nl-mask { opacity: 0; transform: translateY(-6px); }
  #r3nl-root .is-unlocked .r3nl-real { opacity: 1; transform: none; filter: none; }
  #r3nl-root .r3nl-copy {
    appearance: none; -webkit-appearance: none; margin: 0;
    border: 0; border-radius: 999px; padding: 8px 14px;
    background: #FFFFFF; color: #0071E3;
    font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer;
  }
  #r3nl-root .r3nl-copy[hidden] { display: none; }

  /* Testo e modulo */
  #r3nl-root .r3nl-body { padding: 20px 8px 0; }
  #r3nl-root .r3nl-body[hidden] { display: none; }
  #r3nl-root .r3nl-title {
    margin: 0 0 8px; padding: 0;
    font-family: inherit; font-size: 22px; line-height: 1.2; font-weight: 700;
    letter-spacing: -.02em; color: #1D1D1F;
  }
  #r3nl-root .r3nl-text {
    margin: 0 0 16px; font-size: 15px; line-height: 1.45; color: #6E6E73;
  }
  #r3nl-root .r3nl-form { margin: 0; }
  #r3nl-root .r3nl-sr {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
  }
  #r3nl-root .r3nl-input {
    display: block; width: 100%; height: 50px; margin: 0; padding: 0 16px;
    font: inherit; font-size: 16px; color: #1D1D1F;
    background: #F5F5F7; border: 1.5px solid transparent; border-radius: 14px;
    box-shadow: none; outline: none;
    transition: border-color .2s ease, background .2s ease;
  }
  #r3nl-root .r3nl-input::placeholder { color: #86868B; }
  #r3nl-root .r3nl-input:focus { border-color: #0071E3; background: #FFFFFF; }
  #r3nl-root .r3nl-input.is-bad { border-color: #D70015; }
  #r3nl-root .r3nl-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
  #r3nl-root .r3nl-check {
    display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0;
    font-size: 13px; line-height: 1.4; font-weight: 400; color: #6E6E73; cursor: pointer;
  }
  #r3nl-root .r3nl-check input {
    width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: #0071E3;
  }
  #r3nl-root .r3nl-check a { color: #0071E3; text-decoration: underline; }
  #r3nl-root .r3nl-err { margin: 10px 0 0; font-size: 13px; line-height: 1.4; color: #D70015; }
  #r3nl-root .r3nl-err:empty { display: none; }
  #r3nl-root .r3nl-btn {
    display: block; width: 100%; height: 50px; margin: 16px 0 0; padding: 0 16px;
    border: 0; border-radius: 14px; background: #0071E3; color: #FFFFFF;
    font: inherit; font-size: 17px; font-weight: 600; cursor: pointer;
    transition: background .2s ease, opacity .2s ease;
  }
  #r3nl-root .r3nl-btn:hover { background: #0077ED; }
  #r3nl-root .r3nl-btn:disabled { opacity: .6; cursor: default; }

  #r3nl-root .r3nl-x:focus-visible,
  #r3nl-root .r3nl-copy:focus-visible,
  #r3nl-root .r3nl-btn:focus-visible,
  #r3nl-root .r3nl-check input:focus-visible,
  #r3nl-root .r3nl-check a:focus-visible {
    outline: 3px solid rgba(0, 113, 227, .45); outline-offset: 2px;
  }
  #r3nl-root .r3nl-x:focus-visible,
  #r3nl-root .r3nl-copy:focus-visible { outline-color: rgba(255, 255, 255, .8); }

  /* Telefono: pannello dal basso */
  @media (max-width: 600px) {
    #r3nl-root { align-items: flex-end; padding: 0; }
    #r3nl-root .r3nl-panel {
      max-width: none; max-height: 92%;
      border-radius: 24px 24px 0 0;
      padding: 14px 14px calc(20px + env(safe-area-inset-bottom, 0px));
      transform: translateY(100%); opacity: 1;
    }
    #r3nl-root .r3nl-amount { font-size: 52px; }
    #r3nl-root .r3nl-t-top { padding: 22px 20px 16px; }
  }

  @media (prefers-reduced-motion: reduce) {
    #r3nl-root .r3nl-backdrop,
    #r3nl-root .r3nl-panel,
    #r3nl-root .r3nl-mask,
    #r3nl-root .r3nl-real { transition: none; }
  }

  /* ---------- Pannello diagnostica (solo con ?popup3r=diag) ---------- */
  #r3d-root {
    position: fixed; z-index: 10060;
    top: calc(10px + env(safe-area-inset-top, 0px)); left: 10px;
    width: min(380px, calc(100% - 20px));
    background: #FFFFFF; color: #1D1D1F;
    border: 1px solid #D2D2D7; border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px; line-height: 1.4; text-align: left;
    -webkit-font-smoothing: antialiased;
  }
  #r3d-root * { box-sizing: border-box; }
  #r3d-root .r3d-toggle {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
    margin: 0; padding: 12px 14px; border: 0; background: transparent;
    font: inherit; color: inherit; text-align: left; cursor: pointer;
  }
  #r3d-root .r3d-toggle strong { font-size: 14px; font-weight: 600; }
  #r3d-root .r3d-sum { font-size: 12px; color: #6E6E73; white-space: nowrap; }
  #r3d-root .r3d-sum.is-ko { color: #D70015; font-weight: 600; }
  #r3d-root .r3d-sum.is-ok { color: #1E7E34; font-weight: 600; }
  #r3d-root .r3d-body { padding: 0 14px 12px; }
  #r3d-root.is-collapsed .r3d-body { display: none; }
  #r3d-root .r3d-list {
    list-style: none; margin: 0; padding: 0;
    max-height: 40vh; overflow: auto; border-top: 1px solid #E8E8ED;
  }
  #r3d-root .r3d-row {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 0; padding: 8px 0; border-bottom: 1px solid #F2F2F5;
  }
  #r3d-root .r3d-ico {
    flex: 0 0 20px; height: 20px; margin-top: -1px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
  }
  #r3d-root .r3d-ok .r3d-ico { background: #E6F4EA; color: #1E7E34; }
  #r3d-root .r3d-ko .r3d-ico { background: #FDECEE; color: #D70015; }
  #r3d-root .r3d-warn .r3d-ico { background: #FFF4E5; color: #A15C00; }
  #r3d-root .r3d-info .r3d-ico { background: #E8F2FD; color: #0071E3; }
  #r3d-root .r3d-wait .r3d-ico { background: #F2F2F5; color: #6E6E73; }
  #r3d-root .r3d-actions { display: flex; gap: 8px; margin-top: 10px; }
  #r3d-root .r3d-btn {
    flex: 1; height: 36px; margin: 0; border: 0; border-radius: 10px;
    background: #F5F5F7; color: #0071E3;
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  }
  #r3d-root .r3d-note { margin: 8px 0 0; font-size: 11.5px; color: #86868B; }
  @media (max-width: 600px) {
    #r3d-root .r3d-list { max-height: 30vh; }
  }
