@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/fonts/ibm-plex-sans-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/fonts/ibm-plex-sans-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/fonts/ibm-plex-sans-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/fonts/ibm-plex-sans-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #f3f6fb;
  --bg-strong: #e8edf5;
  --panel: #ffffff;
  --panel-soft: #f7f9fd;
  --ink: #172235;
  --ink-soft: #5b6981;
  --line: #d3dceb;
  --line-strong: #b9c6da;
  --accent: #1f4c8f;
  --accent-2: #183f76;
  --accent-soft: #e3ecfb;
  --accent-warm: #d07a24;
  --accent-warm-2: #b56616;
  --accent-warm-soft: #f8e8d7;
  --success-bg: #e6eefb;
  --success-ink: #234f91;
  --muted-bg: #f0f3f7;
  --muted-ink: #5f6b7f;
  --danger: #b33d4f;
  --radius: 6px;
  --shadow: 0 10px 24px rgba(18, 33, 56, 0.06);
  --chatbar-w: 364px;
  --chatbar-collapsed: 24px;
  --topbar-h: 82px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

input,
textarea,
select,
button,
pre,
code,
kbd,
samp {
  font-family: "IBM Plex Sans", sans-serif;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 15% -20%, #ffffff 0%, rgba(255, 255, 255, 0.6) 24%, transparent 46%),
    linear-gradient(180deg, #f8fafb 0%, var(--bg) 55%, var(--bg-strong) 100%);
  font-size: 14px;
  line-height: 1.38;
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.bg-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background:
    radial-gradient(circle at 80% -20%, rgba(208, 122, 36, 0.22), transparent 42%),
    radial-gradient(circle at -10% 120%, rgba(31, 76, 143, 0.32), transparent 45%),
    linear-gradient(145deg, #f4f8ff 0%, #e8f0fb 46%, #d9e5f6 100%);
}

.login-shell {
  width: min(96vw, 980px);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 0;
  align-items: stretch;
}

.login-shell.card {
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #153865;
  background:
    radial-gradient(circle at 9% -28%, rgba(255, 255, 255, 0.18), transparent 54%),
    linear-gradient(152deg, #1f4c8f 0%, #173b6f 44%, #122f58 100%);
  box-shadow: 0 24px 46px rgba(12, 31, 59, 0.28), 0 8px 18px rgba(10, 25, 47, 0.22);
  position: relative;
}

.login-shell.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 30%, transparent 62%);
}

.login-hero {
  color: #eaf2ff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.8rem;
  min-height: 360px;
  padding: 2.1rem 2rem 2rem;
  position: relative;
  z-index: 1;
}

.login-hero .login-kicker {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #bcd0f3;
}

.login-hero h1 {
  margin: 0;
  color: #f5f9ff;
  font-size: 2rem;
  line-height: 1.1;
}

.login-hero .login-subline {
  margin: 0;
  color: #d5e2f9;
  font-size: 1rem;
  max-width: 32ch;
}

.login-points {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.login-points span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #dbe7fb;
  font-size: 0.88rem;
}

.login-points span::before {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #d07a24, #b56616);
}

.login-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  padding: 2rem 1.9rem;
  border-left: 1px solid rgba(183, 205, 241, 0.24);
  background: linear-gradient(180deg, rgba(12, 29, 52, 0.86), rgba(10, 25, 46, 0.94));
  backdrop-filter: blur(2px);
  position: relative;
  z-index: 1;
}

.login-card h2 {
  margin: 0;
  color: #edf4ff;
}

.login-card .login-muted {
  margin: 0.35rem 0 0.2rem;
  color: #b4c6e3;
  font-size: 0.9rem;
}

.login-card label {
  color: #dce8fb;
}

.login-card input {
  background: linear-gradient(180deg, #223c5f, #1a3150);
  border-color: #4f729f;
  color: #edf5ff;
}

.login-card input::placeholder {
  color: #9cb5d8;
}

.login-card input:focus {
  border-color: #79a9df;
  box-shadow: 0 0 0 3px rgba(140, 184, 234, 0.24);
}

.login-card .btn-primary {
  background: linear-gradient(180deg, #6a9dd3, #4b7fba);
  border-color: #5e8fc4;
  color: #f7fbff;
}

.login-card .btn-primary:hover {
  background: linear-gradient(180deg, #78aadf, #598bc3);
}

.login-cancel-link {
  margin-top: 0.62rem;
  border-color: #4f729f;
  color: #dbe8fb;
}

.login-cancel-link:hover {
  border-color: #6388b6;
  color: #eff6ff;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  padding: 0.7rem 1.2rem 0.72rem;
  border-bottom: 1px solid #173a6d;
  background: linear-gradient(180deg, #245aa6, #1e4f94);
  box-shadow: 0 10px 24px rgba(15, 30, 56, 0.24);
  color: #eef4ff;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 24;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
  justify-content: flex-start;
}

.brand-logo {
  width: auto;
  max-width: 124px;
  height: 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.brand-logo svg {
  width: 92%;
  height: 88%;
  stroke: #e7efff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-logo img {
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  display: block;
  border-radius: 0;
}

.brand-text {
  min-width: 0;
  margin-left: 0;
  text-align: left;
  flex: 1 1 auto;
  min-height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.04rem;
}

.topbar h1 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.08;
  color: #f4f8ff;
  letter-spacing: 0.03em;
  text-transform: none;
}

.topbar nav {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: stretch;
  width: 100%;
}

.topbar-right {
  display: flex;
  align-items: stretch;
  gap: 0.62rem;
  width: 100%;
  flex-wrap: wrap;
}

.page-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.28rem;
  border: 1px solid rgba(231, 239, 255, 0.42);
  background: rgba(9, 29, 57, 0.22);
  border-radius: 999px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
}

.page-tabs .page-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #d7e4fb;
  background: transparent;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.page-tabs .page-tab:hover {
  color: #f4f8ff;
  background: rgba(19, 54, 98, 0.56);
  border-color: rgba(203, 220, 246, 0.34);
  text-decoration: none;
}

.page-tabs .page-tab-active {
  color: #1e4f94;
  background: linear-gradient(180deg, #f7fbff, #eaf2ff);
  border-color: rgba(212, 226, 249, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.page-tabs .page-tab-active:hover {
  color: #1a467f;
  background: linear-gradient(180deg, #ffffff, #edf4ff);
  border-color: rgba(220, 231, 250, 0.86);
}

.topbar-toolbar {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
}

.topbar-toolbar .icon-toolbar {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.role-customer .topbar {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
}

.role-customer .topbar-brand {
  width: auto;
  flex: 1 1 auto;
}

.role-customer .topbar-actions {
  width: auto;
  flex: 0 0 auto;
  margin-left: auto;
  justify-content: flex-end;
}

.role-customer .topbar-toolbar {
  width: auto;
  margin-left: 0;
}

.topbar .icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 0 !important;
  box-shadow: none;
}

.topbar .icon-btn-primary,
.topbar .icon-btn-neutral {
  background: linear-gradient(180deg, #2b5f9f, #234f87);
  color: #f6f8fb;
  border-color: transparent;
}

.topbar .icon-btn-primary:hover,
.topbar .icon-btn-neutral:hover {
  background: linear-gradient(180deg, #25558f, #1f4879);
}

.topbar .icon-btn-success {
  background: linear-gradient(180deg, #ffdca8, #f3c57c);
  color: #5d3b14;
  border-color: transparent;
}

.topbar .icon-btn-success:hover {
  background: linear-gradient(180deg, #ffe5ba, #f8cf8f);
}

.topbar .icon-btn-danger {
  background: linear-gradient(180deg, #d07a24, #b56616);
  color: #fff7ec;
  border-color: transparent;
}

.topbar .icon-btn-danger:hover {
  background: linear-gradient(180deg, #c06f20, #a85d13);
}

.topbar nav.topbar-links a {
  display: inline-block;
  padding: 0.4rem 0.66rem;
  border-radius: 6px;
  color: #344861;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid #d3dae6;
  background: #ffffff;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.topbar nav.topbar-links a:hover {
  background: #f6f8fb;
  border-color: #bfcadb;
  color: #1c3858;
  text-decoration: none;
}

.ticket-subject-head {
  margin: 0;
  line-height: 1.12;
  color: #cfddf4;
  font-weight: 500;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.layout {
  padding: 1.2rem;
  width: min(1500px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.role-customer .layout {
  padding-top: 0.7rem;
}

.full-width {
  grid-column: 1 / -1;
}

.panel,
.card {
  background: var(--panel);
  border: 1px solid #d8e0ea;
  border-radius: var(--radius);
  padding: 1.05rem;
  box-shadow: var(--shadow);
}

.panel h2,
.panel h3,
.card h2,
.card h3 {
  margin: 0 0 0.75rem 0;
}

.icon-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
  background: rgba(9, 29, 57, 0.24);
  border: 1px solid rgba(231, 239, 255, 0.34);
  border-radius: 8px;
  padding: 0.22rem;
}

form {
  margin: 0;
}

.icon-btn {
  width: 2.2rem;
  height: 2.2rem;
  margin-top: 0;
  border-radius: 4px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #2b5f9f, #234f87);
  color: #f6f8fb;
  box-shadow: none;
  border: 1px solid #1a406e;
  transition: background 140ms ease, border-color 140ms ease;
}

a.icon-btn {
  text-decoration: none;
}

.icon-btn svg {
  width: 1.08rem;
  height: 1.08rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  background: linear-gradient(180deg, #25558f, #1f4879);
  text-decoration: none;
}

.icon-btn-primary {
  background: linear-gradient(180deg, #2b5f9f, #234f87);
  border-color: #1a406e;
}

.icon-btn-neutral {
  background: linear-gradient(180deg, #6a80a0, #5a7292);
  border-color: #4f6686;
}

.icon-btn-neutral:hover {
  background: linear-gradient(180deg, #5f7595, #526a89);
}

.icon-btn-success {
  background: linear-gradient(180deg, #d07a24, #b56616);
  border-color: #9f5914;
}

.icon-btn-success:hover {
  background: linear-gradient(180deg, #c06f20, #a85d13);
}

.icon-btn-danger {
  background: linear-gradient(180deg, #d07a24, #b56616);
  border-color: #9f5914;
}

.icon-btn-danger:hover {
  background: linear-gradient(180deg, #c06f20, #a85d13);
}

.icon-btn-active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.modal {
  border: 1px solid #d4dcea;
  border-radius: var(--radius);
  padding: 0;
  width: min(96vw, 680px);
  max-height: 88vh;
  box-shadow: 0 20px 60px rgba(13, 22, 37, 0.24);
}

.modal::backdrop {
  background: rgba(13, 22, 37, 0.5);
}

.modal-card {
  padding: 1rem;
  background: var(--panel);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.modal-actions > button,
.modal-actions > .button-link {
  width: auto;
  margin-top: 0;
}

label {
  display: block;
  margin: 0.66rem 0 0.28rem;
  font-weight: 650;
  color: #22375f;
}

input,
textarea,
select,
button {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0.62rem 0.72rem;
  font: inherit;
  line-height: 1.35;
}

input,
textarea,
select {
  background: #fcfdff;
  color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
  outline: 0;
  border-color: #90a2bb;
  box-shadow: 0 0 0 3px rgba(28, 63, 105, 0.14);
}

button {
  margin-top: 0.82rem;
  background: linear-gradient(180deg, #244a78, #1a3d66);
  color: #f6f8ff;
  border: 1px solid #193a61;
  cursor: pointer;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: background 140ms ease, border-color 140ms ease, transform 120ms ease;
}

button:hover {
  background: linear-gradient(180deg, #1f3f66, #173553);
}

button:active {
  transform: none;
}

.btn-primary {
  background: linear-gradient(180deg, #244a78, #1a3d66);
  border-color: #193a61;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #1f3f66, #173553);
}

.btn-success {
  background: linear-gradient(180deg, #244f8f, #1c4278);
  border-color: #173964;
}

.btn-success:hover {
  background: linear-gradient(180deg, #1f4680, #193a6c);
}

.btn-warning {
  background: linear-gradient(180deg, #d07a24, #b56616);
  border-color: #9f5914;
}

.btn-warning:hover {
  background: linear-gradient(180deg, #c06f20, #a85d13);
}

.btn-neutral {
  background: linear-gradient(180deg, #6b7789, #596678);
  border-color: #526074;
}

.btn-neutral:hover {
  background: linear-gradient(180deg, #5f6c7d, #525e6f);
}

.btn-danger {
  background: linear-gradient(180deg, #9a3f46, #7f3138);
  border-color: #6f2d33;
}

.btn-danger:hover {
  background: linear-gradient(180deg, #8a3940, #742c33);
}

.btn-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
}

.btn-icon-inline svg,
.btn-icon-only svg {
  width: 1.05rem;
  height: 1.05rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-icon-only {
  width: 2.5rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-inline-tiny {
  width: 1.7rem;
  min-width: 1.7rem;
  height: 1.7rem;
  margin: 0;
}

.ticket-quick-actions {
  margin-top: 0.8rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.ticket-quick-actions-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.62rem;
  align-items: end;
  width: 100%;
  min-width: 760px;
}

.quick-action-field {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 0;
}

.quick-action-field select {
  margin: 0;
  min-width: 0;
}

.ticket-data-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.78rem;
}

.ticket-data-head h2 {
  margin: 0;
}

.ticket-context-actions {
  background: #f3f7fd;
  border: 1px solid #d3dfef;
}

.support-ticket-shell .panel p {
  overflow-wrap: anywhere;
}

.quick-action-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.quick-action-label {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.quick-action-save {
  height: 2.4rem;
  width: 2.4rem;
  min-width: 2.4rem;
  padding: 0;
}

.quick-icon-btn {
  width: 2.4rem;
  height: 2.4rem;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-icon-btn svg {
  width: 1.06rem;
  height: 1.06rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-icon-btn-status {
  background: linear-gradient(180deg, #244f8f, #1c4278);
  border-color: #173964;
}

.quick-icon-btn-status:hover {
  background: linear-gradient(180deg, #1f4680, #193a6c);
}

.quick-icon-btn-group {
  background: linear-gradient(180deg, #d07a24, #b56616);
  border-color: #9f5914;
}

.quick-icon-btn-group:hover {
  background: linear-gradient(180deg, #c06f20, #a85d13);
}

.quick-icon-btn-priority {
  background: linear-gradient(180deg, #6a80a0, #5a7292);
  border-color: #4f6686;
}

.quick-icon-btn-priority:hover {
  background: linear-gradient(180deg, #5f7595, #526a89);
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

a {
  color: #2651cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid #d7deea;
  border-radius: 8px;
}

.hint-text {
  margin: 0.45rem 0;
  color: #2a588f;
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: #ffffff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.62rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.tickets-table th,
.tickets-table td {
  overflow-wrap: normal;
  word-break: normal;
}

.tickets-table th:nth-child(1),
.tickets-table td:nth-child(1),
.tickets-table th:nth-child(2),
.tickets-table td:nth-child(2),
.tickets-table th:nth-child(5),
.tickets-table td:nth-child(5),
.tickets-table th:nth-child(6),
.tickets-table td:nth-child(6),
.tickets-table th:nth-child(7),
.tickets-table td:nth-child(7),
.tickets-table th:nth-child(8),
.tickets-table td:nth-child(8) {
  white-space: nowrap;
}

.tickets-table td:nth-child(4) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

thead th {
  background: #f5f8fc;
  color: #2f4461;
  font-weight: 700;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: inherit;
  text-decoration: none;
}

.sort-link:hover {
  text-decoration: underline;
}

.sort-link.is-active {
  color: #1f4c8f;
}

.sort-indicator {
  display: inline-block;
  min-width: 0.75rem;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

tbody tr:hover {
  background: #f7f9fc;
}

.priority-glyph {
  width: 2rem;
  height: 1.5rem;
  border-radius: 6px;
  border: 1px solid #d3dbe8;
  background: #f3f6fb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.priority-glyph svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.priority-glyph-lowest {
  color: #6b788f;
}

.priority-glyph-low {
  color: #466996;
}

.priority-glyph-normal {
  color: #2f5f98;
}

.priority-glyph-high {
  color: #c17623;
}

.priority-glyph-highest {
  color: #9a3f46;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.72rem;
}

.kpi-grid-extended {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-card {
  background: #ffffff;
  border: 1px solid #d8e1ef;
  border-left: 3px solid #3568ad;
  border-radius: 4px;
  padding: 0.72rem 0.82rem;
  box-shadow: 0 6px 14px rgba(17, 36, 66, 0.05);
}

.kpi-card h3 {
  margin: 0;
  color: #5a6e8d;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-card p {
  margin: 0.36rem 0 0;
  color: #1f3f70;
  font-size: 1.34rem;
  font-weight: 700;
}

.kpi-card-accent {
  border-left-color: #c9701c;
}

.kpi-card-accent p {
  color: #b7671b;
}

.pie-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.status-pie {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 1px solid #cfdae9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 8px 18px rgba(17, 36, 66, 0.08);
}

.status-legend {
  display: grid;
  gap: 0.46rem;
}

.status-legend-row {
  display: grid;
  grid-template-columns: 14px minmax(120px, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #e3e9f2;
  padding: 0.25rem 0;
}

.status-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(21, 34, 51, 0.22);
}

.status-legend-label {
  color: #314c72;
  font-weight: 600;
}

.status-legend-value {
  color: #294568;
  font-variant-numeric: tabular-nums;
}

.column-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 0.46rem;
  align-items: end;
  min-height: 230px;
}

.column-item {
  display: grid;
  grid-template-rows: auto 170px auto;
  gap: 0.3rem;
  align-items: end;
}

.column-value {
  color: #2b4870;
  font-weight: 650;
  text-align: center;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.column-track {
  height: 170px;
  border: 1px solid #d3ddec;
  border-radius: 6px;
  background: linear-gradient(180deg, #f6f9fd 0%, #ecf2fb 100%);
  display: flex;
  align-items: flex-end;
  padding: 0.16rem;
}

.column-fill {
  display: block;
  width: 100%;
  border-radius: 4px;
  min-height: 0;
  background: linear-gradient(180deg, #d07a24, #b56616);
}

.column-label {
  color: #496182;
  text-align: center;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.bar-chart {
  display: grid;
  gap: 0.48rem;
  margin-top: 0.4rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
}

.bar-label {
  color: #38557d;
  font-size: 0.9rem;
}

.bar-track {
  height: 0.68rem;
  border-radius: 3px;
  background: #e5ecf8;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3769ac, #2b5c9a);
}

.bar-fill-accent {
  background: linear-gradient(90deg, #d07a24, #b56616);
}

.bar-value {
  color: #2d466a;
  font-weight: 600;
  min-width: 3.1rem;
  text-align: right;
}

.requestor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.32rem;
}

.requestor-row-form {
  display: none;
}

.requestor-admin-table,
.accounts-admin-table {
  table-layout: auto;
}

.requestor-admin-table {
  min-width: 1100px;
}

.accounts-admin-table {
  min-width: 1080px;
}

.requestor-admin-table thead th,
.accounts-admin-table thead th {
  white-space: normal;
  line-height: 1.2;
  font-size: 0.85rem;
}

.requestor-admin-table td,
.accounts-admin-table td {
  vertical-align: middle;
}

.requestor-admin-table th:nth-child(1),
.requestor-admin-table td:nth-child(1) {
  width: 24%;
}

.requestor-admin-table th:nth-child(2),
.requestor-admin-table td:nth-child(2) {
  width: 18%;
}

.requestor-admin-table th:nth-child(3),
.requestor-admin-table td:nth-child(3) {
  width: 12%;
}

.requestor-admin-table th:nth-child(4),
.requestor-admin-table td:nth-child(4) {
  width: 8%;
}

.requestor-admin-table th:nth-child(5),
.requestor-admin-table td:nth-child(5) {
  width: 9%;
}

.requestor-admin-table th:nth-child(6),
.requestor-admin-table td:nth-child(6) {
  width: 8%;
}

.requestor-admin-table th:nth-child(7),
.requestor-admin-table td:nth-child(7) {
  width: 7%;
}

.requestor-admin-table th:nth-child(8),
.requestor-admin-table td:nth-child(8) {
  width: 10%;
}

.requestor-admin-table th:nth-child(9),
.requestor-admin-table td:nth-child(9) {
  width: 4%;
}

.accounts-admin-table th:nth-child(1),
.accounts-admin-table td:nth-child(1) {
  width: 18%;
}

.accounts-admin-table th:nth-child(2),
.accounts-admin-table td:nth-child(2) {
  width: 30%;
}

.accounts-admin-table th:nth-child(3),
.accounts-admin-table td:nth-child(3) {
  width: 24%;
}

.accounts-admin-table th:nth-child(4),
.accounts-admin-table td:nth-child(4) {
  width: 20%;
}

.accounts-admin-table th:nth-child(5),
.accounts-admin-table td:nth-child(5) {
  width: 8%;
}

.requestor-col-text {
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.requestor-col-meta {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.admin-table-hint {
  margin-top: -0.2rem;
  margin-bottom: 0.7rem;
}

.requestor-col-actions {
  text-align: right;
  white-space: nowrap;
  min-width: 88px;
}

.account-col-actions {
  text-align: right;
  white-space: nowrap;
  min-width: 72px;
}

.account-col-actions button,
.account-col-actions form {
  margin: 0;
}

.account-col-actions form {
  display: inline-block;
}

.account-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.34rem;
  white-space: nowrap;
}

.account-row-actions form,
.account-row-actions button {
  margin: 0;
}

.account-row-actions form {
  display: inline-flex;
  align-items: center;
}

.requestor-cell-input {
  margin: 0;
  min-height: 2.25rem;
  min-width: 0;
  padding: 0.44rem 0.62rem;
  border-radius: 6px;
}

.requestor-pin-input {
  font-variant-numeric: tabular-nums;
}

.requestor-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.34rem;
}

.requestor-row-actions button,
.requestor-row-actions form {
  margin: 0;
}

.requestor-row-actions form {
  display: inline-flex;
  align-items: center;
}

.requestor-row-actions .btn-icon-only {
  width: 2.35rem;
  min-width: 2.35rem;
  height: 2.35rem;
}

.requestor-admin-table td:nth-child(3) .requestor-cell-input,
.requestor-admin-table td:nth-child(5) .requestor-cell-input {
  min-width: 7.5rem;
}

.requestor-admin-table td:nth-child(4) .requestor-cell-input,
.requestor-admin-table td:nth-child(6) .requestor-cell-input {
  min-width: 5.4rem;
}

.requestor-row.is-dirty td {
  background: color-mix(in srgb, var(--accent-soft) 52%, var(--panel) 48%);
}

.requestor-row.is-dirty:hover td {
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--panel) 42%);
}

.accounts-admin-table tr.is-dirty td {
  background: color-mix(in srgb, var(--accent-soft) 52%, var(--panel) 48%);
}

.accounts-admin-table tr.is-dirty:hover td {
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--panel) 42%);
}

.account-member-pill-form {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin: 0 0.24rem 0.24rem 0;
  max-width: 100%;
}

.account-member-pill-form .tag {
  flex: 1 1 auto;
  min-width: 0;
  margin-right: 0;
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: none;
}

.account-settings-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, 140px) minmax(110px, 140px) auto;
  gap: 0.4rem;
  align-items: center;
}

.account-create-form {
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.9fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr) 2.5rem;
  align-items: center;
}

.account-create-submit {
  width: 2.5rem;
  min-width: 2.5rem;
  grid-column: 5;
  justify-self: end;
  align-self: center;
}

.accounts-admin-table .requestor-pin-form {
  grid-template-columns: minmax(160px, 1fr) auto;
}

.accounts-admin-table .requestor-pin-form .autocomplete-field,
.accounts-admin-table .requestor-pin-form .autocomplete-field input {
  min-width: 0;
  width: 100%;
}

.wait-progress {
  width: 126px;
  height: 8px;
  border-radius: 999px;
  background: #e5ecf8;
  overflow: hidden;
  border: 1px solid #d2ddee;
}

.wait-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 160ms ease, background-color 160ms ease;
}

.wait-progress-label {
  margin-left: 0.38rem;
  color: #35547b;
  font-size: 0.78rem;
  white-space: nowrap;
}

.wait-progress-label-no-bar {
  margin-left: 0;
}

.requestor-pin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: center;
}

.requestor-delete-form {
  display: flex;
  justify-content: flex-start;
}

.requestor-pin-form input,
.requestor-pin-form button,
.requestor-delete-form button {
  margin: 0;
}

.requestor-pin-form button,
.requestor-delete-form button {
  width: auto;
}

.filters {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr auto;
  gap: 0.7rem;
  align-items: center;
}

.filters.account-create-form {
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.9fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr) 2.5rem;
  align-items: center;
}

.requestor-create-form {
  grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1fr) minmax(110px, 0.8fr) minmax(120px, 1fr) minmax(110px, 0.8fr) minmax(120px, 0.95fr) auto;
}

.profile-preferences-form {
  display: grid;
  gap: 0.75rem;
}

.profile-preferences-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 0.72rem;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
}

.profile-field > span {
  font-weight: 650;
  color: #22375f;
}

.profile-preferences-form input,
.profile-preferences-form select,
.profile-inline-form input,
.profile-inline-form select {
  font-weight: 400;
}

.profile-preferences-form .operator-group-choice,
.profile-preferences-form .operator-group-choice span {
  font-weight: 600;
}

.profile-field-toggle .operator-group-choice {
  margin-top: 0;
  min-height: 2.25rem;
  align-items: center;
}

.profile-save-row {
  display: flex;
  justify-content: flex-end;
}

.profile-inline-form {
  display: grid;
  gap: 0.62rem;
  align-items: center;
}

.profile-inline-form--triple {
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
}

.profile-inline-form--single {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.profile-inline-form button {
  margin-top: 0;
  width: auto;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.62rem;
  align-items: center;
}

.filters button,
.inline-form button,
.quick-action-form button,
.ticket-quick-actions-form button,
.requestor-pin-form button,
.account-settings-form button,
.account-create-form button {
  margin-top: 0;
}

.account-settings-form button,
.requestor-pin-form button,
.requestor-delete-form button {
  width: auto;
}

.operator-queues-form {
  display: inline-flex;
}

.operator-group-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.operator-group-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  margin: 0;
  padding: 0.24rem 0.46rem;
  border: 1px solid #d3ddeb;
  border-radius: 999px;
  background: #f7fafe;
  color: #27466e;
  font-weight: 500;
}

.operator-group-choice input {
  width: auto;
  margin: 0;
}

.operator-save-btn {
  margin-top: 0;
}

.presence-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.8rem;
}

.presence-badge {
  display: inline-block;
  border-radius: 6px;
  padding: 0.22rem 0.58rem;
  font-size: 0.82rem;
  font-weight: 650;
  border: 1px solid #d2dbe7;
}

.presence-badge.online {
  background: var(--success-bg);
  color: var(--success-ink);
}

.presence-badge.offline {
  background: var(--muted-bg);
  color: var(--muted-ink);
}

.timeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 1rem;
  align-items: start;
}

.timeline-feed {
  margin-top: 0.8rem;
}

.timeline-item {
  background: #f9fafc;
  border: 1px solid #d8e0ea;
  border-left-width: 3px;
  border-left-color: #c3cfdd;
  margin-bottom: 0.72rem;
  padding: 0.9rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(18, 30, 48, 0.04);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.timeline-time {
  font-size: 0.82rem;
  color: #5e6d86;
  font-variant-numeric: tabular-nums;
}

.timeline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 6px;
  border: 1px solid currentColor;
  background: #eef2f7;
  color: #365173;
}

.timeline-icon svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline-subject {
  margin: 0.5rem 0;
  font-weight: 620;
  color: #233a68;
}

.timeline-more {
  margin-top: 0.5rem;
}

.timeline-more > summary {
  cursor: pointer;
  color: #244ebc;
  font-weight: 620;
}

.timeline-item.chat-summary .timeline-more {
  margin-top: 0.46rem;
  padding: 0.38rem 0.52rem 0.2rem;
  border-top: 1px solid #dfd8cf;
}

.timeline-item.chat-summary .timeline-more > summary {
  font-size: 0.9rem;
  color: #a15f1d;
}

.timeline-item.email-in {
  border-left-color: #29538c;
  background: #f2f6fd;
}

.timeline-item.email-in .timeline-icon {
  color: #2c568d;
  background: #e0e9f9;
}

.timeline-item.email-out {
  border-left-color: #355e95;
  background: #f4f8fd;
}

.timeline-item.email-out .timeline-icon {
  color: #355e95;
  background: #e5edf9;
}

.timeline-item.timeline-accent {
  border-left-color: var(--accent-warm);
  background: #fcf7f1;
}

.timeline-item.timeline-accent .timeline-icon {
  color: #9c5f1e;
  background: var(--accent-warm-soft);
}

.timeline-item.chat-summary {
  border-left-color: var(--accent-warm);
  background: #fcf7f1;
}

.timeline-item.chat-summary .timeline-icon {
  color: #9c5f1e;
  background: var(--accent-warm-soft);
}

.timeline-item.note-internal {
  border-left-color: #6a7484;
  background: #f7f8fa;
}

.timeline-item.note-internal .timeline-icon {
  color: #4f5f76;
  background: #e6ebf2;
}

.note-spent {
  margin: 0.42rem 0 0;
  font-size: 0.82rem;
  color: #5f6f86;
}

.note-actions {
  margin-top: 0.24rem;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  font-size: 0.82rem;
}

.note-action-sep {
  color: #76839a;
}

.note-inline-form {
  display: inline;
  margin: 0;
}

.note-action-link,
.note-action-button {
  display: inline;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #2651cc;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: underline;
  cursor: pointer;
}

.note-action-link:hover,
.note-action-button:hover {
  color: #1d44b2;
  text-decoration: underline;
  background: transparent;
}

.note-action-button:active {
  transform: none;
}

.note-action-link:focus-visible,
.note-action-button:focus-visible {
  outline: 2px solid #7fa3ff;
  outline-offset: 2px;
}

.timeline-item.chat-customer {
  border-left-color: #31578f;
  background: #f3f7fd;
}

.timeline-item.chat-customer .timeline-icon {
  color: #2f568d;
  background: #e0e9f8;
}

.timeline-item.chat-operator {
  border-left-color: #31578f;
  background: #f3f7fd;
}

.timeline-item.chat-operator .timeline-icon {
  color: #2f568d;
  background: #e0e9f8;
}

.timeline-item.chat-customer pre,
.timeline-item.chat-operator pre,
.chat-detail pre {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0.46rem 0 0;
}

.role-operator .timeline-item.chat-operator,
.role-operator .chat-detail.chat-operator {
  border-left-color: #31578f;
  background: #f5f8fd;
}

.role-operator .timeline-item.chat-operator .timeline-icon,
.role-operator .chat-detail.chat-operator .chat-detail-head {
  color: #2f568d;
}

.role-operator .timeline-item.chat-operator .timeline-icon {
  color: #2f568d;
  background: #dfe9f9;
}

.role-operator .timeline-item.chat-customer,
.role-operator .chat-detail.chat-customer {
  border-left-color: var(--accent-warm);
  background: #fcf7f1;
}

.role-operator .timeline-item.chat-customer .timeline-icon,
.role-operator .chat-detail.chat-customer .chat-detail-head {
  color: #9d5f1f;
}

.role-operator .timeline-item.chat-customer .timeline-icon {
  color: #9f611f;
  background: #f7e6cf;
}

.role-customer .timeline-item.chat-customer,
.role-customer .chat-detail.chat-customer {
  border-left-color: #31578f;
  background: #f5f8fd;
}

.role-customer .timeline-item.chat-customer .timeline-icon,
.role-customer .chat-detail.chat-customer .chat-detail-head {
  color: #2f568d;
}

.role-customer .timeline-item.chat-customer .timeline-icon {
  color: #2f568d;
  background: #dfe9f9;
}

.role-customer .timeline-item.chat-operator,
.role-customer .chat-detail.chat-operator {
  border-left-color: var(--accent-warm);
  background: #fcf7f1;
}

.role-customer .timeline-item.chat-operator .timeline-icon,
.role-customer .chat-detail.chat-operator .chat-detail-head {
  color: #9d5f1f;
}

.role-customer .timeline-item.chat-operator .timeline-icon {
  color: #9f611f;
  background: #f7e6cf;
}

.chat-detail {
  border-left: 1px solid #d6dfeb;
  margin: 0.4rem 0 0.4rem 0.9rem;
  padding: 0.3rem 0.52rem;
  background: #f9fbfe;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px #eef3f9;
}

.chat-detail-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  color: #72839f;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.88;
}

.chat-detail.chat-customer {
  border-left-color: #e3c9ac;
  background: #fdf9f3;
}

.chat-detail.chat-operator {
  border-left-color: #bfd1ea;
  background: #f7fafe;
}

.chat-detail .attachment-list {
  gap: 0.32rem;
  margin-top: 0.34rem;
}

.chat-detail .attachment-thumb {
  width: 132px;
  padding: 0.28rem;
}

.chat-detail .attachment-thumb img {
  height: 78px;
}

.chat-detail pre {
  font-size: 0.93rem;
  color: #334867;
}

.chat-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0.52rem 0.72rem;
  position: sticky;
  top: 1rem;
}

.chat-side > summary {
  cursor: pointer;
  font-weight: 700;
  color: #1d3f92;
  padding: 0.3rem 0.2rem;
}

.support-ticket-shell.has-chat-sidebar {
  height: 100vh;
  overflow: hidden;
}

.support-ticket-shell.has-chat-sidebar .layout {
  width: calc(100% - var(--chatbar-w));
  max-width: none;
  margin: 0;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  scrollbar-gutter: stable;
}

.support-ticket-shell.has-chat-sidebar.chat-collapsed .layout {
  width: calc(100% - var(--chatbar-collapsed));
}

.support-ticket-shell.has-chat-sidebar .layout::-webkit-scrollbar {
  width: 11px;
}

.support-ticket-shell.has-chat-sidebar .layout::-webkit-scrollbar-track {
  background: #eef2f7;
  border-left: 1px solid #d7deea;
}

.support-ticket-shell.has-chat-sidebar .layout::-webkit-scrollbar-thumb {
  background: #b6c1d1;
  border: 2px solid #eef2f7;
  border-radius: 10px;
}

.chat-fixed-sidebar {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  width: var(--chatbar-w);
  height: calc(100vh - var(--topbar-h));
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 28px rgba(15, 26, 41, 0.12);
  padding: 0.8rem;
  overflow: visible;
  z-index: 15;
  transition: transform 0.22s ease;
}

.chat-fixed-content {
  height: 100%;
  overflow: auto;
}

.chat-grip {
  position: absolute;
  top: 50%;
  left: -22px;
  transform: translateY(-50%);
  width: 22px;
  height: 96px;
  margin: 0;
  border-radius: 6px 0 0 6px;
  padding: 0;
  border: 1px solid #1e45b2;
  border-right: 0;
  background: linear-gradient(180deg, #244a78, #1a3d66);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: -4px 0 12px rgba(17, 36, 66, 0.28);
  z-index: 18;
}

.chat-grip:hover {
  background: linear-gradient(180deg, #1f3f66, #173553);
}

.chat-grip:focus-visible {
  outline: 2px solid #7fa3ff;
  outline-offset: 2px;
}

.chat-fixed-head {
  position: sticky;
  top: 0;
  background: #ffffff;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.65rem;
}

.chat-fixed-head h3 {
  margin: 0;
}

.support-ticket-shell.chat-collapsed .chat-fixed-sidebar {
  transform: translateX(calc(var(--chatbar-w) - var(--chatbar-collapsed)));
}

.support-ticket-shell.chat-collapsed .chat-fixed-content {
  opacity: 0;
  pointer-events: none;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: #f7f9fb;
  border: 1px solid #dde2ea;
  padding: 0.65rem;
  border-radius: 6px;
}

.drop-area {
  margin-top: 0.7rem;
  padding: 0.92rem;
  border: 1px dashed #9aa8bc;
  border-radius: 6px;
  background: #fbfcfe;
  color: #3a4d68;
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.drop-area:focus-visible {
  outline: 2px solid #7fa3ff;
  outline-offset: 2px;
}

.drop-area.drop-hover {
  border-color: #365981;
  background: #f3f7fc;
  color: #2f4a6d;
}

.file-input-hidden {
  display: none;
}

.drop-file-list {
  margin-top: 0.46rem;
  display: grid;
  gap: 0.34rem;
}

.drop-file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.38rem 0.44rem;
  border: 1px solid #d5dde8;
  border-radius: 6px;
  background: #f8fafd;
}

.drop-file-name {
  font-size: 0.83rem;
  color: #2f4464;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drop-file-remove {
  width: auto;
  margin: 0;
  padding: 0.28rem 0.5rem;
  border-radius: 5px;
  border: 1px solid #9f5914;
  background: linear-gradient(180deg, #d07a24, #b56616);
  color: #f8fbff;
  font-size: 0.75rem;
  line-height: 1;
}

.drop-file-remove:hover {
  background: linear-gradient(180deg, #c06f20, #a85d13);
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.attachment-thumb {
  width: 148px;
  margin-top: 0;
  padding: 0.35rem;
  border-radius: 6px;
  border: 1px solid #d6dee9;
  background: #ffffff;
  color: #2e415f;
  box-shadow: none;
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}

.attachment-thumb:hover {
  background: #f7f9fc;
}

.attachment-thumb img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #d7dde6;
  background: #ffffff;
}

.attachment-thumb-file {
  width: 100%;
  height: 88px;
  border-radius: 4px;
  border: 1px solid #d7dde6;
  background: linear-gradient(160deg, #f7f9fd, #e9eff8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #38557d;
}

.attachment-thumb > span:not(.attachment-thumb-file) {
  width: 100%;
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-preview {
  width: min(96vw, 1080px);
  max-height: 94vh;
}

.modal-preview-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  height: min(90vh, 900px);
}

.attachment-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.attachment-preview-close {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  margin-top: 0;
  flex: 0 0 auto;
}

.attachment-preview-head h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.preview-nav-btn {
  width: 2.1rem;
  height: 2.1rem;
  margin-top: 0;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #17375b;
  background: linear-gradient(180deg, #244a78, #1a3d66);
  color: #f6f8ff;
  font-size: 1.3rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.preview-nav-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.attachment-preview-index {
  min-width: 3.4rem;
  text-align: center;
  font-size: 0.82rem;
  color: #4a5d82;
  font-variant-numeric: tabular-nums;
}

.attachment-preview-stage {
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  background: radial-gradient(circle at 16% 0%, #1f3354, #121f35);
  padding: 0.7rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  overflow: auto;
}

.attachment-preview-stage img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  cursor: zoom-in;
}

.attachment-preview-stage iframe {
  width: 100%;
  height: 100%;
  min-height: 64vh;
  border: 0;
  border-radius: 6px;
  background: #ffffff;
}

.attachment-preview-stage.is-pdf {
  padding: 0.5rem;
  align-items: stretch;
}

.attachment-preview-stage img.zoomed {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.attachment-preview-hint {
  margin: 0;
  color: #4c5f87;
  font-size: 0.86rem;
}

.attachment-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.attachment-preview-download {
  margin-left: auto;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0.62rem 0.82rem;
  background: linear-gradient(180deg, #244a78, #1a3d66);
  color: #f6f8ff;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid #17375b;
}

.button-link:hover {
  background: linear-gradient(180deg, #1f3f66, #173553);
  text-decoration: none;
}

.attachment-link {
  display: inline-block;
  padding: 0.24rem 0.56rem;
  border-radius: 6px;
  background: #f5f7fa;
  color: #2e415f;
  border: 1px solid #d6deea;
}

.error {
  color: var(--danger);
}

.tag {
  display: inline-block;
  padding: 0.12rem 0.52rem;
  margin-right: 0.26rem;
  border-radius: 6px;
  background: #f1f4f8;
  color: #2f466a;
  font-size: 0.84rem;
  border: 1px solid #d6deea;
}

@media (max-width: 1100px) {
  .login-shell {
    grid-template-columns: 1fr;
    width: min(94vw, 520px);
  }

  .login-hero {
    min-height: 0;
    padding: 1.7rem 1.45rem 1.35rem;
  }

  .login-card {
    border-left: 0;
    border-top: 1px solid rgba(183, 205, 241, 0.24);
    padding: 1.45rem;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .timeline-layout {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid-extended {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bar-row {
    grid-template-columns: 130px minmax(0, 1fr) auto;
  }

  .support-ticket-shell.has-chat-sidebar,
  .support-ticket-shell.has-chat-sidebar.chat-collapsed {
    height: auto;
    overflow: auto;
  }

  .support-ticket-shell.has-chat-sidebar .layout,
  .support-ticket-shell.has-chat-sidebar.chat-collapsed .layout {
    width: min(1500px, 100%);
    max-width: none;
    margin: 0 auto;
    height: auto;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .chat-fixed-sidebar {
    position: static;
    width: auto;
    height: auto;
    border-left: 0;
    box-shadow: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 0 clamp(0.85rem, 2.2vw, 1.2rem) 1rem;
    transition: none;
    overflow: visible;
  }

  .ticket-quick-actions {
    overflow-x: visible;
  }

  .ticket-quick-actions-form {
    min-width: 0;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .ticket-quick-actions-form .quick-action-field {
    flex: 1 1 240px;
  }

  .ticket-quick-actions-form .quick-action-save {
    margin-left: auto;
    align-self: end;
  }

  .chat-grip {
    display: none;
  }

  .chat-fixed-content {
    opacity: 1 !important;
    pointer-events: auto !important;
    overflow: visible;
  }

  .pie-layout {
    grid-template-columns: 1fr;
  }

  .status-pie {
    width: 190px;
    height: 190px;
    margin: 0 auto;
  }

  .column-chart {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .account-settings-form,
  .requestor-create-form {
    grid-template-columns: 1fr 1fr;
  }

  .account-settings-form button,
  .requestor-create-form button {
    width: 100%;
  }
}

@media (max-width: 920px) {
  .filters.account-create-form {
    grid-template-columns: 1fr 1fr;
  }

  .account-create-form button {
    width: 100%;
  }

  .account-create-submit {
    width: 2.5rem;
    min-width: 2.5rem;
    grid-column: 2;
    justify-self: end;
  }

  .profile-preferences-grid {
    grid-template-columns: 1fr;
  }

  .profile-inline-form {
    grid-template-columns: 1fr;
  }

  .profile-inline-form button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .attachment-preview-footer {
    flex-wrap: wrap;
  }

  .attachment-preview-download {
    margin-left: 0;
  }
}

@media (max-width: 1120px) {
  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .tickets-table-wrap {
    overflow-x: auto;
    border: 1px solid #d7deea;
    border-radius: 8px;
  }

  .mobile-stack-table {
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  .mobile-stack-table thead {
    display: none;
  }

  .mobile-stack-table tbody {
    display: grid;
    gap: 0.7rem;
  }

  .mobile-stack-table tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: var(--theme-shadow-surface-soft);
    padding: 0.5rem 0.72rem;
  }

  .mobile-stack-table tbody td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.22rem;
    border-bottom: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
    padding: 0.5rem 0.08rem;
    overflow-wrap: normal;
    word-break: normal;
    background: transparent !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .mobile-stack-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-soft);
    line-height: 1.25;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .mobile-stack-table tbody td:last-child {
    border-bottom: 0;
  }

  .mobile-stack-table .requestor-col-actions,
  .mobile-stack-table .account-col-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    width: 100%;
  }

  .mobile-stack-table .requestor-row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .mobile-stack-table .requestor-row-actions .btn-icon-only,
  .mobile-stack-table .requestor-delete-form .btn-icon-only,
  .mobile-stack-table .account-col-actions .btn-icon-only {
    width: 2.2rem;
    min-width: 2.2rem;
    height: 2.2rem;
  }

  .mobile-stack-table .requestor-pin-form,
  .mobile-stack-table .account-settings-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .mobile-stack-table .requestor-cell-input,
  .mobile-stack-table .account-settings-form input,
  .mobile-stack-table .account-settings-form select,
  .mobile-stack-table .requestor-pin-form input,
  .mobile-stack-table .requestor-pin-form select,
  .mobile-stack-table .autocomplete-field,
  .mobile-stack-table .autocomplete-field input {
    width: 100%;
    min-width: 0;
  }

  .mobile-stack-table.tickets-table th,
  .mobile-stack-table.tickets-table td {
    white-space: normal !important;
  }

  .mobile-stack-table.tickets-table .wait-progress {
    width: min(100%, 220px);
  }

  .mobile-stack-table.tickets-table .wait-progress-label {
    margin-left: 0;
    margin-top: 0.25rem;
    display: inline-block;
    white-space: normal;
  }

  .mobile-stack-table .operator-group-checkboxes {
    width: 100%;
  }

  .mobile-stack-table .operator-save-cell {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .topbar-right {
    width: 100%;
    align-items: stretch;
  }

  .topbar-brand {
    align-items: flex-start;
  }

  .brand-logo {
    margin-top: 0.1rem;
    width: auto;
    max-width: 102px;
    height: 32px;
  }

  .brand-text {
    min-height: 32px;
  }

  .topbar-toolbar {
    width: 100%;
    justify-content: flex-end;
  }

  .page-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .topbar-toolbar {
    justify-content: flex-end;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .layout {
    padding: 0.85rem;
  }

  .ticket-quick-actions {
    margin-top: 0.8rem;
    overflow-x: visible;
  }

  .ticket-quick-actions-form {
    min-width: 0;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .ticket-quick-actions-form .quick-action-field {
    flex: 1 1 100%;
    min-width: 0;
  }

  .ticket-quick-actions-form .quick-action-save {
    margin-left: auto;
  }

  .ticket-data-head {
    flex-direction: column;
    align-items: stretch;
  }

  .ticket-context-actions {
    justify-content: flex-start;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid-extended {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 0.24rem;
  }

  .bar-value {
    text-align: left;
  }

  .account-create-form,
  .account-settings-form,
  .requestor-create-form,
  .requestor-pin-form,
  .quick-action-form {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .tickets-table-wrap {
    overflow-x: auto;
    border: 1px solid #d7deea;
    border-radius: 8px;
  }

  .mobile-stack-table {
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  .mobile-stack-table thead {
    display: none;
  }

  .mobile-stack-table tbody {
    display: grid;
    gap: 0.7rem;
  }

  .mobile-stack-table tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: var(--theme-shadow-surface-soft);
    padding: 0.5rem 0.72rem;
  }

  .mobile-stack-table tbody td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.22rem;
    border-bottom: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
    padding: 0.5rem 0.08rem;
    overflow-wrap: normal;
    word-break: normal;
    background: transparent !important;
  }

  .mobile-stack-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-soft);
    line-height: 1.25;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .mobile-stack-table tbody td:last-child {
    border-bottom: 0;
  }

  .mobile-stack-table th,
  .mobile-stack-table td {
    width: auto !important;
    min-width: 0 !important;
  }

  .mobile-stack-table .requestor-col-actions,
  .mobile-stack-table .account-col-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    width: 100%;
  }

  .mobile-stack-table .requestor-row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .mobile-stack-table .requestor-row-actions .btn-icon-only,
  .mobile-stack-table .requestor-delete-form .btn-icon-only,
  .mobile-stack-table .account-col-actions .btn-icon-only {
    width: 2.2rem;
    min-width: 2.2rem;
    height: 2.2rem;
  }

  .mobile-stack-table .requestor-pin-form,
  .mobile-stack-table .account-settings-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .mobile-stack-table .requestor-cell-input,
  .mobile-stack-table .account-settings-form input,
  .mobile-stack-table .account-settings-form select,
  .mobile-stack-table .requestor-pin-form input,
  .mobile-stack-table .requestor-pin-form select,
  .mobile-stack-table .autocomplete-field,
  .mobile-stack-table .autocomplete-field input {
    width: 100%;
    min-width: 0;
  }

  .mobile-stack-table .requestor-pin-form button,
  .mobile-stack-table .requestor-delete-form button,
  .mobile-stack-table .account-settings-form button,
  .mobile-stack-table .account-col-actions button {
    width: auto;
  }

  .mobile-stack-table .account-settings-form button,
  .mobile-stack-table .requestor-pin-form button,
  .mobile-stack-table .requestor-row-actions {
    justify-self: flex-end;
  }

  .mobile-stack-table .account-member-pill-form {
    width: 100%;
    margin-right: 0;
    justify-content: flex-start;
  }

  .mobile-stack-table .account-member-pill-form .tag {
    max-width: calc(100% - 2.8rem);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .column-chart {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .column-item {
    grid-template-rows: auto 130px auto;
  }

  .column-track {
    height: 130px;
  }

  .quick-action-form button {
    width: 100%;
  }

}

/* shared component styles */
.modal-confirm .modal-card {
  min-width: min(92vw, 460px);
}

.autocomplete-field {
  position: relative;
}

.autocomplete-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.22rem);
  left: 0;
  right: 0;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4);
  max-height: 220px;
  overflow-y: auto;
}

.autocomplete-option {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 0.5rem 0.62rem;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 0.16rem;
}

.autocomplete-option:last-child {
  border-bottom: 0;
}

.autocomplete-option:hover {
  background: color-mix(in srgb, var(--accent-soft) 30%, var(--panel) 70%);
}

.autocomplete-option-name {
  font-weight: 600;
  color: var(--ink);
}

.autocomplete-option-email {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

@media (max-width: 760px) {
  .autocomplete-menu {
    position: static;
    margin-top: 0.28rem;
  }
}

/* ===== Theme System (final layer) ===== */
:root {
  /* global colors (dark defaults) */
  --theme-color-bg-canvas: #0a1320;
  --theme-color-bg-canvas-alt: #111f33;
  --theme-color-bg-glow-primary: rgba(47, 94, 142, 0.18);
  --theme-color-bg-glow-accent: rgba(213, 123, 57, 0.14);
  --theme-color-surface-base: #162437;
  --theme-color-surface-raised: #1b2c43;
  --theme-color-surface-overlay: #243852;
  --theme-color-border-subtle: #3a506f;
  --theme-color-border-strong: #56759a;
  --theme-color-text-primary: #eef4fb;
  --theme-color-text-secondary: #c4d2e2;
  --theme-color-text-muted: #9eb2cb;
  --theme-color-text-on-strong: #f8fbff;
  --theme-color-link: #a5d0ff;
  --theme-color-link-hover: #d7eaff;
  --theme-color-focus-ring: #8ab6ef;

  /* topbar */
  --theme-color-topbar-bg-start: #153252;
  --theme-color-topbar-bg-end: #1f4a75;
  --theme-color-topbar-border: #c98a50;
  --theme-color-topbar-text: #f5f9ff;
  --theme-color-topbar-subtext: #d4e1f1;
  --theme-color-topbar-tab-inactive: #c4dbfb;

  /* timeline and code */
  --theme-color-timeline-item-bg: #18283e;
  --theme-color-timeline-item-border: #3f5878;
  --theme-color-timeline-item-hover: #1f3350;
  --theme-color-timeline-icon-bg: #233a58;
  --theme-color-timeline-icon-ink: #b2d0f5;
  --theme-color-timeline-accent-bg: #30283a;
  --theme-color-timeline-accent-border: #c98a50;
  --theme-color-timeline-accent-ink: #f4c79a;
  --theme-color-timeline-divider: #6c6671;
  --theme-color-code-bg: #122033;
  --theme-color-code-border: #3e597f;
  --theme-color-code-text: #ecf4ff;
  --theme-color-code-accent-bg: #221d2a;
  --theme-color-code-accent-border: #6f5f54;
  --theme-color-code-accent-text: #f2e8de;
  --theme-color-attachment-bg: #1c304b;
  --theme-color-attachment-border: #4c698f;
  --theme-color-attachment-hover-bg: #27405f;
  --theme-color-attachment-accent-bg: #3a3044;
  --theme-color-attachment-accent-border: #8e735f;
  --theme-color-attachment-accent-hover-bg: #493b56;

  /* badges */
  --theme-color-presence-online-bg: #264265;
  --theme-color-presence-online-ink: #d8e9ff;
  --theme-color-presence-offline-bg: #374252;
  --theme-color-presence-offline-ink: #d8e0ec;

  /* charts and misc surfaces */
  --theme-color-chart-track-bg: #223651;
  --theme-color-chart-track-border: #466386;
  --theme-color-chart-primary-start: #618ec4;
  --theme-color-chart-primary-end: #3f6fa8;
  --theme-color-chart-accent-start: #dfaa77;
  --theme-color-chart-accent-end: #cb8548;
  --theme-color-kpi-primary-border: #618ec4;
  --theme-color-kpi-accent-border: #c98a50;
  --theme-color-kpi-accent-text: #f4c79a;
  --theme-color-table-wrap-border: #466386;
  --theme-color-chat-grip-bg-start: #618ec4;
  --theme-color-chat-grip-bg-end: #3f6fa8;
  --theme-color-chat-grip-border: #5f86b8;
  --theme-color-chat-grip-text: #f7fbff;

  /* button palette */
  --theme-btn-primary-bg-start: #618ec4;
  --theme-btn-primary-bg-end: #3f6fa8;
  --theme-btn-primary-border: #5f86b8;
  --theme-btn-primary-text: #f7fbff;
  --theme-btn-primary-bg-start-hover: #729ed1;
  --theme-btn-primary-bg-end-hover: #4c7cb4;

  --theme-btn-neutral-bg-start: #8a9cb2;
  --theme-btn-neutral-bg-end: #73879f;
  --theme-btn-neutral-border: #8093aa;
  --theme-btn-neutral-text: #f8fbff;
  --theme-btn-neutral-bg-start-hover: #99a9be;
  --theme-btn-neutral-bg-end-hover: #8093aa;

  --theme-btn-accent-bg-start: #dfaa77;
  --theme-btn-accent-bg-end: #cb8548;
  --theme-btn-accent-border: #d79b64;
  --theme-btn-accent-text: #2a1a0c;
  --theme-btn-accent-bg-start-hover: #e7b888;
  --theme-btn-accent-bg-end-hover: #d59357;

  --theme-btn-danger-bg-start: #cf7481;
  --theme-btn-danger-bg-end: #b75664;
  --theme-btn-danger-border: #c46a77;
  --theme-btn-danger-text: #fff5f7;
  --theme-btn-danger-bg-start-hover: #da848f;
  --theme-btn-danger-bg-end-hover: #c46472;

  /* elevations */
  --theme-shadow-surface: 0 18px 40px rgba(5, 12, 24, 0.34), 0 5px 14px rgba(5, 12, 24, 0.24);
  --theme-shadow-surface-soft: 0 8px 22px rgba(5, 12, 24, 0.2);
}

body.theme-light,
html[data-theme="light"] body {
  --theme-color-bg-canvas: #f2f6fc;
  --theme-color-bg-canvas-alt: #fbfdff;
  --theme-color-bg-glow-primary: rgba(47, 94, 142, 0.14);
  --theme-color-bg-glow-accent: rgba(213, 123, 57, 0.12);
  --theme-color-surface-base: #ffffff;
  --theme-color-surface-raised: #f7faff;
  --theme-color-surface-overlay: #ecf2fb;
  --theme-color-border-subtle: #d5deea;
  --theme-color-border-strong: #b6c6dc;
  --theme-color-text-primary: #1d2f46;
  --theme-color-text-secondary: #425d7e;
  --theme-color-text-muted: #617b9c;
  --theme-color-text-on-strong: #f8fbff;
  --theme-color-link: #1f5fa8;
  --theme-color-link-hover: #16457c;
  --theme-color-focus-ring: #4d84c6;

  --theme-color-topbar-bg-start: #234a78;
  --theme-color-topbar-bg-end: #2f5f97;
  --theme-color-topbar-border: #c98a50;
  --theme-color-topbar-text: #f7faff;
  --theme-color-topbar-subtext: #edf4ff;
  --theme-color-topbar-tab-inactive: #163f73;

  --theme-color-timeline-item-bg: #ffffff;
  --theme-color-timeline-item-border: #cfdbeb;
  --theme-color-timeline-item-hover: #f2f7ff;
  --theme-color-timeline-icon-bg: #e8eff9;
  --theme-color-timeline-icon-ink: #2f5f97;
  --theme-color-timeline-accent-bg: #fff6ee;
  --theme-color-timeline-accent-border: #c98345;
  --theme-color-timeline-accent-ink: #8f5727;
  --theme-color-timeline-divider: #dbcbb8;
  --theme-color-code-bg: #f7f9fd;
  --theme-color-code-border: #dbe3ef;
  --theme-color-code-text: #213854;
  --theme-color-code-accent-bg: #fcf3e8;
  --theme-color-code-accent-border: #dcc8b1;
  --theme-color-code-accent-text: #3f3227;
  --theme-color-attachment-bg: #eef4fd;
  --theme-color-attachment-border: #c6d5ea;
  --theme-color-attachment-hover-bg: #e4eefc;
  --theme-color-attachment-accent-bg: #f9ecdd;
  --theme-color-attachment-accent-border: #d8bfa2;
  --theme-color-attachment-accent-hover-bg: #f4e2cf;

  --theme-color-presence-online-bg: #e7f0ff;
  --theme-color-presence-online-ink: #1f4f88;
  --theme-color-presence-offline-bg: #f0f4f9;
  --theme-color-presence-offline-ink: #596f8a;

  --theme-color-chart-track-bg: #e8eef8;
  --theme-color-chart-track-border: #cdd9ea;
  --theme-color-chart-primary-start: #4f84c0;
  --theme-color-chart-primary-end: #2f6098;
  --theme-color-chart-accent-start: #dda164;
  --theme-color-chart-accent-end: #c87a39;
  --theme-color-kpi-primary-border: #4f84c0;
  --theme-color-kpi-accent-border: #c98345;
  --theme-color-kpi-accent-text: #8f5727;
  --theme-color-table-wrap-border: #cfdcec;
  --theme-color-chat-grip-bg-start: #4f84c0;
  --theme-color-chat-grip-bg-end: #2f6098;
  --theme-color-chat-grip-border: #3f70a9;
  --theme-color-chat-grip-text: #f8fbff;

  --theme-btn-primary-bg-start: #4f84c0;
  --theme-btn-primary-bg-end: #2f6098;
  --theme-btn-primary-border: #3f70a9;
  --theme-btn-primary-text: #f8fbff;
  --theme-btn-primary-bg-start-hover: #5d91cc;
  --theme-btn-primary-bg-end-hover: #3d6da4;

  --theme-btn-neutral-bg-start: #8899ad;
  --theme-btn-neutral-bg-end: #718297;
  --theme-btn-neutral-border: #7a8ca1;
  --theme-btn-neutral-text: #f7f9fc;
  --theme-btn-neutral-bg-start-hover: #95a4b6;
  --theme-btn-neutral-bg-end-hover: #7f90a4;

  --theme-btn-accent-bg-start: #dfa86f;
  --theme-btn-accent-bg-end: #ca7c3a;
  --theme-btn-accent-border: #d4935a;
  --theme-btn-accent-text: #2b1a0b;
  --theme-btn-accent-bg-start-hover: #e7b581;
  --theme-btn-accent-bg-end-hover: #d68a4b;

  --theme-btn-danger-bg-start: #ca6a78;
  --theme-btn-danger-bg-end: #b14f5d;
  --theme-btn-danger-border: #bd5f6d;
  --theme-btn-danger-text: #fff7f9;
  --theme-btn-danger-bg-start-hover: #d47986;
  --theme-btn-danger-bg-end-hover: #bf5d6b;

  --theme-shadow-surface: 0 15px 30px rgba(18, 34, 56, 0.14), 0 4px 10px rgba(18, 34, 56, 0.09);
  --theme-shadow-surface-soft: 0 6px 16px rgba(18, 34, 56, 0.08);
}

/* legacy token compatibility */
body {
  --bg: var(--theme-color-bg-canvas);
  --bg-strong: var(--theme-color-bg-canvas-alt);
  --panel: var(--theme-color-surface-base);
  --panel-soft: var(--theme-color-surface-raised);
  --ink: var(--theme-color-text-primary);
  --ink-soft: var(--theme-color-text-muted);
  --line: var(--theme-color-border-subtle);
  --line-strong: var(--theme-color-border-strong);
  --accent: var(--theme-btn-primary-bg-end);
  --accent-2: var(--theme-btn-primary-bg-start);
  --accent-soft: var(--theme-color-surface-overlay);
  --accent-warm: var(--theme-btn-accent-bg-end);
  --accent-warm-2: var(--theme-btn-accent-bg-start);
  --accent-warm-soft: var(--theme-color-timeline-accent-bg);
  --success-bg: var(--theme-color-presence-online-bg);
  --success-ink: var(--theme-color-presence-online-ink);
  --muted-bg: var(--theme-color-presence-offline-bg);
  --muted-ink: var(--theme-color-presence-offline-ink);
  --danger: var(--theme-btn-danger-bg-end);
  --shadow: var(--theme-shadow-surface);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1020px 700px at -12% -18%, var(--theme-color-bg-glow-accent), transparent 64%),
    radial-gradient(920px 620px at 106% 112%, var(--theme-color-bg-glow-primary), transparent 66%),
    linear-gradient(180deg, var(--theme-color-bg-canvas-alt) 0%, var(--theme-color-bg-canvas) 100%);
  color: var(--theme-color-text-primary);
}

.topbar {
  background: linear-gradient(135deg, var(--theme-color-topbar-bg-start), var(--theme-color-topbar-bg-end));
  border-bottom: 2px solid var(--theme-color-topbar-border);
  box-shadow: var(--theme-shadow-surface);
  color: var(--theme-color-topbar-subtext);
}

.topbar h1,
.brand-text h1,
.ticket-subject-head {
  color: var(--theme-color-topbar-text);
}

.ticket-subject-head {
  color: var(--theme-color-topbar-subtext);
}

.brand-logo {
  border-color: transparent;
  background: transparent;
}

.page-tabs,
.icon-toolbar,
.ticket-context-actions {
  background: color-mix(in srgb, var(--theme-color-surface-overlay) 84%, transparent);
  border-color: color-mix(in srgb, var(--theme-color-border-subtle) 84%, transparent);
}

.page-tabs .page-tab {
  color: var(--theme-color-topbar-tab-inactive);
}

.page-tabs .page-tab:hover {
  color: var(--theme-color-topbar-text);
  background: color-mix(in srgb, var(--theme-btn-primary-bg-end) 36%, var(--theme-color-surface-overlay) 64%);
  border-color: color-mix(in srgb, var(--theme-btn-primary-bg-start) 46%, var(--theme-color-border-subtle) 54%);
}

.page-tabs .page-tab-active,
.page-tabs .page-tab-active:hover {
  color: var(--theme-btn-accent-text);
  background: linear-gradient(180deg, var(--theme-btn-accent-bg-start), var(--theme-btn-accent-bg-end));
  border-color: var(--theme-btn-accent-border);
}

body.theme-light .page-tabs,
html[data-theme="light"] body .page-tabs {
  background: color-mix(in srgb, var(--theme-color-topbar-bg-end) 30%, #ffffff 70%);
  border-color: color-mix(in srgb, var(--theme-color-topbar-bg-end) 42%, #ffffff 58%);
}

body.theme-light .page-tabs .page-tab,
html[data-theme="light"] body .page-tabs .page-tab {
  color: var(--theme-color-topbar-tab-inactive);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.theme-light .page-tabs .page-tab:hover,
html[data-theme="light"] body .page-tabs .page-tab:hover {
  background: color-mix(in srgb, var(--theme-color-topbar-bg-end) 48%, transparent);
  border-color: color-mix(in srgb, var(--theme-color-topbar-text) 26%, var(--theme-color-topbar-bg-end) 74%);
}

body.theme-light .page-tabs .page-tab.page-tab-active,
body.theme-light .page-tabs .page-tab.page-tab-active:hover,
html[data-theme="light"] body .page-tabs .page-tab.page-tab-active,
html[data-theme="light"] body .page-tabs .page-tab.page-tab-active:hover {
  color: var(--theme-btn-accent-text);
  background: linear-gradient(180deg, var(--theme-btn-accent-bg-start), var(--theme-btn-accent-bg-end));
  border-color: var(--theme-btn-accent-border);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffffff 42%, transparent);
}

.panel,
.card,
.kpi-card,
.chat-fixed-sidebar,
.chat-fixed-head,
.chat-side,
.modal,
.modal-card,
.autocomplete-menu,
table,
.timeline-item,
.chat-detail,
.attachment-thumb,
.attachment-link,
.drop-area,
.drop-file-item {
  background: linear-gradient(170deg, color-mix(in srgb, var(--theme-color-surface-base) 92%, #ffffff 8%), var(--theme-color-surface-base));
  border-color: var(--theme-color-border-subtle);
  color: var(--theme-color-text-primary);
}

.panel,
.card,
.kpi-card {
  box-shadow: var(--theme-shadow-surface);
}

thead th {
  background: color-mix(in srgb, var(--theme-color-surface-raised) 92%, #ffffff 8%);
  color: var(--theme-color-text-primary);
  border-bottom-color: var(--theme-color-border-subtle);
}

tbody tr:hover {
  background: color-mix(in srgb, var(--theme-btn-primary-bg-end) 14%, var(--theme-color-surface-base) 86%);
}

label,
strong,
.status-legend-label,
.bar-label,
.column-label,
h2,
h3,
.panel h2,
.panel h3,
.card h2,
.card h3 {
  color: var(--theme-color-text-primary);
}

p,
li,
td,
th,
span {
  color: var(--theme-color-text-primary);
}

.hint-text,
.timeline-time,
.status-legend-value,
.bar-value,
.column-value,
.drop-file-name,
.autocomplete-option-email,
.wait-progress-label {
  color: var(--theme-color-text-muted);
}

a,
.timeline-more > summary {
  color: var(--theme-color-link);
}

a:hover,
.timeline-more > summary:hover {
  color: var(--theme-color-link-hover);
}

.timeline-more > summary {
  background: transparent;
}

input,
select,
textarea,
.quick-action-form select {
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-color-surface-raised) 90%, #ffffff 10%), var(--theme-color-surface-raised));
  border-color: var(--theme-color-border-strong);
  color: var(--theme-color-text-primary);
}

input::placeholder,
textarea::placeholder {
  color: var(--theme-color-text-muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--theme-color-border-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-color-focus-ring) 34%, transparent);
}

pre {
  white-space: pre-wrap;
  background: var(--theme-color-code-bg);
  border: 1px solid var(--theme-color-code-border);
  color: var(--theme-color-code-text);
}

.timeline-item.timeline-accent:not(.chat-summary) pre,
.role-operator .timeline-item.chat-customer pre,
.role-customer .timeline-item.chat-operator pre,
.role-operator .chat-detail.chat-customer pre,
.role-customer .chat-detail.chat-operator pre {
  background: var(--theme-color-code-accent-bg);
  border-color: var(--theme-color-code-accent-border);
  color: var(--theme-color-code-accent-text);
}

.timeline-item {
  background: linear-gradient(170deg, color-mix(in srgb, var(--theme-color-timeline-item-bg) 92%, #ffffff 8%), var(--theme-color-timeline-item-bg));
  border-color: var(--theme-color-timeline-item-border);
  box-shadow: var(--theme-shadow-surface-soft);
  transition: none;
}

.timeline-item:hover {
  transform: none;
  border-color: var(--theme-color-timeline-item-border);
  background: linear-gradient(170deg, color-mix(in srgb, var(--theme-color-timeline-item-bg) 92%, #ffffff 8%), var(--theme-color-timeline-item-bg));
}

.timeline-item.email-in,
.timeline-item.email-out,
.timeline-item.note-internal,
.timeline-item.chat-operator,
.timeline-item.chat-customer,
.role-operator .timeline-item.chat-operator,
.role-customer .timeline-item.chat-customer {
  background: linear-gradient(170deg, color-mix(in srgb, var(--theme-color-timeline-item-bg) 92%, #ffffff 8%), var(--theme-color-timeline-item-bg));
  border-left-color: color-mix(in srgb, var(--theme-btn-primary-bg-end) 52%, var(--theme-color-timeline-item-border) 48%);
}

.timeline-item.email-in .timeline-icon,
.timeline-item.email-out .timeline-icon,
.timeline-item.note-internal .timeline-icon,
.timeline-item.chat-operator .timeline-icon,
.timeline-item.chat-customer .timeline-icon,
.role-operator .timeline-item.chat-operator .timeline-icon,
.role-customer .timeline-item.chat-customer .timeline-icon {
  background: var(--theme-color-timeline-icon-bg);
  color: var(--theme-color-timeline-icon-ink);
}

.timeline-icon {
  background: var(--theme-color-timeline-icon-bg);
  color: var(--theme-color-timeline-icon-ink);
  border-color: color-mix(in srgb, var(--theme-color-timeline-icon-ink) 38%, var(--theme-color-border-subtle) 62%);
}

.timeline-item.timeline-accent,
.timeline-item.chat-summary,
.role-operator .timeline-item.chat-customer,
.role-customer .timeline-item.chat-operator,
.role-operator .chat-detail.chat-customer,
.role-customer .chat-detail.chat-operator {
  background: linear-gradient(168deg, color-mix(in srgb, var(--theme-color-timeline-accent-bg) 92%, #ffffff 8%), var(--theme-color-timeline-accent-bg));
  border-left-color: var(--theme-color-timeline-accent-border);
}

.timeline-item.timeline-accent .timeline-icon,
.timeline-item.chat-summary .timeline-icon,
.role-operator .timeline-item.chat-customer .timeline-icon,
.role-customer .timeline-item.chat-operator .timeline-icon {
  background: color-mix(in srgb, var(--theme-color-timeline-accent-border) 18%, var(--theme-color-surface-raised) 82%);
  color: var(--theme-color-timeline-accent-ink);
}

.timeline-item.chat-summary .timeline-more {
  border-top-color: var(--theme-color-timeline-divider);
}

.timeline-item.chat-summary .timeline-more > summary {
  color: var(--theme-color-timeline-accent-ink);
  background: transparent;
}

.chat-detail {
  border-left-color: var(--theme-color-timeline-item-border);
  background: linear-gradient(168deg, color-mix(in srgb, var(--theme-color-surface-raised) 92%, #ffffff 8%), var(--theme-color-surface-raised));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-color-border-subtle) 74%, transparent);
}

.chat-detail.chat-operator,
.role-operator .chat-detail.chat-operator,
.role-customer .chat-detail.chat-customer {
  border-left-color: var(--theme-color-timeline-item-border);
  background: linear-gradient(168deg, color-mix(in srgb, var(--theme-color-surface-raised) 92%, #ffffff 8%), var(--theme-color-surface-raised));
}

.presence-badge {
  border-color: var(--theme-color-border-strong);
}

.presence-badge.online {
  background: var(--theme-color-presence-online-bg);
  color: var(--theme-color-presence-online-ink);
}

.presence-badge.offline {
  background: var(--theme-color-presence-offline-bg);
  color: var(--theme-color-presence-offline-ink);
}

.wait-progress,
.bar-track {
  background: color-mix(in srgb, var(--theme-color-surface-overlay) 72%, var(--theme-color-surface-base) 28%);
  border-color: var(--theme-color-border-subtle);
}

.table-wrap {
  border-color: var(--theme-color-table-wrap-border);
}

.kpi-card {
  border-left-color: var(--theme-color-kpi-primary-border);
}

.kpi-card-accent {
  border-left-color: var(--theme-color-kpi-accent-border);
}

.kpi-card-accent p {
  color: var(--theme-color-kpi-accent-text);
}

.status-pie {
  border-color: var(--theme-color-border-subtle);
}

.status-legend-row {
  border-bottom-color: color-mix(in srgb, var(--theme-color-border-subtle) 86%, transparent);
}

.status-legend-dot {
  border-color: color-mix(in srgb, var(--theme-color-border-strong) 58%, transparent);
}

.column-track {
  border-color: var(--theme-color-chart-track-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-color-chart-track-bg) 88%, #ffffff 12%), var(--theme-color-chart-track-bg));
}

.column-fill {
  background: linear-gradient(180deg, var(--theme-color-chart-accent-start), var(--theme-color-chart-accent-end));
}

.bar-fill {
  background: linear-gradient(90deg, var(--theme-color-chart-primary-start), var(--theme-color-chart-primary-end));
}

.bar-fill-accent {
  background: linear-gradient(90deg, var(--theme-color-chart-accent-start), var(--theme-color-chart-accent-end));
}

.operator-group-choice {
  border-color: color-mix(in srgb, var(--theme-color-border-subtle) 84%, transparent);
  background: color-mix(in srgb, var(--theme-color-surface-raised) 84%, #ffffff 16%);
  color: var(--theme-color-text-secondary);
}

.chat-grip {
  border-color: var(--theme-color-chat-grip-border);
  background: linear-gradient(180deg, var(--theme-color-chat-grip-bg-start), var(--theme-color-chat-grip-bg-end));
  color: var(--theme-color-chat-grip-text);
}

.chat-grip:hover {
  background: linear-gradient(180deg, var(--theme-btn-primary-bg-start-hover), var(--theme-btn-primary-bg-end-hover));
}

.attachment-thumb,
.attachment-link,
.drop-file-item,
.autocomplete-option,
.drop-area {
  border-color: color-mix(in srgb, var(--theme-color-border-subtle) 84%, #ffffff 16%);
}

.attachment-thumb,
.attachment-link {
  background: linear-gradient(168deg, color-mix(in srgb, var(--theme-color-attachment-bg) 90%, #ffffff 10%), var(--theme-color-attachment-bg));
  border-color: var(--theme-color-attachment-border);
}

.autocomplete-menu {
  border-color: var(--theme-color-border-strong);
}

.autocomplete-option {
  color: var(--theme-color-text-primary);
  border-bottom-color: var(--theme-color-border-subtle);
}

.autocomplete-option:hover,
.attachment-thumb:hover,
.attachment-link:hover,
.drop-area.drop-hover {
  background: color-mix(in srgb, var(--theme-btn-primary-bg-end) 14%, var(--theme-color-surface-base) 86%);
}

.attachment-thumb:hover,
.attachment-link:hover {
  background: linear-gradient(168deg, color-mix(in srgb, var(--theme-color-attachment-hover-bg) 90%, #ffffff 10%), var(--theme-color-attachment-hover-bg));
}

.timeline-item.timeline-accent:not(.chat-summary) .attachment-thumb,
.timeline-item.timeline-accent:not(.chat-summary) .attachment-link,
.role-operator .timeline-item.chat-customer .attachment-thumb,
.role-operator .timeline-item.chat-customer .attachment-link,
.role-customer .timeline-item.chat-operator .attachment-thumb,
.role-customer .timeline-item.chat-operator .attachment-link,
.role-operator .chat-detail.chat-customer .attachment-thumb,
.role-operator .chat-detail.chat-customer .attachment-link,
.role-customer .chat-detail.chat-operator .attachment-thumb,
.role-customer .chat-detail.chat-operator .attachment-link {
  background: linear-gradient(168deg, color-mix(in srgb, var(--theme-color-attachment-accent-bg) 90%, #ffffff 10%), var(--theme-color-attachment-accent-bg));
  border-color: var(--theme-color-attachment-accent-border);
}

.timeline-item.timeline-accent:not(.chat-summary) .attachment-thumb:hover,
.timeline-item.timeline-accent:not(.chat-summary) .attachment-link:hover,
.role-operator .timeline-item.chat-customer .attachment-thumb:hover,
.role-operator .timeline-item.chat-customer .attachment-link:hover,
.role-customer .timeline-item.chat-operator .attachment-thumb:hover,
.role-customer .timeline-item.chat-operator .attachment-link:hover,
.role-operator .chat-detail.chat-customer .attachment-thumb:hover,
.role-operator .chat-detail.chat-customer .attachment-link:hover,
.role-customer .chat-detail.chat-operator .attachment-thumb:hover,
.role-customer .chat-detail.chat-operator .attachment-link:hover {
  background: linear-gradient(168deg, color-mix(in srgb, var(--theme-color-attachment-accent-hover-bg) 90%, #ffffff 10%), var(--theme-color-attachment-accent-hover-bg));
}

.attachment-thumb img {
  border-color: var(--theme-color-border-subtle);
}

.modal::backdrop {
  background: color-mix(in srgb, var(--theme-color-bg-canvas) 74%, transparent);
}

button,
.button-link,
.preview-nav-btn {
  background: linear-gradient(180deg, var(--theme-btn-primary-bg-start), var(--theme-btn-primary-bg-end));
  border-color: var(--theme-btn-primary-border);
  color: var(--theme-btn-primary-text);
}

button:hover,
.button-link:hover,
.preview-nav-btn:hover {
  background: linear-gradient(180deg, var(--theme-btn-primary-bg-start-hover), var(--theme-btn-primary-bg-end-hover));
  border-color: color-mix(in srgb, var(--theme-btn-primary-border) 78%, var(--theme-color-border-subtle) 22%);
}

.icon-btn-primary,
.btn-primary,
.quick-icon-btn-status {
  background: linear-gradient(180deg, var(--theme-btn-primary-bg-start), var(--theme-btn-primary-bg-end));
  border-color: var(--theme-btn-primary-border);
  color: var(--theme-btn-primary-text);
}

.icon-btn-primary:hover,
.btn-primary:hover,
.quick-icon-btn-status:hover {
  background: linear-gradient(180deg, var(--theme-btn-primary-bg-start-hover), var(--theme-btn-primary-bg-end-hover));
}

.icon-btn-neutral,
.btn-neutral {
  background: linear-gradient(180deg, var(--theme-btn-neutral-bg-start), var(--theme-btn-neutral-bg-end));
  border-color: var(--theme-btn-neutral-border);
  color: var(--theme-btn-neutral-text);
}

.icon-btn-neutral:hover,
.btn-neutral:hover {
  background: linear-gradient(180deg, var(--theme-btn-neutral-bg-start-hover), var(--theme-btn-neutral-bg-end-hover));
}

.icon-btn-success,
.btn-success,
.quick-icon-btn-group,
.btn-warning {
  background: linear-gradient(180deg, var(--theme-btn-accent-bg-start), var(--theme-btn-accent-bg-end));
  border-color: var(--theme-btn-accent-border);
  color: var(--theme-btn-accent-text);
}

.icon-btn-success:hover,
.btn-success:hover,
.quick-icon-btn-group:hover,
.btn-warning:hover {
  background: linear-gradient(180deg, var(--theme-btn-accent-bg-start-hover), var(--theme-btn-accent-bg-end-hover));
}

.icon-btn-danger,
.btn-danger,
.drop-file-remove {
  background: linear-gradient(180deg, var(--theme-btn-danger-bg-start), var(--theme-btn-danger-bg-end));
  border-color: var(--theme-btn-danger-border);
  color: var(--theme-btn-danger-text);
}

.icon-btn-danger:hover,
.btn-danger:hover,
.drop-file-remove:hover {
  background: linear-gradient(180deg, var(--theme-btn-danger-bg-start-hover), var(--theme-btn-danger-bg-end-hover));
}

.topbar .icon-btn-primary {
  border: 1px solid var(--theme-btn-primary-border) !important;
}

.topbar .icon-btn-neutral {
  border: 1px solid var(--theme-btn-neutral-border) !important;
}

.topbar .icon-btn-success {
  border: 1px solid var(--theme-btn-accent-border) !important;
}

.topbar .icon-btn-danger {
  border: 1px solid var(--theme-btn-danger-border) !important;
}

.icon-btn-active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-color-text-on-strong) 28%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .timeline-item,
  .icon-btn,
  .btn-primary,
  .btn-neutral,
  .btn-success,
  .btn-warning,
  .btn-danger {
    transition: none;
  }
}
