.tewl{max-width:920px;margin:24px auto;padding:0 16px;font-size:14px;line-height:1.5;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif}
.tewl-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;border-radius:14px;background:linear-gradient(180deg,#0f1826 0%,#0b1220 100%);color:#e9eef7;border:1px solid rgba(255,255,255,.08)}
.tewl-brand{display:flex;align-items:center;gap:12px}
.tewl-logo{width:34px;height:34px;object-fit:contain;filter:drop-shadow(0 2px 6px rgba(0,0,0,.35))}
.tewl-name{font-weight:700;letter-spacing:.2px}
.tewl-sub{font-size:12px;opacity:.85;margin-top:2px}
.tewl-ver{opacity:.75;margin-left:6px;font-size:12px}
.tewl-session{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.tewl-who{align-self:center;font-size:12px;opacity:.9;color:#e9eef7;padding:0 6px;white-space:nowrap;max-width:320px;overflow:hidden;text-overflow:ellipsis}
.tewl-link{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.10);color:#e9eef7;padding:8px 10px;border-radius:10px;cursor:pointer;font-size:13px}
.tewl-link:hover{background:rgba(255,255,255,.10)}
.tewl-card{margin-top:14px;background:#0b1220;color:#e9eef7;border:1px solid rgba(255,255,255,.08);border-radius:16px;padding:18px;box-shadow:0 12px 30px rgba(0,0,0,.25)}
.tewl-footer{margin-top:12px;opacity:.8;font-size:12px;color:#2b3648}
.tewl-footnote{color:rgba(15,24,38,.65)}
.tewl h2{margin:0 0 12px 0;font-size:18px}
.tewl .tewl-grid{display:grid;grid-template-columns:1fr;gap:14px}
@media (min-width:860px){.tewl .tewl-grid{grid-template-columns:1fr 1fr}}
.tewl .tewl-panel{border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:14px;background:rgba(255,255,255,.03)}
.tewl label{display:block;font-size:12px;opacity:.9;margin-bottom:6px}
.tewl input,.tewl select,.tewl textarea{width:100%;padding:10px 10px;border-radius:12px;border:1px solid rgba(255,255,255,.12);background:rgba(0,0,0,.22);color:#e9eef7;outline:none}
.tewl textarea{min-height:86px;resize:vertical}
.tewl .row{display:grid;grid-template-columns:1fr;gap:10px}
@media (min-width:860px){.tewl .row{grid-template-columns:1fr 1fr}}
.tewl .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 12px;border-radius:12px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.08);color:#e9eef7;cursor:pointer;font-weight:600;font-size:13px}
.tewl .btn:hover{background:rgba(255,255,255,.12)}
.tewl .btn[disabled]{opacity:.5;cursor:not-allowed}
.tewl .muted{font-size:12px;opacity:.85;margin-top:6px}
.tewl .hr{height:1px;background:rgba(255,255,255,.08);margin:12px 0}
.tewl .pill{display:inline-block;padding:4px 8px;border-radius:999px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.06);font-size:12px}
.tewl .ok{color:#b7f5c7}.tewl .warn{color:#ffe8a3}.tewl .bad{color:#ffb3b3}

/* Micro UX polish: emphasize high badge levels (premium) */
.tewl .pill.ok.level4,.tewl .pill.ok.level5{border-color:rgba(198,168,86,.40);background:linear-gradient(180deg, rgba(198,168,86,.22) 0%, rgba(255,255,255,.06) 68%);box-shadow:0 0 0 1px rgba(198,168,86,.22) inset, 0 14px 34px rgba(0,0,0,.28);}
.tewl .pill.ok.level5{background:linear-gradient(180deg, rgba(198,168,86,.30) 0%, rgba(255,255,255,.06) 72%);filter:drop-shadow(0 0 12px rgba(198,168,86,.22));}

/* One-time pop for freshly rendered pills */
.tewl .pill.pop{animation:tewlPop 280ms ease-out;}

/* Premium pulse: 3 times on render, then settle */
.tewl .pill.ok.level4.pop,.tewl .pill.ok.level5.pop{animation:tewlPop 280ms ease-out 0s 1, tewlPulse 650ms ease-out 0.28s 3;}

@keyframes tewlPulse{0%{transform:translateY(0) scale(1);}38%{transform:translateY(-1px) scale(1.04);}100%{transform:translateY(0) scale(1);}}

@keyframes tewlPop{from{transform:translateY(2px);opacity:.75}to{transform:translateY(0);opacity:1}}
.tewl pre{white-space:pre-wrap;word-break:break-word;background:rgba(0,0,0,.25);border:1px solid rgba(255,255,255,.08);padding:10px;border-radius:12px;overflow:auto}
.tewl .rulelist{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.tewl .rule{font-size:12px}
.tewl .hint{margin-top:8px}


/* Unified CTA under both panels */
.tewl-cta{margin-top:14px;background:#0b1220;color:#e9eef7;border:1px solid rgba(255,255,255,.08);border-radius:16px;padding:16px;box-shadow:0 12px 30px rgba(0,0,0,.25)}
.tewl-cta-title{font-weight:700;font-size:14px;margin-bottom:6px}
.tewl-cta-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.tewl-cta .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 12px;border-radius:12px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.08);color:#e9eef7;text-decoration:none;font-weight:600;font-size:13px;cursor:pointer}
.tewl-cta .btn:hover{background:rgba(255,255,255,.10)}


.tewl-tabs{display:flex;gap:8px;margin:10px 0 14px 0;}
.tewl-tabbtn{background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);color:#fff;padding:8px 12px;border-radius:999px;cursor:pointer;font-size:12px;}
.tewl-tabbtn.active{background:rgba(255,255,255,0.14);border-color:rgba(255,255,255,0.25);}

/* Events form */
.row{margin:10px 0;}
.row label{display:block;margin-bottom:6px;font-size:12px;opacity:.9;}
.row input,.row select,.row textarea{width:100%;box-sizing:border-box;}
.tewl-tabs-actions{margin-top:12px;}

.tewl-span-2{grid-column:1 / -1;max-width:none;width:100%;}

.row input[type=file]{padding:10px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);border-radius:10px;color:#fff;}


/* PRO-slot disabled UI */
.tewl-disabled-block{opacity:.55;pointer-events:none;}
.tewl-checkline{display:flex;gap:10px;align-items:flex-start;}
.tewl-checkline input{margin-top:2px;}
.tewl-adv{margin:10px 0;padding:10px;border:1px solid rgba(255,255,255,.12);border-radius:12px;background:rgba(255,255,255,.04);}
.tewl-adv summary{cursor:pointer;pointer-events:auto;opacity:1;user-select:none;}
.tewl-adv summary::-webkit-details-marker{display:none;}
.tewl-inline{display:flex;gap:10px;align-items:center;}

.tewl-adv{opacity:.55;}
.tewl-adv summary{opacity:1;}
.tewl-adv > *:not(summary){pointer-events:none;}


/* PRO options grouped */
.tewl-progroup{margin-top:14px;padding:10px;border:1px solid rgba(255,255,255,.12);border-radius:14px;background:rgba(255,255,255,.03);}
.tewl-progroup summary{cursor:pointer;user-select:none;font-size:12px;opacity:.95;}
.tewl-progroup summary::-webkit-details-marker{display:none;}

/* Recent events list */
.tewl-table{width:100%;border-collapse:collapse;margin-top:10px;font-size:13px;}
.tewl-table th,.tewl-table td{border-bottom:1px solid rgba(255,255,255,0.08);padding:8px 8px;vertical-align:top;}
.tewl-table th{text-align:left;font-weight:600;opacity:.9;}
.tewl-pager{display:flex;align-items:center;gap:10px;margin-top:12px;}

/* Ensure native date picker renders in Chromium */
#ev_happened_at{ -webkit-appearance:auto; appearance:auto; }



/* Editor labels */
.tewl-label{display:block; font-size:12px; margin:0 0 6px 0; color: rgba(255,255,255,0.78);}
.tewl-modal .tewl-label{color: rgba(255,255,255,0.85);}


/* --- Site theme overrides: keep TE UI buttons compact even if the theme styles all buttons --- */
.tewl .btn{
  padding: 9px 14px !important;
  font-size: 13px !important;
  line-height: 1.1 !important;
}

/* Edit modal sizing/scroll is handled in the injected markup (JS).
   We intentionally do NOT override scrollbar styling so the site theme remains in control. */

/* Slightly reduce pill buttons on very small screens */
@media (max-width: 520px){
  .tewl .btn{ padding: 8px 12px !important; font-size: 12px !important; }
}

/* Review Requests — attention box */
.tewl-alert-red{
  border: 1px solid rgba(239, 68, 68, .55);
  background: rgba(239, 68, 68, .10);
  border-radius: 12px;
  padding: 12px 14px;
}

.tewl-suggest-box{border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.04);border-radius:12px;padding:14px}
.tewl-suggest-title{font-weight:700;margin-bottom:4px}
.tewl-suggest-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:10px 0}
.tewl-suggest-script{margin-top:10px;padding-top:10px;border-top:1px solid rgba(255,255,255,.10)}
.tewl-suggest-script ol{margin:8px 0 0 18px}
.tewl-suggest-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}


/* Add Event assist focus mode */
.tewl-suggest-focus .row{
  transition: filter .18s ease, opacity .18s ease;
}
.tewl-suggest-focus .row:not(.tewl-suggest-trigger):not(#ev_suggest_wrap){
  filter: blur(4px) brightness(.72);
  opacity: .58;
  pointer-events: none;
  user-select: none;
}
.tewl-suggest-focus .tewl-suggest-trigger,
.tewl-suggest-focus #ev_suggest_wrap{
  position: relative;
  z-index: 3;
}
.tewl-suggest-focusline{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  margin-bottom:10px;
  border:1px solid rgba(198,168,86,.35);
  background:rgba(198,168,86,.10);
  color:#ffe8a3;
  font-size:12px;
  font-weight:700;
}
.tewl-suggest-box{
  box-shadow:0 0 0 1px rgba(198,168,86,.16) inset, 0 12px 28px rgba(0,0,0,.20);
}
.tewl-suggest-note{
  margin-top:10px;
  font-size:12px;
  opacity:.9;
}
.tewl .btn.ghost{
  background:transparent;
}
@media (max-width: 768px){
  .tewl-suggest-focus .row:not(.tewl-suggest-trigger):not(#ev_suggest_wrap){
    filter: brightness(.78);
  }
  .tewl-suggest-grid{
    grid-template-columns:1fr;
  }
}


/* Floating assist placement */
.tewl-suggest-focus #ev_suggest_wrap{
  position: fixed;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -46%);
  width: min(560px, calc(100vw - 32px));
  max-width: 560px;
  margin: 0;
  z-index: 40;
  animation: tewlAssistIn 120ms ease-out;
}
.tewl-suggest-focus #ev_suggest_box{
  max-height: min(72vh, 760px);
  overflow: auto;
}
@keyframes tewlAssistIn{
  from{opacity:0;transform:translateY(10px) scale(.985)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
@media (max-width: 768px){
  .tewl-suggest-focus #ev_suggest_wrap{
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: none;
    animation: none;
  }
  .tewl-suggest-focus #ev_suggest_box{
    max-height: none;
    overflow: visible;
  }
}


/* Edit event modal polish */
#tewl_edit_close:hover{background:rgba(255,255,255,.12);}
#tewl_event_editor_modal [id="tewl_edit_subject_context"]{overflow:visible !important;}
@media (max-width: 768px){
  #tewl_event_editor_modal [id="tewl_edit_subject_context"] > div:last-child{grid-template-columns:1fr !important;}
}


.tewl-form select,
.tewl-card select,
.tewl-shell select{
  width:100%;
  background:#172235;
  color:#f4f6fb;
  border:1px solid rgba(214,178,94,0.28);
  border-radius:14px;
  padding:14px 16px;
  font-size:16px;
  outline:none;
}
.tewl-form select:focus,
.tewl-card select:focus,
.tewl-shell select:focus{
  border-color:rgba(214,178,94,0.7);
  box-shadow:0 0 0 2px rgba(214,178,94,0.16);
}

.tewl-form select,.tewl-card select,.tewl-shell select,select#c,select#tz{
  width:100%;
  background:#172235;
  color:#f4f6fb;
  border:1px solid rgba(214,178,94,0.28);
  border-radius:14px;
  padding:14px 16px;
  font-size:16px;
  line-height:1.3;
  min-height:52px;
  outline:none;
  appearance:auto;
  -webkit-appearance:menulist;
}
.tewl-form select option,.tewl-card select option,.tewl-shell select option,select#c option,select#tz option{
  color:#111;
  background:#fff;
}
.tewl-form select:focus,.tewl-card select:focus,.tewl-shell select:focus,select#c:focus,select#tz:focus{
  border-color:rgba(214,178,94,0.7);
  box-shadow:0 0 0 2px rgba(214,178,94,0.16);
}


/* account creation modal */
.tewl-create-backdrop{
 position:fixed;
 inset:0;
 background:rgba(6,10,18,.75);
 display:flex;
 align-items:center;
 justify-content:center;
 z-index:999999;
 backdrop-filter:blur(2px);
}

.tewl-create-card{
 background:linear-gradient(180deg,#071224,#09172c);
 border:1px solid rgba(214,178,94,.35);
 border-radius:22px;
 padding:28px;
 text-align:center;
 color:#fff;
 width:420px;
 box-shadow:0 20px 50px rgba(0,0,0,.5);
}

.tewl-create-logo{
 position:relative;
 width:90px;
 height:90px;
 margin:0 auto 16px auto;
}

.tewl-create-logo img{
 position:absolute;
 inset:15px;
 width:60px;
 height:60px;
 object-fit:contain;
}

.tewl-create-ring{
 position:absolute;
 inset:0;
 border-radius:50%;
 border:3px solid rgba(214,178,94,.25);
 border-top-color:#d6b25e;
 animation:teSpin 1s linear infinite;
}

@keyframes teSpin{
 from{transform:rotate(0deg);}
 to{transform:rotate(360deg);}
}

.tewl-create-title{
 font-size:26px;
 margin-bottom:8px;
}

.tewl-create-text{
 font-size:14px;
 opacity:.9;
}


/* --- Make suggestion modal solid (no transparency) --- */
#ev_suggest_box{
  background: linear-gradient(180deg,#071224 0%,#09172c 100%) !important;
  opacity:1 !important;
  backdrop-filter:none !important;
}
#ev_suggest_box *{
  opacity:1 !important;
}


.tewl-btn-outline{
  background: transparent !important;
  color: #d6b25e !important;
  border: 1px solid rgba(214,178,94,0.45) !important;
  box-shadow: none !important;
}

.tewl-btn-muted{
  background: rgba(255,255,255,0.06) !important;
  color: #f4f6fb !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  box-shadow: none !important;
}

.tewl-tabbtn.is-locked{opacity:.45;cursor:not-allowed;filter:saturate(.6);}
.tewl-tabbtn.is-locked:hover{transform:none;}

.tewl-tabpanel[data-tewl-tabpanel="profile"] input.is-locked{opacity:1;cursor:not-allowed;background:rgba(255,255,255,.08);color:#dfe7ff;}

.tewl .tewl-field-missing{border-color:rgba(239,68,68,.95) !important;box-shadow:0 0 0 1px rgba(239,68,68,.45), 0 0 0 4px rgba(239,68,68,.10) !important;background:rgba(127,29,29,.22) !important;}
.tewl .tewl-row-missing label{color:#ff9a9a !important;}
.tewl .tewl-field-note{margin-top:6px;font-size:12px;color:#ff9a9a;font-weight:600;}


/* Verification panel refresh */
.tewl-verify-card{border:1px solid rgba(255,255,255,.10);border-radius:14px;padding:14px 16px;background:rgba(255,255,255,.03)}
.tewl-verify-card.pending{border-color:rgba(214,178,94,.38);background:rgba(214,178,94,.07)}
.tewl-verify-card.verified{border-color:rgba(90,181,113,.34);background:rgba(90,181,113,.08)}
.tewl-verify-card.quarantine{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.08)}
.tewl-verify-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;flex-wrap:wrap}
.tewl-verify-title{font-size:15px;font-weight:700;margin-bottom:4px}
.tewl-verify-copy{font-size:13px;line-height:1.45;opacity:.95;max-width:760px}
.tewl-verify-pillwrap{display:flex;align-items:center}
.tewl-verify-countdown,.tewl-verify-statusline{margin-top:10px;font-size:13px}
.tewl-verify-countdown{padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);display:inline-flex;gap:6px;flex-wrap:wrap}
.tewl-verify-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.tewl-verify-details{margin-top:12px;padding-top:10px;border-top:1px solid rgba(255,255,255,.08)}
.tewl-verify-details summary{cursor:pointer;font-weight:600;font-size:13px;list-style:none}
.tewl-verify-details summary::-webkit-details-marker{display:none}
.tewl-verify-detailrow{margin-top:10px}

.tewl-verify-card.verified{padding-bottom:10px}
.tewl-verify-details summary{display:flex;align-items:center;gap:8px}
.tewl-verify-details summary::before{content:'▸';display:inline-block;transition:transform .18s ease;opacity:.9}
.tewl-verify-details[open] summary::before{transform:rotate(90deg)}
.tewl-verify-summary-label{display:inline-block}
.tewl-verify-actions .btn[disabled]{opacity:.55;cursor:not-allowed}

.tewl-feedback-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.62);z-index:999999;display:flex;align-items:center;justify-content:center;padding:20px}
.tewl-feedback-card{width:min(560px,100%);border-radius:18px;padding:18px;border:1px solid rgba(255,255,255,.12);background:linear-gradient(180deg,rgba(8,17,36,.98),rgba(7,13,28,.98));box-shadow:0 18px 48px rgba(0,0,0,.38)}
.tewl-feedback-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.tewl-feedback-title{font-size:20px;font-weight:800}
.tewl-feedback-copy{color:#c8d3ef;font-size:13px;margin-bottom:12px}
.tewl-feedback-close{border:0;background:transparent;color:#fff;font-size:28px;line-height:1;cursor:pointer;padding:0 2px}
.tewl-feedback-card textarea{min-height:140px;resize:vertical}
.tewl-feedback-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:14px}


.tewl-disabled-wrap{display:inline-block}
.tewl-disabled-wrap > .btn[disabled]{pointer-events:none}


/* Shared sandbox demo banner */
.tewl-sandbox-banner{margin:12px 0 14px 0;padding:12px 14px;border-radius:14px;border:1px solid rgba(214,178,94,0.38);background:linear-gradient(180deg, rgba(214,178,94,0.12) 0%, rgba(214,178,94,0.06) 100%);box-shadow:0 10px 24px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.03);}
.tewl-sandbox-banner__title{font-weight:700;font-size:13px;color:#ffe8a3;margin-bottom:4px;}
.tewl-sandbox-banner__text{font-size:12px;line-height:1.45;color:rgba(255,255,255,.88);}
