body:has(.ticket) .site-header{background:#fff}
.board-page:has(.ticket){padding-top:148px}
.board-layout:has(.ticket){justify-content:flex-start;gap:36px}
.board-layout:has(.ticket) .board-main{max-width:780px}
.board-head.is-ticket{margin-bottom:18px}
.ticket{min-width:0;color:#243044}
.ticket-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px}
.ticket-tools-end{display:flex;align-items:center;gap:8px}
.ticket-back{color:#376df7;font-size:13px;font-weight:650}
.ticket-back:hover{text-decoration:underline}
.ticket-more{position:relative}
.ticket-more-btn,.ticket-menu button,.ticket-dialog button,.ticket-icon-btn{
  min-height:32px;border:1px solid #d7dee8;background:#fff;color:#243044;font-size:13px;font-weight:650
}
.ticket-more-btn{padding:0 10px}
.ticket-menu{position:absolute;top:calc(100% + 4px);right:0;z-index:20;min-width:120px;border:1px solid #d7dee8;background:#fff}
.ticket-menu button{display:block;width:100%;padding:8px 12px;border:0;text-align:left;color:#b42318}
.ticket-kicker{margin:14px 0 0;color:#676767;font-size:12px}
.ticket h1{margin:4px 0 0;font-size:26px;line-height:1.35;letter-spacing:-.4px;font-weight:750;overflow-wrap:anywhere}
.ticket-state{display:inline-flex;align-items:center;gap:6px;margin:0;padding:4px 8px;background:#f4f5f7;color:#4a5568;font-size:12px;font-weight:650;line-height:1.3}
.ticket-state::before{content:"";width:6px;height:6px;background:currentColor}
.ticket-state.is-ai{background:#eef2ff;color:#376df7}
.ticket-state.is-staff{background:#eef7f1;color:#1a7f37}
.ticket-state.is-followup,.ticket-state.is-waiting{background:#f8f3ea;color:#8a5a12}
.ticket-state.is-closed{background:#f4f5f7;color:#676767}
.ticket-meta{display:flex;flex-wrap:wrap;gap:4px 16px;margin:10px 0 0}
.ticket-meta div{display:flex;gap:6px;min-width:0;font-size:12px;line-height:1.45}
.ticket-meta dt{color:#8b93a1}
.ticket-meta dd{margin:0;overflow-wrap:anywhere}
.ticket-admin{margin-top:16px}
.ticket-admin summary{width:fit-content;color:#676767;font-size:13px;font-weight:650;cursor:pointer}
.ticket-admin-id{display:flex;align-items:center;gap:8px;min-width:0;margin-top:8px}
.ticket-admin-id span,.ticket-admin p{color:#4a5568;font-size:13px}
.ticket-admin p{margin:6px 0 0}
.ticket-admin-id code{overflow-wrap:anywhere;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px}
.ticket-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0}
.ticket-icon-btn svg{width:15px;height:15px}
.ticket-icon-btn.is-copied{color:#1a7f37;border-color:#b7dfc4}
.ticket-thread{list-style:none;margin:28px 0 0;padding:0}
.ticket-msg{display:flex;align-items:flex-start;gap:12px;margin:0 0 24px;min-width:0}
.ticket-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex:0 0 38px;border-radius:10px;overflow:hidden;background:#f4f5f7;color:#5c6b80}
.ticket-avatar svg{width:20px;height:20px}
.ticket-avatar img{width:100%;height:100%;object-fit:contain;padding:5px;box-sizing:border-box}
.ticket-msg.is-ai .ticket-avatar,.ticket-msg.is-admin .ticket-avatar{box-sizing:border-box;background:#fff;border:1px solid #e6e8ee}
.ticket-main{flex:1;min-width:0}
.ticket-who{display:flex;align-items:center;gap:8px;min-width:0}
.ticket-who strong{font-size:14px;font-weight:700}
.ticket-role{color:#676767;font-size:12px}
.ticket-msg.is-ai .ticket-role,.ticket-msg.is-admin .ticket-role{padding:1px 6px;background:#eef2ff;color:#376df7;font-weight:650}
.ticket-who time{margin-left:auto;color:#8b93a1;font-size:12px;white-space:nowrap}
.ticket-body{margin-top:8px;padding:12px 14px;font-size:14.5px;line-height:1.75;overflow-wrap:anywhere}
.ticket-msg.is-customer .ticket-body,.ticket-msg.is-user .ticket-body{background:#f4f5f7;white-space:pre-wrap}
.ticket-msg.is-ai .ticket-body,.ticket-msg.is-admin .ticket-body{border:1px solid #e6e8ee;background:#fff;white-space:normal}
.ticket-md h2,.ticket-md h3{margin:1.05em 0 .4em;font-size:16px;line-height:1.4;font-weight:750}
.ticket-md h3{font-size:15px}
.ticket-md p{margin:0 0 .85em}
.ticket-md p:last-child{margin-bottom:0}
.ticket-md ul,.ticket-md ol{margin:.2em 0 .85em;padding-left:1.25em}
.ticket-md li{margin:.2em 0}
.ticket-md code{padding:0 .25em;background:#f4f5f7;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92em}
.ticket-md pre{margin:.5em 0 .85em;padding:10px 12px;overflow:auto;background:#f4f5f7}
.ticket-md pre code{padding:0;background:none}
.ticket-md a{color:#376df7;text-decoration:underline;overflow-wrap:anywhere}
.ticket-md table{width:100%;margin:.6em 0 .9em;border-collapse:collapse;font-size:13px}
.ticket-md th,.ticket-md td{padding:6px 8px;border-bottom:1px solid #e6e8ee;text-align:left;vertical-align:top}
.ticket-md th{color:#5c6b80;font-weight:650}
.ticket-image{display:block;max-width:100%;margin-top:8px}
.ticket-link{margin:8px 0 0;font-size:13px;overflow-wrap:anywhere}
.ticket-link a{color:#376df7}
.ticket-sources{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:8px}
.ticket-sources a{display:flex;align-items:center;gap:10px;min-width:0;min-height:44px;padding:10px 12px;border:1px solid #e6e8ee;background:#fafbfc;color:#243044;font-size:13px}
.ticket-sources a:hover{border-color:#c9d4ea}
.ticket-sources svg{width:16px;height:16px;flex:0 0 16px;color:#676767}
.ticket-sources span{min-width:0;overflow-wrap:anywhere}
.ticket-sources em{margin-left:6px;color:#8b93a1;font-style:normal}
.ticket-disclaimer{display:flex;align-items:flex-start;gap:6px;margin:10px 0 0;color:#8b93a1;font-size:12px;line-height:1.55}
.ticket-disclaimer svg{width:14px;height:14px;flex:0 0 14px;margin-top:2px}
.ticket-notice{display:flex;align-items:flex-start;gap:12px;margin:0 0 24px;padding:12px 14px;background:#f7f8fa;color:#4a5568}
.ticket-notice-icon{display:inline-flex;width:38px;height:38px;flex:0 0 38px;align-items:center;justify-content:center;color:#8a5a12}
.ticket-notice-icon svg{width:20px;height:20px}
.ticket-notice strong{display:block;color:#243044;font-size:14px}
.ticket-notice p{margin:4px 0 0;font-size:14px;line-height:1.7}
.ticket-notice time{display:block;margin-top:6px;color:#8b93a1;font-size:12px}
.ticket-pending{margin:0 0 16px;color:#376df7;font-size:13px;font-weight:650}
.ticket-compose{margin-top:8px}
.ticket-error{margin:0 0 8px;color:#c24141;font-size:13px}
.ticket-compose-box{border:1px solid #d7dee8;background:#fff}
.ticket-compose textarea{display:block;width:100%;min-height:120px;max-height:320px;padding:12px;border:0;resize:vertical;background:transparent;color:#243044;font-size:14.5px;line-height:1.65}
.ticket-compose-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px}
.ticket-check{display:inline-flex;align-items:center;gap:8px;min-height:44px;color:#4a5568;font-size:13px}
.ticket-check input{width:16px;height:16px;margin:0}
.ticket-compose button{min-height:40px;padding:0 14px;border:0;background:#376df7;color:#fff;font-size:13px;font-weight:650}
.ticket-compose button:disabled{opacity:.6}
.ticket-note,.ticket-lock{margin:0 0 10px;color:#676767;font-size:13px;line-height:1.5}
.ticket-lock{margin-top:16px;font-size:14px}
.ticket-lock a{display:inline-flex;align-items:center;min-height:40px;margin-top:8px;padding:0 14px;background:#376df7;color:#fff}
.ticket-dialog{width:min(420px,calc(100% - 32px));padding:18px;border:1px solid #d7dee8;background:#fff;color:#243044}
.ticket-dialog h2{margin:0;font-size:18px}
.ticket-dialog p{margin:8px 0 0;color:#4a5568;font-size:14px;line-height:1.5}
.ticket-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.ticket-dialog button{min-height:36px;padding:0 12px}
.ticket-dialog .is-danger{border-color:#e3b3b3;background:#fff;color:#b42318}
.ticket-dialog::backdrop{background:rgba(16,24,43,.35)}
@media(max-width:900px){
  .board-page:has(.ticket){padding-top:124px}
  .board-layout:has(.ticket){gap:0}
  .board-layout:has(.ticket) .board-side{display:none}
  .board-layout:has(.ticket) .board-main{max-width:none}
  .ticket h1{font-size:24px}
  .ticket-who{flex-wrap:wrap}
  .ticket-who time{margin-left:0}
  .ticket-compose-bar{align-items:stretch}
  .ticket-compose button,.ticket-more-btn,.ticket-icon-btn,.ticket-dialog button{min-height:44px}
  .ticket-icon-btn{width:44px}
}
html[data-theme="dark"] body:has(.ticket) .site-header{background:#0d1117}
html[data-theme="dark"] .ticket,
html[data-theme="dark"] .ticket h1,
html[data-theme="dark"] .ticket-notice strong,
html[data-theme="dark"] .ticket-sources a{color:#e8edf7}
html[data-theme="dark"] .ticket-kicker,
html[data-theme="dark"] .ticket-role,
html[data-theme="dark"] .ticket-who time,
html[data-theme="dark"] .ticket-disclaimer,
html[data-theme="dark"] .ticket-note,
html[data-theme="dark"] .ticket-lock,
html[data-theme="dark"] .ticket-meta dt,
html[data-theme="dark"] .ticket-admin summary,
html[data-theme="dark"] .ticket-notice,
html[data-theme="dark"] .ticket-notice time,
html[data-theme="dark"] .ticket-sources em{color:#9aa6bc}
html[data-theme="dark"] .ticket-meta dd,
html[data-theme="dark"] .ticket-admin p,
html[data-theme="dark"] .ticket-admin-id span,
html[data-theme="dark"] .ticket-check{color:#d5dceb}
html[data-theme="dark"] .ticket-msg.is-ai .ticket-body,
html[data-theme="dark"] .ticket-msg.is-admin .ticket-body,
html[data-theme="dark"] .ticket-sources a,
html[data-theme="dark"] .ticket-compose-box,
html[data-theme="dark"] .ticket-menu,
html[data-theme="dark"] .ticket-dialog,
html[data-theme="dark"] .ticket-more-btn,
html[data-theme="dark"] .ticket-icon-btn{border-color:rgba(255,255,255,.12)}
html[data-theme="dark"] .ticket-msg.is-customer .ticket-body,
html[data-theme="dark"] .ticket-msg.is-user .ticket-body,
html[data-theme="dark"] .ticket-avatar,
html[data-theme="dark"] .ticket-notice,
html[data-theme="dark"] .ticket-md code,
html[data-theme="dark"] .ticket-md pre,
html[data-theme="dark"] .ticket-state{background:#141a22}
html[data-theme="dark"] .ticket-msg.is-ai .ticket-role,
html[data-theme="dark"] .ticket-msg.is-admin .ticket-role,
html[data-theme="dark"] .ticket-state.is-ai{background:#1c2744;color:#8eabff}
html[data-theme="dark"] .ticket-msg.is-ai .ticket-body,
html[data-theme="dark"] .ticket-msg.is-admin .ticket-body,
html[data-theme="dark"] .ticket-sources a,
html[data-theme="dark"] .ticket-compose-box,
html[data-theme="dark"] .ticket-compose textarea,
html[data-theme="dark"] .ticket-menu,
html[data-theme="dark"] .ticket-more-btn,
html[data-theme="dark"] .ticket-icon-btn,
html[data-theme="dark"] .ticket-dialog{background:#161b22;color:#e8edf7}
html[data-theme="dark"] .ticket-state.is-staff{background:#173024;color:#8fd4a8}
html[data-theme="dark"] .ticket-state.is-followup,
html[data-theme="dark"] .ticket-state.is-waiting{background:#2a2418;color:#e2c48a}
html[data-theme="dark"] .ticket-back,
html[data-theme="dark"] .ticket-link a,
html[data-theme="dark"] .ticket-md a,
html[data-theme="dark"] .ticket-pending{color:#8eabff}
html[data-theme="dark"] .ticket-avatar{color:#c7d0e0}
html[data-theme="dark"] .ticket-msg.is-ai .ticket-avatar,
html[data-theme="dark"] .ticket-msg.is-admin .ticket-avatar{background:#161b22;border-color:rgba(255,255,255,.12)}
html[data-theme="dark"] .ticket-md th,
html[data-theme="dark"] .ticket-md td,
html[data-theme="dark"] .ticket-sources a{border-color:rgba(255,255,255,.12)}
