:root {
  color-scheme: light;
  --blue: #0a84c1;
  --blue-strong: #075c8f;
  --teal: #0f9ab2;
  --green: #15915f;
  --amber: #d98a00;
  --red: #b23333;
  --ink: #132033;
  --muted: #627087;
  --line: #d4e1ed;
  --soft-line: #e8eff6;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --surface-blue: #edf7fd;
  --shadow: 0 10px 24px rgba(21, 45, 74, 0.09);
  --shadow-tight: 0 5px 14px rgba(21, 45, 74, 0.08);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f4f9fc 0%, #edf4f8 48%, #e8f1f7 100%);
  color: var(--ink);
}

body.app-logged-in #manualLoginButton,
body.app-logged-in #ssoLoginButton {
  display: none;
}

body.app-logged-out #logoutButton {
  display: none;
}

body.app-no-contact .voice-controls {
  display: none;
}

body.app-no-contact .interaction-card,
body.app-no-contact .customer-panel,
body.app-no-contact .wrap-panel {
  display: none;
}

body.app-no-contact .context-grid {
  display: none;
}

body.app-no-contact .advanced-panel:not(.events-panel) {
  display: none;
}

body.app-log-capture-off .events-panel {
  display: none;
}

body.app-logged-in .launch-card,
body.app-launch-dismissed .launch-card {
  display: none;
}

body.app-launch-required .workspace-shell {
  display: none;
}

body.app-no-contact .interaction-layout {
  grid-template-columns: 1fr;
}

body.app-no-contact .control-stack {
  display: block;
}

body.app-no-contact #interactionState {
  width: 100%;
  justify-content: center;
}

body.app-no-contact .digital-card {
  opacity: 0.92;
}

#niceVoiceAudio {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

button,
select,
input,
textarea {
  font: inherit;
}

.agent-console {
  width: min(720px, calc(100% - 10px));
  margin: 0 auto;
  padding: 4px 0 14px;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 7px;
  margin-top: 7px;
}

.workspace-content {
  min-width: 0;
}

.icon-rail {
  position: sticky;
  top: 6px;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-tight);
}

.icon-rail a {
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 32px;
  padding: 3px 2px;
  border-radius: 12px;
  color: #445267;
  text-decoration: none;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.icon-rail a:hover,
.icon-rail a:focus {
  background: #e7f3fb;
  color: var(--blue-strong);
}

.launch-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  width: auto;
  margin: 7px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-tight);
}

.launch-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 2px 7px;
  border-bottom: 1px solid var(--soft-line);
}

.launch-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #14afd1, #087eb6);
  color: #ffffff;
  font-weight: 900;
  font-size: 13px;
}

.launch-brand .section-label {
  margin: 0;
  font-size: 9px;
}

.launch-brand h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.1;
}

.voice-choice-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.voice-choice-list label,
.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
}

.voice-choice-list label {
  min-height: 38px;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fbfe;
  color: #41506a;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.voice-choice-list label:has(input:checked) {
  border-color: #8fc2e6;
  background: #e4f3fb;
  color: var(--blue-strong);
}

.voice-choice-list input,
.remember-row input {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.launch-input {
  display: none;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

body.launch-mode-value .launch-input {
  display: block;
}

.remember-row {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.launch-card .button {
  min-height: 40px;
  border-radius: 12px;
  font-size: 15px;
}

.phone-frame {
  overflow: hidden;
  border: 1px solid #c8d5e3;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.phone-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fb;
}

.phone-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3e4a5b;
  font-size: 13px;
}

.phone-glyph {
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.window-actions {
  display: inline-flex;
  gap: 12px;
}

.window-actions span {
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: #7b8797;
}

.presence-bar {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(135deg, #12a9cf 0%, #087eb6 58%, #066a9f 100%);
  color: #ffffff;
}

body.app-logged-in .presence-bar {
  grid-template-columns: minmax(0, 1fr) auto;
}

body.app-logged-in .session-actions {
  justify-content: end;
}

.brand-lockup {
  min-width: 0;
}

.eyebrow,
.section-label {
  display: block;
  margin: 0 0 2px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.presence-bar .eyebrow {
  color: rgba(255, 255, 255, 0.76);
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 16px;
  line-height: 1.08;
}

.presence-bar h1 {
  color: #ffffff;
}

h2 {
  font-size: 13px;
  line-height: 1.25;
}

.session-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.agent-presence-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 170px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue-strong);
  font-size: 13px;
  font-weight: 900;
}

.presence-state {
  display: block;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.agent-presence-chip small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 800;
}

.button,
.small-button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
}

.button {
  min-height: 32px;
  padding: 0 12px;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(11, 92, 171, 0.16);
}

.button:hover {
  background: var(--blue-strong);
}

.button:disabled,
.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button-secondary {
  background: #e8f3f7;
  color: var(--blue-strong);
  box-shadow: none;
}

.presence-bar .button-secondary {
  background: rgba(255, 255, 255, 0.9);
}

.presence-bar #manualLoginButton:not(:disabled) {
  background: #ffffff;
  color: var(--blue-strong);
  opacity: 1;
}

.presence-bar #ssoLoginButton:not(:disabled) {
  background: #067fbd;
  color: #ffffff;
  opacity: 1;
  box-shadow: 0 8px 18px rgba(3, 95, 145, 0.2);
}

.presence-bar #manualLoginButton:not(:disabled):hover,
.presence-bar #ssoLoginButton:not(:disabled):hover {
  transform: translateY(-1px);
}

.button-secondary:hover {
  background: #d7ecf2;
}

.button-danger {
  background: #f7e8e8;
  color: #862020;
  box-shadow: none;
}

.button-danger:hover {
  background: #efd0d0;
}

.action-primary {
  background: var(--green);
  box-shadow: 0 8px 18px rgba(22, 138, 98, 0.16);
}

.small-button {
  min-height: 30px;
  padding: 0 10px;
  background: #ecf2f8;
  color: var(--blue-strong);
}

.small-button:hover {
  background: #dfeaf4;
}

.danger-text {
  color: #8a1f1f;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e6f0fa;
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.connection-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  margin: 6px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-tight);
}

.connection-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 28px;
  padding: 4px 8px;
  border-right: 1px solid var(--soft-line);
  background: transparent;
  box-shadow: none;
}

.connection-item:nth-child(even) {
  border-right: 0;
}

.connection-item:nth-child(-n + 2) {
  border-bottom: 1px solid var(--soft-line);
}

.connection-item:nth-child(5) {
  grid-column: 1 / -1;
  border-top: 1px solid var(--soft-line);
  border-right: 0;
}

.connection-item p {
  display: inline;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.connection-item strong {
  display: inline;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #aebaca;
  box-shadow: 0 0 0 4px rgba(174, 186, 202, 0.14);
}

.status-dot.ok,
.status-dot.live {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 138, 98, 0.13);
}

.status-dot.warn {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(216, 139, 0, 0.13);
}

.status-dot.error {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(184, 50, 50, 0.13);
}

.warning-panel {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #f1c876;
  border-radius: 14px;
  background: #fff8e8;
  color: #704900;
  font-size: 13px;
}

.hidden {
  display: none;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.82fr) minmax(230px, 1.18fr);
  grid-template-areas:
    "interaction interaction"
    "agent dial"
    "digital digital";
  gap: 10px;
  align-items: start;
}

body.app-no-contact .command-grid {
  grid-template-areas:
    "agent dial"
    "digital digital";
}

.context-grid,
.advanced-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.panel {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-tight);
}

.agent-card {
  grid-area: agent;
}

.dial-card {
  grid-area: dial;
}

.settings-panel {
  grid-column: 1 / -1;
}

.agent-card .details-list,
.dial-card .field {
  margin-bottom: 5px;
}

.agent-card .panel-heading,
.dial-card .panel-heading,
.digital-card .panel-heading {
  margin-bottom: 6px;
}

.interaction-card {
  grid-area: interaction;
  border-color: #b8d2e7;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body.app-has-contact .interaction-card {
  position: sticky;
  top: 6px;
  z-index: 2;
}

.digital-card {
  grid-area: digital;
}

.panel-heading,
summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.panel-heading {
  margin-bottom: 6px;
}

summary {
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary strong {
  display: block;
  font-size: 13px;
}

.tools-summary-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef6fb;
  color: var(--blue-strong);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.advanced-content {
  padding-top: 8px;
}

.details-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.details-list div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 0;
  border-top: 1px solid var(--soft-line);
}

.details-list div:first-child {
  border-top: 0;
}

.details-list.compact {
  margin-bottom: 8px;
}

.active-details div {
  grid-template-columns: 76px minmax(0, 1fr);
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.presence-rail,
.dial-grid,
.interaction-layout {
  display: grid;
  gap: 6px;
}

.presence-rail {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
}

.reason-field {
  grid-column: 1 / -1;
  order: -1;
}

.presence-rail .button {
  width: 100%;
}

.voice-leg-controls {
  margin-top: 8px;
}

.voice-leg-controls .small-button {
  flex: 1 1 96px;
  min-height: 36px;
}

.dial-grid {
  grid-template-columns: minmax(0, 1fr) minmax(90px, 0.48fr);
  align-items: end;
}

.phone-field {
  grid-column: 1 / -1;
}

.dial-grid .button {
  width: 100%;
}

.interaction-layout {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
}

.control-stack {
  display: grid;
  align-content: start;
  gap: 8px;
}

.control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.voice-controls .small-button {
  flex: 1 1 62px;
  min-height: 44px;
  background: #f1f5f9;
  color: #38475a;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px 6px;
  font-size: 10px;
  line-height: 1;
}

.voice-controls .small-button::before {
  content: attr(data-icon);
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(68, 82, 103, 0.1);
  color: inherit;
  font-size: 12px;
  font-weight: 900;
}

.voice-controls .primary-answer {
  background: #15915f;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(21, 145, 95, 0.18);
}

.voice-controls .primary-answer:hover {
  background: #0f774d;
}

.voice-controls .primary-answer::before {
  background: rgba(255, 255, 255, 0.22);
}

.voice-controls .primary-end {
  background: #f7e8e8;
  color: #8a1f1f;
}

body.app-has-contact .voice-controls {
  position: sticky;
  bottom: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 18px rgba(20, 47, 79, 0.08);
}

.voice-controls .small-button:hover {
  background: #e3edf5;
}

.voice-controls .danger-text {
  background: #f7e8e8;
}

.interaction-card.tone-ringing {
  border-color: rgba(217, 138, 0, 0.7);
  box-shadow: 0 0 0 2px rgba(217, 138, 0, 0.1), var(--shadow-tight);
}

.interaction-card.tone-dialing {
  border-color: rgba(10, 132, 193, 0.7);
  box-shadow: 0 0 0 2px rgba(10, 132, 193, 0.1), var(--shadow-tight);
}

.interaction-card.tone-active {
  border-color: rgba(21, 145, 95, 0.72);
  box-shadow: 0 0 0 2px rgba(21, 145, 95, 0.1), var(--shadow-tight);
}

.interaction-card.tone-hold {
  border-color: rgba(217, 138, 0, 0.62);
  background: #fffdf6;
}

.pill.tone-ringing,
.pill.tone-hold {
  background: #fff3d8;
  color: #8a5a00;
}

.pill.tone-dialing,
.pill.tone-work {
  background: #e6f4fb;
  color: var(--blue-strong);
}

.pill.tone-active {
  background: #e2f6ed;
  color: #0d6c47;
}

.pill.tone-ended {
  background: #f4e9e9;
  color: #8a1f1f;
}

.field {
  display: grid;
  gap: 3px;
  margin: 0 0 6px;
}

.field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
}

select,
input {
  min-height: 31px;
  padding: 0 8px;
}

textarea {
  resize: vertical;
  padding: 8px;
}

select:focus,
input:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(14, 154, 167, 0.26);
  outline-offset: 2px;
}

.empty-state {
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed #b9c9da;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.customer-card {
  display: grid;
  gap: 10px;
}

.customer-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--blue-strong);
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
}

.workflow-target {
  grid-column: 1 / -1;
}

.workflow-summary {
  display: grid;
  gap: 4px;
  min-height: 46px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.workflow-summary strong {
  color: var(--ink);
}

.full-width {
  width: 100%;
}

.simulator-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.events-panel {
  grid-column: 1 / -1;
}

.settings-gear {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e6f0fa;
  color: var(--blue-strong);
  font-weight: 900;
}

.settings-content {
  display: grid;
  gap: 7px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.simulator-row {
  justify-content: flex-start;
}

.simulator-row .small-button {
  min-width: 104px;
}

.voice-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.voice-phone-field,
.voice-station-field {
  display: none;
}

body.voice-mode-phone .voice-phone-field,
body.voice-mode-station .voice-station-field {
  display: grid;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.toggle-row input {
  width: 16px;
  height: 16px;
}

.event-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.event-list {
  display: grid;
  gap: 4px;
  max-height: 280px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}

.event-item {
  display: grid;
  grid-template-columns: 84px 110px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--surface-soft);
  font-size: 11px;
  line-height: 1.25;
}

.event-time {
  color: var(--muted);
  white-space: nowrap;
}

.event-source {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.event-message {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.event-details {
  max-height: 110px;
  margin: 4px 0 0;
  padding: 6px;
  overflow: auto;
  border: 1px solid #c8d5e3;
  border-radius: 4px;
  background: #ffffff;
  color: #3a4656;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.35;
  white-space: pre-wrap;
}

@media (max-width: 560px) {
  .agent-console {
    width: min(100% - 8px, 430px);
    padding-top: 4px;
  }

  .workspace-shell {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 5px;
  }

  .icon-rail {
    padding: 6px 4px;
    border-radius: 14px;
  }

  .icon-rail a {
    width: 38px;
    min-height: 30px;
    border-radius: 11px;
    font-size: 8px;
  }

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

  body.app-logged-in .presence-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .session-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
  }

  body.app-logged-in .session-actions {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, auto));
    justify-content: end;
  }

  .agent-presence-chip {
    min-width: 0;
  }

  .command-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "interaction"
      "agent"
      "dial"
      "digital";
  }

  body.app-no-contact .command-grid {
    grid-template-areas:
      "agent"
      "dial"
      "digital";
  }

  .context-grid,
  .advanced-grid,
  .dial-grid {
    grid-template-columns: 1fr;
  }

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

  .phone-field,
  .workflow-target {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .agent-console {
    width: min(100% - 8px, 430px);
  }

  .phone-frame {
    border-radius: 14px;
  }

  .phone-titlebar {
    min-height: 24px;
  }

  .phone-title {
    font-size: 12px;
  }

  h1 {
    font-size: 18px;
  }

  h2 {
    font-size: 12px;
  }

  .presence-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    padding: 7px 8px;
  }

  .eyebrow,
  .section-label {
    font-size: 9px;
  }

  .agent-presence-chip {
    gap: 6px;
  }

  .avatar {
    width: 30px;
    height: 30px;
    border-width: 2px;
    font-size: 12px;
  }

  .presence-state {
    font-size: 12px;
  }

  .agent-presence-chip small {
    font-size: 9px;
  }

  .session-actions {
    gap: 5px;
  }

  body.app-logged-in .session-actions {
    gap: 4px;
  }

  .session-actions .button {
    min-height: 28px;
    padding: 0 6px;
    font-size: 12px;
  }

  body.app-logged-in .session-actions .button {
    min-width: 52px;
  }

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

  .connection-item {
    min-height: 25px;
    padding: 3px 7px;
  }

  .connection-item:nth-child(odd) {
    border-right: 1px solid var(--soft-line);
  }

  .connection-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .connection-item p {
    display: none;
  }

  .connection-item strong {
    font-size: 11px;
  }

  .command-grid,
  .context-grid,
  .advanced-grid {
    gap: 6px;
    margin-top: 6px;
  }

  .panel {
    padding: 8px;
    border-radius: 14px;
  }

  .panel-heading {
    margin-bottom: 6px;
  }

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

  .details-list div,
  .active-details div {
    grid-template-columns: 74px minmax(0, 1fr);
    padding: 4px 0;
  }

  dt,
  .field span {
    font-size: 10px;
  }

  dd {
    font-size: 12px;
  }

  .control-stack {
    gap: 6px;
  }

  .voice-controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  body.app-no-contact .voice-controls {
    display: none;
  }

  .voice-controls .small-button {
    min-height: 42px;
    padding: 0 4px;
    font-size: 9px;
  }

  .presence-rail {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
    gap: 6px;
  }

  .reason-field {
    grid-column: 1 / -1;
    order: -1;
  }

  .presence-rail .button {
    width: 100%;
    min-height: 32px;
  }

  .dial-grid {
    gap: 6px;
  }

  select,
  input {
    min-height: 32px;
    font-size: 12px;
  }

  .event-list {
    max-height: 220px;
  }

  .event-item {
    grid-template-columns: 1fr;
  }
}

/* Final agent polish overrides. Kept at the end so responsive rules stay compact. */
:root {
  --blue: #057cb7;
  --blue-strong: #045f91;
  --teal: #0aa9c9;
  --green: #1fa36b;
  --amber: #e19a12;
  --red: #c34848;
  --ink: #102033;
  --muted: #5d6c82;
  --line: #cfe0ee;
  --soft-line: #e9f1f7;
  --surface-soft: #f7fbff;
  --surface-blue: #edf7fd;
  --shadow: 0 14px 38px rgba(21, 66, 102, 0.12);
  --shadow-soft: 0 8px 22px rgba(21, 66, 102, 0.08);
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(10, 169, 201, 0.12), transparent 26%),
    linear-gradient(180deg, #f8fcff 0%, #edf5fb 100%);
}

.app-shell {
  gap: 8px;
}

.phone-frame,
.panel,
.workspace-shell,
.launch-card {
  border-color: rgba(136, 174, 205, 0.52);
  box-shadow: var(--shadow-soft);
}

.phone-frame {
  border-radius: 20px;
}

.presence-bar {
  background:
    radial-gradient(circle at 72% 15%, rgba(255, 255, 255, 0.22), transparent 22%),
    linear-gradient(135deg, #0ba9cc 0%, #087db9 48%, #1f7fad 100%);
}

.button,
.small-button,
select,
input,
textarea {
  border-radius: 16px;
}

.workspace-shell {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
}

.panel {
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
}

.icon-rail {
  border-radius: 18px;
  gap: 4px;
  padding: 7px;
}

.icon-rail a {
  border-radius: 14px;
}

.call-state-pill {
  border-radius: 999px;
  background: #e8f3fb;
  color: var(--blue-strong);
}

body.app-contact-incoming .call-state-pill,
body.app-contact-dialing .call-state-pill {
  background: #fff3d8;
  color: #7a4d00;
}

body.app-contact-active .call-state-pill,
body.app-contact-holding .call-state-pill {
  background: #e6f8ef;
  color: #0c6f48;
}

.voice-controls {
  gap: 8px;
}

.voice-controls .small-button {
  min-height: 52px;
  padding: 5px 7px;
  border-radius: 17px;
  background: #f8fbff;
  border: 1px solid transparent;
  box-shadow: none;
}

.voice-controls .small-button::before {
  width: 32px;
  height: 24px;
  margin-bottom: 3px;
  border-radius: 999px;
  background: #eaf4fb;
  color: var(--blue-strong);
  font-size: 9px;
  letter-spacing: 0;
}

body.app-contact-incoming .voice-controls .primary-answer {
  background: linear-gradient(135deg, #24b97d, #15915f);
  color: #fff;
  box-shadow: 0 10px 24px rgba(31, 163, 107, 0.22);
}

body.app-contact-active .voice-controls .primary-end,
body.app-contact-dialing .voice-controls .primary-end {
  background: linear-gradient(135deg, #d95a5a, #b23333);
  color: #fff;
  box-shadow: 0 10px 24px rgba(195, 72, 72, 0.18);
}

body.app-contact-incoming .voice-controls .primary-answer::before,
body.app-contact-active .voice-controls .primary-end::before,
body.app-contact-dialing .voice-controls .primary-end::before {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.events-panel[open] {
  max-height: 320px;
}

.event-list {
  background: #f8fbff;
}

.event-actions .small-button {
  min-height: 36px;
  padding: 0 13px;
}

@media (max-width: 760px) {
  .presence-bar {
    min-height: 0;
    padding: 12px;
    gap: 10px;
  }

  .presence-bar h1 {
    font-size: 24px;
  }

  body.app-logged-in .presence-bar h1 {
    font-size: 20px;
  }

  .workspace-shell {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 8px;
  }

  .panel {
    padding: 10px;
  }

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

  .voice-controls .small-button {
    min-height: 48px;
  }
}

/* Agent call-state palette. These overrides keep the console calm during calls while
   making the current voice state visible without relying on the event log. */
:root {
  --blue: #0b6f9f;
  --blue-strong: #084f73;
  --teal: #167d8f;
  --green: #16835b;
  --amber: #b86f08;
  --red: #b53d3d;
  --ink: #142236;
  --muted: #5b6878;
  --line: #d6e0e8;
  --soft-line: #edf2f6;
  --surface-soft: #f6f9fb;
  --surface-blue: #e9f4f8;
  --shadow: 0 12px 28px rgba(22, 38, 57, 0.1);
  --shadow-soft: 0 7px 18px rgba(22, 38, 57, 0.08);
  --state-accent: #0b6f9f;
  --state-accent-soft: #e9f4f8;
  --state-accent-text: #084f73;
}

body {
  background: linear-gradient(180deg, #f7fafb 0%, #eef4f6 100%);
}

body.app-tone-ringing {
  --state-accent: #b86f08;
  --state-accent-soft: #fff4df;
  --state-accent-text: #744400;
}

body.app-tone-dialing,
body.app-tone-work {
  --state-accent: #0b6f9f;
  --state-accent-soft: #e7f3f8;
  --state-accent-text: #084f73;
}

body.app-tone-active {
  --state-accent: #16835b;
  --state-accent-soft: #e5f6ee;
  --state-accent-text: #0f6041;
}

body.app-tone-hold {
  --state-accent: #9f650b;
  --state-accent-soft: #fff5df;
  --state-accent-text: #684200;
}

body.app-tone-ended {
  --state-accent: #b53d3d;
  --state-accent-soft: #f9e8e8;
  --state-accent-text: #842626;
}

.presence-bar {
  background: linear-gradient(135deg, #114261 0%, #176f82 58%, #236d75 100%);
}

body.app-tone-ringing .presence-bar {
  background: linear-gradient(135deg, #65420e 0%, #94620f 58%, #715111 100%);
}

body.app-tone-active .presence-bar {
  background: linear-gradient(135deg, #123f34 0%, #17684e 58%, #236d58 100%);
}

body.app-tone-hold .presence-bar {
  background: linear-gradient(135deg, #51401d 0%, #806115 58%, #655522 100%);
}

body.app-tone-ended .presence-bar {
  background: linear-gradient(135deg, #5b2626 0%, #933939 58%, #6e3434 100%);
}

.panel,
.workspace-shell,
.launch-card,
.icon-rail {
  border-radius: 10px;
}

.button,
.small-button,
select,
input,
textarea {
  border-radius: 8px;
}

.interaction-card {
  border-color: color-mix(in srgb, var(--state-accent) 34%, var(--line));
  border-left: 5px solid var(--state-accent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--state-accent-soft) 72%, #ffffff) 0%, #ffffff 42%);
}

body.app-has-contact .interaction-card {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--state-accent) 14%, transparent), var(--shadow-soft);
}

.interaction-card.tone-active,
.interaction-card.tone-ringing,
.interaction-card.tone-dialing,
.interaction-card.tone-hold {
  border-color: color-mix(in srgb, var(--state-accent) 48%, var(--line));
}

.interaction-card.tone-hold {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--state-accent-soft) 80%, #ffffff) 0%, #ffffff 48%);
}

.pill.tone-ringing,
.pill.tone-dialing,
.pill.tone-active,
.pill.tone-hold,
.pill.tone-ended,
.pill.tone-work {
  background: var(--state-accent-soft);
  color: var(--state-accent-text);
  border: 1px solid color-mix(in srgb, var(--state-accent) 24%, transparent);
}

.voice-controls {
  background: color-mix(in srgb, var(--state-accent-soft) 34%, #ffffff);
}

.voice-controls .small-button {
  min-height: 50px;
  border: 1px solid #dbe5ec;
  background: #ffffff;
  color: #304053;
}

.voice-controls .small-button::before {
  background: color-mix(in srgb, var(--state-accent-soft) 72%, #ffffff);
  color: var(--state-accent-text);
}

.voice-controls .small-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--state-accent) 35%, #dbe5ec);
  background: var(--state-accent-soft);
}

body.app-tone-ringing .voice-controls .primary-answer,
body.app-tone-dialing .voice-controls .primary-answer {
  background: #16835b;
  color: #ffffff;
  border-color: #16835b;
  box-shadow: 0 8px 20px rgba(22, 131, 91, 0.2);
}

body.app-tone-active .voice-controls .primary-end,
body.app-tone-dialing .voice-controls .primary-end,
body.app-tone-hold .voice-controls .primary-end {
  background: #b53d3d;
  color: #ffffff;
  border-color: #b53d3d;
  box-shadow: 0 8px 20px rgba(181, 61, 61, 0.18);
}

body.app-tone-ringing .voice-controls .primary-answer::before,
body.app-tone-active .voice-controls .primary-end::before,
body.app-tone-dialing .voice-controls .primary-end::before,
body.app-tone-hold .voice-controls .primary-end::before {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.agent-presence-chip,
.tools-summary-status {
  border: 1px solid rgba(255, 255, 255, 0.26);
}

/* Embedded navigation rail: quiet by default, useful when the workspace grows. */
.workspace-shell {
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 6px;
}

.icon-rail {
  top: 4px;
  gap: 5px;
  padding: 6px 4px;
  border-color: #dce6ee;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.icon-rail a {
  width: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #667486;
  font-size: 11px;
  font-weight: 900;
}

.icon-rail a:hover,
.icon-rail a:focus {
  border-color: color-mix(in srgb, var(--state-accent) 28%, #dce6ee);
  background: var(--state-accent-soft);
  color: var(--state-accent-text);
}

body.app-no-contact .icon-rail a[href="#interactionPanel"],
body.app-no-contact .icon-rail a[href="#wrapPanel"] {
  display: none;
}

/* DaVinci embedded refinement: lighter login chrome and tighter side-panel density. */
.agent-console {
  width: min(560px, calc(100% - 10px));
  padding-top: 3px;
}

.phone-frame {
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(22, 38, 57, 0.08);
}

.phone-titlebar {
  min-height: 22px;
  padding: 0 8px;
}

.phone-title {
  gap: 6px;
  font-size: 11px;
}

.phone-glyph {
  font-size: 9px;
}

.window-actions {
  gap: 7px;
}

.window-actions span {
  width: 9px;
  opacity: 0.55;
}

.presence-bar {
  grid-template-columns: minmax(105px, 1fr) auto;
  gap: 7px;
  padding: 7px 9px;
}

body.app-logged-out .presence-bar {
  grid-template-columns: minmax(96px, 1fr) minmax(0, auto);
}

.brand-lockup h1 {
  font-size: 14px;
}

.presence-bar .eyebrow {
  font-size: 8px;
}

.session-actions {
  gap: 4px;
  flex-wrap: nowrap;
}

.session-actions .button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: none;
  font-size: 11px;
}

.presence-bar #manualLoginButton:not(:disabled),
.presence-bar #ssoLoginButton:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: none;
}

.presence-bar #ssoLoginButton:not(:disabled) {
  background: rgba(255, 255, 255, 0.26);
}

.presence-bar #manualLoginButton:not(:disabled):hover,
.presence-bar #ssoLoginButton:not(:disabled):hover {
  transform: none;
  background: rgba(255, 255, 255, 0.32);
}

.presence-bar #logoutButton:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.agent-presence-chip {
  min-width: 132px;
  gap: 6px;
}

.avatar {
  width: 26px;
  height: 26px;
  border-width: 2px;
  font-size: 11px;
}

.presence-state {
  font-size: 12px;
}

.agent-presence-chip small {
  font-size: 9px;
}

.launch-card {
  gap: 7px;
  padding: 9px;
  border-radius: 10px;
  box-shadow: 0 5px 14px rgba(22, 38, 57, 0.07);
}

.launch-brand {
  padding-bottom: 6px;
}

.launch-mark {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 11px;
}

.launch-brand h2 {
  font-size: 13px;
}

.voice-choice-list label {
  min-height: 34px;
  border-radius: 8px;
  font-size: 10px;
}

.launch-card .button {
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--blue) 35%, #cfe0ee);
  background: #ffffff;
  color: var(--blue-strong);
  box-shadow: none;
  font-size: 13px;
}

.launch-card .button:hover {
  background: var(--surface-blue);
}

@media (max-width: 560px) {
  .agent-console {
    width: min(100% - 6px, 420px);
  }

  body.app-logged-out .presence-bar,
  .presence-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .session-actions {
    display: flex;
    grid-column: auto;
    justify-content: flex-start;
  }

  body.app-logged-in .session-actions {
    grid-column: auto;
    justify-content: flex-start;
  }

  .workspace-shell {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 4px;
  }

  .icon-rail {
    padding: 5px 3px;
  }

  .icon-rail a {
    width: 22px;
    min-height: 24px;
    font-size: 10px;
  }
}

/* NICE-in-CRM visual model: flat embedded chrome, dense utility rail, and CRM-style panels. */
body {
  background: #f3f5f7;
}

.agent-console {
  width: min(430px, 100%);
  padding: 0;
}

.phone-frame {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.phone-titlebar {
  min-height: 0;
  padding: 0;
  border: 0;
}

.phone-title,
.window-actions {
  display: none;
}

.presence-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 50px;
  padding: 7px 10px;
  border-bottom: 1px solid #0875a8;
  background: #087eb6;
  color: #ffffff;
}

body.app-tone-active .presence-bar {
  background: #0f7f62;
  border-bottom-color: #0b674f;
}

body.app-tone-ringing .presence-bar,
body.app-tone-hold .presence-bar {
  background: #9a650c;
  border-bottom-color: #77500b;
}

body.app-tone-ended .presence-bar {
  background: #9f3838;
  border-bottom-color: #7f2d2d;
}

.brand-lockup {
  align-self: center;
}

.brand-lockup h1 {
  font-size: 14px;
  font-weight: 800;
}

.presence-bar .eyebrow {
  margin-bottom: 1px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 9px;
}

.agent-presence-chip {
  min-width: 112px;
  padding: 0;
  border: 0;
}

.avatar {
  width: 28px;
  height: 28px;
  border: 0;
  background: #ffffff;
  color: #087eb6;
}

.presence-state {
  font-size: 11px;
  line-height: 1.1;
}

.agent-presence-chip small {
  margin-top: 1px;
  font-size: 9px;
}

.session-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  padding-top: 6px;
}

body.app-logged-in .session-actions {
  grid-column: auto;
  padding-top: 0;
}

.session-actions .button {
  min-height: 24px;
  padding: 0 8px;
  border-color: rgba(255, 255, 255, 0.32);
  border-radius: 4px;
  font-size: 11px;
}

.launch-card {
  margin: 8px;
  border-radius: 2px;
  box-shadow: none;
}

.workspace-shell {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0;
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

.icon-rail {
  position: sticky;
  top: 0;
  min-height: calc(100vh - 50px);
  gap: 2px;
  padding: 7px 5px;
  border: 0;
  border-right: 1px solid #d9e1e8;
  border-radius: 0;
  background: #e8eff5;
}

.icon-rail a {
  width: 31px;
  min-height: 31px;
  border-radius: 2px;
  color: #3f5668;
  font-size: 11px;
}

.icon-rail a:hover,
.icon-rail a:focus {
  border-color: #b5c9d8;
  background: #ffffff;
  color: #087eb6;
}

.workspace-content {
  padding: 7px;
  background: #ffffff;
}

.command-grid,
.context-grid,
.advanced-grid {
  gap: 7px;
  margin-top: 7px;
}

.command-grid {
  margin-top: 0;
}

.panel,
.launch-card,
.connection-strip {
  border-color: #d6e0e8;
  border-radius: 2px;
  background: #ffffff;
  box-shadow: none;
}

.panel {
  padding: 9px;
}

.panel-heading {
  padding-bottom: 6px;
  border-bottom: 1px solid #edf2f6;
}

.section-label {
  color: #087eb6;
  font-size: 10px;
}

h2 {
  font-size: 13px;
}

.pill,
.badge {
  min-height: 22px;
  border-radius: 999px;
}

.button,
.small-button,
select,
input,
textarea {
  border-radius: 3px;
}

.button {
  min-height: 30px;
  box-shadow: none;
}

select,
input,
textarea {
  border-color: #cfdbe5;
  background: #ffffff;
}

.details-list div,
.active-details div {
  grid-template-columns: 82px minmax(0, 1fr);
  padding: 5px 0;
}

.interaction-card {
  border-left-width: 4px;
  border-radius: 2px;
}

body.app-has-contact .interaction-card {
  position: sticky;
  top: 0;
  box-shadow: none;
}

body.app-has-contact .voice-controls {
  bottom: 0;
  border-radius: 2px;
  box-shadow: none;
}

.voice-controls .small-button {
  border-radius: 3px;
}

.events-panel[open] {
  max-height: 280px;
}

@media (max-width: 560px) {
  .agent-console {
    width: 100%;
  }

  .workspace-shell {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .workspace-content {
    padding: 6px;
  }

  .icon-rail {
    padding: 6px 4px;
  }

  .icon-rail a {
    width: 29px;
    min-height: 29px;
  }
}

/* DaVinci embedded refresh: neutral CRM chrome with status colors used only for state. */
:root {
  --blue: #25636f;
  --blue-strong: #164e63;
  --green: #198754;
  --amber: #b7791f;
  --red: #b42318;
  --ink: #172033;
  --muted: #5c6675;
  --line: #d9e0e7;
  --soft-line: #edf1f5;
  --surface-soft: #f7f8fa;
  --surface-blue: #eef4f6;
  --shadow: none;
  --shadow-tight: none;
}

body {
  background: #f4f5f7;
  color: var(--ink);
}

.agent-console {
  width: min(860px, 100%);
  margin: 0;
  padding: 0;
}

.phone-frame {
  border: 0;
  border-bottom: 1px solid #d7dde4;
  background: #ffffff;
}

.presence-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 46px;
  padding: 7px 12px;
  border-bottom: 1px solid #d7dde4;
  background: #ffffff;
  color: var(--ink);
}

body.app-tone-active .presence-bar,
body.app-tone-ringing .presence-bar,
body.app-tone-hold .presence-bar,
body.app-tone-ended .presence-bar {
  border-bottom-color: #d7dde4;
  background: #ffffff;
}

.brand-lockup {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.presence-bar .eyebrow {
  margin: 0;
  color: #6b7280;
  font-size: 10px;
  letter-spacing: 0;
}

.brand-lockup h1 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.agent-presence-chip {
  min-width: 126px;
  padding: 3px 8px;
  border: 1px solid #d7dde4;
  border-radius: 999px;
  background: #f8fafc;
}

.avatar {
  width: 25px;
  height: 25px;
  border: 0;
  background: #e8f3ee;
  color: #146c43;
  font-size: 11px;
}

.presence-state {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.05;
}

.agent-presence-chip small {
  color: #687386;
  font-size: 9px;
}

.session-actions {
  grid-column: auto;
  padding-top: 0;
}

.session-actions .button,
.presence-bar #manualLoginButton:not(:disabled),
.presence-bar #ssoLoginButton:not(:disabled) {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #cbd5df;
  border-radius: 4px;
  background: #ffffff;
  color: #263244;
  box-shadow: none;
  font-size: 12px;
}

.presence-bar #ssoLoginButton:not(:disabled) {
  background: #f1f5f9;
}

.session-actions .button:hover,
.presence-bar #manualLoginButton:not(:disabled):hover,
.presence-bar #ssoLoginButton:not(:disabled):hover {
  transform: none;
  border-color: #9aa7b4;
  background: #f6f8fa;
}

body.app-logged-in .presence-bar {
  grid-template-columns: minmax(0, 1fr) minmax(118px, auto) auto;
}

body.app-logged-in .session-actions {
  display: flex;
  grid-column: auto;
  justify-content: flex-end;
  min-width: max-content;
}

body.app-logged-in #logoutButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.app-logged-in .presence-bar #logoutButton:not(:disabled) {
  border-color: #cbd5df;
  background: #ffffff;
  color: #8a1f1f;
}

.workspace-shell {
  grid-template-columns: 32px minmax(0, 1fr);
  background: #ffffff;
}

.icon-rail {
  min-height: calc(100vh - 47px);
  padding: 6px 3px;
  border-right: 1px solid #d7dde4;
  background: #f7f9fb;
}

.icon-rail a {
  width: 25px;
  min-height: 28px;
  border-radius: 4px;
  color: #5f6b7a;
  font-size: 10px;
}

.icon-rail a:hover,
.icon-rail a:focus {
  background: #e9eef4;
  color: #1f2937;
}

.workspace-content {
  padding: 8px 10px 12px;
}

.command-grid {
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1.1fr);
  gap: 10px;
}

.panel,
.launch-card,
.connection-strip {
  border-color: #d7dde4;
  border-radius: 4px;
  background: #ffffff;
}

.panel {
  padding: 12px;
}

.panel-heading {
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid #edf1f5;
}

.section-label {
  color: #667085;
  font-size: 10px;
  letter-spacing: 0;
}

h2 {
  color: var(--ink);
  font-size: 15px;
}

.pill,
.badge,
.tools-summary-status {
  min-height: 22px;
  border-radius: 999px;
  background: #eef2f6;
  color: #334155;
  font-size: 11px;
}

.details-list div,
.active-details div {
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
}

dt,
.field span {
  color: #667085;
  font-size: 11px;
}

dd {
  font-size: 13px;
}

select,
input,
textarea {
  border-color: #cfd8e3;
  border-radius: 4px;
  color: #172033;
  font-size: 14px;
}

select,
input {
  min-height: 38px;
  padding: 0 11px;
}

.button {
  min-height: 36px;
  border-radius: 4px;
  background: #334155;
  box-shadow: none;
  font-size: 14px;
}

.button:hover {
  background: #1f2937;
}

.button-secondary {
  background: #eef2f6;
  color: #526071;
}

.button-secondary:hover {
  background: #e2e8f0;
}

.action-primary {
  background: #198754;
  color: #ffffff;
}

.action-primary:hover {
  background: #146c43;
}

.presence-rail .button {
  border: 1px solid transparent;
}

.presence-rail .button.state-selected {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72), 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.presence-rail #readyButton.state-selected {
  background: #198754;
  color: #ffffff;
}

.presence-rail #notReadyButton.state-selected {
  background: #8a2430;
  color: #ffffff;
}

.presence-rail #notReadyButton.state-selected:hover {
  background: #761e29;
}

.presence-rail {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.reason-field {
  grid-column: 1 / -1;
}

.dial-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.dial-grid .button {
  width: min(210px, 100%);
}

.event-actions .button {
  min-height: 32px;
  padding: 0 12px;
}

.event-list {
  max-height: 360px;
}

.event-item {
  grid-template-columns: 74px 140px minmax(0, 1fr);
  padding: 8px 10px;
  border-radius: 4px;
  background: #f8fafc;
  font-size: 12px;
}

.event-source {
  color: #475569;
}

body.app-no-contact .icon-rail a[href="#interactionPanel"],
body.app-no-contact .icon-rail a[href="#wrapPanel"] {
  display: none;
}

@media (max-width: 720px) {
  .agent-console {
    width: 100%;
  }

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

  .session-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 6px;
  }

  .workspace-shell {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .workspace-content {
    padding: 7px;
  }

  .command-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "agent"
      "dial"
      "interaction"
      "digital";
  }
}

/* Active-call clarity pass: compact call controls and readable transfer workflows. */
body.app-tone-active .agent-presence-chip {
  border-color: #b7dfca;
  background: #f0f9f4;
}

body.app-tone-ringing .agent-presence-chip,
body.app-tone-hold .agent-presence-chip {
  border-color: #edd6a3;
  background: #fff8e8;
}

body.app-tone-ended .agent-presence-chip {
  border-color: #f1b7b7;
  background: #fff1f1;
}

.interaction-card {
  border-left: 3px solid #d7dde4;
}

.interaction-card.tone-active {
  border-color: #b7dfca;
  border-left-color: #198754;
  background: #ffffff;
}

.interaction-card.tone-ringing,
.interaction-card.tone-hold {
  border-left-color: #b7791f;
}

.interaction-card.tone-ended {
  border-left-color: #b42318;
}

.interaction-layout {
  grid-template-columns: minmax(210px, 0.92fr) minmax(280px, 1.08fr);
  gap: 12px;
}

.control-stack {
  gap: 8px;
}

.voice-controls,
body.app-has-contact .voice-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  position: static;
  padding: 8px;
  border: 1px solid #d7dde4;
  border-radius: 4px;
  background: #f8fafc;
  box-shadow: none;
}

.voice-controls .small-button {
  min-height: 46px;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto;
  place-items: center;
  gap: 3px;
  padding: 6px 4px;
  border: 1px solid #d7dde4;
  border-radius: 4px;
  background: #ffffff;
  color: #344054;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  box-shadow: none;
}

.voice-controls .small-button::before {
  width: 22px;
  height: 18px;
  border-radius: 999px;
  background: #eef2f6;
  color: #475467;
  font-size: 9px;
  line-height: 1;
}

.voice-controls .small-button:hover:not(:disabled) {
  border-color: #98a2b3;
  background: #f9fafb;
}

.voice-controls .small-button:disabled {
  opacity: 0.38;
}

.voice-controls .primary-answer {
  border-color: #b7dfca;
  background: #f0f9f4;
  color: #146c43;
}

.voice-controls .primary-answer::before {
  background: #dff3e8;
  color: #146c43;
}

.voice-controls .primary-end {
  border-color: #d92d20;
  background: #d92d20;
  color: #ffffff;
}

.voice-controls .primary-end::before {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.advanced-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.advanced-panel summary strong {
  max-width: 220px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.15;
}

#transferPanel,
#conferencePanel {
  align-self: start;
}

#transferPanel .advanced-content,
#conferencePanel .advanced-content {
  display: grid;
  gap: 10px;
}

.workflow-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.workflow-target {
  grid-column: 1 / -1;
}

#transferPanel .control-buttons,
#conferencePanel .control-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#transferPanel .small-button,
#conferencePanel .small-button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  background: #f8fafc;
  color: #263244;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

#transferPanel .small-button:hover:not(:disabled),
#conferencePanel .small-button:hover:not(:disabled) {
  border-color: #98a2b3;
  background: #eef2f6;
}

#startTransferButton,
#startConferenceButton,
#addParticipantButton {
  border-color: #b7dfca;
  background: #f0f9f4;
  color: #146c43;
}

#cancelTransferButton,
#endConferenceButton {
  border-color: #f1b7b7;
  background: #fff1f1;
  color: #9a221e;
}

.workflow-summary {
  min-height: 42px;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 4px;
  background: #f8fafc;
  color: #5c6675;
  font-size: 13px;
}

@media (max-width: 720px) {
  .interaction-layout,
  .advanced-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .voice-controls,
  body.app-has-contact .voice-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #transferPanel .control-buttons,
  #conferencePanel .control-buttons {
    grid-template-columns: minmax(0, 1fr);
  }
}
