/* help center: ticket page. same dark look as the report window, built as a proper page */
:root { --bg: #0c0e12; --panel: #101216; --panel2: #14171c; --field: #181b20; --line: #23262c; --line2: #2a2d34; --fg: #e9eaee; --mut: #8b909a; --mut2: #a3a7b0; --acc: #4a74f0; --acc2: #5b83ff; --ok: #3ddc84; --warn: #f0c15a; --bad: #ff7a7a; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; display: flex; flex-direction: column; }
a { color: var(--acc2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.hd { flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 58px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 800; font-size: 18px; }
.sep { color: var(--line2); }
.hd h1 { margin: 0; font-size: 15px; font-weight: 600; color: var(--mut2); }
.sp { flex: 1; }

.btn { border: 0; border-radius: 7px; background: #23262c; color: var(--fg); font-weight: 700; font-size: 13px; padding: 9px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #2d3139; }
.btn.solid { background: #3a63d8; color: #fff; }
.btn.solid:hover { background: #2f55c4; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn[hidden] { display: none; }
.in { width: 100%; background: var(--field); color: var(--fg); border: 1px solid var(--line2); border-radius: 7px; padding: 9px 11px; outline: none; }
.in:focus { border-color: var(--acc); }
.in::placeholder { color: #6f7581; }
textarea.in { resize: vertical; min-height: 84px; }

.app { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px 1fr; }
.side { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; padding: 12px 12px 4px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; color: var(--mut2); border-radius: 99px; padding: 6px 11px; font-weight: 600; font-size: 12.5px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.tab:hover { background: var(--panel2); }
.tab[aria-selected="true"] { background: #1c2740; color: #cdd9ff; }
.tab i { font-style: normal; font-size: 11px; background: #23262c; border-radius: 99px; padding: 0 7px; color: var(--mut2); }
.tab[aria-selected="true"] i { background: #2a3d6e; color: #fff; }
.srch { display: grid; grid-template-columns: 1fr 138px; gap: 8px; padding: 8px 12px 12px; border-bottom: 1px solid var(--line); }
.list { flex: 1; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.empty { color: var(--mut); text-align: center; padding: 28px 16px; }

.tk { text-align: left; width: 100%; background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.tk:hover { background: var(--panel2); }
.tk.on { background: var(--panel2); border-color: var(--line2); }
.tk .r1 { display: flex; gap: 8px; align-items: center; }
.tk .sub { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk.unread .sub { color: #fff; font-weight: 800; }
.tk .when { flex: none; color: var(--mut); font-size: 12px; }
.tk .pre { color: var(--mut); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk .r3 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--acc); }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 9px; background: #23262c; color: var(--mut2); white-space: nowrap; }
.chip.ai { background: #1c2740; color: #9db6ff; }
.chip.team { background: #3a2f12; color: var(--warn); }
.chip.closed { background: #1d2a21; color: #7fd7a0; }
.chip.high { background: #3a1818; color: var(--bad); }
.chip.low { opacity: 0.75; }

.pane { min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.home { max-width: 760px; width: 100%; margin: 0 auto; padding: 36px 24px; display: flex; flex-direction: column; gap: 22px; }
.home h2 { margin: 0; font-size: 26px; letter-spacing: -0.01em; }
.home p { margin: 0; color: var(--mut2); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: var(--fg); text-decoration: none; }
.card:hover { border-color: #3a3f49; }
.card b { font-size: 14px; }
.card span { color: var(--mut); font-size: 12.5px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat b { display: block; font-size: 26px; line-height: 1.1; }
.stat span { color: var(--mut); font-size: 12.5px; }
.stat.hot b { color: var(--warn); }
.h3 { margin: 6px 0 -8px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mut); }

.thead { flex: none; padding: 16px 24px 14px; border-bottom: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.tback { display: none; align-self: flex-start; }
.thead h2 { margin: 0; font-size: 19px; word-break: break-word; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.meta { color: var(--mut); font-size: 12.5px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.tools label { display: flex; gap: 6px; align-items: center; color: var(--mut2); font-size: 12.5px; }
.tools select { width: auto; padding: 6px 8px; }

.thread { flex: 1; min-height: 120px; overflow: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.m { display: flex; gap: 10px; max-width: 760px; width: 100%; align-self: center; }
.m .av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: #2a2d34; color: #fff; }
.m .av.ai { background: #fff; overflow: hidden; }
.m .av.ai img { width: 100%; height: 100%; display: block; }
.pic { flex: none; padding: 0; border: 0; border-radius: 50%; overflow: hidden; background: #2a2d34; cursor: pointer; }
.pic:hover { box-shadow: 0 0 0 2px var(--acc); }
.pic:disabled { cursor: default; box-shadow: none; }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plink { border: 0; background: none; padding: 0; color: var(--acc2); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pcard { display: flex; flex-direction: column; gap: 10px; margin: -18px -18px 0; padding-bottom: 6px; }
.pbanner { height: 96px; background: linear-gradient(135deg, #1c2740, #2a1f3d); background-size: cover; background-position: center; }
.pavatar { position: relative; width: 84px; height: 84px; margin: -48px 0 0 18px; border-radius: 50%; border: 4px solid var(--panel); background: #2a2d34; }
.pavatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.pst { position: absolute; right: 0; bottom: 2px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--panel); background: #6f7581; }
.pst.online { background: var(--ok); } .pst.away { background: var(--warn); } .pst.busy { background: var(--bad); }
.pname, .pcard .meta, .pbio, .pstats, .pconn { margin: 0 18px; }
.pname { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 18px; }
.pbio { color: var(--mut2); white-space: pre-wrap; word-break: break-word; }
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pstats div { background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.pstats b { display: block; font-size: 16px; }
.pstats span { color: var(--mut); font-size: 11.5px; }
.pconn { display: flex; flex-wrap: wrap; gap: 8px; }
.pc { display: inline-flex; align-items: center; gap: 6px; background: var(--field); border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px 4px 8px; color: var(--fg); text-decoration: none; font-size: 12.5px; }
a.pc:hover { border-color: #5b6270; }
.pc img { width: 16px; height: 16px; }
.m.team .av { background: #1f3a2a; color: #8fe3a4; }
.m.note .av { background: #3a2f12; color: var(--warn); }
.m .bd { min-width: 0; flex: 1; }
.m .who { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--mut); }
.m .who b { color: var(--fg); font-size: 13px; }
.m .tx { margin-top: 2px; white-space: pre-wrap; word-break: break-word; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 9px 13px; }
.m.me { flex-direction: row-reverse; }
.m.me .who { justify-content: flex-end; }
.m.me .tx { background: #1c2a4d; border-color: #2a3d6e; border-radius: 12px 4px 12px 12px; }
.m.team .tx { background: #172a1f; border-color: #25402f; }
.m.note .tx { background: #2a2310; border: 1px dashed #5b4a1a; }
.m.sys { justify-content: center; color: var(--mut); font-size: 12.5px; text-align: center; }
.m.sys .tx { background: none; border: 0; padding: 2px 8px; }
.typing { align-self: center; max-width: 760px; width: 100%; color: var(--mut); font-size: 13px; }
.typing::after { content: ""; display: inline-block; width: 1.4em; text-align: left; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.comp { flex: none; border-top: 1px solid var(--line); background: var(--panel); padding: 12px 24px 16px; display: flex; flex-direction: column; gap: 10px; }
.comp > * { max-width: 760px; width: 100%; margin: 0 auto; }
.comp .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.comp .row .sp { flex: 1; }
.seg { display: inline-flex; background: var(--field); border: 1px solid var(--line2); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: transparent; color: var(--mut2); font-weight: 700; font-size: 12.5px; padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #2a3d6e; color: #fff; }
.seg button.note[aria-pressed="true"] { background: #5b4a1a; }
.hint { color: var(--mut); font-size: 12.5px; }
.rate { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--mut2); }
.rate .btn[aria-pressed="true"] { background: #2a3d6e; color: #fff; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { background: #1d2026; border: 1px solid var(--line2); border-left: 3px solid var(--acc); border-radius: 8px; padding: 10px 14px; max-width: 320px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); }
.toast.err { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--ok); }

.back { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.7); display: grid; place-items: center; padding: 16px; }
.dlg { width: min(520px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.dlg.wide { width: min(640px, 100%); }
.dh { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.dx { border: 0; width: 24px; height: 24px; border-radius: 50%; background: #23262c; color: var(--mut2); cursor: pointer; line-height: 1; padding: 0; }
.dx:hover { color: #fff; }
.db { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.db p { margin: 0; color: var(--mut2); }
.df { display: flex; justify-content: flex-end; gap: 10px; padding: 0 18px 18px; }
.f { display: flex; flex-direction: column; gap: 6px; }
.f > span { font-weight: 700; font-size: 12.5px; color: var(--mut2); }
.f small { color: var(--mut); text-align: right; }
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.cat { text-align: left; background: var(--field); border: 1px solid var(--line2); border-radius: 9px; padding: 9px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.cat b { font-size: 13px; }
.cat span { color: var(--mut); font-size: 12px; }
.cat:hover { border-color: #5b6270; }
.cat[aria-pressed="true"] { border-color: var(--acc); background: #1c2740; }
.chk { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; color: var(--mut2); }
.chk input { margin-top: 3px; accent-color: var(--acc); }
.cn { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; background: var(--field); border: 1px solid var(--line); border-radius: 9px; }
.cn .in { background: #101216; }
.cn textarea { grid-column: 1 / -1; min-height: 60px; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .app.has .side { display: none; }
  .app:not(.has) .pane { display: none; }
  .tback { display: inline-flex; }
  .hd { padding: 0 14px; gap: 8px; }
  .sep { display: none; }
  .hd h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .hd .btn { padding: 8px 11px; }
  .thead, .thread, .comp { padding-left: 14px; padding-right: 14px; }
  .home { padding: 22px 14px; }
}

.closedbox { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2, #14161c); color: var(--mut2); }
.closedbox b { color: var(--fg, #eee); }
.closedbox .btn { margin-top: 6px; }
.comp .rate { justify-content: center; }

/* attachments */
.aprev { display: flex; gap: 8px; flex-wrap: wrap; }
.aprev[hidden] { display: none; }
.ap { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line2); background: var(--field); }
.ap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap.busy img { opacity: 0.35; }
.ap.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; border-top-color: transparent; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.ax { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.7); color: #fff; cursor: pointer; line-height: 1; padding: 0; }
.files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.fimg { border: 1px solid var(--line2); border-radius: 10px; padding: 0; overflow: hidden; background: var(--field); cursor: zoom-in; width: 160px; height: 110px; }
.fimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bigimg { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 8px; }
.m.me .files { justify-content: flex-end; }
