/* USY Helpdesk v2.6.0 — frontend + Portal Klien ticket enhancements */
:root{
  --usy-hd-navy:#092f4d;
  --usy-hd-navy-2:#0d3b60;
  --usy-hd-gold:#e09a20;
  --usy-hd-gold-soft:#f4c96d;
  --usy-hd-cream:#f3e7dc;
  --usy-hd-surface:#fffdfa;
  --usy-hd-white:#fff;
  --usy-hd-text:#092f4d;
  --usy-hd-muted:#64717c;
  --usy-hd-border:#e5ddd5;
  --usy-hd-danger:#a43b3b;
  --usy-hd-success:#2e7651;
  --usy-hd-shadow:0 18px 55px rgba(9,47,77,.18);
  --usy-hd-radius:22px;
}

.usy-hd,.usy-hd *{box-sizing:border-box}
.usy-hd{position:fixed;right:24px;bottom:24px;z-index:99990;font-family:inherit;color:var(--usy-hd-text)}
.usy-hd button,.usy-hd input,.usy-hd select,.usy-hd textarea{font:inherit}
.usy-hd button,.usy-hd a{touch-action:manipulation}
.usy-hd-launcher{position:relative;display:flex;align-items:center;justify-content:flex-end;gap:13px;min-width:196px;height:58px;padding:0 62px 0 24px;border:1px solid rgba(224,154,32,.92);border-radius:999px;background:linear-gradient(135deg,var(--usy-hd-navy),#06253d);color:#fff;box-shadow:0 12px 32px rgba(9,47,77,.23);cursor:pointer;transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease}
.usy-hd-launcher:hover{transform:translateY(-2px);box-shadow:0 17px 38px rgba(9,47,77,.27);border-color:var(--usy-hd-gold-soft)}
.usy-hd-launcher:focus-visible,.usy-hd button:focus-visible,.usy-hd a:focus-visible,.usy-hd input:focus-visible,.usy-hd select:focus-visible,.usy-hd textarea:focus-visible{outline:3px solid rgba(224,154,32,.35);outline-offset:3px}
.usy-hd-launcher-text{font-weight:750;letter-spacing:.01em;white-space:nowrap}
.usy-hd-logo-badge{position:absolute;right:-3px;top:50%;transform:translateY(-50%);width:66px;height:66px;border-radius:50%;overflow:hidden;background:var(--usy-hd-cream);border:2px solid var(--usy-hd-gold);box-shadow:0 8px 20px rgba(9,47,77,.22);display:grid;place-items:center}
.usy-hd-logo-badge img,.usy-hd-brand-logo img{width:100%;height:100%;object-fit:cover;transform:scale(1.22);display:block}

.usy-hd-panel{position:absolute;right:0;bottom:78px;width:min(410px,calc(100vw - 32px));max-height:min(82vh,780px);overflow:hidden;background:var(--usy-hd-surface);border:1px solid rgba(9,47,77,.10);border-radius:24px;box-shadow:var(--usy-hd-shadow);animation:usyHdIn .24s ease both}
.usy-hd-panel[hidden]{display:none!important}
@keyframes usyHdIn{from{opacity:0;transform:translateY(12px) scale(.985)}to{opacity:1;transform:none}}
.usy-hd-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 18px 17px;background:linear-gradient(135deg,#072944,var(--usy-hd-navy-2));color:#fff;border-bottom:3px solid rgba(224,154,32,.78)}
.usy-hd-brand{display:flex;align-items:center;gap:12px;min-width:0}
.usy-hd-brand-logo{width:50px;height:50px;flex:0 0 50px;border-radius:50%;overflow:hidden;background:var(--usy-hd-cream);border:1px solid rgba(255,255,255,.55);box-shadow:0 6px 16px rgba(0,0,0,.14)}
.usy-hd-brand strong{display:block;font-size:15px;letter-spacing:.035em}
.usy-hd-brand small{display:block;margin-top:2px;color:rgba(255,255,255,.78);font-size:11.5px}
.usy-hd-close{width:38px;height:38px;border:0;border-radius:12px;background:rgba(255,255,255,.08);color:#fff;font-size:25px;line-height:1;cursor:pointer}
.usy-hd-close:hover{background:rgba(255,255,255,.15)}
.usy-hd-stage{max-height:calc(min(82vh,780px) - 88px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(9,47,77,.18) transparent}
.usy-hd-screen{display:none;padding:20px}
.usy-hd-screen.is-active{display:block;animation:usyHdScreen .2s ease}
@keyframes usyHdScreen{from{opacity:.25;transform:translateX(7px)}to{opacity:1;transform:none}}
.usy-hd-greeting{display:flex;align-items:flex-start;gap:11px;margin-bottom:16px;padding:2px 2px 4px}
.usy-hd-greeting>span{font-size:26px;line-height:1}
.usy-hd-greeting h3{margin:0 0 4px;color:var(--usy-hd-navy);font-size:17px;line-height:1.25}
.usy-hd-greeting p{margin:0;color:var(--usy-hd-muted);font-size:12.5px;line-height:1.5}
.usy-hd-menu{display:grid;gap:10px}
.usy-hd-menu>button,.usy-hd-choice-stack>button{width:100%;display:grid;grid-template-columns:44px 1fr 20px;gap:11px;align-items:center;text-align:left;padding:11px;border:1px solid var(--usy-hd-border);border-radius:15px;background:#fff;color:var(--usy-hd-text);cursor:pointer;transition:border-color .18s ease,transform .18s ease,box-shadow .18s ease}
.usy-hd-menu>button:hover,.usy-hd-choice-stack>button:hover{border-color:rgba(224,154,32,.65);transform:translateY(-1px);box-shadow:0 8px 22px rgba(9,47,77,.08)}
.usy-hd-menu strong,.usy-hd-choice-stack strong{display:block;font-size:13px;line-height:1.28}
.usy-hd-menu small,.usy-hd-choice-stack small{display:block;margin-top:3px;color:var(--usy-hd-muted);font-size:11px;line-height:1.35}
.usy-hd-menu i,.usy-hd-choice-stack i{font-style:normal;color:var(--usy-hd-gold);font-size:20px}
.usy-hd-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:var(--usy-hd-navy);font-size:19px;filter:saturate(.7)}
.usy-hd-icon.is-gold{background:var(--usy-hd-gold)}
.usy-hd-footer-link{margin-top:13px;padding:12px 13px;border-radius:14px;background:linear-gradient(135deg,var(--usy-hd-cream),#fff8ee);border:1px solid rgba(224,154,32,.18);display:flex;justify-content:space-between;gap:10px;font-size:11.5px}
.usy-hd-footer-link span{color:var(--usy-hd-muted)}
.usy-hd-footer-link a{color:var(--usy-hd-navy);font-weight:750;text-decoration:none}

.usy-hd-subhead{display:flex;align-items:center;gap:10px;margin:-4px 0 14px}
.usy-hd-subhead>button{width:38px;height:38px;border:1px solid var(--usy-hd-border);border-radius:12px;background:#fff;color:var(--usy-hd-navy);cursor:pointer}
.usy-hd-subhead span{display:block;font-weight:800;font-size:14px}
.usy-hd-subhead small{display:block;margin-top:2px;color:var(--usy-hd-muted);font-size:11px}
.usy-hd-choice-stack{display:grid;gap:10px}
.usy-hd-choice-stack>button{grid-template-columns:1fr 20px;padding:15px}
.usy-hd-callout{text-align:center;padding:24px 16px;border:1px solid var(--usy-hd-border);border-radius:18px;background:linear-gradient(150deg,#fff,var(--usy-hd-cream))}
.usy-hd-callout>span{font-size:36px}.usy-hd-callout h3{margin:9px 0 5px}.usy-hd-callout p{margin:0 auto 16px;max-width:310px;color:var(--usy-hd-muted);font-size:12px;line-height:1.55}
.usy-hd-primary-link,.usy-hd-secondary-btn{display:inline-flex;justify-content:center;align-items:center;min-height:44px;padding:0 18px;border:0;border-radius:12px;background:var(--usy-hd-navy);color:#fff!important;text-decoration:none;font-weight:750;cursor:pointer}

.usy-hd-progress{height:5px;margin:0 0 17px;border-radius:999px;background:#e9e4df;overflow:hidden}
.usy-hd-progress i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--usy-hd-gold),#f0b53d);transition:width .25s ease}
.usy-hd-form-step{display:none}.usy-hd-form-step.is-active{display:block}
.usy-hd-form-step h3{margin:0 0 14px;font-size:15px;color:var(--usy-hd-navy)}
.usy-hd-form label{display:block;margin:0 0 12px;color:var(--usy-hd-navy);font-size:11.5px;font-weight:700}
.usy-hd-form input,.usy-hd-form select,.usy-hd-form textarea{width:100%;margin-top:6px;padding:11px 12px;border:1px solid #d9d9d9;border-radius:11px;background:#fff;color:#173047;font-size:12.5px;transition:border-color .16s ease,box-shadow .16s ease}
.usy-hd-form textarea{resize:vertical;min-height:92px}
.usy-hd-form input:focus,.usy-hd-form select:focus,.usy-hd-form textarea:focus{border-color:var(--usy-hd-gold);box-shadow:0 0 0 3px rgba(224,154,32,.10);outline:0}
.usy-hd-form small{display:block;margin-top:5px;color:var(--usy-hd-muted);font-weight:400;line-height:1.4}
.usy-hd-optional{font-weight:400;color:var(--usy-hd-muted)}
.usy-hd-next,.usy-hd-submit{width:100%;min-height:45px;border:0;border-radius:11px;background:linear-gradient(135deg,var(--usy-hd-navy),#0d436d);color:#fff;font-weight:750;cursor:pointer}
.usy-hd-next:hover,.usy-hd-submit:hover{filter:brightness(1.07)}
.usy-hd-step-actions{display:flex;gap:9px;margin-top:5px}.usy-hd-step-actions>*{flex:1}
.usy-hd-back-step{min-height:45px;border:1px solid var(--usy-hd-border);border-radius:11px;background:#fff;color:var(--usy-hd-navy);font-weight:700;cursor:pointer}
.usy-hd-captcha{margin:14px 0;padding:12px;border:1px solid var(--usy-hd-border);border-radius:12px;background:#fff}
.usy-hd-captcha>span{display:block;margin-bottom:8px;color:var(--usy-hd-navy);font-size:11px;font-weight:750}
.usy-hd-form-error{margin:11px 0 0;padding:10px 11px;border-radius:10px;background:#fff0ef;color:var(--usy-hd-danger);font-size:11.5px}
.usy-hd-field-error{margin:-7px 0 10px;color:var(--usy-hd-danger);font-size:10.5px}
.usy-hd input.is-invalid,.usy-hd select.is-invalid,.usy-hd textarea.is-invalid{border-color:#c85f58!important;box-shadow:0 0 0 3px rgba(200,95,88,.09)!important}
.usy-hd-submit[disabled]{opacity:.62;cursor:wait}

.usy-hd-success{text-align:center;padding:25px 10px 13px}
.usy-hd-success-icon{display:grid;place-items:center;width:76px;height:76px;margin:0 auto 15px;border-radius:50%;background:linear-gradient(145deg,#fff0d1,var(--usy-hd-cream));color:var(--usy-hd-gold);font-size:40px;font-weight:900;box-shadow:inset 0 0 0 1px rgba(224,154,32,.18)}
.usy-hd-success h3{margin:0 0 11px;font-size:20px}.usy-hd-success>strong{display:inline-block;padding:9px 12px;border-radius:10px;background:#fff5e7;color:#b76f00;letter-spacing:.035em}.usy-hd-success p{max-width:300px;margin:13px auto 20px;color:var(--usy-hd-muted);font-size:12px;line-height:1.55}

/* Portal Klien — ticket enhancements */
.usy-portal-ticket-enhanced{display:block!important}
.usy-portal-ticket-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 15px}
.usy-portal-ticket-grid .is-wide{grid-column:1/-1}
.usy-portal-ticket-grid label{margin:0!important}
.usy-portal-ticket-grid select,.usy-portal-ticket-grid input,.usy-portal-ticket-grid textarea{width:100%;margin-top:7px;padding:12px 13px;border:1px solid #cfd7df;border-radius:7px;background:#fff;color:#0c2e49}
.usy-portal-ticket-grid label>span{font-weight:400;color:#6b7883}.usy-portal-ticket-grid small{display:block;margin-top:5px;color:#6b7883}
.usy-portal-ticket-security{grid-column:1/-1;margin:14px 0;padding:13px;border:1px solid #e0e4e8;border-radius:8px;background:#fff}.usy-portal-ticket-security>strong{display:block;margin-bottom:8px;color:#0c2e49}
.usy-ticket-card-tags{display:flex;gap:7px;flex-wrap:wrap}.usy-ticket-card-tags span{display:inline-flex!important;width:auto!important}
.usy-ticket-empty{grid-column:1/-1;padding:20px;border:1px dashed #cad3db;border-radius:12px;text-align:center;color:#426077;background:#fff}
.usy-ticket-thread-enhanced{margin-top:28px}.usy-ticket-thread-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:18px}.usy-ticket-thread-head h3{margin-top:7px}.usy-ticket-meta-public{display:flex;align-items:flex-end;flex-direction:column;gap:5px;text-align:right}.usy-ticket-meta-public>span{display:inline-flex;padding:5px 8px;border-radius:999px;background:#fff3da;color:#976200;font-size:10px;font-weight:800}.usy-ticket-meta-public small{color:#6a7680}.usy-ticket-thread article.is-usy{border-left-color:var(--usy-hd-gold);background:#fffaf1}.usy-ticket-reply-file{display:block;margin:10px 0}.usy-ticket-client-confirmed{margin-top:18px;padding:14px;border:1px solid #bdd9c8;border-radius:10px;background:#eef8f2;color:#2d6747;font-weight:700}

@media(max-width:720px){
  .usy-hd{right:16px;bottom:max(84px,calc(env(safe-area-inset-bottom) + 72px))}
  .usy-hd-launcher{min-width:174px;height:54px;padding-left:20px;font-size:13px}.usy-hd-logo-badge{width:62px;height:62px}
  .usy-hd-panel{position:fixed;right:8px;left:8px;bottom:max(8px,env(safe-area-inset-bottom));width:auto;max-height:92vh;border-radius:23px}
  .usy-hd-stage{max-height:calc(92vh - 86px)}
  .usy-hd-screen{padding:17px}
  .usy-portal-ticket-grid{grid-template-columns:1fr}.usy-portal-ticket-grid .is-wide{grid-column:auto}
  .usy-ticket-thread-head{flex-direction:column}.usy-ticket-meta-public{align-items:flex-start;text-align:left}
}
@media(max-width:420px){.usy-hd-launcher-text{font-size:12.5px}.usy-hd-menu>button{grid-template-columns:40px 1fr 18px}.usy-hd-icon{width:39px;height:39px}.usy-hd-header{padding:15px}.usy-hd-brand-logo{width:46px;height:46px;flex-basis:46px}}
@media(prefers-reduced-motion:reduce){.usy-hd *{animation-duration:.001ms!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}
