/* Unified panel UI system — derived from UI提示词(1).txt. Loaded last. */
:root{
  --ui-bg:#f5f8fc;
  --ui-surface:#ffffff;
  --ui-soft:#f7f9fc;
  --ui-soft-blue:#eef6ff;
  --ui-primary:#1677ff;
  --ui-primary-hover:#0f69e8;
  --ui-primary-soft:#f2f8ff;
  --ui-line:#dce7f3;
  --ui-line-strong:#c8d8e8;
  --ui-text:#24364b;
  --ui-text-2:#52677d;
  --ui-muted:#7e90a3;
  --ui-success:#25885f;
  --ui-success-bg:#edf9f3;
  --ui-warning:#a96c12;
  --ui-warning-bg:#fff7e8;
  --ui-danger:#c34b4b;
  --ui-danger-bg:#fff2f2;
  --ui-radius:9px;
  --ui-radius-sm:7px;
  --ui-control:32px;
  --ui-control-sm:28px;
  --ui-shadow:0 2px 8px rgba(38,76,116,.045);
  --ui-font:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
}

/* ---------- shared ---------- */
body.saas-admin,body.platform-body,body.support-desk-page,body.login-body,body.support-login-body,body.panel-auth-page{
  font-family:var(--ui-font)!important;
  color:var(--ui-text)!important;
  background:var(--ui-bg)!important;
  font-size:13px!important;
  line-height:1.5;
  font-synthesis:none;
}
body.saas-admin *,body.platform-body *,body.support-desk-page *,body.login-body *,body.support-login-body *,body.panel-auth-page *{box-sizing:border-box}
body.saas-admin button,body.saas-admin input,body.saas-admin select,body.saas-admin textarea,
body.platform-body button,body.platform-body input,body.platform-body select,body.platform-body textarea,
body.support-desk-page button,body.support-desk-page input,body.support-desk-page select,body.support-desk-page textarea,
body.login-body button,body.login-body input,body.support-login-body button,body.support-login-body input,
body.panel-auth-page button,body.panel-auth-page input{font-family:var(--ui-font)}

body.saas-admin :focus-visible,body.platform-body :focus-visible,body.support-desk-page :focus-visible,
body.login-body :focus-visible,body.support-login-body :focus-visible,body.panel-auth-page :focus-visible{
  outline:0!important;
  box-shadow:0 0 0 3px rgba(22,119,255,.14)!important;
  border-color:#6aa9ff!important;
}

/* Fixed control rhythm. */
body.saas-admin input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
body.saas-admin select,
body.platform-body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
body.platform-body select{
  min-height:var(--ui-control)!important;
  height:var(--ui-control);
  padding:5px 9px!important;
  border:1px solid var(--ui-line-strong)!important;
  border-radius:var(--ui-radius-sm)!important;
  background:#fff!important;
  color:var(--ui-text)!important;
  font-size:12px!important;
  box-shadow:none!important;
}
body.saas-admin textarea,body.platform-body textarea{
  padding:7px 9px!important;
  border:1px solid var(--ui-line-strong)!important;
  border-radius:var(--ui-radius-sm)!important;
  background:#fff!important;
  color:var(--ui-text)!important;
  font-size:12px!important;
  box-shadow:none!important;
}
body.saas-admin label,body.platform-body label{color:var(--ui-text-2)!important;font-size:11px!important}

/* Buttons: one size system. */
body.saas-admin .primary,body.saas-admin .secondary,body.saas-admin .button-link,body.saas-admin .danger-solid,body.saas-admin .danger-button,
body.saas-admin .accounts-content button,body.platform-body .btn,
body.support-desk-page button:not(.notification-item):not(.quick-reply-item):not(.ticket):not(.attachment-card){
  min-height:var(--ui-control-sm)!important;
  height:auto;
  padding:5px 10px!important;
  border-radius:var(--ui-radius-sm)!important;
  font-size:11px!important;
  font-weight:600!important;
  line-height:1.35!important;
  box-shadow:none!important;
  transition:background-color .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease,transform .15s ease!important;
}
body.saas-admin .primary,body.platform-body .btn.primary,body.saas-admin .agent-primary-button{
  background:var(--ui-primary)!important;border-color:var(--ui-primary)!important;color:#fff!important;
}
body.saas-admin .primary:hover,body.platform-body .btn.primary:hover,body.saas-admin .agent-primary-button:hover{background:var(--ui-primary-hover)!important;border-color:var(--ui-primary-hover)!important}
body.saas-admin .secondary,body.saas-admin .button-link,body.platform-body .btn:not(.primary):not(.danger){
  background:#fff!important;border:1px solid var(--ui-line-strong)!important;color:#41698e!important;
}
body.saas-admin .secondary:hover,body.saas-admin .button-link:hover,body.platform-body .btn:not(.primary):not(.danger):hover{background:var(--ui-primary-soft)!important;border-color:#b8d5f4!important;color:#245f9c!important}
body.saas-admin .danger-button,body.saas-admin .danger-solid,body.platform-body .btn.danger{background:var(--ui-danger-bg)!important;border-color:#f0caca!important;color:var(--ui-danger)!important}
body.saas-admin button:active,body.platform-body .btn:active,body.support-desk-page button:active{transform:scale(.985)}

/* Badges. */
body.saas-admin .security-chip,body.saas-admin .model-chip,body.saas-admin .conversation-state,
body.platform-body .status-badge,body.support-desk-page .presence-state{
  min-height:20px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:2px 7px!important;
  border-radius:6px!important;
  font-size:10px!important;
  line-height:1!important;
  font-weight:600!important;
}
body.platform-body .status-badge.enabled{background:var(--ui-success-bg)!important;color:var(--ui-success)!important}
body.platform-body .status-badge.disabled{background:var(--ui-warning-bg)!important;color:var(--ui-warning)!important}

/* ---------- tenant user panel ---------- */
body.saas-admin{--brand:var(--ui-primary);--brand-dark:var(--ui-primary-hover);--text:var(--ui-text);--muted:var(--ui-muted);--line:var(--ui-line);--bg:var(--ui-bg)}
body.saas-admin .admin-shell{grid-template-columns:210px minmax(0,1fr)!important;background:var(--ui-bg)}
body.saas-admin .sidebar{
  width:210px!important;padding:12px 10px!important;background:#fff!important;border-right:1px solid var(--ui-line)!important;
}
body.saas-admin .sidebar .brand{min-height:48px;padding:4px 7px 10px!important;margin-bottom:2px;border-bottom:1px solid #edf2f7}
body.saas-admin .sidebar .brand>div{width:30px!important;height:30px!important;border-radius:8px!important;background:var(--ui-primary)!important;font-size:12px!important}
body.saas-admin .sidebar .brand strong{font-size:13px!important;color:var(--ui-text)!important;font-weight:650!important}
body.saas-admin .sidebar .brand small{font-size:10px!important;color:var(--ui-muted)!important}
body.saas-admin .sidebar nav{gap:5px!important;padding:4px 0 8px!important;align-content:start!important}
body.saas-admin .nav-group{margin:0!important}
body.saas-admin .nav-group>summary{
  min-height:25px!important;padding:5px 7px!important;color:#74889d!important;font-size:10px!important;font-weight:650!important;letter-spacing:.02em!important;
}
body.saas-admin .nav-group-links{position:relative;display:grid!important;gap:4px!important;padding:2px 0 3px 9px!important}
body.saas-admin .nav-group-links:before{content:"";position:absolute;left:4px;top:3px;bottom:4px;width:1px;background:#e6edf5}
body.saas-admin .sidebar .nav-group-links a{
  position:relative;width:100%!important;min-height:34px!important;margin:0!important;padding:7px 9px 7px 12px!important;
  border:1px solid #e4edf6!important;border-radius:8px!important;background:#f9fbfd!important;color:#5e748a!important;font-size:11.5px!important;font-weight:550!important;
}
body.saas-admin .sidebar .nav-group-links a:before{content:"";position:absolute;left:-6px;top:50%;width:6px;height:1px;background:#e1eaf3}
body.saas-admin .sidebar .nav-group-links a:hover{background:var(--ui-primary-soft)!important;border-color:#cfe2f7!important;color:#315f8c!important;transform:none!important;box-shadow:var(--ui-shadow)!important}
body.saas-admin .sidebar .nav-group-links a.active{
  background:var(--ui-soft-blue)!important;border-color:#9dc9f6!important;color:#145da8!important;font-weight:650!important;box-shadow:inset 2px 0 var(--ui-primary)!important;
}
body.saas-admin .sidebar .nav-dot{width:4px!important;height:4px!important;background:#aebdcb!important}.sidebar .active .nav-dot{background:var(--ui-primary)!important}
body.saas-admin .side-bottom{gap:5px!important;padding-top:8px!important;border-top:1px solid var(--ui-line)!important}
body.saas-admin .side-bottom .side-action{
  min-height:34px!important;padding:6px 8px!important;border:1px solid #e4edf6!important;border-radius:8px!important;background:#f9fbfd!important;color:#5c7288!important;
}
body.saas-admin .side-bottom .side-action:hover{background:var(--ui-primary-soft)!important;border-color:#cfe2f7!important;transform:none!important}
body.saas-admin .side-action-icon{width:23px!important;height:23px!important;border-radius:6px!important;background:#edf5fe!important;color:#4b7ca8!important}
body.saas-admin .side-action strong{font-size:11px!important;color:inherit!important}.side-action b{font-size:11px!important}
body.saas-admin .side-bottom .logout-entry{background:#fffafa!important;border-color:#f1dada!important;color:#ad5858!important}

body.saas-admin .admin-main{width:calc(100vw - 210px)!important}
body.saas-admin .topbar{
  height:50px!important;min-height:50px!important;padding:0 18px!important;background:rgba(255,255,255,.98)!important;border-bottom:1px solid var(--ui-line)!important;box-shadow:none!important;
}
body.saas-admin .topbar h1{margin:0!important;font-size:17px!important;line-height:1.25!important;color:var(--ui-text)!important;font-weight:650!important;letter-spacing:0!important}
body.saas-admin .topbar p{margin:2px 0 0!important;font-size:10px!important;color:var(--ui-muted)!important;line-height:1.3!important}
body.saas-admin .top-status{font-size:10px!important;color:var(--ui-muted)!important}
body.saas-admin .content{max-width:1440px!important;padding:14px 18px 42px!important}
body.saas-admin .page-head{margin-bottom:10px!important;align-items:center!important}.page-head h2{font-size:16px!important}.page-head p{font-size:11px!important}

body.saas-admin .panel,body.saas-admin .edit-card,body.saas-admin .account-table,body.saas-admin .channel-card,
body.saas-admin .agent-card,body.saas-admin .agent-create-form{
  border:1px solid var(--ui-line)!important;border-radius:var(--ui-radius)!important;background:#fff!important;box-shadow:var(--ui-shadow)!important;
}
body.saas-admin .panel{padding:12px!important;margin-bottom:10px!important}
body.saas-admin .edit-card{padding:12px!important}
body.saas-admin .panel h2,body.saas-admin .panel h3,body.saas-admin .edit-card h2,body.saas-admin .edit-card h3{font-size:14px!important;color:var(--ui-text)!important;margin-bottom:9px!important}
body.saas-admin .help,body.saas-admin .field-help{font-size:10.5px!important;color:var(--ui-muted)!important;line-height:1.55!important}

/* statistics */
body.saas-admin .stats{gap:8px!important;margin-bottom:10px!important}
body.saas-admin .stats>a,body.saas-admin .stats>div,body.saas-admin .monitor-card{
  min-height:82px!important;padding:11px 12px!important;border:1px solid var(--ui-line)!important;border-radius:var(--ui-radius)!important;background:#fff!important;box-shadow:var(--ui-shadow)!important;
}
body.saas-admin .stats span,body.saas-admin .monitor-card span{font-size:10.5px!important;color:var(--ui-muted)!important}
body.saas-admin .stats strong,body.saas-admin .monitor-card strong{margin:5px 0 3px!important;font-size:20px!important;line-height:1.2!important;color:#24496f!important;font-weight:650!important;font-variant-numeric:tabular-nums}
body.saas-admin .stats p,body.saas-admin .monitor-card p{font-size:9.5px!important;color:#91a0ae!important;line-height:1.4!important}
body.saas-admin .overview-stats-primary{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.saas-admin .overview-stats-secondary{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-width:50%!important}

/* Tables */
body.saas-admin table{border-collapse:collapse;color:var(--ui-text-2);font-size:11px}
body.saas-admin th{height:31px!important;padding:6px 8px!important;background:#f7faff!important;color:#6f8398!important;font-size:10px!important;font-weight:650!important;white-space:nowrap;border-bottom:1px solid var(--ui-line)!important}
body.saas-admin td{padding:7px 8px!important;border-bottom:1px solid #e8eff6!important;vertical-align:middle!important}
body.saas-admin tr:last-child td{border-bottom:0!important}
body.saas-admin tbody tr:hover{background:#fbfdff}
body.saas-admin .account-table,body.saas-admin .channel-log-wrap{overflow:auto!important;border:1px solid var(--ui-line)!important;border-radius:var(--ui-radius)!important;background:#fff!important}

/* Compact tabs / filters / toolbars */
body.saas-admin .filter-tabs{gap:5px!important;margin-bottom:10px!important}
body.saas-admin .filter-tabs a{min-height:28px!important;padding:5px 9px!important;border:1px solid var(--ui-line)!important;border-radius:7px!important;background:#fff!important;color:#60778d!important;font-size:10.5px!important}
body.saas-admin .filter-tabs a.active{background:var(--ui-soft-blue)!important;border-color:#a9cff5!important;color:#1d66ad!important}
body.saas-admin .actions{gap:7px!important;margin-top:10px!important}
body.saas-admin .sticky-actions{padding:8px 10px!important;border:1px solid var(--ui-line)!important;border-radius:8px!important;box-shadow:0 3px 12px rgba(37,80,120,.06)!important}

/* Customer-service account management */
body.saas-admin .accounts-content{display:grid!important;gap:11px!important}
body.saas-admin .agent-create-section,body.saas-admin .agent-list-section{margin:0!important;padding:0!important}
body.saas-admin .accounts-section-copy h2,body.saas-admin .accounts-section-head h2{margin:0!important;font-size:15px!important;color:var(--ui-text)!important}
body.saas-admin .accounts-section-copy p{margin:2px 0 8px!important;color:var(--ui-muted)!important;font-size:10.5px!important}
body.saas-admin .agent-create-form{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr)) auto!important;gap:8px!important;padding:10px!important;align-items:end!important;margin:0!important}
body.saas-admin .agent-create-form label{margin:0!important}.agent-create-form label input{margin-top:4px!important}
body.saas-admin .agent-primary-button{height:32px!important;min-height:32px!important;white-space:nowrap!important}
body.saas-admin .account-status-message{min-height:0!important;margin:5px 0!important;padding:6px 8px!important;border-radius:7px!important;font-size:10px!important}
body.saas-admin .accounts-section-head{margin:0 0 8px!important;align-items:end!important}
body.saas-admin .account-view-switch{display:grid!important;grid-template-columns:repeat(2,58px)!important;gap:3px!important;padding:3px!important;border:1px solid var(--ui-line)!important;border-radius:8px!important;background:#f6f9fc!important}
body.saas-admin .account-view-switch button{height:26px!important;min-height:26px!important;padding:3px 7px!important;border:0!important;background:transparent!important;color:#71859a!important}
body.saas-admin .account-view-switch button.is-active{background:#fff!important;color:#2367ab!important;box-shadow:0 1px 4px rgba(34,75,115,.08)!important}
body.saas-admin .account-view-switch .view-icon{display:none!important}
body.saas-admin .agent-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important}
body.saas-admin .agent-card{padding:10px!important;min-height:0!important}
body.saas-admin .agent-card-main{gap:8px!important}.agent-avatar{width:32px!important;height:32px!important;flex-basis:32px!important;border-radius:8px!important;background:var(--ui-soft-blue)!important;color:#2367ab!important;font-size:12px!important}
body.saas-admin .agent-name-row strong{font-size:12px!important}.agent-username{font-size:9.5px!important;color:var(--ui-muted)!important}
body.saas-admin .agent-enable-badge{height:19px!important;padding:2px 6px!important;font-size:9px!important;border-radius:6px!important}
body.saas-admin .agent-card-metrics{display:grid!important;grid-template-columns:repeat(2,1fr)!important;gap:0!important;margin:8px 0 0!important;border-top:1px solid #edf2f7!important;border-bottom:1px solid #edf2f7!important}
body.saas-admin .agent-card-metrics>div{padding:7px 5px!important;background:transparent!important;border:0!important;border-right:1px solid #edf2f7!important;border-radius:0!important}.agent-card-metrics>div:last-child{border-right:0!important}
body.saas-admin .agent-card-metrics span{font-size:9px!important;color:var(--ui-muted)!important}.agent-card-metrics strong{font-size:15px!important;color:#315875!important;font-variant-numeric:tabular-nums}
body.saas-admin .agent-card-details summary{min-height:28px!important;margin-top:7px!important;padding:5px 7px!important;border:1px solid var(--ui-line)!important;border-radius:7px!important;background:#f8fbfe!important;color:#5c748a!important;font-size:10.5px!important}
body.saas-admin .agent-detail-body{padding-top:7px!important}.agent-detail-row{min-height:32px!important;padding:5px 0!important}.agent-detail-row span{font-size:10px!important}
body.saas-admin .agent-manage-form{gap:6px!important}.agent-manage-form button{min-height:28px!important}.agent-manage-form input{min-height:30px!important;height:30px!important}
body.saas-admin .account-table-view{border:1px solid var(--ui-line)!important;border-radius:9px!important;overflow:auto!important;background:#fff!important}

/* channels */
body.saas-admin .channel-grid{gap:9px!important;grid-template-columns:repeat(auto-fit,minmax(300px,1fr))!important}
body.saas-admin .channel-card{padding:12px!important}.channel-card h2{margin:0 0 3px!important;font-size:14px!important}.channel-card p{margin:6px 0!important}.channel-card label{margin:7px 0 3px!important;font-size:10.5px!important}.channel-card button{min-height:28px!important;height:28px!important;padding:4px 9px!important;background:#fff!important;border:1px solid var(--ui-line-strong)!important;color:#41698e!important}.channel-card button[name=action][value=save]{background:var(--ui-primary)!important;border-color:var(--ui-primary)!important;color:#fff!important}.channel-card .code{padding:7px!important;background:#f6f9fc!important;border:1px solid #e5edf5!important}

/* ---------- platform administrator ---------- */
body.platform-body{--accent:var(--ui-primary);--ink:var(--ui-text);--muted:var(--ui-muted);--line:var(--ui-line);--bg:var(--ui-bg)}
body.platform-body .platform-shell{grid-template-columns:210px minmax(0,1fr)!important;background:var(--ui-bg)!important}
body.platform-body .platform-sidebar{width:210px!important;padding:12px 10px!important;background:#fff!important;border-right:1px solid var(--ui-line)!important;color:var(--ui-text-2)!important;box-shadow:none!important;gap:8px!important}
body.platform-body .platform-brand{min-height:48px!important;padding:4px 7px 10px!important;border-bottom:1px solid #edf2f7!important;color:var(--ui-text)!important;font-size:13px!important}
body.platform-body .brand-symbol{flex-basis:30px!important;height:30px!important;border-radius:8px!important;background:var(--ui-primary)!important;font-size:12px!important;box-shadow:none!important}
body.platform-body .platform-brand small{font-size:9.5px!important;color:var(--ui-muted)!important}
body.platform-body .platform-sidebar nav{gap:7px!important;padding-top:4px!important}.platform-nav-group{display:grid;gap:3px}.platform-nav-label{padding:3px 7px!important;color:#768a9d!important;font-size:9.5px!important;font-weight:650!important}
body.platform-body .platform-nav-links{position:relative;display:grid!important;gap:4px!important;padding-left:9px!important}.platform-nav-links:before{content:"";position:absolute;left:4px;top:2px;bottom:2px;width:1px;background:#e6edf5}
body.platform-body .platform-sidebar nav a{position:relative;min-height:34px!important;padding:7px 9px 7px 12px!important;border:1px solid #e4edf6!important;border-radius:8px!important;background:#f9fbfd!important;color:#5e748a!important;font-size:11.5px!important;font-weight:550!important}
body.platform-body .platform-sidebar nav a:before{content:"";position:absolute;left:-6px;top:50%;width:6px;height:1px;background:#e1eaf3}.platform-sidebar nav a:hover{background:var(--ui-primary-soft)!important;border-color:#cfe2f7!important;color:#315f8c!important;transform:none!important}.platform-sidebar nav a.active{background:var(--ui-soft-blue)!important;border-color:#9dc9f6!important;color:#145da8!important;font-weight:650!important;box-shadow:inset 2px 0 var(--ui-primary)!important}
body.platform-body .platform-sidebar nav small{margin-left:auto!important;font-size:9px!important;color:#72879b!important}
body.platform-body .platform-side-footer{margin-top:auto!important;padding:8px 7px 0!important;border-top:1px solid var(--ui-line)!important;color:var(--ui-muted)!important;font-size:10px!important;gap:5px!important}.platform-logout{min-height:32px!important;padding:6px 8px!important;border:1px solid #f1dada!important;border-radius:8px!important;background:#fffafa!important;color:#ad5858!important}
body.platform-body .platform-main{grid-column:2!important;width:calc(100vw - 210px)!important}
body.platform-body .platform-topbar{height:50px!important;min-height:50px!important;padding:0 18px!important;background:#fff!important;border-bottom:1px solid var(--ui-line)!important;box-shadow:none!important}.platform-topbar>span{font-size:11px!important;color:var(--ui-muted)!important}.avatar-label{min-height:28px!important;padding:5px 9px!important;border:1px solid var(--ui-line)!important;border-radius:7px!important;background:#f8fbfe!important;color:#4e718f!important;font-size:10px!important}
body.platform-body .platform-content{max-width:1480px!important;padding:14px 18px 42px!important}.platform-page-heading{margin-bottom:10px!important;align-items:center!important}.platform-page-heading .eyebrow{display:none!important}.platform-page-heading h1{margin:0 0 2px!important;font-size:18px!important;line-height:1.25!important;color:var(--ui-text)!important;font-weight:650!important}.platform-page-heading .muted{font-size:10px!important;color:var(--ui-muted)!important}
body.platform-body .platform-card,body.platform-body .stat-card,body.platform-body .platform-filters{border:1px solid var(--ui-line)!important;border-radius:var(--ui-radius)!important;background:#fff!important;box-shadow:var(--ui-shadow)!important}.platform-card{padding:12px!important;margin-bottom:10px!important}.platform-stats{gap:8px!important;margin-bottom:10px!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}.stat-card{min-height:82px!important;padding:11px 12px!important}.stat-card span{font-size:10.5px!important;color:var(--ui-muted)!important}.stat-card strong{margin:5px 0 3px!important;font-size:20px!important;color:#24496f!important;font-weight:650!important;font-variant-numeric:tabular-nums}.stat-card small{font-size:9.5px!important;color:#91a0ae!important}
body.platform-body .platform-two-col,body.platform-body .user-grid{gap:9px!important}.section-heading{margin-bottom:8px!important}.section-heading h2{font-size:14px!important}.section-heading a{font-size:10.5px!important;color:#2367ab!important}
body.platform-body .platform-filters{display:grid!important;grid-template-columns:minmax(200px,1.4fr) minmax(150px,1fr) minmax(120px,.7fr) auto auto!important;gap:7px!important;padding:9px!important;align-items:end!important}.platform-filters label{margin:0!important}.platform-filters .btn{height:32px!important;min-height:32px!important}
body.platform-body .compact-row,body.platform-body .health-row{padding:8px 0!important;border-color:#e8eff6!important}.compact-row strong,.health-row strong{font-size:11.5px!important}.compact-row small,.health-row p{font-size:10px!important;color:var(--ui-muted)!important}
body.platform-body .user-card{padding:11px!important}.user-card .section-heading{align-items:center!important}.user-card .muted{font-size:10px!important}.user-entry-list{padding:3px 8px!important;border:1px solid #e7eef6!important;border-radius:7px!important;background:#f8fbfe!important}.user-entry-list>div{padding:6px 0!important}.user-entry-list span,.user-entry-list a,.user-entry-list button{font-size:10px!important}.user-card-actions{gap:6px!important;margin-top:8px!important}.user-more>summary{min-height:28px!important;padding:5px 8px!important;border:1px solid var(--ui-line)!important;border-radius:7px!important;background:#f8fbfe!important;color:#5c748a!important;font-size:10.5px!important}.user-management-forms{gap:10px!important;margin-top:8px!important}.user-management-forms form{padding-top:9px!important;gap:6px!important}
body.platform-body .support-directory-user{border-top:1px solid #e7eef5}.support-directory-user>summary{min-height:36px!important;padding:7px 4px!important;font-size:11px!important}.support-directory-table{overflow:auto!important}.support-directory-table table{min-width:760px;width:100%;border-collapse:collapse}.support-directory-table th{height:31px;padding:6px 8px;background:#f7faff;color:#6f8398;font-size:10px;font-weight:650;text-align:left;border-bottom:1px solid var(--ui-line)}.support-directory-table td{padding:7px 8px;border-bottom:1px solid #e8eff6;font-size:10.5px;vertical-align:middle}.inline-admin-form{display:inline-flex!important;align-items:center!important;gap:4px!important;margin:2px!important}.inline-admin-form input[type=password]{width:110px!important;height:28px!important;min-height:28px!important}.inline-admin-form .btn{height:28px!important;min-height:28px!important;padding:4px 7px!important}
body.platform-body .audit-row{grid-template-columns:80px minmax(0,1fr) 130px!important;gap:10px!important;padding:9px 0!important}.audit-action{font-size:10px!important}.audit-row strong{font-size:11px!important}.audit-row small,.audit-row time{font-size:9.5px!important}
body.platform-body .pagination{gap:7px!important;margin-top:12px!important;font-size:10px!important}.pagination .btn{min-width:70px;text-align:center}

/* ---------- support workbench ---------- */
body.support-desk-page{overflow:hidden!important;background:#fff!important}
body.support-desk-page .support-header{
  min-height:48px!important;height:48px!important;padding:0 10px!important;gap:8px!important;border-bottom:1px solid var(--ui-line)!important;background:#fff!important;box-shadow:none!important;
}
body.support-desk-page .support-header strong{font-size:13px!important;color:var(--ui-text)!important;font-weight:650!important}.support-header>span{font-size:10px!important;color:var(--ui-muted)!important}.header-mark{width:26px!important;height:26px!important;min-width:26px!important;flex-basis:26px!important;border-radius:7px!important;background:var(--ui-soft-blue)!important;color:var(--ui-primary)!important}
body.support-desk-page .agent-presence-control{gap:4px!important;color:var(--ui-muted)!important;font-size:10px!important}.presence-mode-buttons{gap:2px!important;padding:2px!important;border:1px solid var(--ui-line)!important;border-radius:7px!important;background:#f7faff!important}.presence-mode-buttons button{height:24px!important;min-height:24px!important;padding:3px 6px!important;border:0!important;background:transparent!important;color:#6f8398!important;font-size:9px!important}.presence-mode-buttons button[aria-pressed=true]{background:#fff!important;color:#1e67ad!important;box-shadow:0 1px 3px rgba(35,75,115,.08)!important}
body.support-desk-page .desk-notifications .icon-button,body.support-desk-page #logoutForm .icon-button{height:28px!important;min-height:28px!important;padding:4px 7px!important;border:1px solid var(--ui-line)!important;background:#fff!important;color:#5c748a!important}
body.support-desk-page>#notice{height:24px!important;min-height:24px!important;padding:4px 10px!important;border-bottom:1px solid var(--ui-line)!important;background:#f8fbfe!important;color:var(--ui-muted)!important;font-size:9.5px!important}
body.support-desk-page>.desk{grid-template-columns:150px 265px minmax(0,1fr)!important;height:calc(100dvh - 72px)!important;background:#fff!important}
body.support-desk-page .support-nav-rail{padding:8px 7px!important;border-right:1px solid var(--ui-line)!important;background:#f8fafd!important;color:var(--ui-text-2)!important}
body.support-desk-page .support-profile{min-height:42px!important;padding:5px 5px 8px!important;margin-bottom:2px!important;border-bottom:1px solid #e9eff6!important}.support-avatar{width:28px!important;height:28px!important;flex-basis:28px!important;border-radius:7px!important;background:var(--ui-soft-blue)!important;color:#2367ab!important}.support-profile strong{font-size:11px!important}.support-profile small{font-size:9px!important;color:var(--ui-muted)!important}.profile-more{width:26px!important;min-width:26px!important;height:26px!important;padding:0!important;border:1px solid transparent!important;background:transparent!important;color:#71859a!important}
body.support-desk-page .rail-section-label{padding:7px 6px 3px!important;color:#7b8fa3!important;font-size:9.5px!important;font-weight:650!important}
body.support-desk-page .rail-item{width:100%!important;min-height:32px!important;margin:0 0 3px!important;padding:6px 8px!important;border:1px solid #e4edf6!important;border-radius:7px!important;background:#fff!important;color:#60768b!important;font-size:10.5px!important;font-weight:550!important}.rail-item svg{width:14px!important;height:14px!important}.rail-item b{font-size:9px!important;color:#8395a7!important}.rail-item:hover{background:var(--ui-primary-soft)!important;border-color:#cfe2f7!important;color:#315f8c!important;transform:none!important}.rail-item.active{background:var(--ui-soft-blue)!important;border-color:#9dc9f6!important;color:#145da8!important;box-shadow:inset 2px 0 var(--ui-primary)!important}
body.support-desk-page #queuePanel{border-right:1px solid var(--ui-line)!important;background:#fff!important}.queue-head{padding:7px!important;border-bottom:1px solid var(--ui-line)!important}.queue-title-row{gap:6px!important}.queue-title-row h2{margin:0!important;font-size:13px!important}.queue-search{margin-top:6px!important}.queue-search input{height:30px!important;min-height:30px!important;padding:5px 28px 5px 8px!important;border:1px solid var(--ui-line)!important;border-radius:7px!important;background:#f8fafd!important;font-size:11px!important}.queue-tools{gap:3px!important;margin-top:6px!important}.queue-tool,.queue-share,.queue-sort{height:26px!important;min-height:26px!important;padding:3px 7px!important;border:1px solid var(--ui-line)!important;border-radius:6px!important;background:#fff!important;color:#6a7f93!important;font-size:9.5px!important}.queue-tool.active{background:var(--ui-soft-blue)!important;border-color:#add1f4!important;color:#1f65a7!important}
body.support-desk-page #queue{overflow:auto!important}.ticket{min-height:64px!important;padding:8px 9px!important;border-bottom:1px solid #edf2f7!important;background:#fff!important}.ticket:hover{background:#f9fcff!important}.ticket.active{background:#f1f7ff!important;box-shadow:inset 2px 0 var(--ui-primary)!important}.ticket strong{font-size:11px!important}.ticket small,.ticket time{font-size:9px!important;color:var(--ui-muted)!important}
body.support-desk-page .conversation{min-width:0!important;background:#fff!important}.toolbar{min-height:45px!important;padding:6px 9px!important;gap:5px!important;border-bottom:1px solid var(--ui-line)!important;background:#fff!important}.toolbar-identity{gap:5px!important}.toolbar-identity strong{font-size:12px!important;color:var(--ui-text)!important}.toolbar-identity>button,.toolbar-actions>button{height:27px!important;min-height:27px!important;padding:4px 7px!important;border-radius:6px!important;font-size:9.5px!important}.toolbar button.secondary{background:#fff!important;color:#567188!important;border:1px solid var(--ui-line)!important}.toolbar button.secondary:hover{background:var(--ui-primary-soft)!important;border-color:#c7def5!important}.toolbar button.danger{background:var(--ui-danger-bg)!important;color:var(--ui-danger)!important;border-color:#efcdcd!important}
body.support-desk-page .client-details{padding:6px 9px!important;border-bottom:1px solid #e9eff6!important;background:#f8fbfe!important}.client-details-head{margin-bottom:4px!important}.client-details-grid{gap:4px 9px!important}.client-details-grid span{font-size:8.5px!important;color:var(--ui-muted)!important}.client-details-grid strong{font-size:9.5px!important;color:#445f78!important}
body.support-desk-page .messages{background:#f7f9fc!important;padding:10px 12px!important}.bubble{border-radius:8px!important;box-shadow:none!important}.bubble.agent{background:#fff!important;border:1px solid #e0eaf4!important}.bubble.user{background:#e8f3ff!important;border:1px solid #d0e5fb!important}.message-meta{font-size:8.5px!important;color:#8b9aa9!important}
body.support-desk-page .quick-reply-dock{border-top:1px solid #e8eff6!important;background:#fff!important}.quick-reply-dock-head{min-height:28px!important;padding:4px 8px!important}.quick-reply-item{min-height:27px!important;padding:4px 7px!important;border:1px solid #e0eaf4!important;border-radius:6px!important;background:#f8fbfe!important;color:#58738b!important;font-size:9.5px!important}
body.support-desk-page .support-composer{padding:6px 8px!important;gap:5px!important;border-top:1px solid var(--ui-line)!important;background:#fff!important}.support-composer textarea{min-height:34px!important;height:34px!important;max-height:92px!important;padding:6px 8px!important;border:1px solid var(--ui-line-strong)!important;border-radius:7px!important;background:#fff!important;font-size:11px!important;line-height:20px!important}.composer-file,.composer-send{height:30px!important;min-height:30px!important;border-radius:7px!important}.composer-send{background:var(--ui-primary)!important;border-color:var(--ui-primary)!important;color:#fff!important}
body.support-desk-page dialog,body.support-desk-page .enterprise-dialog,body.support-desk-page .notification-panel{border:1px solid var(--ui-line)!important;border-radius:10px!important;background:#fff!important;box-shadow:0 16px 40px rgba(34,68,104,.12)!important}.notification-panel{padding:9px!important}.notification-item{padding:7px 8px!important;border:1px solid #e1eaf4!important;border-radius:7px!important;background:#f8fbfe!important;font-size:10px!important}

/* ---------- menu button and close X ---------- */
.menu-bars,.support-menu-bars{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;width:14px!important;height:12px!important}.menu-bars i,.support-menu-bars i{display:block!important;width:14px!important;height:1.5px!important;min-height:1.5px!important;margin:0!important;border-radius:999px!important;background:#5f7489!important;opacity:1!important;transform:none!important}
.close-glyph{position:relative!important;display:block!important;width:12px!important;height:12px!important}.close-glyph:before,.close-glyph:after{content:""!important;position:absolute!important;left:50%!important;top:50%!important;width:13px!important;height:1.5px!important;border-radius:999px!important;background:currentColor!important;transform-origin:center!important}.close-glyph:before{transform:translate(-50%,-50%) rotate(45deg)!important}.close-glyph:after{transform:translate(-50%,-50%) rotate(-45deg)!important}

/* ---------- login surfaces ---------- */
body.login-body{min-height:100dvh!important;display:grid!important;place-items:center!important;padding:18px!important;background:var(--ui-bg)!important}
body.login-body .modern-login{width:min(390px,100%)!important;margin:0!important;padding:22px!important;border:1px solid var(--ui-line)!important;border-radius:11px!important;background:#fff!important;box-shadow:var(--ui-shadow)!important}.modern-login .login-mark{width:36px!important;height:36px!important;border-radius:9px!important;background:var(--ui-primary)!important}.modern-login h1{margin:10px 0 3px!important;font-size:18px!important}.modern-login>p{margin:0 0 14px!important;font-size:11px!important;color:var(--ui-muted)!important}.modern-login label{margin:8px 0 4px!important;font-size:11px!important;color:var(--ui-text-2)!important}.modern-login input{height:34px!important;min-height:34px!important;border:1px solid var(--ui-line-strong)!important;border-radius:7px!important;padding:6px 9px!important;font-size:13px!important}.modern-login .primary{width:100%!important;height:34px!important;margin-top:12px!important}.modern-login>a{margin-top:9px!important;font-size:10.5px!important;color:#286cb0!important}
body.support-login-body{min-height:100dvh!important;display:grid!important;place-items:center!important;padding:18px!important}.support-login-body .login{width:min(390px,100%)!important;margin:0!important;padding:0!important;text-align:left!important}.support-login-body .login>h1{font-size:18px!important;margin:0 0 3px!important}.support-login-body .login>p{margin:0 0 12px!important;font-size:11px!important;color:var(--ui-muted)!important}.support-login-body .login .card{padding:20px!important;border:1px solid var(--ui-line)!important;border-radius:11px!important;background:#fff!important;box-shadow:var(--ui-shadow)!important}.support-login-body .card label{font-size:11px!important;color:var(--ui-text-2)!important}.support-login-body .card input{height:34px!important;margin-top:4px!important;border:1px solid var(--ui-line-strong)!important;border-radius:7px!important;padding:6px 9px!important;font-size:13px!important}.support-login-body .card button{width:100%!important;height:34px!important;margin-top:10px!important;background:var(--ui-primary)!important;border:1px solid var(--ui-primary)!important;color:#fff!important}.support-login-body .login>a{display:inline-block!important;margin-top:10px!important;color:#286cb0!important;font-size:10.5px!important}
body.panel-auth-page{min-height:100dvh!important;background:var(--ui-bg)!important}.panel-auth-page .login-shell{max-width:410px!important;margin:0 auto!important;padding:8vh 16px 24px!important}.panel-auth-page .back{margin-bottom:10px!important;font-size:10.5px!important;color:#6b8196!important}.panel-auth-page .login-card{padding:22px!important;border:1px solid var(--ui-line)!important;border-radius:11px!important;background:#fff!important;box-shadow:var(--ui-shadow)!important}.panel-auth-page .login-card .eyebrow{display:none!important}.panel-auth-page .login-card h1{margin:0 0 5px!important;font-size:19px!important;color:var(--ui-text)!important}.panel-auth-page .login-card .lead{margin:0 0 15px!important;font-size:11px!important;line-height:1.55!important;color:var(--ui-muted)!important}.panel-auth-page .login-card label{margin:8px 0 4px!important;font-size:11px!important;color:var(--ui-text-2)!important}.panel-auth-page .login-card input[type=text],.panel-auth-page .login-card input[type=password]{height:34px!important;border:1px solid var(--ui-line-strong)!important;border-radius:7px!important;padding:6px 9px!important;font-size:13px!important}.panel-auth-page .login-card .button{min-height:34px!important;height:34px!important;margin-top:12px!important;padding:6px 10px!important;border-radius:7px!important;background:var(--ui-primary)!important;font-size:11px!important}.panel-auth-page .login-card .button.secondary{background:#fff!important;border-color:var(--ui-line-strong)!important;color:#41698e!important}.panel-auth-page .auth-links{gap:8px!important}.panel-auth-page .switch{margin-top:10px!important;font-size:10.5px!important;color:#286cb0!important}

/* ---------- responsive ---------- */
@media(max-width:1023px){
  body.saas-admin .overview-stats-primary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.saas-admin .overview-stats-secondary{max-width:none!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.saas-admin .agent-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.platform-body .platform-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.platform-body .platform-filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}.platform-filters .btn{width:auto!important}
}

@media(max-width:900px){
  body.saas-admin .admin-shell,body.platform-body .platform-shell{display:block!important}
  body.saas-admin .sidebar,body.platform-body .platform-sidebar{
    width:min(360px,calc(100vw - 24px))!important;max-width:min(360px,calc(100vw - 24px))!important;
    padding:10px 9px max(12px,env(safe-area-inset-bottom))!important;box-shadow:10px 0 28px rgba(35,71,108,.12)!important;
  }
  body.saas-admin .admin-main,body.platform-body .platform-main{width:100%!important;margin:0!important}
  body.saas-admin .topbar,body.platform-body .platform-topbar{display:grid!important;grid-template-columns:30px minmax(0,1fr) auto!important;gap:7px!important;height:48px!important;min-height:48px!important;padding:0 9px!important}
  body.saas-admin .topbar p{display:none!important}.platform-topbar>span{font-size:10.5px!important}.avatar-label{height:27px!important;min-height:27px!important}
  body.saas-admin .panel-menu-toggle,body.platform-body .panel-menu-toggle,body.support-desk-page .support-nav-toggle{
    display:inline-flex!important;align-items:center!important;justify-content:center!important;width:30px!important;min-width:30px!important;height:30px!important;min-height:30px!important;padding:0!important;border:1px solid var(--ui-line)!important;border-radius:7px!important;background:#fff!important;color:#5f7489!important;box-shadow:none!important;
  }
  body.saas-admin .panel-menu-toggle:hover,body.platform-body .panel-menu-toggle:hover,body.support-desk-page .support-nav-toggle:hover{background:var(--ui-primary-soft)!important;border-color:#c7def5!important}
  body.saas-admin .panel-menu-close,body.platform-body .panel-menu-close,body.support-desk-page .support-nav-close{
    display:inline-flex!important;align-items:center!important;justify-content:center!important;position:absolute!important;top:10px!important;right:9px!important;width:28px!important;min-width:28px!important;height:28px!important;min-height:28px!important;padding:0!important;border:1px solid var(--ui-line)!important;border-radius:7px!important;background:#fff!important;color:#6b7f92!important;font-size:0!important;box-shadow:none!important;
  }
  body.saas-admin .content,body.platform-body .platform-content{padding:10px 9px max(24px,env(safe-area-inset-bottom))!important}
  body.saas-admin .agent-create-form{grid-template-columns:repeat(2,minmax(0,1fr))!important}.agent-create-form .agent-primary-button{justify-self:start!important;width:auto!important;min-width:92px!important}
  body.platform-body .platform-page-heading{margin-bottom:8px!important}.platform-page-heading h1{font-size:17px!important}.platform-page-heading .muted{display:none!important}.platform-page-heading>.btn{height:30px!important;min-height:30px!important;width:auto!important}
  body.platform-body .platform-filters{grid-template-columns:1fr 1fr!important;padding:8px!important}.platform-filters label:first-of-type{grid-column:1/-1!important}
  body.support-desk-page .support-header{display:grid!important;grid-template-columns:30px minmax(0,1fr) auto!important;min-height:48px!important;height:48px!important;padding:0 8px!important;gap:6px!important}.support-header strong{min-width:0;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}.support-header .agent-presence-control,.support-header>span:not(.agent-presence-status),.support-header .agent-presence-status{display:none!important}.support-header .desk-notifications{margin-left:auto!important}.support-header #logoutForm{display:none!important}
  body.support-desk-page .support-nav-rail{display:flex!important;position:fixed!important;z-index:220!important;inset:0 auto 0 0!important;width:min(360px,calc(100vw - 24px))!important;max-width:min(360px,calc(100vw - 24px))!important;transform:translateX(-101%);visibility:hidden;transition:transform .16s ease,visibility .16s ease!important;padding:9px 8px max(12px,env(safe-area-inset-bottom))!important;background:#fff!important;box-shadow:10px 0 28px rgba(35,71,108,.14)!important}.support-nav-open .support-nav-rail{transform:translateX(0)!important;visibility:visible!important}.support-nav-rail .support-profile{display:flex!important;padding-right:34px!important}
  body.support-desk-page .rail-item{min-height:36px!important}
  body.support-desk-page>.desk{grid-template-columns:minmax(0,1fr)!important;height:calc(100dvh - 72px)!important}.support-desk-page #queuePanel{position:absolute!important;z-index:40!important;inset:0 auto 0 0!important;width:min(330px,88vw)!important;transform:translateX(-101%);transition:transform .16s ease!important;box-shadow:8px 0 24px rgba(30,68,105,.12)!important}.support-desk-page.queue-open #queuePanel{transform:translateX(0)!important}.queue-close,.queue-toggle{display:inline-flex!important}.mobile-workbench-tools{display:none!important}
  body.support-desk-page .toolbar{min-height:42px!important;padding:5px 7px!important}.toolbar-actions{gap:4px!important;overflow-x:auto!important}.toolbar-actions>button{height:27px!important;min-height:27px!important;padding:4px 6px!important}.toolbar-identity #title{font-size:11.5px!important}.client-details-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.messages{padding:8px!important}.support-composer textarea{font-size:16px!important}
}

@media(max-width:767px){
  body.saas-admin .content{padding-top:9px!important}
  body.saas-admin .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}.stats>a,.stats>div{min-height:76px!important;padding:9px!important}.stats strong{font-size:18px!important}
  body.saas-admin .grid-2,body.saas-admin .settings-grid,body.saas-admin .two-col{grid-template-columns:1fr!important;gap:8px!important}
  body.saas-admin .panel{padding:10px!important;margin-bottom:8px!important}
  body.saas-admin .agent-create-form{grid-template-columns:1fr 1fr!important;gap:7px!important}.agent-create-form label:nth-of-type(3){grid-column:1/-1!important}.agent-primary-button{grid-column:1/-1!important;justify-self:start!important}
  body.saas-admin .agent-card-grid{grid-template-columns:1fr!important;gap:7px!important}.agent-card{padding:9px!important}.accounts-section-head{align-items:center!important}.accounts-section-copy p{display:none!important}.account-view-switch{grid-template-columns:repeat(2,52px)!important}.account-table-view table{min-width:720px!important}
  body.saas-admin .channel-grid{grid-template-columns:1fr!important}.channel-card{padding:10px!important}.channel-card form>button{width:auto!important;display:inline-flex!important;margin-top:3px!important}
  body.platform-body .platform-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}.stat-card{min-height:74px!important;padding:9px!important}.stat-card strong{font-size:18px!important}.platform-two-col,.user-grid{grid-template-columns:1fr!important}.platform-card{padding:10px!important}.platform-filters{grid-template-columns:1fr 1fr!important;gap:6px!important}.platform-filters label{min-width:0!important}.platform-filters .btn{justify-self:start!important;width:auto!important}.audit-row{grid-template-columns:1fr!important;gap:3px!important}.audit-row time{grid-column:auto!important}.support-tenant-row{display:grid!important;gap:6px!important}.support-tenant-metrics{justify-content:flex-start!important}
}

@media(max-width:480px){
  body.saas-admin .sidebar,body.platform-body .platform-sidebar,body.support-desk-page .support-nav-rail{width:calc(100vw - 18px)!important;max-width:calc(100vw - 18px)!important}
  body.saas-admin .sidebar .nav-group-links a,body.platform-body .platform-sidebar nav a{min-height:33px!important;font-size:11px!important}
  body.saas-admin .content,body.platform-body .platform-content{padding-left:7px!important;padding-right:7px!important}
  body.saas-admin .topbar,body.platform-body .platform-topbar{padding-left:7px!important;padding-right:7px!important}
  body.saas-admin .topbar h1{font-size:16px!important}.platform-page-heading h1{font-size:16px!important}
  body.saas-admin .stats{gap:5px!important}.stats>a,.stats>div{padding:8px!important}.stats strong{font-size:17px!important}
  body.saas-admin .agent-create-form{grid-template-columns:1fr!important}.agent-create-form label:nth-of-type(3){grid-column:auto!important}.agent-primary-button{grid-column:auto!important}
  body.platform-body .platform-filters{grid-template-columns:1fr!important}.platform-filters label:first-of-type{grid-column:auto!important}.platform-filters .btn{height:30px!important;min-height:30px!important}
  body.support-desk-page .support-header{grid-template-columns:30px minmax(0,1fr) auto!important}.header-mark{display:none!important}.support-header strong{font-size:12px!important}.desk-notifications #notificationButton{min-width:28px!important;padding:4px!important;font-size:15px!important}.support-desk-page #queuePanel{width:calc(100vw - 18px)!important}.toolbar{padding:4px 6px!important}.toolbar-identity>button,.toolbar-actions>button{padding:4px 5px!important}.button-label{display:none!important}.client-details{padding:5px 7px!important}
}

@media(prefers-reduced-motion:reduce){body.saas-admin *,body.platform-body *,body.support-desk-page *{transition:none!important;animation:none!important}}

/* Support message stream generated by support.js. */
body.support-desk-page #messages{min-height:0!important;overflow:auto!important;padding:10px 12px!important;background:#f7f9fc!important;scrollbar-width:thin}
body.support-desk-page .message{position:relative!important;max-width:min(680px,78%)!important;margin:6px 0!important;padding:8px 10px!important;border:1px solid #e0eaf4!important;border-radius:9px!important;background:#fff!important;color:var(--ui-text)!important;font-size:11px!important;line-height:1.55!important;box-shadow:none!important}
body.support-desk-page .message.user{margin-left:auto!important;background:#eaf4ff!important;border-color:#d0e4f8!important}
body.support-desk-page .message.assistant{margin-right:auto!important}
body.support-desk-page .desk-message-avatar{width:23px!important;height:23px!important;min-width:23px!important;border-radius:6px!important;background:#eef4fa!important;color:#5c7690!important;font-size:9px!important}
body.support-desk-page .message-copy{white-space:pre-wrap;overflow-wrap:anywhere}.message-meta,.message-footer{font-size:8.5px!important;color:#8b9cab!important}.message-actions{gap:4px!important;margin-top:5px!important}.message-actions button{min-height:24px!important;padding:3px 6px!important;font-size:9px!important}
body.support-desk-page .message-day{margin:8px auto!important;padding:2px 7px!important;border-radius:5px!important;background:#edf2f7!important;color:#8a9aa9!important;font-size:8.5px!important}
body.support-desk-page .empty{color:var(--ui-muted)!important;font-size:11px!important}

/* Keep support workbench desktop/tablet layout until the JS mobile breakpoint (760px). */
@media(min-width:761px) and (max-width:900px){
  body.support-desk-page .support-header{display:flex!important;height:48px!important;min-height:48px!important;padding:0 10px!important;gap:7px!important;flex-wrap:nowrap!important}
  body.support-desk-page .support-nav-toggle{display:none!important}
  body.support-desk-page .support-header .agent-presence-control{display:flex!important}
  body.support-desk-page .support-header>span:not(.agent-presence-status){display:inline!important}
  body.support-desk-page .support-header .agent-presence-status{display:inline!important;font-size:9px!important}
  body.support-desk-page .support-header #logoutForm{display:block!important}
  body.support-desk-page .support-nav-rail{display:flex!important;position:static!important;z-index:auto!important;inset:auto!important;width:auto!important;max-width:none!important;transform:none!important;visibility:visible!important;padding:8px 7px!important;background:#f8fafd!important;box-shadow:none!important}
  body.support-desk-page .support-nav-close{display:none!important}
  body.support-desk-page>.desk{grid-template-columns:150px 250px minmax(0,1fr)!important;height:calc(100dvh - 72px)!important}
  body.support-desk-page #queuePanel{position:static!important;z-index:auto!important;inset:auto!important;width:auto!important;transform:none!important;box-shadow:none!important}
  body.support-desk-page .queue-close,body.support-desk-page .queue-toggle{display:none!important}
}
@media(max-width:760px){
  body.support-desk-page #queuePanel.mobile-open{transform:translateX(0)!important}
}

/* iOS-friendly form text without enlarging button chrome. */
@media(max-width:900px){
  body.saas-admin input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
  body.saas-admin select,body.saas-admin textarea,
  body.platform-body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
  body.platform-body select,body.platform-body textarea{
    font-size:16px!important;
    min-height:34px!important;
    height:34px;
    padding-top:5px!important;padding-bottom:5px!important;
  }
  body.saas-admin textarea,body.platform-body textarea{height:auto!important;min-height:72px!important}
}
@media(max-width:760px){
  body.support-desk-page input:not([type=checkbox]):not([type=radio]):not([type=range]),body.support-desk-page select,body.support-desk-page textarea{font-size:16px!important}
}

/* Long/dynamic regions scroll internally instead of stretching pages indefinitely. */
body.saas-admin .runtime-log{max-height:250px;overflow:auto;padding-right:2px}
body.saas-admin .shared-quick-list{max-height:520px;overflow:auto;padding-right:3px}
body.saas-admin .unknown-list,body.saas-admin .teaching-list,body.saas-admin .editor-list{max-height:720px;overflow:auto;padding-right:3px}
body.platform-body .audit-list{max-height:620px;overflow:auto;padding-right:3px}
body.support-desk-page .notification-panel{max-height:min(420px,70dvh)!important;overflow:auto!important}

/* Workbench sizing: the header can gain controls or wrap without covering chat. */
body.support-desk-page{display:flex;flex-direction:column;height:100dvh;min-height:0}
body.support-desk-page>.support-header{flex:0 0 auto;height:auto!important;min-height:48px!important;align-content:center;flex-wrap:wrap!important;padding:5px 10px!important}
body.support-desk-page>#notice{flex:0 0 auto}
body.support-desk-page>.desk{position:relative;flex:1 1 0;height:auto!important;min-height:0;min-width:0;grid-template-columns:minmax(130px,150px) minmax(220px,265px) minmax(0,1fr)!important;gap:0!important;padding:0!important}
body.support-desk-page .support-nav-rail,body.support-desk-page #queuePanel,body.support-desk-page .conversation{min-height:0!important;min-width:0}
body.support-desk-page .support-nav-rail{overflow-y:auto}
body.support-desk-page #queuePanel{display:flex;flex-direction:column;overflow:hidden}
body.support-desk-page #queuePanel .queue-head,body.support-desk-page #queuePanel .queue-footer{flex:0 0 auto}
body.support-desk-page #queue{flex:1 1 0;height:auto!important;min-height:0;overflow-y:auto!important}
body.support-desk-page .conversation{overflow:hidden}
body.support-desk-page .support-header .notification-sound-controls{min-width:0;max-width:100%}
body.support-desk-page #messages .attachment-link,body.support-desk-page #messages .message-footer{min-width:0;max-width:100%;overflow-wrap:anywhere}
body.support-desk-page #messages .message-footer{flex-wrap:wrap;white-space:normal}
body.support-desk-page #messages .message-read-status{flex:0 1 auto;max-width:100%;white-space:normal;overflow-wrap:anywhere}
body.support-desk-page #messages img,body.support-desk-page #messages video{max-width:100%;height:auto}
body.support-desk-page #queue .ticket .ticket-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.support-desk-page #queue .ticket .ticket-indicators{min-width:0}
body.support-desk-page #queue .ticket>small{display:block;min-width:0;padding-right:55px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.support-desk-page #queue .ticket>.read-state{top:auto!important;bottom:6px;right:7px}
@media(min-width:761px) and (max-width:1100px){
  body.support-desk-page>.support-header{flex-wrap:wrap!important;gap:5px 8px!important}
  body.support-desk-page .support-header strong{min-width:0;flex:0 1 auto;margin-right:auto}
  body.support-desk-page .support-header .agent-presence-status{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
@media(max-width:760px){
  body.support-desk-page>.support-header{display:grid!important;grid-template-columns:30px minmax(0,1fr) auto!important;gap:5px 7px!important;padding:5px 8px!important}
  body.support-desk-page .support-header .desk-notifications{grid-column:3;grid-row:1}
  body.support-desk-page .support-header .notification-sound-controls{grid-column:1/-1;grid-row:auto;justify-self:end;justify-content:flex-end;flex-wrap:wrap}
  body.support-desk-page .support-header .enable-support-sound{grid-column:1/-1;justify-self:end}
  body.support-desk-page>.desk{grid-template-columns:minmax(0,1fr)!important}
  body.support-desk-page #queuePanel{position:fixed!important;inset:0 auto 0 0!important;height:100dvh!important;max-height:100dvh!important;overflow-y:auto;overscroll-behavior:contain}
  body.support-desk-page #queuePanel .queue-head{position:relative;top:auto}
  body.support-desk-page #queuePanel #queue{min-height:80px;overflow-y:auto!important}
  body.support-desk-page .toolbar-identity #title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body.support-desk-page .toolbar-actions{max-width:100%;overflow-x:auto}
}
@media(max-width:360px){
  body.support-desk-page .support-header .notification-sound-controls select{max-width:70px}
  body.support-desk-page .support-composer{grid-template-columns:34px minmax(0,1fr) auto!important}
}

/* Settings pages: keep cards and form controls inside narrow viewports. */
body.saas-admin .channel-grid,body.saas-admin .notify-grid,body.saas-admin .agent-card-grid{min-width:0;max-width:100%}
body.saas-admin .channel-card,body.saas-admin .notify-card,body.saas-admin .notify-rules fieldset{min-width:0;max-width:100%;overflow-wrap:anywhere}
body.saas-admin .channel-card input,body.saas-admin .notify-card input,body.saas-admin .notify-rules input,body.saas-admin .notify-rules select{max-width:100%}
body.saas-admin .notify-table,body.saas-admin .channel-log-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
