.wi-workbench { --wi-muted: #586575; color: #172738; min-width: 0; max-width: 1380px; width: 100%; margin-left: auto; margin-right: auto; }
.wi-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 8px 14px; margin-bottom: 10px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 10px; }
.wi-header-main { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.wi-header-desc { display: none; }
.wi-detail-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding-bottom: 8px; border-bottom: 1px solid #edf0f3; }
.wi-chat-head { padding-bottom: 6px; border-bottom: 1px solid #edf2ef; }
.wi-detail-title-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.wi-header h2, .wi-detail h2 { margin: 0; font-size: 13.5px; font-weight: 600; color: #0f172a; }
.wi-workbench h3 { margin: 0; font-size: 12.5px; font-weight: 600; color: #1e293b; }
.wi-muted, .wi-source { color: var(--wi-muted); font-size: 11.5px; }
.wi-meta-inline { font-size: 11.5px; }
.wi-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.wi-toolbar, .wi-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.wi-summary { margin: 0; padding: 0; font-size: 12px; color: #334155; }
.wi-summary > span { padding: 2px 8px; background: #f4f6f8; border: 1px solid #e5e7eb; border-radius: 999px; font-weight: 500; }
.wi-summary:empty, .wi-notice:empty, .wi-action-status:empty { display: none; }
.wi-notice, .wi-action-status { margin: 4px 0; font-size: 12px; color: #3b5978; }
.wi-status-pills, .wi-followup-chips, .wi-chat-quick-bar, .wi-bridge-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wi-status-pill, .wi-chip-btn, .wi-chat-chip { background: #ffffff; border: 1px solid #e5e7eb; color: #3a4654; border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 500; transition: background .14s ease, border-color .14s ease; }
.wi-status-pill:hover:not(:disabled), .wi-chip-btn:hover:not(:disabled), .wi-chat-chip:hover:not(:disabled) { background: #f4f6f8; border-color: #cfd8e3; }
.wi-status-pill[aria-pressed="true"] { background: #eef2f6; border-color: #5b708b; color: #1e293b; font-weight: 600; }
.wi-fold { border: 1px solid #e5e7eb; border-radius: 8px; background: #fafbfc; padding: 6px 12px; min-width: 0; }
.wi-fold[open] { background: #ffffff; padding-bottom: 10px; }
.wi-fold-summary { cursor: pointer; font-size: 12px; font-weight: 600; color: #334155; user-select: none; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.wi-fold-summary::-webkit-details-marker { display: none; }
.wi-fold-summary::before { content: '▸'; color: #64748b; font-size: 11px; }
.wi-fold[open] > .wi-fold-summary { margin-bottom: 8px; }
.wi-fold[open] > .wi-fold-summary::before { content: '▾'; color: #2c3e55; }
.wi-fold--inline { padding: 4px 10px; background: #f8fafc; }
.wi-fold--inline[open] { padding: 6px 10px; }
.wi-pills-fold { position: relative; }
.wi-pills-fold[open] .wi-status-pills { margin-top: 4px; }
.wi-columns { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.wi-workbench.is-list-collapsed .wi-columns { grid-template-columns: minmax(0, 1fr); }
.wi-workbench.is-list-collapsed .wi-sidebar { display: none; }
.wi-sidebar { display: flex; flex-direction: column; min-width: 0; }
.wi-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 200px); overflow-y: auto; padding: 2px; }
.wi-list-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px; background: #ffffff; color: inherit; font: inherit; cursor: pointer; transition: border-color .14s ease, background .14s ease; }
.wi-list-item:hover:not(:disabled) { border-color: #cbd5e1; background: #fafbfc; }
.wi-list-item[aria-pressed="true"] { background: #f4f7fb; border-color: #3b6ea5; box-shadow: inset 3px 0 #3b6ea5; }
.wi-item-title { font-size: 12.5px; font-weight: 600; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wi-item-name, .wi-list-item .wi-muted, .wi-masked { grid-column: 1 / -1; overflow-wrap: anywhere; font-size: 11.5px; line-height: 1.35; }
.wi-state { font-size: 11px; font-weight: 600; color: #3d5a78; white-space: nowrap; padding: 2px 7px; background: #eef2f6; border-radius: 5px; }
.wi-detail { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 10px; min-width: 0; min-height: calc(100vh - 156px); box-shadow: 0 1px 3px rgba(15, 23, 42, .02); }
.wi-contact-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.wi-facts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; font-size: 11.5px; padding: 3px 8px; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px; }
.wi-facts dt { color: var(--wi-muted); font-size: 11.5px; }
.wi-facts dt::after { content: ':'; }
.wi-facts dd { margin: 0 6px 0 0; font-weight: 500; color: #1e293b; overflow-wrap: anywhere; }
.wi-question { font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 8px 10px; background: #fafbfc; border: 1px solid #edf0f3; border-radius: 6px; }
.wi-source { overflow-wrap: anywhere; margin: 6px 0 0; }
.wi-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; margin: 6px 0; align-items: start; }
.wi-actions > .btn { justify-self: start; }
.wi-form { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; }
.wi-form h3, .wi-form p { margin: 0; }
.wi-form > .btn { align-self: start; }
.wi-collab-bridge { background: #fafbfc; border-color: #dfe5ec; }
.wi-bridge-link { text-decoration: none; }
.wi-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; }
.wi-workbench :is(select, input, textarea) { min-width: 0; max-width: 100%; padding: 5px 8px; border: 1px solid #d1d9e2; border-radius: 6px; color: inherit; background: #ffffff; font: inherit; font-size: 12.5px; }
.wi-workbench textarea { resize: vertical; min-height: 46px; width: 100%; box-sizing: border-box; }
.wi-workbench :is(button, input, select, textarea, a):focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.wi-workbench :disabled { cursor: not-allowed; opacity: .6; }
.wi-workbench [hidden] { display: none !important; }
.wi-history { padding-left: 18px; margin: 6px 0 0; font-size: 11.5px; }
.wi-history li { padding: 4px 0; overflow-wrap: anywhere; }
.wi-history li > span { margin-left: 10px; }
.wi-history p { margin: 4px 0; white-space: pre-wrap; }
.wi-empty { color: var(--wi-muted); padding: 24px; text-align: center; }
.wi-error { border: 1px solid #ebd2cc; background: #fdf6f4; border-radius: 8px; padding: 12px; }
.wi-mail { margin-bottom: 8px; }
.wi-customer-fields { display: grid; gap: 8px; }
.wi-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.wi-nav-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d92939; margin-left: auto; flex-shrink: 0; }
.wi-chat-presence { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wi-chat-presence .wi-muted { font-size: 11.5px; }
.wi-chat-state { background: #ebf3ed; color: #2d6142; border-radius: 5px; padding: 2px 7px; font-size: 11px; font-weight: 600; width: fit-content; }
.wi-chat-unread { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d92939; align-self: center; justify-self: end; }
.wi-chat-panel { flex: 1 1 auto; display: flex; flex-direction: column; margin: 0; padding: 10px 12px; border: 1px solid #dfe7e2; border-radius: 10px; background: #ffffff; min-height: 460px; }
.wi-chat-messages { flex: 1 1 auto; list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 12px; margin: 6px 0; min-height: 320px; max-height: calc(100vh - 300px); overflow: auto; background: #fafcfb; border: 1px solid #edf2ef; border-radius: 8px; }
.wi-chat-message { max-width: 82%; align-self: flex-start; border: 1px solid #e2e8f0; border-radius: 8px; background: #ffffff; padding: 7px 10px; }
.wi-chat-staff { align-self: flex-end; background: #eef7f0; border-color: #d5e8d9; }
.wi-chat-message-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: #586575; }
.wi-chat-message p { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
.wi-chat-composer { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.wi-chat-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.wi-chat-input-row textarea { min-height: 44px; max-height: 110px; }
.wi-chat-footnote { margin: 4px 0 0; font-size: 11px; }
@media (max-width: 760px) {
  .wi-chat-input-row { grid-template-columns: 1fr; }
  .wi-chat-composer button[type="submit"] { justify-self: start; min-width: 88px; }
  .wi-chat-panel { scroll-margin-top: 90px; scroll-margin-bottom: 96px; min-height: 320px; }
  .wi-chat-messages { min-height: 200px; max-height: 320px; }
  .wi-header { flex-direction: column; align-items: stretch; }
  .wi-columns { grid-template-columns: 1fr; }
  .wi-list { max-height: 260px; }
  .wi-detail { padding: 12px; min-height: 0; }
  .wi-actions { grid-template-columns: 1fr; }
}
