/* Ticket System plugin: self-contained styles, scoped under .ts so Blesta's theme is untouched. */
.ts { --ts-ink: #1f2933; --ts-muted: #6b7280; --ts-line: #e5e7eb; --ts-bg: #ffffff; --ts-soft: #f5f7fa; --ts-accent: #2563eb; --ts-accent-ink: #ffffff; --ts-ok: #16a34a; --ts-warn: #d97706; --ts-bad: #dc2626; --ts-radius: 8px;
      color: var(--ts-ink); font-size: 15px; line-height: 1.5; }
.ts * { box-sizing: border-box; }
.ts a { color: var(--ts-accent); text-decoration: none; }
.ts a:hover { text-decoration: underline; }
.ts .ts-card { background: var(--ts-bg); border: 1px solid var(--ts-line); border-radius: var(--ts-radius); }
.ts .ts-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: .9rem 1rem; border-bottom: 1px solid var(--ts-line); }
.ts .ts-head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.ts .ts-body { padding: 1rem; }
.ts .ts-tabs { display: flex; gap: .25rem; }
.ts .ts-tab { padding: .35rem .75rem; border-radius: 999px; color: var(--ts-muted); background: transparent; border: 0; cursor: pointer; font: inherit; }
.ts .ts-tab.is-active { background: var(--ts-soft); color: var(--ts-ink); font-weight: 600; }
.ts .ts-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--ts-line); background: var(--ts-bg); color: var(--ts-ink); font: inherit; font-size: .95rem; font-weight: 500; cursor: pointer; text-decoration: none; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); transition: background .15s, box-shadow .15s, transform .15s; }
.ts .ts-btn:hover { background: var(--ts-soft); text-decoration: none; box-shadow: 0 2px 6px rgba(15, 23, 42, .08); }
.ts .ts-btn:active { transform: translateY(1px); box-shadow: none; }
.ts .ts-btn:focus-visible { outline: 2px solid var(--ts-accent); outline-offset: 2px; }
.ts .ts-btn-primary { background: var(--ts-accent); border-color: var(--ts-accent); color: var(--ts-accent-ink); box-shadow: 0 1px 2px rgba(37, 99, 235, .3); }
.ts .ts-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; box-shadow: 0 3px 8px rgba(37, 99, 235, .3); }
@media (prefers-reduced-motion: reduce) { .ts .ts-btn { transition: none; } .ts .ts-btn:active { transform: none; } }
.ts .ts-btn-danger { color: var(--ts-bad); }
.ts .ts-btn[disabled] { opacity: .6; cursor: default; }
.ts .ts-btn-sm { min-height: 32px; padding: .3rem .7rem; font-size: .85rem; border-radius: 6px; }
.ts table { width: 100%; border-collapse: collapse; }
.ts th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ts-muted); padding: .6rem .75rem; border-bottom: 1px solid var(--ts-line); }
.ts td { padding: .7rem .75rem; border-bottom: 1px solid var(--ts-line); vertical-align: middle; }
.ts tr:last-child td { border-bottom: 0; }
.ts .ts-row { cursor: pointer; transition: background .12s; }
.ts .ts-row:hover { background: var(--ts-soft); }
.ts .ts-row td:first-child { border-left: 3px solid transparent; }
.ts .ts-row.needs-you td:first-child { border-left-color: var(--ts-warn); }
.ts .ts-row.needs-you .ts-subject a { font-weight: 600; }
.ts .ts-subject a { color: var(--ts-ink); font-weight: 500; display: block; max-width: 40ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts .ts-subject a:hover { color: var(--ts-accent); text-decoration: none; }
.ts .ts-sub-meta { display: block; color: var(--ts-muted); font-size: .8rem; margin-top: .15rem; }
.ts .ts-sep { margin: 0 .4rem; opacity: .6; }
.ts .ts-last-who { display: block; font-size: .78rem; color: var(--ts-ink); font-weight: 500; }
.ts .ts-tickets td { vertical-align: top; padding-top: .8rem; }
.ts .ts-tickets .ts-num { font-size: .78rem; }
.ts .ts-tickets .ts-subject { width: 48%; }
.ts .ts-tickets .ts-badge { margin-top: .1rem; }
.ts .ts-when { white-space: nowrap; }
.ts .ts-when time { cursor: help; }
@media (max-width: 720px) {
    .ts .ts-col-opened { display: none; }
    .ts .ts-subject a { max-width: 28ch; }
    .ts .ts-tickets .ts-subject { width: auto; }
}
.ts .ts-num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; color: var(--ts-muted); }
.ts .ts-badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--ts-soft); color: var(--ts-muted); white-space: nowrap; }
.ts .ts-badge.open, .ts .ts-badge.in_progress { background: #dcfce7; color: #166534; }
.ts .ts-badge.awaiting_reply { background: #fef3c7; color: #92400e; }
.ts .ts-badge.on_hold { background: #e5e7eb; color: #374151; }
.ts .ts-badge.closed { background: #e5e7eb; color: #4b5563; }
.ts .ts-badge.staff { background: #dbeafe; color: #1e40af; }
.ts .ts-badge.system { background: #e5e7eb; color: #374151; }
.ts .ts-muted { color: var(--ts-muted); font-size: .88rem; }
#support-app { min-height: 320px; }
.ts .ts-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ts .ts-bone { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--ts-soft) 25%, var(--ts-line) 50%, var(--ts-soft) 75%); background-size: 400% 100%; animation: ts-shimmer 1.4s ease infinite; max-width: 100%; }
.ts .ts-bone.pill { height: 22px; border-radius: 999px; }
.ts .ts-bone.btn { height: 40px; border-radius: 8px; }
.ts .ts-bone.title { height: 22px; }
.ts .ts-bone.input { height: 40px; border-radius: 6px; }
.ts .ts-bone.block { height: 130px; border-radius: 6px; }
.ts .ts-sk .ts-head { min-height: 61px; }
.ts .ts-sk-tabs { display: flex; gap: .5rem; }
.ts .ts-sk-rows { padding: .75rem 1rem; display: grid; gap: .45rem; }
.ts .ts-sk-row { border: 1px solid var(--ts-line); border-radius: 8px; display: grid; grid-template-columns: 3.4fr 1.1fr .8fr 1fr; gap: 1rem; align-items: start; padding: 1rem .75rem; border-bottom: 1px solid var(--ts-line); }
.ts .ts-sk-stack { display: flex; flex-direction: column; gap: .5rem; }
.ts .ts-sk-stack .ts-bone:last-child { height: 10px; }
.ts .ts-sk-row:last-child { border-bottom: 0; }
@media (max-width: 720px) { .ts .ts-sk-row { grid-template-columns: 2.6fr 1.1fr 1fr; } .ts .ts-sk-row > .ts-bone:nth-child(3) { display: none; } }
.ts .ts-sk-card { display: flex; flex-direction: column; gap: .7rem; padding: 1rem 1.1rem; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); min-height: 132px; }
.ts .ts-sk .ts-ticket-head { display: flex; flex-direction: column; gap: .6rem; }
.ts .ts-sk .ts-ticket-title { width: 100%; }
.ts .ts-sk-composer { display: flex; flex-direction: column; gap: .6rem; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); padding: 1rem; margin-bottom: 1.25rem; }
.ts .ts-sk-composer .ts-bone.btn { align-self: flex-start; }
.ts .ts-sk-reply { border: 1px solid var(--ts-line); border-radius: var(--ts-radius); margin: .6rem 0 .9rem; overflow: hidden; }
.ts .ts-sk-reply-head { display: flex; justify-content: space-between; padding: .7rem .9rem; background: var(--ts-soft); }
.ts .ts-sk-reply-body { display: flex; flex-direction: column; gap: .6rem; padding: .9rem; }
.ts .ts-sk .ts-body > .ts-bone { margin-bottom: .6rem; }
@media (prefers-reduced-motion: reduce) { .ts .ts-bone { animation: none; } }
.ts .ts-skeleton { padding: 0 1rem 1.5rem; display: flex; flex-direction: column; gap: .7rem; }
.ts .ts-skeleton span { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--ts-soft) 25%, var(--ts-line) 50%, var(--ts-soft) 75%); background-size: 400% 100%; animation: ts-shimmer 1.4s ease infinite; }
.ts .ts-skeleton span:nth-child(1) { width: 60%; } .ts .ts-skeleton span:nth-child(2) { width: 85%; } .ts .ts-skeleton span:nth-child(3) { width: 45%; }
@keyframes ts-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .ts .ts-skeleton span { animation: none; } }
.ts .ts-loading { display: flex; align-items: center; gap: .6rem; padding: 2rem 1rem; color: var(--ts-muted); }
.ts .ts-spinner { width: 18px; height: 18px; border: 2px solid var(--ts-line); border-top-color: var(--ts-accent); border-radius: 50%; animation: ts-spin .8s linear infinite; display: inline-block; }
@keyframes ts-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ts .ts-spinner { animation: none; } }
.ts .ts-alert { padding: .75rem 1rem; border-radius: 6px; border: 1px solid var(--ts-line); background: var(--ts-soft); margin-bottom: 1rem; }
.ts .ts-alert.ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.ts .ts-alert.bad { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.ts .ts-alert.info { border-color: #bae6fd; background: #f0f9ff; color: #075985; }
.ts .ts-alert.info a { color: inherit; font-weight: 600; }
.ts .ts-alert.warn { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.ts .ts-empty { padding: 3rem 1rem; text-align: center; color: var(--ts-muted); display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.ts .ts-empty-icon { font-size: 2rem; line-height: 1; margin-bottom: .4rem; }
.ts .ts-empty strong { color: var(--ts-ink); font-size: 1.05rem; }
.ts .ts-empty .ts-btn { margin-top: 1rem; }
.ts .ts-list { display: grid; gap: .6rem; }
.ts .ts-dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.ts .ts-dept { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem 1rem; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); color: inherit; background: var(--ts-bg); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: border-color .15s, box-shadow .15s, transform .15s; }
.ts .ts-dept:hover { text-decoration: none; border-color: var(--ts-accent); box-shadow: 0 6px 18px rgba(15, 23, 42, .08); transform: translateY(-1px); }
.ts .ts-dept:focus-visible { outline: 2px solid var(--ts-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ts .ts-dept { transition: none; } .ts .ts-dept:hover { transform: none; } }
.ts .ts-dept-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.ts .ts-dept-top strong { font-size: 1.05rem; }
.ts .ts-dept-state { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--ts-ok); white-space: nowrap; font-weight: 600; }
.ts .ts-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ts-ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.ts .ts-dept.is-closed .ts-dept-state { color: var(--ts-muted); font-weight: 500; }
.ts .ts-dept.is-closed .ts-dot { background: #9ca3af; box-shadow: 0 0 0 3px rgba(156, 163, 175, .2); }
.ts .ts-dept-desc { display: block; color: var(--ts-muted); font-size: .92rem; }
.ts .ts-dept-cta { margin-top: auto; padding-top: .5rem; font-size: .88rem; font-weight: 600; color: var(--ts-accent); }
.ts .ts-hours { font-size: .82rem; color: var(--ts-muted); margin-top: .2rem; line-height: 1.6; }
.ts .ts-hours strong { color: var(--ts-ink); font-weight: 600; }
.ts .ts-field { margin-bottom: 1rem; }
.ts .ts-field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.ts .ts-field input, .ts .ts-field select, .ts .ts-field textarea { min-height: 40px; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04); transition: border-color .15s, box-shadow .15s; }
.ts .ts-field input:hover, .ts .ts-field select:hover, .ts .ts-field textarea:hover { border-color: #cbd2dc; }
.ts .ts-field input, .ts .ts-field select, .ts .ts-field textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--ts-line); border-radius: 6px; font: inherit; color: inherit; background: var(--ts-bg); }
.ts .ts-field input:focus, .ts .ts-field select:focus, .ts .ts-field textarea:focus { outline: none; border-color: var(--ts-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.ts .ts-field.is-invalid input, .ts .ts-field.is-invalid textarea, .ts .ts-field.is-invalid select { border-color: var(--ts-bad); }
.ts .ts-field .ts-error { color: var(--ts-bad); font-size: .85rem; margin-top: .3rem; }
.ts .ts-field .ts-hint { color: var(--ts-muted); font-size: .85rem; margin-top: .3rem; }
.ts .ts-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .ts .ts-grid-2 { grid-template-columns: 1fr; } }
.ts .ts-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.ts .ts-reply { border: 1px solid var(--ts-line); border-radius: var(--ts-radius); margin-bottom: .9rem; overflow: hidden; }
.ts .ts-reply-head { display: flex; justify-content: space-between; gap: .5rem; padding: .55rem .9rem; background: var(--ts-soft); font-size: .9rem; }
.ts .ts-reply.staff .ts-reply-head { background: #eff6ff; }
.ts .ts-reply.system .ts-reply-head { font-style: italic; }
.ts .ts-reply-body { padding: .9rem; }
.ts .ts-reply-body > :first-child { margin-top: 0; }
.ts .ts-reply-body > :last-child { margin-bottom: 0; }
.ts .ts-reply-body pre { background: var(--ts-soft); padding: .6rem; border-radius: 6px; overflow-x: auto; }
.ts .ts-reply-body code { background: var(--ts-soft); padding: .1rem .3rem; border-radius: 4px; }
.ts .ts-reply-body img { max-width: 100%; }
.ts .ts-reply-body .reply-signature { margin-top: .9rem; padding-top: .6rem; border-top: 1px solid var(--ts-line); color: var(--ts-muted); font-size: .92em; }
.ts .ts-thumbs { display: flex; flex-wrap: wrap; gap: .6rem; padding: .6rem .9rem; border-top: 1px solid var(--ts-line); }
.ts .ts-thumb { display: flex; flex-direction: column; width: 140px; border: 1px solid var(--ts-line); border-radius: 6px; overflow: hidden; background: var(--ts-soft); text-decoration: none; color: inherit; }
.ts .ts-thumb:hover { border-color: var(--ts-accent); }
.ts .ts-thumb img { display: block; width: 100%; height: 100px; object-fit: cover; background: #fff; }
.ts .ts-thumb-name { font-size: .75rem; padding: .3rem .45rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts .ts-attachments { padding: .5rem .9rem; border-top: 1px solid var(--ts-line); font-size: .9rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.ts .ts-pager { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-top: 1px solid var(--ts-line); font-size: .9rem; color: var(--ts-muted); }
.ts .ts-cred { border: 1px dashed #fca5a5; border-radius: var(--ts-radius); margin: 0 0 1.25rem; }
.ts .ts-cred.ts-cc { border: 1px solid var(--ts-line); }
.ts .ts-cred.ts-cc summary:hover { background: var(--ts-soft); }
.ts .ts-cc-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.ts .ts-cc-form input { flex: 1 1 14rem; padding: .5rem; border: 1px solid var(--ts-line); border-radius: 6px; }
.ts .ts-draft { display: flex; gap: .75rem; align-items: center; font-size: .85rem; color: var(--ts-muted); margin: 0 0 .75rem; }
.ts .ts-draft button { background: none; border: 0; padding: 0; color: var(--ts-accent); cursor: pointer; font: inherit; text-decoration: underline; }
.ts .ts-cred summary { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; cursor: pointer; list-style: none; user-select: none; }
.ts .ts-cred summary::-webkit-details-marker { display: none; }
.ts .ts-cred summary:hover { background: #fff7f7; }
.ts .ts-cred summary:focus-visible { outline: 2px solid var(--ts-accent); outline-offset: -2px; border-radius: var(--ts-radius); }
.ts .ts-cred-title { font-weight: 600; }
.ts .ts-cred-sub { color: var(--ts-muted); font-size: .85rem; }
.ts .ts-cred-chevron { margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ts-muted); border-bottom: 2px solid var(--ts-muted); transform: rotate(45deg); transition: transform .15s; }
.ts .ts-cred[open] .ts-cred-chevron { transform: rotate(225deg); }
.ts .ts-cred-body { padding: 0 1rem 1rem; }
.ts .ts-cred-body > p { margin-top: 0; }
.ts .ts-cred .ts-error { color: var(--ts-bad); font-size: .85rem; margin-top: .4rem; }
@media (prefers-reduced-motion: reduce) { .ts .ts-cred-chevron { transition: none; } }
.ts .ts-cred-row { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--ts-line); font-size: .92rem; }
.ts .ts-cred-form { display: grid; grid-template-columns: 1fr 2fr auto; gap: .5rem; margin-top: .75rem; align-items: start; }
.ts .ts-cred-form input, .ts .ts-cred-form textarea { padding: .5rem; border: 1px solid var(--ts-line); border-radius: 6px; font: inherit; color: inherit; background: var(--ts-bg); width: 100%; }
.ts form .ts-cred .ts-cred-form { grid-template-columns: 1fr 2fr; }
@media (max-width: 640px) { .ts .ts-cred-form { grid-template-columns: 1fr; } }
.ts .ts-drop-area { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25rem .6rem; padding: .7rem 1rem; border: 2px dashed var(--ts-line); border-radius: var(--ts-radius); text-align: center; cursor: pointer; color: var(--ts-muted); background: var(--ts-soft); transition: border-color .15s, background .15s; }
.ts .ts-drop-area:hover, .ts .ts-drop-area.is-over { border-color: var(--ts-accent); background: #eff6ff; }
.ts .ts-drop-area:focus-visible { outline: 2px solid var(--ts-accent); outline-offset: 2px; }
.ts .ts-drop-area strong { color: var(--ts-ink); }
.ts .ts-drop-icon { font-size: 1.1rem; line-height: 1; }
.ts .ts-drop-area .ts-muted { font-size: .8rem; }
.ts .ts-drop-list { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.ts .ts-drop-item { position: relative; width: 132px; border: 1px solid var(--ts-line); border-radius: 6px; overflow: hidden; background: var(--ts-bg); }
.ts .ts-drop-item img { display: block; width: 100%; height: 84px; object-fit: cover; }
.ts .ts-drop-file { height: 84px; display: flex; align-items: center; justify-content: center; font-size: 2rem; background: var(--ts-soft); }
.ts .ts-drop-meta { padding: .35rem .5rem; font-size: .78rem; display: flex; flex-direction: column; }
.ts .ts-drop-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts .ts-drop-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.ts .ts-drop-remove:hover { background: var(--ts-bad); }
.ts .ts-drop-errors .ts-error { color: var(--ts-bad); font-size: .85rem; margin-top: .3rem; }
.ts .ts-md { border: 1px solid var(--ts-line); border-radius: 6px; overflow: hidden; background: var(--ts-bg); }
.ts .ts-md:focus-within { outline: 2px solid var(--ts-accent); outline-offset: 1px; }
.ts .ts-md-bar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .25rem .4rem; border-bottom: 1px solid var(--ts-line); background: var(--ts-soft); flex-wrap: wrap; }
.ts .ts-md-tools { display: flex; gap: .1rem; }
.ts .ts-md-btn { min-width: 28px; height: 26px; border: 0; background: transparent; border-radius: 4px; cursor: pointer; font: inherit; font-size: .85rem; color: var(--ts-ink); }
.ts .ts-md-btn:hover { background: var(--ts-line); }
.ts .ts-md-btn[disabled] { opacity: .4; cursor: default; }
.ts .ts-md-tabs { display: flex; gap: .1rem; }
.ts .ts-md-tab { border: 0; background: transparent; padding: .2rem .6rem; border-radius: 4px; font: inherit; font-size: .82rem; color: var(--ts-muted); cursor: pointer; }
.ts .ts-md-tab.is-active { background: var(--ts-bg); color: var(--ts-ink); font-weight: 600; box-shadow: 0 0 0 1px var(--ts-line); }
.ts .ts-field .ts-md textarea.ts-md-input { border: 0; border-radius: 0; resize: vertical; min-height: 9rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92rem; }
.ts .ts-field .ts-md textarea.ts-md-input:focus { outline: none; }
.ts .ts-md-preview { min-height: 9rem; padding: .75rem; }
.ts .ts-ticket-head { padding: 1rem 1.25rem 1.1rem; border-bottom: 1px solid var(--ts-line); background: linear-gradient(180deg, var(--ts-soft), var(--ts-bg)); }
.ts .ts-back { display: inline-block; font-size: .85rem; color: var(--ts-muted); margin-bottom: .5rem; }
.ts .ts-back:hover { color: var(--ts-accent); text-decoration: none; }
.ts .ts-ticket-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.ts .ts-ticket-title h2 { margin: 0; font-size: 1.35rem; font-weight: 650; line-height: 1.3; text-wrap: balance; }
.ts .ts-ticket-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .5rem; font-size: .88rem; color: var(--ts-muted); }
.ts .ts-ticket-meta strong { color: var(--ts-ink); font-weight: 600; }
.ts .ts-ticket-meta time { cursor: help; }
.ts .ts-composer { padding: 0 0 1.25rem; margin-bottom: .5rem; border-bottom: 1px solid var(--ts-line); }
.ts .ts-composer .ts-field { margin-bottom: .75rem; }
.ts .ts-thread-heading { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ts-muted); margin: 1.25rem 0 .6rem; }
.ts-lightbox { position: fixed; inset: 0; margin: 0; border: 0; width: auto; height: auto; overflow: visible; color: inherit; z-index: 2147483647; background: rgba(10, 12, 16, .88); display: flex; align-items: center; justify-content: center; padding: 3rem; }
.ts-lb-open { overflow: hidden; }
.ts .ts-lb-figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.ts .ts-lb-figure img { max-width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.ts .ts-lb-figure figcaption { color: #e5e7eb; font-size: .9rem; display: flex; gap: 1rem; align-items: center; }
.ts .ts-lb-download { color: #fff; text-decoration: underline; }
.ts .ts-lb-close, .ts .ts-lb-nav { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ts .ts-lb-close:hover, .ts .ts-lb-nav:hover { background: rgba(255,255,255,.25); }
.ts .ts-lb-close:focus-visible, .ts .ts-lb-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ts .ts-lb-close { top: 1rem; right: 1rem; }
.ts .ts-lb-nav { top: 50%; transform: translateY(-50%); }
.ts .ts-lb-nav.prev { left: 1rem; } .ts .ts-lb-nav.next { right: 1rem; }
.ts .ts-lb-nav[hidden] { display: none; }
@media (max-width: 640px) { .ts-lightbox, .ts-lightbox:popover-open { padding: 3.5rem .5rem 1rem; } .ts .ts-lb-nav { width: 38px; height: 38px; } }
/* Popover UA defaults (centered, bordered, padded) are reset so top-layer overlays keep their own layout. */
.ts-lightbox:popover-open, .ts-toasts:popover-open { margin: 0; border: 0; padding: 0; width: auto; height: auto; overflow: visible; color: inherit; }
.ts-lightbox:popover-open { inset: 0; padding: 3rem; }
.ts-toasts:popover-open { inset: auto 1rem 1rem auto; background: transparent; }
.ts-lightbox::backdrop, .ts-toasts::backdrop { background: transparent; }
.ts-modal { position: fixed; inset: 0; margin: 0; border: 0; padding: 1rem; width: auto; height: auto; overflow: auto; color: inherit; z-index: 2147483647; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.ts-modal.is-in { opacity: 1; }
.ts-modal.is-leaving { opacity: 0; }
.ts-modal::backdrop { background: transparent; }
.ts-modal-open { overflow: hidden; }
.ts .ts-modal-box { width: min(440px, 100%); background: var(--ts-bg); border-radius: 12px; padding: 1.4rem 1.5rem 1.25rem; box-shadow: 0 24px 64px rgba(0, 0, 0, .3); transform: translateY(8px) scale(.98); transition: transform .15s; }
.ts-modal.is-in .ts-modal-box { transform: none; }
.ts .ts-modal-box h3 { margin: 0 0 .5rem; font-size: 1.15rem; font-weight: 650; }
.ts .ts-modal-box p { margin: 0 0 1.25rem; color: var(--ts-muted); }
.ts .ts-modal-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.ts .ts-btn-danger-solid { background: var(--ts-bad); border-color: var(--ts-bad); color: #fff; }
.ts .ts-btn-danger-solid:hover { background: #b91c1c; border-color: #b91c1c; }
@media (prefers-reduced-motion: reduce) { .ts-modal, .ts .ts-modal-box { transition: none; } }
.ts-toasts { position: fixed; inset: auto 1rem 1rem auto; margin: 0; border: 0; padding: 0; width: auto; height: auto; overflow: visible; background: transparent; color: inherit; z-index: 2147483647; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); }
.ts-toasts:empty { display: none !important; }
.ts .ts-toast { display: flex; align-items: flex-start; gap: .6rem; padding: .7rem .8rem; border-radius: 8px; background: #1f2933; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: .92rem; line-height: 1.4; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.ts .ts-toast.is-in { opacity: 1; transform: none; }
.ts .ts-toast.is-leaving { opacity: 0; transform: translateY(8px); }
.ts .ts-toast.ok { background: #14532d; }
.ts .ts-toast.bad { background: #7f1d1d; }
.ts .ts-toast-icon { flex: none; font-weight: 700; }
.ts .ts-toast-text { flex: 1; }
.ts .ts-toast-close { flex: none; border: 0; background: transparent; color: inherit; opacity: .7; font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 .1rem; }
.ts .ts-toast-close:hover { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .ts-toasts:empty { display: none !important; }
.ts .ts-toast { transition: none; } }
.ts .ts-closed { padding: 1.25rem; border-left: 4px solid var(--ts-bad); background: #fef2f2; border-radius: 6px; }

/* Conversation: avatar + message layout */
.ts .ts-msg { display: flex; gap: .75rem; margin-bottom: 1rem; }
.ts .ts-msg-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; color: #fff; background: #6b7280; margin-top: .15rem; }
.ts .ts-msg.staff .ts-msg-avatar { background: var(--ts-accent); }
.ts .ts-msg.system .ts-msg-avatar { background: var(--ts-soft); color: var(--ts-muted); border: 1px dashed var(--ts-line); }
.ts .ts-msg-main { flex: 1; min-width: 0; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); background: var(--ts-bg); overflow: hidden; }
.ts .ts-msg.staff .ts-msg-main { border-left: 3px solid var(--ts-accent); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ts .ts-msg.system .ts-msg-main { background: var(--ts-soft); border-style: dashed; }
.ts .ts-msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; padding: .6rem .9rem .35rem; font-size: .92rem; }
.ts .ts-msg-head strong { color: var(--ts-ink); }
.ts .ts-msg-time { margin-left: auto; color: var(--ts-muted); font-size: .8rem; cursor: help; }
.ts .ts-msg .ts-reply-body { padding: .2rem .9rem .9rem; }
.ts .ts-msg.system .ts-reply-body { color: var(--ts-muted); font-size: .92rem; }
.ts .ts-msg .ts-thumbs, .ts .ts-msg .ts-attachments { border-top: 1px solid var(--ts-line); }
@media (max-width: 640px) { .ts .ts-msg { gap: 0; } .ts .ts-msg-avatar { display: none; } }

/* Client dashboard widget */
.ts.ts-widget { font-size: 14px; }
.ts .ts-widget-summary { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .75rem; }
.ts .ts-widget-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .7rem; border-radius: 999px; background: var(--ts-soft); color: var(--ts-muted); font-size: .82rem; }
.ts .ts-widget-chip b { color: var(--ts-ink); font-weight: 700; }
.ts .ts-widget-chip.warn { background: #fef3c7; color: #92400e; }
.ts .ts-widget-chip.warn b { color: #92400e; }
.ts .ts-widget-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.ts .ts-widget-row a { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; border: 1px solid var(--ts-line); border-radius: 8px; background: var(--ts-bg); color: var(--ts-ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ts .ts-widget-row a:hover { border-color: var(--ts-accent); box-shadow: 0 4px 14px rgba(15, 23, 42, .08); transform: translateY(-1px); text-decoration: none; }
.ts .ts-widget-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ts-ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.ts .ts-widget-row.needs-you .ts-widget-dot { background: var(--ts-warn); box-shadow: 0 0 0 3px rgba(217, 119, 6, .18); }
.ts .ts-widget-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.ts .ts-widget-subject { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ts .ts-widget-row.needs-you .ts-widget-subject { color: var(--ts-ink); }
.ts .ts-widget-meta { color: var(--ts-muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts .ts-widget-meta .ts-num { font-size: .75rem; }
.ts .ts-widget-when { flex: none; color: var(--ts-muted); font-size: .8rem; min-width: 5.5rem; text-align: right; }
.ts .ts-widget-chevron { flex: none; color: var(--ts-line); font-size: 1.3rem; line-height: 1; }
.ts .ts-widget-row a:hover .ts-widget-chevron { color: var(--ts-accent); }
.ts .ts-widget-empty { display: flex; align-items: center; gap: .6rem; margin: .25rem 0; padding: .9rem 1rem; border: 1px dashed var(--ts-line); border-radius: 8px; color: var(--ts-muted); }
.ts .ts-widget-empty-icon { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; background: #dcfce7; color: #166534; font-weight: 700; }
.ts .ts-widget-more { margin: .6rem .25rem 0; font-size: .88rem; }
.ts .ts-widget-more a { color: var(--ts-accent); font-weight: 500; }
@media (max-width: 640px) { .ts .ts-widget-when { display: none; } .ts .ts-widget-row a { gap: .5rem; padding: .55rem .6rem; } }
@media (prefers-reduced-motion: reduce) { .ts .ts-widget-row a { transition: none; } .ts .ts-widget-row a:hover { transform: none; } }

/* Main ticket list: card rows matching the dashboard widget */
.ts .ts-trows { list-style: none; margin: 0; padding: .75rem 1rem; display: grid; gap: .45rem; }
.ts .ts-trow a { display: flex; align-items: center; gap: .85rem; padding: .7rem .9rem; border: 1px solid var(--ts-line); border-radius: 8px; background: var(--ts-bg); color: var(--ts-ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ts .ts-trow a:hover { border-color: var(--ts-accent); box-shadow: 0 4px 14px rgba(15, 23, 42, .08); transform: translateY(-1px); text-decoration: none; }
.ts .ts-trow.needs-you .ts-widget-dot { background: var(--ts-warn); box-shadow: 0 0 0 3px rgba(217, 119, 6, .18); }
.ts .ts-trow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.ts .ts-trow-subject { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts .ts-trow .ts-sub-meta { margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts .ts-trow-status { flex: none; display: flex; align-items: center; gap: .85rem; }
.ts .ts-trow-opened, .ts .ts-trow-activity { flex: none; display: flex; flex-direction: column; align-items: flex-end; min-width: 6.5rem; font-size: .8rem; line-height: 1.3; }
.ts .ts-trow-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ts-muted); }
.ts .ts-trow-activity .ts-last-who { font-size: .78rem; }
@media (max-width: 720px) { .ts .ts-trow-opened { display: none; } .ts .ts-trow a { gap: .6rem; padding: .6rem .7rem; } .ts .ts-trow-activity { min-width: 0; } }
/* Phones: a two-row grid, so the row can never be wider than the screen */
@media (max-width: 560px) {
    .ts .ts-trows { padding: .6rem .6rem; }
    .ts .ts-trow a { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; grid-template-areas: "dot main chev" "status status status"; column-gap: .6rem; row-gap: .4rem; align-items: center; padding: .6rem .7rem; }
    .ts .ts-trow .ts-widget-dot { grid-area: dot; }
    .ts .ts-trow-main { grid-area: main; min-width: 0; }
    .ts .ts-trow .ts-widget-chevron { grid-area: chev; }
    .ts .ts-trow-status { grid-area: status; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; min-width: 0; }
    .ts .ts-trow-activity { display: contents; }
    .ts .ts-trow-activity .ts-last-who { display: inline; }
    .ts .ts-widget-row a { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; grid-template-areas: "dot main chev" "badge badge badge"; column-gap: .6rem; row-gap: .35rem; }
    .ts .ts-widget-row .ts-widget-dot { grid-area: dot; }
    .ts .ts-widget-row .ts-widget-main { grid-area: main; min-width: 0; }
    .ts .ts-widget-row .ts-widget-chevron { grid-area: chev; }
    .ts .ts-widget-row .ts-badge { grid-area: badge; justify-self: start; }
}
.ts .ts-trow, .ts .ts-widget-row { min-width: 0; }
.ts .ts-trow a, .ts .ts-widget-row a { max-width: 100%; min-width: 0; }
.ts .ts-badge { max-width: 100%; }
@media (prefers-reduced-motion: reduce) { .ts .ts-trow a { transition: none; } .ts .ts-trow a:hover { transform: none; } }

/* Custom fields */
.ts .ts-check { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.ts .ts-check input { width: auto; min-height: 0; margin: 0; }
.ts .ts-details { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem .9rem; margin: 0 0 1.1rem; padding: .8rem 1rem; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); background: var(--ts-soft); }
.ts .ts-details div { min-width: 0; }
.ts .ts-details dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ts-muted); margin: 0 0 .1rem; }
.ts .ts-details dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* Long subjects wrap instead of stretching the page */
.ts .ts-ticket-head, .ts .ts-ticket-title, .ts .ts-ticket-meta { min-width: 0; }
.ts .ts-ticket-title h2 { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.ts .ts-ticket-meta > span { min-width: 0; overflow-wrap: anywhere; }
.ts .ts-card, .ts .ts-body { min-width: 0; max-width: 100%; }
.ts .ts-reply-body { overflow-wrap: anywhere; }
.ts .ts-reply-body pre { max-width: 100%; }

/* iOS zooms into fields smaller than 16px; keep them at 16px on phones */
@media (max-width: 640px) {
    .ts input:not([type="checkbox"]):not([type="radio"]), .ts textarea, .ts select { font-size: 16px; }
    .ts .ts-md-toolbar button { font-size: 16px; }
}

/* Message bodies never exceed the screen: links break anywhere, tables scroll within themselves */
.ts .ts-reply-body a { word-break: break-all; }
.ts .ts-reply-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.ts .ts-reply-body th, .ts .ts-reply-body td { border: 1px solid var(--ts-line); padding: .35rem .6rem; }
.ts .ts-reply-body img { height: auto; }
.ts .ts-msg-main { overflow-x: hidden; }
