/* Support chat widget (resources/views/partials/chat-widget.blade.php, public/js/chat.js).
   Self-contained: every class starts with "tpc"; colours fall back when tp.css is absent. */
.tpc{
  --tpc-g:#10b981;--tpc-g-d:#059669;--tpc-g-dd:#047857;--tpc-g-50:#ecfdf5;--tpc-g-100:#d1fae5;
  --tpc-ink:#0b1712;--tpc-text:#2b3a33;--tpc-muted:#6b7a73;--tpc-line:#e6ece9;--tpc-soft:#f2f5f3;
  --tpc-grad:linear-gradient(135deg,#34d399 0%,#10b981 55%,#84cc16 100%);
  --tpc-font:"Inter",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --tpc-display:"Sora","Inter",ui-sans-serif,system-ui,sans-serif;
  position:fixed;right:22px;bottom:22px;z-index:2147483000;font-family:var(--tpc-font);font-size:15px;line-height:1.5;color:var(--tpc-text);
}
.tpc *,.tpc *::before,.tpc *::after{box-sizing:border-box}
.tpc svg{display:block;flex-shrink:0}
.tpc button{font:inherit;color:inherit;cursor:pointer}
.tpc [hidden]{display:none!important}

/* Launcher */
.tpc-launch{position:relative;display:grid;place-items:center;width:58px;height:58px;border:0;border-radius:999px;background:var(--tpc-grad);color:#03140d;box-shadow:0 14px 34px -10px rgba(5,150,105,.75),inset 0 1px 0 rgba(255,255,255,.35);transition:transform .25s cubic-bezier(.2,.7,.2,1),box-shadow .25s}
.tpc-launch:hover{transform:translateY(-2px) scale(1.03);box-shadow:0 18px 40px -10px rgba(5,150,105,.85),inset 0 1px 0 rgba(255,255,255,.35)}
.tpc-launch svg{width:27px;height:27px;grid-area:1/1;transition:transform .3s cubic-bezier(.2,.7,.2,1),opacity .2s}
.tpc-launch__close{opacity:0;transform:rotate(-90deg) scale(.6)}
.tpc.is-open .tpc-launch__chat{opacity:0;transform:rotate(90deg) scale(.6)}
.tpc.is-open .tpc-launch__close{opacity:1;transform:none}
.tpc-badge{position:absolute;top:-3px;right:-3px;min-width:21px;height:21px;padding:0 6px;border-radius:999px;background:#ef4444;color:#fff;font-size:12px;font-weight:700;line-height:21px;text-align:center;box-shadow:0 0 0 2.5px #fff}
.tpc-badge--tab{top:2px;right:calc(50% - 26px);min-width:9px;height:9px;padding:0;font-size:0}

/* Panel */
.tpc-panel{position:absolute;right:0;bottom:74px;display:flex;flex-direction:column;width:396px;height:min(700px,calc(100vh - 110px));border-radius:26px;background:#fff;overflow:hidden;box-shadow:0 30px 80px -20px rgba(6,40,30,.45),0 0 0 1px rgba(8,22,17,.06);transform-origin:bottom right;animation:tpc-in .28s cubic-bezier(.2,.7,.2,1)}
@keyframes tpc-in{from{opacity:0;transform:translateY(14px) scale(.96)}to{opacity:1;transform:none}}
.tpc-view{position:relative;display:flex;flex-direction:column;flex:1;min-height:0}
.tpc-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 18px 18px;scrollbar-width:thin}

/* Home */
.tpc-home__glow{position:absolute;inset:0 0 auto;height:260px;background:radial-gradient(120% 90% at 85% -10%,rgba(110,231,183,.55),transparent 60%),radial-gradient(90% 80% at 0% 0%,rgba(190,242,100,.35),transparent 55%),linear-gradient(180deg,#f0fdf6,#fff);pointer-events:none}
.tpc-top{position:relative;display:flex;align-items:center;gap:12px;padding:24px 22px 8px 26px}
.tpc-top__logo{height:24px;width:auto;margin-right:auto}
.tpc-top__logo--night{display:none}
.tpc-avatars{display:flex}
.tpc-av{display:grid;place-items:center;width:40px;height:40px;border-radius:999px;border:2.5px solid #fff;background:#fff;box-shadow:0 4px 12px -4px rgba(6,40,30,.3);overflow:hidden}
.tpc-avatars .tpc-av+.tpc-av{margin-left:-11px}
.tpc-av img{width:100%;height:100%;object-fit:cover}
.tpc-av--logo{background:#0a1511}
.tpc-av--logo img{width:78%;height:78%;object-fit:contain}
.tpc-av--ai{background:var(--tpc-grad);color:#03140d}
.tpc-av--ai svg{width:20px;height:20px}
.tpc-av--team{background:#e7f8ef;color:var(--tpc-g-dd)}
.tpc-av--team svg{width:20px;height:20px}
.tpc-av--sm{width:34px;height:34px;border-width:0;box-shadow:none}
.tpc-x{display:grid;place-items:center;width:34px;height:34px;margin-left:4px;border:0;border-radius:10px;background:transparent;color:var(--tpc-ink)}
.tpc-x:hover{background:rgba(8,22,17,.06)}
.tpc-x svg{width:20px;height:20px}
.tpc-home .tpc-scroll{position:relative;padding-top:6px}
.tpc-hello{margin:30px 8px 22px;font-family:var(--tpc-display);font-size:29px;font-weight:700;line-height:1.18;letter-spacing:-.025em;color:var(--tpc-ink)}
.tpc-hello>span{display:block;color:#8a978f;font-weight:600}
.tpc-wave{display:inline-block;transform-origin:70% 70%;animation:tpc-wave 2.4s ease-in-out 1s 2}
@keyframes tpc-wave{0%,60%,100%{transform:none}10%,30%{transform:rotate(16deg)}20%,40%{transform:rotate(-8deg)}}
.tpc-card{display:block;width:100%;margin:0 0 12px;padding:16px 18px;border:0;border-radius:18px;background:#fff;text-align:left;text-decoration:none;color:inherit;box-shadow:0 1px 2px rgba(8,22,17,.05),0 0 0 1px var(--tpc-line),0 10px 26px -18px rgba(6,40,30,.35)}
.tpc-ask{display:flex;align-items:center;gap:14px;transition:box-shadow .2s,transform .2s}
.tpc-ask:hover{transform:translateY(-1px);box-shadow:0 1px 2px rgba(8,22,17,.05),0 0 0 1px var(--tpc-g-100),0 16px 30px -18px rgba(6,78,59,.45)}
.tpc-ask>span{flex:1}
.tpc-ask b,.tpc-acct b{display:block;color:var(--tpc-ink);font-size:15px;font-weight:600}
.tpc-ask small,.tpc-acct small{display:block;color:var(--tpc-muted);font-size:13.5px}
.tpc-send-ico{width:20px;height:20px;color:var(--tpc-g-d)}
.tpc-search{padding:8px}
.tpc-searchbox{display:flex;align-items:center;gap:8px;padding:0 14px;border-radius:12px;background:var(--tpc-soft)}
.tpc-searchbox input{flex:1;min-width:0;height:44px;border:0;background:transparent;font:inherit;font-size:15px;font-weight:600;color:var(--tpc-ink);outline:0}
.tpc-searchbox input::placeholder{color:var(--tpc-ink);opacity:.85}
.tpc-searchbox input::-webkit-search-cancel-button{display:none}
.tpc-searchbox svg{width:19px;height:19px;color:var(--tpc-g-d)}
.tpc-searchbox:focus-within{box-shadow:inset 0 0 0 1.5px var(--tpc-g)}
.tpc-searchbox--help{margin:4px 0 8px}
.tpc-links{display:flex;flex-direction:column}
.tpc-link{display:flex;align-items:center;gap:12px;padding:11px 10px;border:0;border-radius:10px;background:transparent;text-align:left;color:var(--tpc-text);font-size:14.5px;line-height:1.4}
.tpc-link:hover{background:var(--tpc-g-50);color:var(--tpc-ink)}
.tpc-link span{flex:1}
.tpc-link svg,.tpc-chev{width:16px;height:16px;color:var(--tpc-g-d)}
.tpc-empty{padding:14px 10px;color:var(--tpc-muted);font-size:14px}
.tpc-empty button{padding:0;border:0;background:none;color:var(--tpc-g-d);font-weight:600;text-decoration:underline}
.tpc-acct{display:flex;align-items:center;gap:13px}
.tpc-acct>span:nth-child(2){flex:1}
.tpc-acct b{font-size:17px}
.tpc-acct--guest b{font-size:15px}
.tpc-acct__ico{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:var(--tpc-g-50);color:var(--tpc-g-dd)}
.tpc-acct__ico svg{width:21px;height:21px}
.tpc-pill{padding:7px 14px;border-radius:999px;background:var(--tpc-ink);color:#fff;font-size:13px;font-weight:600;text-decoration:none}
.tpc-pill:hover{background:#1a2e26}

/* Bars */
.tpc-bar{display:flex;align-items:center;gap:8px;padding:12px 12px 12px 10px;border-bottom:1px solid var(--tpc-line);background:#fff}
.tpc-bar--plain{padding-left:18px}
.tpc-bar__t{flex:1;min-width:0;display:flex;flex-direction:column}
.tpc-bar__t b{color:var(--tpc-ink);font-size:15px;font-weight:650}
.tpc-bar__t small{display:flex;align-items:center;gap:6px;color:var(--tpc-muted);font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tpc-dot{width:8px;height:8px;border-radius:99px;background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.18);flex-shrink:0}
.tpc-dot--team{background:#f59e0b;box-shadow:0 0 0 3px rgba(245,158,11,.18)}
.tpc-ibtn{display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:10px;background:transparent;color:var(--tpc-ink)}
.tpc-ibtn:hover{background:var(--tpc-soft)}
.tpc-ibtn svg{width:20px;height:20px}
.tpc-human{color:var(--tpc-g-dd)}
.tpc-bar--chat{gap:4px;padding:10px 8px 10px 6px}
.tpc-avatars--sm{margin:0 6px 0 2px}
.tpc-avatars--sm .tpc-av{width:32px;height:32px;border-width:2px;box-shadow:none}
.tpc-avatars--sm .tpc-av+.tpc-av{margin-left:-10px}
.tpc-avatars--sm .tpc-av svg{width:16px;height:16px}
.tpc-panel[data-view="messages"] .tpc-tabs{display:none}

/* Messages */
.tpc-msgs{flex:1;min-height:0;display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain;padding:14px 16px 10px;background:#fff}
.tpc-intro{margin:0 0 18px;color:var(--tpc-muted);font-size:13.5px;text-align:center}
.tpc-row{display:flex;flex-direction:column;align-items:flex-start;margin:0 0 4px}
.tpc-row--me{align-items:flex-end}
.tpc-row--end{margin-bottom:14px}
.tpc-row--pending .tpc-bub{opacity:.7}
.tpc-bub{max-width:85%;padding:11px 16px;border-radius:20px;background:var(--tpc-soft);color:var(--tpc-text);font-size:14.5px;line-height:1.5;overflow-wrap:anywhere}
.tpc-anim{animation:tpc-pop .22s ease-out}
@keyframes tpc-pop{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.tpc-row--me .tpc-bub{background:var(--tpc-g-d);color:#fff}
.tpc-row--agent .tpc-bub{background:#fff7e6;box-shadow:inset 0 0 0 1px #fde7b0}
.tpc-meta{margin:5px 6px 0;color:var(--tpc-muted);font-size:12px;line-height:1.3}
.tpc-bub p{margin:0 0 8px}.tpc-bub p:last-child{margin:0}
.tpc-bub ul,.tpc-bub ol{margin:4px 0 8px;padding-left:20px}
.tpc-bub li{margin:2px 0}
.tpc-bub a{color:var(--tpc-g-dd);font-weight:600;text-decoration:underline;text-underline-offset:2px}
.tpc-row--me .tpc-bub a{color:#fff}
.tpc-bub code{padding:1px 5px;border-radius:5px;background:rgba(8,22,17,.07);font-family:"JetBrains Mono",ui-monospace,Menlo,monospace;font-size:12.5px}
.tpc-bub pre{margin:6px 0;padding:10px 12px;border-radius:10px;background:#0a1511;color:#d1fae5;overflow-x:auto;font-size:12.5px;line-height:1.5}
.tpc-bub pre code{padding:0;background:none;color:inherit}
.tpc-row--me .tpc-bub code{background:rgba(255,255,255,.18)}
.tpc-sys{margin:6px auto 12px;max-width:88%;padding:7px 12px;border-radius:999px;background:var(--tpc-g-50);color:var(--tpc-g-dd);font-size:12.5px;font-weight:550;text-align:center}
.tpc-sys--warn{background:#fff1f2;color:#be123c}
.tpc-time{display:block;margin-top:3px;font-size:11px;opacity:.55}
.tpc-typing{display:inline-flex;gap:4px;padding:14px 16px}
.tpc-typing i{width:7px;height:7px;border-radius:9px;background:#9aa8a1;animation:tpc-dots 1.2s infinite ease-in-out}
.tpc-typing i:nth-child(2){animation-delay:.15s}.tpc-typing i:nth-child(3){animation-delay:.3s}
@keyframes tpc-dots{0%,80%,100%{opacity:.35;transform:none}40%{opacity:1;transform:translateY(-3px)}}
/* Suggested questions sit at the bottom, right-aligned, until the first message. */
.tpc-chips{display:flex;flex-direction:column;align-items:flex-end;gap:8px;margin:auto 0 2px;padding-top:16px}
.tpc-chip{max-width:85%;padding:9px 16px;border:0;border-radius:999px;background:#fff;color:var(--tpc-g-dd);font-size:14px;font-weight:550;text-align:right;box-shadow:0 0 0 1px var(--tpc-line),0 6px 16px -10px rgba(6,40,30,.35);transition:background .2s,box-shadow .2s,transform .2s}
.tpc-chip:hover{background:var(--tpc-g-50);box-shadow:0 0 0 1px var(--tpc-g-100),0 8px 18px -10px rgba(6,78,59,.4);transform:translateY(-1px)}
.tpc-compose{display:flex;flex-direction:column;margin:4px 12px 12px;padding:12px 10px 8px 16px;border-radius:18px;background:#fff;box-shadow:inset 0 0 0 1.5px var(--tpc-line);transition:box-shadow .2s}
.tpc-compose:focus-within{box-shadow:inset 0 0 0 1.5px var(--tpc-g),0 0 0 4px rgba(16,185,129,.12)}
.tpc-compose textarea{width:100%;max-height:130px;padding:0 6px 0 0;border:0;resize:none;background:transparent;font:inherit;font-size:15px;color:var(--tpc-ink);outline:0}
.tpc-compose textarea::placeholder{color:var(--tpc-muted)}
.tpc-compose__bar{display:flex;align-items:center;gap:10px;margin-top:8px}
.tpc-fine{flex:1;min-width:0;color:#9aa8a1;font-size:11.5px;line-height:1.35}
.tpc-sendbtn{display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:999px;background:#e3e8e5;color:#fff;transition:background .2s,opacity .2s,transform .2s}
.tpc-compose textarea:not(:placeholder-shown)+.tpc-compose__bar .tpc-sendbtn{background:var(--tpc-g-d);box-shadow:0 6px 14px -6px rgba(5,150,105,.7)}
.tpc-compose textarea:not(:placeholder-shown)+.tpc-compose__bar .tpc-sendbtn:hover{background:var(--tpc-g-dd);transform:translateY(-1px)}
.tpc-sendbtn:disabled{opacity:.45;cursor:default}
.tpc-sendbtn svg{width:17px;height:17px}
.tpc-emailform{margin:6px 12px 0;padding:10px 12px;border-radius:14px;background:var(--tpc-g-50);font-size:13px;color:var(--tpc-g-dd)}
.tpc-emailform div{display:flex;gap:6px;margin-top:6px}
.tpc-emailform input{flex:1;min-width:0;height:36px;padding:0 10px;border:1px solid var(--tpc-g-100);border-radius:9px;font:inherit;font-size:14px;outline:0}
.tpc-emailform input:focus{border-color:var(--tpc-g)}
.tpc-emailform button{padding:0 14px;border:0;border-radius:9px;background:var(--tpc-g-d);color:#fff;font-weight:600}

/* Help */
.tpc-help .tpc-scroll{padding-top:12px}
.tpc-article{padding:18px 22px 24px}
.tpc-article h3{margin:0 0 12px;font-family:var(--tpc-display);font-size:20px;line-height:1.3;color:var(--tpc-ink);letter-spacing:-.015em}
.tpc-article p{margin:0 0 10px;font-size:14.5px}
.tpc-article ul,.tpc-article ol{padding-left:20px;font-size:14.5px}
.tpc-article code{padding:1px 5px;border-radius:5px;background:var(--tpc-soft);font-family:"JetBrains Mono",ui-monospace,Menlo,monospace;font-size:12.5px;overflow-wrap:anywhere}
.tpc-article a{color:var(--tpc-g-dd);font-weight:600}
.tpc-article__ask{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:20px;padding:14px 16px;border-radius:14px;background:var(--tpc-g-50);font-size:14px}
.tpc-article__ask button{padding:8px 14px;border:0;border-radius:999px;background:var(--tpc-g-d);color:#fff;font-weight:600;font-size:13px;white-space:nowrap}

/* Tabs */
.tpc-tabs{display:flex;border-top:1px solid var(--tpc-line);background:#fff;padding:6px 8px 8px}
.tpc-tabs button{position:relative;flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 0 4px;border:0;border-radius:12px;background:transparent;color:#4a5852;font-size:13.5px;font-weight:500}
.tpc-tabs button:hover{background:var(--tpc-soft)}
.tpc-tabs svg{width:25px;height:25px}
.tpc-tabs [aria-current="page"]{color:var(--tpc-g-d);font-weight:650}

.tpc button:focus-visible,.tpc a:focus-visible,.tpc input:focus-visible{outline:2px solid var(--tpc-g);outline-offset:2px}

@media (max-width:520px){
  .tpc{right:14px;bottom:14px}
  .tpc.is-open .tpc-launch{display:none}
  .tpc-panel{position:fixed;inset:0;width:auto;height:100%;height:100dvh;border-radius:0;animation:tpc-up .25s ease-out}
  @keyframes tpc-up{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}
  .tpc-top{padding-top:18px}
  .tpc-hello{margin-top:20px}
  .tpc-compose{margin-bottom:max(12px,env(safe-area-inset-bottom))}
}
@media (prefers-reduced-motion:reduce){
  .tpc-panel,.tpc-anim,.tpc-wave,.tpc-typing i{animation:none}
  .tpc-launch,.tpc-launch svg{transition:none}
}
@media print{.tpc{display:none}}
