.sm-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Header controls share a centerline; global summary margins must not shift tickets. */
.page-header .sm-header {
  min-height: 40px;
  font-size: 12px;
  line-height: 20px;
}
.page-header .sm-ticket-menu {
  margin: 0;
  padding: 0;
}
.page-header .sm-ticket-menu > summary,
.page-header .sm-bell {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  font-size: 12px;
  line-height: 20px;
}
.page-header .toolbar #staff-session,
.page-header .toolbar #refresh,
.page-header .toolbar #toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  margin-block: 0;
  padding-block: 0;
  line-height: 20px;
}
.sm-header[hidden],
.sm-bubble[hidden] {
  display: none;
}
.sm-header svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sm-ticket-menu {
  position: relative;
}
.sm-ticket-menu summary,
.sm-bell {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  color: #25365b;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.sm-ticket-menu summary {
  list-style: none;
}
.sm-ticket-menu summary::-webkit-details-marker {
  display: none;
}
.sm-ticket-menu > div {
  position: absolute;
  right: 0;
  top: 40px;
  width: 148px;
  padding: 6px;
  background: white;
  border: 1px solid #dce3ee;
  border-radius: 8px;
  box-shadow: 0 6px 24px #25365b20;
  z-index: 60;
}
.sm-ticket-menu > div a,
.sm-ticket-menu > div button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 9px;
  border: 0;
  background: transparent;
  text-align: left;
  color: #25365b;
  text-decoration: none;
}
.sm-ticket-menu > div a:hover,
.sm-ticket-menu > div button:hover {
  background: #eff3ff;
}
/* Links and the create action are the same menu rows, independent of form button styles. */
.page-header .sm-ticket-menu > div > :is(a,button) {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  height:44px;
  min-height:44px;
  margin:0;
  padding:0 10px;
  border:0;
  border-radius:5px;
  box-shadow:none;
  font-family:inherit;
  font-size:13px;
  font-weight:500;
  line-height:20px;
  text-align:left;
  letter-spacing:normal;
}
.page-header .sm-ticket-menu > div > :is(a,button) > svg {
  width:16px;
  height:16px;
  flex:0 0 16px;
}
.page-header .sm-ticket-menu > div > :is(a,button):focus-visible {
  outline:2px solid #8a602a;
  outline-offset:-2px;
}
.sm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e43c42;
  color: white !important;
  font-size: 11px;
  height: 18px;
  line-height: 18px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
  box-sizing: border-box;
}
.sm-badge[hidden] {
  display: none;
}
.sm-bubble {
  position: fixed;
  right: 24px;
  top: 92px;
  width: min(340px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 16px 20px;
  border: 1px solid #c4d2fb;
  border-top: 3px solid #4263eb;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 30px #26386124;
  z-index: 90;
}
.sm-bubble > strong {
  color: #3152d5;
}
.sm-bubble p {
  margin: 9px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.sm-bubble p[data-sm-bubble-title] {
  font-weight: 600;
  padding-right: 12px;
}
.sm-bubble a {
  margin-left: 12px;
  font-size: 13px;
}
.sm-dismiss,
.sm-close {
  position: absolute;
  right: 10px;
  top: 7px;
  border: 0 !important;
  background: transparent !important;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
}
.sm-card {
  padding: 18px;
  min-width: 0;
}
.sm-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.sm-filters input {
  width: 280px;
  max-width: 100%;
}
.sm-filters select {
  width: auto;
  min-width: 120px;
}
.sm-filters > a {
  margin-left: auto;
  font-size: 13px;
}
.sm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  overflow: visible;
  margin-bottom: 12px;
}
.sm-tabs button {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  white-space: nowrap;
  padding: 10px 12px !important;
  color: #52607a;
}
.sm-tabs button[aria-selected='true'] {
  color: #3152d5;
  border-bottom: 2px solid #4263eb !important;
  font-weight: 600;
}
.sm-tabs span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin-left: 5px;
  background: #e43c42;
  border-radius: 999px;
  color: white;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  height: 18px;
  min-width: 18px;
  line-height: 18px;
  padding: 0 5px;
  flex: none;
}
.sm-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sm-actions label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.sm-actions input,
.sm-row > input,
.sm-recipient-list input {
  width: 15px !important;
  height: 15px;
  flex: none;
  margin: 0;
}
.sm-actions button {
  font-size: 12px;
  padding: 5px 9px;
}
.sm-actions > span {
  margin-left: auto;
  color: #66758c;
  font-size: 12px;
}
.sm-row {
  display: grid;
  grid-template-columns: 20px 95px minmax(0, 1fr) 160px;
  gap: 10px;
  align-items: center;
  min-height: 49px;
  border-bottom: 1px solid #e7ebf2;
  padding: 4px 8px;
}
.sm-row:hover {
  background: #f6f8fe;
}
.sm-title {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #334155;
  text-align: left;
  overflow-wrap: anywhere;
  padding: 8px 0 !important;
  line-height: 1.5;
  min-width: 0;
}
.sm-unread .sm-title {
  font-weight: 650;
  color: #172f61;
}
.sm-title i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #4263eb;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.sm-row time {
  font-size: 12px;
  color: #7a869b;
  text-align: right;
}
.sm-category {
  font-size: 12px;
  color: #66758c;
}
.sm-category b {
  display: inline-block;
  margin-left: 5px;
  font-size: 10px;
  color: #b45309;
  background: #fff3db;
  border-radius: 3px;
  padding: 1px 4px;
}
.sm-empty {
  text-align: center;
  padding: 35px 0;
  color: #8190a6;
}
.sm-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
  font-size: 12px;
  color: #66758c;
}
.sm-dialog {
  box-sizing: border-box;
  width: min(690px, calc(100vw - 24px));
  max-height: 85dvh;
  padding: 26px;
  border: 1px solid #dce3ee;
  border-radius: 12px;
  color: #25365b;
}
.sm-dialog::backdrop {
  background: #14243b65;
}
.sm-dialog h2 {
  font-size: 19px;
  margin: 0 24px 15px 0;
}
.sm-meta {
  font-size: 12px;
  color: #718096;
  margin: 7px 0;
}
.sm-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
  font-size: 14px;
  margin: 18px 0;
}
.sm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.sm-compose label {
  display: block;
  font-size: 13px;
  margin-bottom: 10px;
}
.sm-compose input:not([type='checkbox']),
.sm-compose textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 5px;
}
.sm-compose .sm-filters label {
  flex: 1;
}
.sm-compose .sm-filters select {
  display: block;
  width: 100%;
  margin-top: 5px;
}
.sm-recipient-list {
  height: 210px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 4px 8px;
}
.sm-recipient-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 9px 4px;
  border-bottom: 1px solid #edf0f6;
}
.sm-recipient-list small {
  font-size: 12px;
  color: #718096;
}
.sm-recipient-list small:last-child {
  display: block;
}
.sm-recipient-list label>span,.sm-dialog h3 {min-width:0;overflow-wrap:anywhere}
.sm-recipient-preview {
  font-size: 12px;
  max-height: 100px;
  overflow: auto;
  line-height: 1.7;
}
.sm-error {
  color: #c53030;
  font-size: 13px;
  white-space: pre-wrap;
}
.sm-sent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 135px 160px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e7ebf2;
  padding: 14px 5px;
  font-size: 13px;
}
.sm-sent-row strong {
  overflow-wrap: anywhere;
}
.sm-sent-row > div:last-child {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}
.sm-sent-row button {
  font-size: 12px;
  padding: 6px 9px;
}
.sm-receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid #e7ebf2;
  font-size: 13px;
}
@media (max-width: 700px) {
  .sm-card {
    padding: 12px;
  }
  .sm-row {
    grid-template-columns: 18px 55px minmax(0, 1fr);
    gap: 6px;
    padding: 6px 2px;
  }
  .sm-row time {
    grid-column: 3;
    margin-top: -7px;
    font-size: 11px;
  }
  .sm-category b {
    margin: 2px 0;
    display: block;
    width: fit-content;
  }
  .sm-filters {
    gap: 7px;
  }
  .sm-filters input {
    width: 100%;
    flex: 1;
    min-width: 100px;
  }
  .sm-filters > a {
    font-size: 12px;
  }
  .sm-tabs {
    gap: 0;
  }
  .sm-tabs button {
    padding: 9px !important;
  }
  .sm-actions {
    gap: 5px;
  }
  .sm-actions button {
    padding: 5px 7px;
  }
  .sm-sent-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
  }
  .sm-sent-row > div:last-child {
    grid-column: 1/-1;
    justify-content: flex-start;
  }
  .sm-bubble {
    top: 116px;
    right: 12px;
  }
  .sm-header {
    gap: 10px;
  }
  .sm-bell-label {
    display: none;
  }
  .sm-header summary {
    font-size: 12px;
  }
  .sm-header svg {
    width: 18px;
    height: 18px;
  }
  .sm-dialog {
    padding: 22px 16px;
  }
  .sm-receipt-row {
    font-size: 12px;
    flex-wrap: wrap;
  }
  .page-header .toolbar:has(.sm-header) {
    flex-wrap: wrap;
  }
}
.sm-filters > .ss-trigger {
  width: 140px;
  flex: 0 0 140px;
}
.sm-row > .sm-title {
  display: block;
  justify-content: flex-start;
  text-align: left;
}
@media (max-width: 700px) {
  body .sm-tabs[role='tablist'] {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    overflow: visible !important;
    gap: 0;
    white-space: normal;
  }
  body .sm-tabs[role='tablist'] > button {
    white-space: normal;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 8px 4px !important;
  }
  .sm-filters > .ss-trigger {
    flex-basis: 120px;
    width: 120px;
  }
  .sm-filters input[name='q'] {
    flex: 1 1 160px;
  }
}
