.ticket-workspace {
  --ticket-surface: #fff;
  --ticket-border: #d9d9d9;
  --ticket-text: #232323;
  --ticket-muted: #605c56;
  --ticket-accent: #725840;
  --ticket-subtle: #f6f4f1;
  color: var(--ticket-text);
  min-width: 0;
}
.ticket-workspace [hidden] { display: none !important; }
.ticket-workspace :is(h2, h3, h4, p, dl, ul) { margin: 0; }
.ticket-workspace h2 { font-size: 22px; font-weight: 650; }
.ticket-workspace h3 { font-size: 19px; font-weight: 650; }
.ticket-workspace h4 { font-size: 15px; font-weight: 650; margin-bottom: 10px; }
.ticket-workspace a { color: var(--ticket-accent); text-decoration: underline; }
.ticket-workspace :is(button, input, select, textarea) {
  box-sizing: border-box;
  font: inherit;
  color: var(--ticket-text);
  border: 1px solid var(--ticket-border);
  border-radius: 5px;
  background: var(--ticket-surface);
  min-height: 36px;
  padding: 6px 9px;
}
.ticket-workspace :is(input, select, textarea) { display: block; width: 100%; min-width: 0; }
.ticket-workspace textarea { resize: vertical; }
.ticket-workspace button:hover { border-color: var(--ticket-accent); background: var(--ticket-subtle); }
.ticket-workspace button:disabled { opacity: .55; }
.ticket-workspace .ticket-primary { color: white; background: var(--ticket-accent); border-color: var(--ticket-accent); }
.ticket-workspace .ticket-primary:hover { background: #5d4836; }
.ticket-workspace :focus-visible { outline: 2px solid var(--ticket-accent); outline-offset: 2px; }
.ticket-workspace .ticket-heading:focus { outline: none; }
.ticket-header, .ticket-actions, .ticket-row-meta, .ticket-pages {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.ticket-header, .ticket-pages { justify-content: space-between; }
.ticket-header { margin-bottom: 12px; }
.ticket-workspace .ticket-message { color: #7b3428; margin-bottom: 8px; }
.ticket-message:empty { display: none; }
.ticket-layout { display: grid; grid-template-columns: minmax(235px, 300px) minmax(0, 1fr); gap: 14px; align-items: start; }
.ticket-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(185px, .54fr); gap: 14px; align-items: start; }
.ticket-sidebar { display: grid; gap: 12px; }
.ticket-workspace .ticket-panel { background: var(--ticket-surface); border: 1px solid var(--ticket-border); border-radius: 7px; padding: 14px; min-width: 0; }
.ticket-workspace [data-ticket-create] { margin-bottom: 14px; }
.ticket-form, .ticket-filter-fields { display: grid; gap: 8px; }
.ticket-filter-fields, .ticket-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.ticket-filter-fields label:first-child { grid-column: 1 / -1; }
.ticket-form button, .ticket-queue button:not(.ticket-row) { justify-self: start; }
.ticket-queue form .ticket-actions, .ticket-pages { margin: 8px 0; }
.ticket-workspace label { display: grid; gap: 4px; min-width: 0; margin: 0; font-weight: 600; }
.ticket-workspace label small { font-weight: 400; }
.ticket-workspace [data-ticket-list] { margin-top: 12px; }
.ticket-workspace .ticket-row {
  display: grid; gap: 4px; text-align: left; width: 100%; padding: 9px 10px; margin: 4px 0;
  overflow-wrap: anywhere;
}
.ticket-workspace .ticket-row[aria-current="true"] { background: #f3eee7; border-color: #a78e75; }
.ticket-workspace .ticket-badge { display: inline-block; background: #ebedf0; color: #2f3d4d; border-radius: 12px; padding: 2px 8px; font-size: 12px; }
.ticket-workspace .ticket-badge[data-status="Waiting for Staff"] { background: #f7edd7; color: #644610; }
.ticket-workspace .ticket-badge:is([data-status="Resolved"],[data-status="Closed"]) { background: #e6eee4; color: #2f5433; }
.ticket-workspace :is(.ticket-id, .ticket-muted, small, time, dt) { color: var(--ticket-muted); }
.ticket-id { font-variant-numeric: tabular-nums; font-size: 12px; }
.ticket-heading { display: grid; gap: 6px; overflow-wrap: anywhere; }
.ticket-conversation { display: grid; gap: 10px; margin: 12px 0; }
.ticket-line { padding: 10px; border: 1px solid var(--ticket-border); border-radius: 5px; overflow-wrap: anywhere; }
.ticket-line[data-kind="internal"] { background: #fbf4e3; border-color: #e2c991; }
.ticket-line[data-kind="status"] { background: var(--ticket-subtle); }
.ticket-line > div { display: flex; gap: 3px 10px; justify-content: space-between; flex-wrap: wrap; }
.ticket-line p { white-space: pre-wrap; margin-top: 5px; }
.ticket-line time { font-size: 12px; }
.ticket-workspace dl { display: grid; gap: 8px; }
.ticket-workspace dd { margin: 0; overflow-wrap: anywhere; }
.ticket-workspace :is(.ticket-linked,.ticket-notices) { list-style: none; padding: 0; display: grid; gap: 8px; overflow-wrap: anywhere; }
.ticket-sidebar .ticket-panel > button { margin-top: 8px; }
.ticket-workspace [data-ticket-links-form] { margin-top: 10px; }
.ticket-notices button { margin-left: 6px; }
.ticket-workspace .ticket-back { display: none; }
@media (max-width: 1040px) {
  .ticket-detail-grid { grid-template-columns: minmax(0,1fr); }
  .ticket-sidebar { grid-template-columns: repeat(auto-fit,minmax(min(175px,100%),1fr)); }
}
@media (max-width: 690px) {
  .ticket-layout { display: block; }
  .ticket-workspace:not(.ticket-is-open) .ticket-content, .ticket-is-open .ticket-queue { display: none; }
  .ticket-workspace .ticket-back { display: inline-block; margin-bottom: 10px; }
  .ticket-workspace :is(button, input, textarea, select) { min-height: 44px; }
  .ticket-workspace :is(input, textarea, select) { font-size: 16px; }
}
@media (max-width: 400px) {
  .ticket-form-grid { grid-template-columns: minmax(0,1fr); }
}
.ticket-create-dialog,.ticket-recycle-dialog{width:min(1280px,94vw);max-height:90vh;padding:0;border:1px solid #d9d9d9;border-radius:8px;background:white;color:#232323}
.ticket-create-dialog::backdrop,.ticket-recycle-dialog::backdrop{background:rgb(0 0 0 / .5)}
.ticket-dialog-header{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;border-bottom:1px solid #d9d9d9}
.ticket-workspace .ticket-create-dialog form{border:0;border-radius:0;margin:0;padding:18px 20px}
.ticket-create-dialog [data-ticket-create-body]{max-height:calc(90vh - 70px);overflow-y:auto}
.ticket-create-dialog .ticket-actions{position:sticky;bottom:-18px;background:white;padding:12px 0;margin-bottom:-18px;border-top:1px solid #d9d9d9}
.ticket-recycle-dialog{padding:20px;max-width:900px}
.ticket-workspace.ticket-it-workspace .ticket-layout{display:block}
.ticket-it-workspace .ticket-content{margin-top:14px}
.ticket-it-workspace .ticket-filter-fields{grid-template-columns:minmax(180px,2fr) repeat(5,minmax(100px,1fr))}
.ticket-it-workspace .ticket-filter-fields label:first-child{grid-column:auto}
.ticket-table-scroll{overflow-x:auto}
.ticket-table{width:100%;border-collapse:collapse;font-size:13px}
.ticket-table th{background:#f1eee9;text-align:left;font-weight:600;white-space:nowrap}
.ticket-table :is(td,th){padding:10px 12px;border-bottom:1px solid #dedbd6;vertical-align:middle}
.ticket-table tbody tr:hover{background:#f7f5f2}
.ticket-table td:nth-child(2){min-width:180px}
.staff-login-scene{position:fixed;inset:0;z-index:50;display:flex;justify-content:center;align-items:center;padding:24px;overflow-y:auto}
.staff-login-scene.hidden{display:none!important}
.staff-login-card{width:100%;max-width:500px;margin:auto;background:white;border:1px solid #d9d9d9;border-radius:5px;box-shadow:0 8px 28px #0001;overflow:hidden}
.staff-login-brand{background:#232323;color:white;text-align:center;padding:28px}
.staff-login-brand img{height:130px;max-width:100%;object-fit:contain;margin-bottom:20px}
.staff-login-brand h2{font-size:22px}
.staff-login-brand p{font-size:12px;margin:12px 0 0}
#loginScreenOverlay #login{border:0;margin:0;padding:28px 32px;border-radius:0}
#loginScreenOverlay #login label{margin:0 0 18px}
#loginScreenOverlay #login input{height:46px}
#loginScreenOverlay #login > button{width:100%;background:#8c6f55}
.staff-login-active > header,.staff-login-active main > #title{visibility:hidden}
#staff-login-message{color:#822b25}
@media(max-width:1000px){.ticket-it-workspace .ticket-filter-fields{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.ticket-it-workspace .ticket-filter-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.staff-login-scene{padding:16px}.staff-login-brand{padding:24px 16px}.staff-login-brand h2{font-size:20px}}
/* v42 IT register: search on its own row (with Search / Clear / Fit to width), filters below; Fit to width */
.ticket-it-workspace form[data-ticket-search]{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:10px;align-items:end}
.ticket-it-workspace form[data-ticket-search] .ticket-filter-fields{display:contents}
.ticket-it-workspace .ticket-search-field{grid-column:1;grid-row:1;min-width:0}
.ticket-it-workspace form[data-ticket-search] .ticket-actions{grid-column:2;grid-row:1;margin:0;flex-wrap:nowrap}
.ticket-it-workspace .ticket-filter-row{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:10px}
.ticket-it-workspace.ticket-fit .ticket-table-scroll{overflow-x:hidden}
.ticket-it-workspace.ticket-fit .ticket-table{table-layout:fixed;width:100%;min-width:0!important}
.ticket-it-workspace.ticket-fit .ticket-table :is(th,td){white-space:normal;overflow-wrap:anywhere;padding:9px 8px}
.ticket-it-workspace.ticket-fit .ticket-table td:nth-child(2){min-width:0}
.ticket-it-workspace.ticket-fit .ticket-table th:nth-child(1){width:15%}.ticket-it-workspace.ticket-fit .ticket-table th:nth-child(2){width:23%}
.ticket-it-workspace.ticket-fit .ticket-table th:nth-child(3){width:11%}.ticket-it-workspace.ticket-fit .ticket-table th:nth-child(4){width:14%}
.ticket-it-workspace.ticket-fit .ticket-table th:nth-child(5){width:10%}.ticket-it-workspace.ticket-fit .ticket-table th:nth-child(6){width:8%}
.ticket-it-workspace.ticket-fit .ticket-table th:nth-child(7){width:10%}.ticket-it-workspace.ticket-fit .ticket-table th:nth-child(8){width:9%}
[data-ticket-fit][aria-pressed="true"]{border-color:#8c6f55;background:#f5f1eb}
@media(max-width:1000px){.ticket-it-workspace .ticket-filter-row{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.ticket-it-workspace form[data-ticket-search]{grid-template-columns:minmax(0,1fr)}.ticket-it-workspace form[data-ticket-search] .ticket-actions{grid-column:1;grid-row:3;flex-wrap:wrap;margin-top:8px}.ticket-it-workspace .ticket-filter-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* v50 Staff "My Tickets": one table (no search / status filter), conversation below when a ticket is opened. */
.ticket-workspace.ticket-staff-list .ticket-layout{display:block}
.ticket-staff-list .ticket-content{margin-top:14px}
.ticket-staff-list form[data-ticket-search][hidden]{display:none!important}
.ticket-staff-table{width:100%;border-collapse:collapse}
.ticket-staff-table th{text-align:left;font-size:12.5px;font-weight:500;color:#6B6B6B;padding:9px 10px;border-bottom:1px solid #E2DED8;background:#FAF8F6;white-space:nowrap}
.ticket-staff-table td{padding:10px;border-bottom:1px solid #EFECE8;vertical-align:top;font-size:13.5px;color:#232323}
.ticket-staff-table td:first-child{white-space:nowrap}
.ticket-staff-table td:first-child button{background:none;border:0;padding:0;font-weight:600;color:#232323;text-decoration:underline;text-underline-offset:3px;cursor:pointer;height:auto;min-height:0}
.ticket-staff-table td:first-child small{display:block;color:#8A8A8A;font-size:11.5px;margin-top:2px}
.ticket-staff-table .ticket-desc{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:420px;color:#474747}
.ticket-staff-table td:last-child a{color:#8C6F55;overflow-wrap:anywhere}
@media(max-width:700px){.ticket-staff-table thead{display:none}.ticket-staff-table tr{display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px 0;border-bottom:1px solid #EFECE8}.ticket-staff-table td{border:0;padding:0 4px}.ticket-staff-table td:nth-child(2){grid-column:1/-1;order:-1;font-weight:500}.ticket-staff-table td:nth-child(4),.ticket-staff-table td:nth-child(5){grid-column:1/-1}.ticket-staff-table .ticket-desc{max-width:none}}
/* Admin "New ticket for staff": requester search box */
.ticket-requester{position:relative;display:grid;gap:4px}
.ticket-requester-list{position:absolute;z-index:20;top:100%;left:0;right:0;margin:4px 0 0;padding:4px;list-style:none;background:#fff;border:1px solid #D9D5CF;border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.14);max-height:280px;overflow:auto}
.ticket-requester-list li{padding:7px 10px;border-radius:7px;cursor:pointer;display:grid}
.ticket-requester-list li b{font-weight:500;color:#232323}
.ticket-requester-list li small{color:#7A7A7A;font-size:12px}
.ticket-requester-list li[aria-selected="true"]{background:#F1EBE3}
.ticket-requester-list .ticket-requester-empty{color:#7A7A7A;cursor:default}
/* v51 New ticket window opens near the top of the screen (another rule pushed it to the bottom). */
html body dialog.ticket-create-dialog,html body dialog.ticket-recycle-dialog{margin:4vh auto auto!important;max-height:92vh;inset:0;bottom:auto}
html body .ticket-create-dialog [data-ticket-create-body]{max-height:calc(92vh - 70px)}
@media (max-width:690px){html body dialog.ticket-create-dialog{margin:0 auto auto!important;width:100vw;max-width:100vw;max-height:100vh;border-radius:0}html body .ticket-create-dialog [data-ticket-create-body]{max-height:calc(100vh - 64px)}}

/* v95 uniform rows-per-page pagination bar */
.ticket-pages { padding-top: 10px; border-top: 1px solid var(--ticket-border); margin-top: 10px; }
.ticket-pages-left, .ticket-pages-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ticket-workspace label.ticket-page-size { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ticket-muted); }
.ticket-workspace label.ticket-page-size select { width: auto; min-width: 72px; min-height: 32px; padding: 3px 8px; font-size: 12px; }
.ticket-pages-info, .ticket-pages-num { font-size: 12px; color: var(--ticket-muted); font-variant-numeric: tabular-nums; }
.ticket-pages-right button { min-height: 32px; padding: 4px 10px; font-size: 12px; }
html.v91-theme-dark .ticket-workspace { --ticket-surface: #25221E; --ticket-border: #3B3630; --ticket-text: #F2EFE9; --ticket-muted: #B8B1A6; --ticket-subtle: #2E2A25; }
html.v91-theme-dark .ticket-table th { background: #2D2924; color: #EAE6DF; }
html.v91-theme-dark .ticket-table :is(td,th) { border-bottom-color: #36322C; }
html.v91-theme-dark .ticket-table tbody tr:hover { background: #2B2722; }
