/* ZigTech Support Desk. Brand navy #1B3664 and orange #D75225 (same tokens as zigtech-site).
   Rules are prefixed with #top where Enfold styles form elements (Enfold puts id="top" on <body>). */
.ztsup {
  --ztsup-navy: #1B3664;
  --ztsup-navy-dark: #12264A;
  --ztsup-orange: #D75225;
  --ztsup-orange-dark: #B8421A;
  --ztsup-ink: #1F2937;
  --ztsup-grey: #5B6472;
  --ztsup-line: #D5DBE5;
  --ztsup-tint: #F4F6FA;
  --ztsup-green: #2F7D43;
  color: var(--ztsup-ink);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}
.ztsup *, .ztsup *::before, .ztsup *::after { box-sizing: border-box; }
.ztsup [hidden] { display: none !important; }

/* ---------- floating button */
.ztsup-floating { position: fixed; z-index: 2147482000; bottom: var(--ztsup-bottom, 24px); }
.ztsup-floating.ztsup-pos-right { right: 20px; }
.ztsup-floating.ztsup-pos-left { left: 20px; }
#top .ztsup .ztsup-launcher, .ztsup .ztsup-launcher {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 56px; margin: 0; padding: 0 20px 0 14px; border: 0; border-radius: 28px;
  background: var(--ztsup-navy); color: #fff; font: 600 16px/1 inherit; letter-spacing: 0; text-transform: none;
  box-shadow: 0 6px 20px rgba(18, 38, 74, .35); cursor: pointer; transition: background .15s, transform .15s;
}
#top .ztsup .ztsup-launcher:hover, .ztsup .ztsup-launcher:hover { background: var(--ztsup-navy-dark); transform: translateY(-1px); }
#top .ztsup .ztsup-launcher:focus-visible, .ztsup .ztsup-launcher:focus-visible { outline: 3px solid var(--ztsup-orange); outline-offset: 3px; }
.ztsup-launcher svg { flex: none; }
.ztsup-badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--ztsup-orange); color: #fff; font: 700 12px/22px inherit; text-align: center; box-shadow: 0 0 0 2px #fff;
}
.ztsup-open .ztsup-launcher-label { display: none; }
.ztsup-open .ztsup-launcher { padding: 0 14px; }

/* ---------- panel */
.ztsup-panel {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ztsup-line); border-radius: 14px; overflow: hidden;
}
.ztsup-floating .ztsup-panel {
  position: absolute; bottom: 70px; width: 380px; max-width: calc(100vw - 32px);
  height: min(620px, calc(100vh - var(--ztsup-bottom, 24px) - 100px)); box-shadow: 0 16px 48px rgba(18, 38, 74, .28);
}
.ztsup-pos-right .ztsup-panel { right: 0; }
.ztsup-pos-left .ztsup-panel { left: 0; }
.ztsup-panel-page { max-width: 760px; margin: 0 auto; min-height: 420px; }
.ztsup-head {
  display: flex; align-items: center; gap: 6px; padding: 14px 12px 14px 18px; background: var(--ztsup-navy); color: #fff;
}
#top .ztsup h2.ztsup-title, .ztsup h2.ztsup-title {
  flex: 1; margin: 0; color: #fff; font-size: 18px; font-weight: 700; line-height: 1.25; letter-spacing: 0; text-transform: none; outline: none;
}
#top .ztsup .ztsup-icon-btn, .ztsup .ztsup-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: 0; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer;
}
#top .ztsup .ztsup-icon-btn:hover, .ztsup .ztsup-icon-btn:hover { background: rgba(255, 255, 255, .14); }
.ztsup-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.ztsup-panel-page .ztsup-body { padding: 24px; }
.ztsup p { margin: 0; }
.ztsup-muted { color: var(--ztsup-grey); font-size: 14px; }
.ztsup-fine { color: var(--ztsup-grey); font-size: 13px; }
#top .ztsup a, .ztsup a { color: var(--ztsup-orange); font-weight: 600; text-decoration: none; }
#top .ztsup a:hover, .ztsup a:hover { text-decoration: underline; }
.ztsup-error { padding: 10px 12px; border-radius: 8px; background: #FDECEA; color: #8A1F11; font-size: 14px; }
.ztsup-loading { padding: 24px 0; text-align: center; }
.ztsup-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ztsup-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- home cards */
.ztsup-cards { display: grid; gap: 10px; }
.ztsup-panel-page .ztsup-cards { grid-template-columns: 1fr 1fr; }
#top .ztsup .ztsup-card, .ztsup .ztsup-card {
  display: flex; flex-direction: column; gap: 4px; width: 100%; margin: 0; padding: 14px 16px; text-align: left;
  border: 1px solid var(--ztsup-line); border-radius: 10px; background: #fff; color: var(--ztsup-ink);
  font: inherit; text-transform: none; letter-spacing: 0; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
#top .ztsup .ztsup-card:hover, .ztsup .ztsup-card:hover { border-color: var(--ztsup-navy); box-shadow: 0 2px 10px rgba(27, 54, 100, .12); text-decoration: none; }
.ztsup-card strong { color: var(--ztsup-navy); font-size: 16px; }
.ztsup-card span { color: var(--ztsup-grey); font-size: 14px; font-weight: 400; }
.ztsup-card em { color: var(--ztsup-orange); font-size: 13px; font-style: normal; font-weight: 600; }
.ztsup-card-locked { background: var(--ztsup-tint) !important; }

/* ---------- buttons */
#top .ztsup .ztsup-btn, .ztsup .ztsup-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 11px 18px; min-height: 44px;
  border: 1px solid var(--ztsup-orange); border-radius: 8px; background: var(--ztsup-orange); color: #fff;
  font: 600 15px/1.2 inherit; text-transform: none; letter-spacing: 0; cursor: pointer;
}
#top .ztsup .ztsup-btn:hover, .ztsup .ztsup-btn:hover { background: var(--ztsup-orange-dark); border-color: var(--ztsup-orange-dark); }
#top .ztsup .ztsup-btn:disabled, .ztsup .ztsup-btn:disabled { opacity: .6; cursor: default; }
#top .ztsup .ztsup-btn-ghost, .ztsup .ztsup-btn-ghost { background: #fff; color: var(--ztsup-navy); border-color: var(--ztsup-line); }
#top .ztsup .ztsup-btn-ghost:hover, .ztsup .ztsup-btn-ghost:hover { background: var(--ztsup-tint); border-color: var(--ztsup-navy); }
.ztsup-wide { width: 100%; justify-content: space-between !important; }

/* ---------- forms */
.ztsup-form { display: flex; flex-direction: column; gap: 12px; }
.ztsup-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ztsup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#top .ztsup label, .ztsup label { margin: 0; color: var(--ztsup-ink); font-size: 14px; font-weight: 600; }
#top .ztsup input[type=text], #top .ztsup input[type=email], #top .ztsup select, #top .ztsup textarea,
.ztsup input[type=text], .ztsup input[type=email], .ztsup select, .ztsup textarea {
  width: 100%; margin: 0; padding: 10px 12px; border: 1px solid var(--ztsup-line); border-radius: 8px; background: #fff;
  color: var(--ztsup-ink); font: 15px/1.4 inherit; box-shadow: none;
}
#top .ztsup select, .ztsup select { height: auto; min-height: 44px; }
#top .ztsup textarea, .ztsup textarea { resize: vertical; min-height: 96px; }
#top .ztsup input:focus, #top .ztsup select:focus, #top .ztsup textarea:focus,
.ztsup input:focus, .ztsup select:focus, .ztsup textarea:focus { outline: 2px solid var(--ztsup-navy); outline-offset: 0; border-color: var(--ztsup-navy); }
#top .ztsup input[type=file], .ztsup input[type=file] { padding: 6px 0; border: 0; font-size: 14px; }
.ztsup-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- list */
.ztsup ul.ztsup-list, .ztsup ol.ztsup-thread, .ztsup ul.ztsup-files { margin: 0; padding: 0; list-style: none; }
.ztsup-list { display: flex; flex-direction: column; gap: 8px; }
#top .ztsup .ztsup-item, .ztsup .ztsup-item {
  display: flex; flex-direction: column; gap: 3px; width: 100%; margin: 0; padding: 12px 14px; text-align: left;
  border: 1px solid var(--ztsup-line); border-radius: 10px; background: #fff; color: var(--ztsup-ink); font: inherit; cursor: pointer;
}
#top .ztsup .ztsup-item:hover, .ztsup .ztsup-item:hover { border-color: var(--ztsup-navy); }
.ztsup-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ztsup-no { color: var(--ztsup-grey); font-size: 13px; font-weight: 600; }
.ztsup-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #E7EBF1; color: var(--ztsup-navy); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ztsup-pill-alert { background: #FBE4DB; color: var(--ztsup-orange-dark); }
.ztsup-pill-done { background: #E3F1E6; color: var(--ztsup-green); }

/* ---------- ticket */
.ztsup-ticket-head { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--ztsup-line); }
.ztsup-subject { color: var(--ztsup-navy); font-size: 17px; }
.ztsup-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ztsup-thread { display: flex; flex-direction: column; gap: 10px; }
.ztsup-msg { max-width: 88%; padding: 10px 12px; border-radius: 12px; }
.ztsup-msg-customer { align-self: flex-end; background: #E9EEF7; border-bottom-right-radius: 4px; }
.ztsup-msg-agent { align-self: flex-start; background: #fff; border: 1px solid var(--ztsup-line); border-bottom-left-radius: 4px; }
.ztsup-msg-system { align-self: center; max-width: 100%; padding: 2px 8px; color: var(--ztsup-grey); font-size: 12px; text-align: center; }
.ztsup-msg-meta { margin-bottom: 4px; color: var(--ztsup-grey); font-size: 12px; font-weight: 600; }
.ztsup-msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.ztsup-files { margin-top: 6px !important; font-size: 13px; }
.ztsup-files li::before { content: "📎 "; }
.ztsup-reply { padding-top: 12px; border-top: 1px solid var(--ztsup-line); }
.ztsup-done { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; text-align: center; }
.ztsup-big { color: var(--ztsup-navy); font-size: 28px; font-weight: 700; }

/* ---------- phones: the panel takes the screen */
@media (max-width: 520px) {
  .ztsup-floating.ztsup-pos-right { right: 14px; }
  .ztsup-floating.ztsup-pos-left { left: 14px; }
  .ztsup-floating .ztsup-panel { position: fixed; inset: 0; width: auto; max-width: none; height: auto; border-radius: 0; border: 0; }
  .ztsup-open .ztsup-launcher { display: none; }
  .ztsup-row, .ztsup-panel-page .ztsup-cards { grid-template-columns: 1fr; }
  #top .ztsup .ztsup-launcher, .ztsup .ztsup-launcher { height: 52px; }
}
@media (prefers-reduced-motion: reduce) { .ztsup * { transition: none !important; } }
