/* dhvani product workspace. Shared tokens/components: css/system.css. */

body {
  min-width: 320px;
}

button,
input,
select,
textarea {
  font-family: var(--fw-font-sans);
}

.fw-skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: var(--fw-radius-md);
  background: var(--fw-surface);
  color: var(--fw-primary);
  box-shadow: var(--fw-shadow-card);
}

.fw-skip-link:focus {
  top: 16px;
}

/* Shell */

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 256px;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px;
  overflow-y: auto;
  background: var(--fw-surface);
  border-right: 1px solid var(--fw-border);
}

.app-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  margin-bottom: 32px;
}

.app-sidebar__close,
.app-menu {
  display: none;
}

.app-nav {
  display: grid;
  gap: 24px;
}

.app-nav__label {
  margin: 0 12px 8px;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
  font-weight: 500;
}

.app-nav__item {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--fw-radius-md);
  background: transparent;
  color: var(--fw-on-surface-muted);
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms var(--fw-ease), color 140ms var(--fw-ease);
}

.app-nav__item .ph {
  font-size: 20px;
}

.app-nav__item:hover {
  background: var(--fw-well);
  color: var(--fw-on-surface);
}

.app-nav__item.active {
  background: var(--fw-well);
  color: var(--fw-on-surface);
  font-weight: 500;
}

.app-nav__item--button {
  width: 100%;
}

.app-nav__count {
  min-width: 24px;
  margin-left: auto;
  color: var(--fw-on-surface-muted);
  text-align: right;
}

.app-sidebar__foot {
  margin-top: auto;
  padding-top: 32px;
}

.app-number {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--fw-border);
  border-radius: 18px;
  background: var(--fw-surface);
}

.app-number__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--fw-well);
  color: var(--fw-on-surface);
}

.app-number__label,
.app-number__value {
  display: block;
  line-height: 1.35;
}

.app-number__label {
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-number__value {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
}

.app-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 16px 8px 4px;
  border-top: 1px solid var(--fw-border);
}

.app-user__avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--fw-primary);
  color: var(--fw-on-primary);
  font-size: 13px;
  font-weight: 500;
}

.app-user__copy {
  min-width: 0;
}

.app-user__copy strong,
.app-user__copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user__copy strong {
  font-size: 14px;
  font-weight: 500;
}

.app-user__copy span {
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-powered {
  margin: 12px 8px 0;
  color: var(--fw-on-surface-muted);
  font-size: 12px;
}

.app-powered a {
  font-weight: 500;
}

.app-nav-scrim {
  display: none;
}

.app-body {
  min-height: 100vh;
  margin-left: 256px;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  background: var(--fw-neutral);
  border-bottom: 1px solid var(--fw-border);
}

.app-search {
  position: relative;
  width: min(420px, 44vw);
}

.app-search .ph {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fw-on-surface-muted);
  pointer-events: none;
}

.app-search input {
  width: 100%;
  height: 44px;
  padding: 0 40px;
  border: 1px solid transparent;
  border-radius: var(--fw-radius-md);
  background: var(--fw-well);
  color: var(--fw-on-surface);
  font-size: 15px;
}

.app-search input:focus {
  outline: none;
  background: var(--fw-surface);
  border-color: var(--fw-primary);
  box-shadow: 0 0 0 3px rgba(63, 111, 209, 0.24);
}

.app-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 24px;
  padding: 1px 8px;
  border: 1px solid var(--fw-border-strong);
  border-radius: 6px;
  background: var(--fw-surface);
  color: var(--fw-on-surface-muted);
  font: 13px/20px "Fragment Mono", monospace;
  text-align: center;
}

.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.app-demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-sm);
  background: var(--fw-surface);
  color: var(--fw-on-surface-muted);
  font-size: 13px;
  white-space: nowrap;
}

#app-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 32px 56px;
  outline: none;
}

.app-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.app-page-title {
  margin: 0;
  font-size: 36px;
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.app-page-subtitle {
  margin: 8px 0 0;
  color: var(--fw-on-surface-muted);
  font-size: 17px;
}

.app-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Setup */

.app-setup {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  padding: 16px 24px 16px 16px;
  border: 1px solid var(--fw-border);
  border-radius: 24px;
  background: var(--fw-surface);
  box-shadow: var(--fw-shadow-card);
}

.app-setup__sky {
  width: 88px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 16px;
  background-color: var(--fw-secondary);
  background-image: var(--sky-image);
  background-position: center;
  background-size: cover;
  image-rendering: pixelated;
}

.app-setup__copy {
  flex: 1;
}

.app-setup__copy h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.app-setup__copy p {
  margin: 4px 0 0;
  color: var(--fw-on-surface-muted);
  font-size: 15px;
}

/* Stats */

.app-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.app-stat {
  padding: 24px;
  border-radius: 24px;
}

.app-stat .fw-stat__value {
  font-family: "Fragment Mono", monospace;
  font-size: 32px;
  letter-spacing: 0;
}

.app-stat .fw-stat__label {
  margin-top: 12px;
}

/* Dashboard panels */

.app-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 24px;
}

.app-panel {
  min-width: 0;
  border-radius: 24px;
  overflow: hidden;
}

.app-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
}

.app-panel__title {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.app-panel__subtitle {
  margin: 4px 0 0;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
}

.app-panel__empty {
  margin: 0;
  padding: 24px;
  color: var(--fw-on-surface-muted);
  font-size: 15px;
}

.app-link {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.app-chart {
  height: 240px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  padding: 24px 24px 0;
}

.app-chart__day {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr 24px;
  gap: 8px;
}

.app-chart__bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  border-bottom: 1px solid var(--fw-border);
}

.app-chart__bar {
  width: min(16px, 36%);
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--fw-well-deep);
}

.app-chart__bar--answered {
  background: var(--fw-primary);
}

.app-chart__label {
  color: var(--fw-on-surface-muted);
  font-family: "Fragment Mono", monospace;
  font-size: 12px;
  text-align: center;
}

.app-chart__legend {
  display: flex;
  gap: 24px;
  padding: 12px 24px 24px;
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-chart__legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-chart__key {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--fw-well-deep);
}

.app-chart__key--answered {
  background: var(--fw-primary);
}

.app-attention {
  padding-top: 12px;
}

.app-attention__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 24px;
  color: inherit;
  text-decoration: none;
}

.app-attention__item:hover {
  background: #fafaf9;
}

.app-attention__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--fw-well);
  color: var(--fw-on-surface);
}

.app-attention__item strong,
.app-attention__item span span {
  display: block;
}

.app-attention__item strong {
  font-size: 14px;
  font-weight: 500;
}

.app-attention__item span span {
  margin-top: 4px;
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-agent-duty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 24px 0;
}

.app-agent-duty__icon,
.app-agent-card__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--fw-well);
  color: var(--fw-on-surface);
}

.app-agent-duty h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.app-agent-duty p {
  margin: 4px 0 0;
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-agent-duty .app-status {
  margin-left: auto;
}

.app-agent-duty__stats {
  display: flex;
  gap: 24px;
  padding: 24px 24px;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
}

.app-agent-duty__stats strong {
  color: var(--fw-on-surface);
  font-weight: 500;
}

.app-agent-duty__actions {
  padding: 0 24px 24px;
}

/* Tables */

.app-table-panel {
  border-radius: 24px;
  overflow: hidden;
}

.app-table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 24px;
  flex-wrap: wrap;
}

.app-table-search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}

.app-table-search .ph {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fw-on-surface-muted);
  pointer-events: none;
}

.app-table-search input,
.app-filter {
  height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--fw-well);
  color: var(--fw-on-surface);
  font-size: 14px;
}

.app-table-search input {
  width: 100%;
  padding: 0 12px 0 40px;
}

.app-filter {
  padding: 0 32px 0 12px;
}

.app-table-search input:focus,
.app-filter:focus {
  outline: none;
  background: var(--fw-surface);
  border-color: var(--fw-primary);
  box-shadow: 0 0 0 3px rgba(63, 111, 209, 0.24);
}

.app-table-wrap {
  overflow-x: auto;
}

.app-table th:first-child,
.app-table td:first-child {
  padding-left: 24px;
}

.app-table th:last-child,
.app-table td:last-child {
  padding-right: 24px;
}

.app-table tbody tr[data-action] {
  cursor: pointer;
}

.app-cell-primary,
.app-cell-secondary {
  display: block;
}

.app-cell-primary {
  font-weight: 500;
}

.app-cell-secondary {
  margin-top: 4px;
  color: var(--fw-on-surface-muted);
  font-size: 12px;
}

.app-call-status {
  font-size: 14px;
}

.app-call-status--missed {
  color: var(--fw-error);
}

.app-call-status--completed,
.app-call-status--transferred {
  color: var(--fw-on-surface);
}

.app-consent {
  color: var(--fw-on-surface-muted);
  font-size: 14px;
}

/* Agents */

.app-agent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.app-agent-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.app-agent-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.app-agent-card__title {
  min-width: 0;
  flex: 1;
}

.app-agent-card__title h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.app-agent-card__title p {
  margin: 4px 0 0;
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-agent-card__description {
  display: -webkit-box;
  margin: 24px 0 12px;
  overflow: hidden;
  color: var(--fw-on-surface-muted);
  font-size: 15px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.app-agent-card__languages {
  margin: 0 0 24px;
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-agent-card__stats {
  display: flex;
  gap: 24px;
  margin-top: auto;
  padding: 16px 0;
  border-top: 1px solid var(--fw-border);
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-agent-card__stats strong {
  color: var(--fw-on-surface);
  font-size: 18px;
  font-weight: 500;
}

.app-agent-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-agent-card__delete {
  margin-left: auto;
  color: var(--fw-error);
}

.app-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fw-on-surface-muted);
  font-family: "Fragment Mono", monospace;
  font-size: 13px;
  white-space: nowrap;
}

.app-status--live {
  color: var(--fw-tertiary-text);
}

/* Follow-ups */

.app-followup-head {
  margin-bottom: 16px;
}

.app-followup-list {
  border-radius: 24px;
  overflow: hidden;
}

.app-followup {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 24px;
  border-top: 1px solid var(--fw-border);
}

.app-followup:first-child {
  border-top: 0;
}

.app-followup--done .app-followup__main p {
  color: var(--fw-on-surface-muted);
  text-decoration: line-through;
}

.app-followup__check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--fw-border-strong);
  border-radius: 7px;
  background: var(--fw-surface);
  color: var(--fw-on-primary);
  cursor: pointer;
}

.app-followup__check .ph {
  font-size: 15px;
}

.app-followup__check--done {
  background: var(--fw-primary);
  border-color: var(--fw-primary);
}

.app-followup__main {
  min-width: 0;
  flex: 1;
}

.app-followup__main p {
  margin: 0;
  font-weight: 500;
}

.app-followup__main span {
  display: block;
  margin-top: 4px;
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-followup__due {
  color: var(--fw-on-surface-muted);
  font-family: "Fragment Mono", monospace;
  font-size: 12px;
  white-space: nowrap;
}

.app-followup__due--overdue {
  color: var(--fw-error);
}

/* Integrations */

.app-integration-section {
  margin-bottom: 40px;
}

.app-section-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.app-section-description {
  max-width: 60ch;
  margin: 8px 0 24px;
  color: var(--fw-on-surface-muted);
  font-size: 16px;
}

.app-integration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.app-integration-card__sky {
  height: 220px;
}

.app-integration-card__sky .fw-window__panel {
  min-height: 150px;
}

.app-integration-card__body {
  padding: 24px;
}

.app-integration-card__body .fw-card__title {
  margin-top: 12px;
  font-size: 22px;
}

.app-integration-card__body .fw-card__text {
  margin-top: 8px;
  font-size: 15px;
}

.app-integration-card__status {
  margin: 16px 0 0;
  color: var(--fw-on-surface-muted);
  font-family: "Fragment Mono", monospace;
  font-size: 12px;
}

.app-integration-card__body .fw-card__actions {
  margin-top: 24px;
}

.app-channel-list {
  border-radius: 24px;
  overflow: hidden;
}

.app-channel-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 24px 24px;
  border-top: 1px solid var(--fw-border);
}

.app-channel-row:first-child {
  border-top: 0;
}

.app-channel-row__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--fw-well);
  color: var(--fw-on-surface);
}

.app-channel-row__copy strong,
.app-channel-row__copy span {
  display: block;
}

.app-channel-row__copy strong {
  font-size: 15px;
  font-weight: 500;
}

.app-channel-row__copy span {
  margin-top: 4px;
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-channel-row__status {
  color: var(--fw-on-surface-muted);
}

/* Settings and forms */

.app-settings {
  max-width: 840px;
}

.app-settings__actions {
  margin-bottom: 24px;
}

.app-settings__section {
  margin-bottom: 24px;
  padding: 32px;
  border-radius: 24px;
}

.app-settings__section .app-section-description {
  margin-bottom: 24px;
}

.app-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.app-field {
  display: grid;
  align-content: start;
  gap: 0;
}

.app-field--full {
  grid-column: 1 / -1;
}

.app-voice-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-voice-picker .fw-select {
  flex: 1;
  min-width: 0;
}

.app-voice-picker .fw-btn {
  flex-shrink: 0;
}

.app-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.app-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--fw-border);
  border-radius: 10px;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
  cursor: pointer;
}

.app-check-label:has(input:checked) {
  background: var(--fw-well);
  color: var(--fw-on-surface);
  border-color: var(--fw-border-strong);
}

.app-check-label input {
  accent-color: var(--fw-primary);
}

.app-textarea--tall {
  min-height: 160px;
}

.app-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--fw-border);
}

.app-toggle-row:first-of-type {
  border-top: 0;
}

.app-toggle-row strong,
.app-toggle-row span span {
  display: block;
}

.app-toggle-row strong {
  font-size: 15px;
  font-weight: 500;
}

.app-toggle-row span span {
  margin-top: 4px;
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-retention {
  max-width: 360px;
  margin-top: 24px;
}

.app-settings__actions {
  display: flex;
  justify-content: flex-start;
  padding: 8px 0 0;
}

.app-form-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 24px 0 0;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
}

/* Modal */

.app-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(88vh, 920px);
  padding: 0;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-window);
  background: var(--fw-surface);
  color: var(--fw-on-surface);
  box-shadow: 0 24px 80px rgba(23, 23, 23, 0.2);
}

.app-modal::backdrop {
  background: rgba(23, 23, 23, 0.42);
}

.app-modal[open] {
  animation: app-modal-in 200ms var(--fw-ease);
}

@keyframes app-modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-modal__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px;
  border-bottom: 1px solid var(--fw-border);
  background: var(--fw-surface);
}

.app-modal__head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.app-modal__head p {
  margin: 4px 0 0;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
}

.app-modal__body {
  padding: 24px;
}

.app-modal__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px 24px;
  border-top: 1px solid var(--fw-border);
  background: var(--fw-surface);
}

.app-call-summary {
  padding: 16px;
  border-radius: var(--fw-radius-md);
  background: var(--fw-well);
  color: var(--fw-on-surface-muted);
  font-size: 15px;
}

.app-call-summary p {
  margin: 0;
}

.app-call-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.app-call-facts div,
.app-extracted div {
  padding: 12px;
  border: 1px solid var(--fw-border);
  border-radius: 12px;
}

.app-call-facts span,
.app-call-facts strong,
.app-extracted span,
.app-extracted strong {
  display: block;
}

.app-call-facts span,
.app-extracted span {
  color: var(--fw-on-surface-muted);
  font-size: 12px;
  text-transform: capitalize;
}

.app-call-facts strong,
.app-extracted strong {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
}

.app-detail-section {
  margin-top: 24px;
}

.app-detail-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 500;
}

.app-extracted {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.app-muted {
  color: var(--fw-on-surface-muted);
}

.app-confirm-copy {
  margin: 0;
  color: var(--fw-on-surface-muted);
}

.app-help {
  display: grid;
  gap: 8px;
}

.app-help div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--fw-border);
}

.app-help kbd {
  min-width: 32px;
  padding: 4px 8px;
  border: 1px solid var(--fw-border-strong);
  border-radius: 6px;
  background: var(--fw-well);
  font: 13px "Fragment Mono", monospace;
  text-align: center;
}

.app-help__copy {
  margin: 24px 0 0;
  color: var(--fw-on-surface-muted);
}

/* Toasts and empty states */

.app-toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(400px, calc(100vw - 32px));
}

.app-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-md);
  background: var(--fw-surface);
  box-shadow: var(--fw-shadow-card);
  font-size: 15px;
  animation: app-toast-in 220ms var(--fw-ease);
}

.app-toast .ph {
  color: var(--fw-tertiary-text);
}

.app-toast--error .ph {
  color: var(--fw-error);
}

@keyframes app-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-empty {
  padding: 56px 24px;
  text-align: center;
}

.app-empty__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--fw-well);
  color: var(--fw-on-surface-muted);
}

.app-empty h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.app-empty p {
  max-width: 46ch;
  margin: 8px auto 24px;
  color: var(--fw-on-surface-muted);
  font-size: 15px;
}

/* Responsive */

@media (max-width: 1180px) {
  .app-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-dashboard-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 960px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform 220ms var(--fw-ease);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .app-sidebar__close,
  .app-menu {
    display: inline-flex;
  }

  .app-nav-scrim.visible {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    border: 0;
    background: rgba(23, 23, 23, 0.36);
  }

  .app-body {
    margin-left: 0;
  }

  .app-topbar {
    padding: 0 24px;
  }

  #app-main {
    padding: 32px 24px 40px;
  }

}

@media (max-width: 640px) {
  .app-topbar {
    gap: 8px;
    height: 64px;
    padding: 0 12px;
  }

  .app-search {
    width: auto;
    flex: 1;
  }

  /* Help stays reachable on phones; the New agent label is visually hidden
     but still read by assistive technology. */
  .app-search kbd {
    display: none;
  }

  /* Keep the demo label visible at every width, in compact form. */
  .app-demo-badge {
    padding: 4px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .app-topbar__cta span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .app-topbar__cta {
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  #app-main {
    padding: 24px 12px 40px;
  }

  .app-page-header {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
  }

  .app-page-title {
    font-size: 28px;
  }

  .app-page-subtitle {
    font-size: 15px;
  }

  .app-setup {
    flex-wrap: wrap;
    padding: 16px;
  }

  .app-setup .fw-btn {
    width: 100%;
  }

  .app-stats,
  .app-agent-grid,
  .app-integration-grid {
    grid-template-columns: 1fr;
  }

  .app-chart {
    gap: 8px;
    padding-inline: 16px;
  }

  .app-form-grid,
  .app-call-facts,
  .app-extracted {
    grid-template-columns: 1fr;
  }

  .app-settings__section,
  .app-agent-card {
    padding: 24px;
  }

  .app-channel-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding: 16px;
  }

  .app-channel-row__status {
    display: none;
  }

  .app-followup {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 16px;
  }

  .app-followup__due {
    margin-left: 40px;
  }

  .app-modal {
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .app-modal__head,
  .app-modal__body,
  .app-modal__foot {
    padding-left: 24px;
    padding-right: 24px;
  }

  .app-table th:first-child,
  .app-table td:first-child {
    padding-left: 16px;
  }

  .app-table th:last-child,
  .app-table td:last-child {
    padding-right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Knowledge */

.app-knowledge-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px 24px;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-md);
  background: var(--fw-surface);
}

.app-knowledge-note .ph {
  margin-top: 4px;
  color: var(--fw-secondary);
}

.app-knowledge-note p {
  margin: 0;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
}

.app-knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.app-knowledge-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.app-knowledge-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.app-knowledge-card__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--fw-well);
  color: var(--fw-on-surface);
}

.app-knowledge-card__head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.app-knowledge-card__head p {
  margin: 4px 0 0;
  color: var(--fw-on-surface-muted);
  font-size: 12px;
}

.app-knowledge-card__content {
  display: -webkit-box;
  margin: 16px 0 24px;
  overflow: hidden;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

.app-knowledge-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.app-knowledge-card__actions .fw-btn--icon {
  margin-left: auto;
  color: var(--fw-error);
}

/* Browser test call */

.app-test {
  display: grid;
  gap: 16px;
}

/* Setup row: three equal, top-aligned fields. */
.app-test__setup {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.app-test__field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.app-test__field .fw-select {
  width: 100%;
  min-height: 44px;
  font-size: 15px;
}

.app-test__hint {
  margin: -8px 0 0;
}

/* One panel holds the call: status bar, conversation and composer. */
.app-test__call {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-md);
  background: var(--fw-surface);
}

.app-test__callbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--fw-border);
}

.app-test__state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--fw-on-surface-muted);
  font-family: "Fragment Mono", monospace;
  font-size: 12px;
}

.app-test__callbar-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.app-test[data-state="idle"] [data-action="stop-test"],
.app-test[data-state="live"] [data-action="start-test"],
.app-test[data-state="live"] [data-action="hear-greeting"] {
  display: none;
}

.app-test[data-state="live"] .app-test__state {
  color: var(--fw-tertiary-text);
}

.app-test__end {
  color: var(--fw-error);
}

.app-test__transcript {
  min-height: 260px;
  max-height: 46vh;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  background: var(--fw-well);
}

.app-test__transcript .app-muted {
  margin: 0;
  font-size: 14px;
}

.app-test__empty {
  display: grid;
  justify-items: center;
  align-self: center;
  gap: 12px;
  max-width: 360px;
  margin: 40px auto;
  text-align: center;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
  line-height: 1.5;
}

.app-test__empty p {
  margin: 0;
}

.app-test__empty strong {
  color: var(--fw-on-surface);
  font-weight: 500;
}

.app-test__empty-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-sm);
  background: var(--fw-surface);
  color: var(--fw-on-surface);
  font-size: 20px;
}

.app-test__bubble {
  width: fit-content;
  max-width: 85%;
  padding: 12px 16px;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-bubble) var(--fw-radius-bubble)
    var(--fw-radius-bubble) 6px;
  background: var(--fw-surface);
  font-size: 15px;
  line-height: 1.45;
}

.app-test__bubble--caller {
  justify-self: end;
  border-color: transparent;
  border-radius: var(--fw-radius-bubble) var(--fw-radius-bubble) 6px
    var(--fw-radius-bubble);
  background: var(--fw-tertiary-tint);
}

.app-test__bubble span {
  display: block;
  margin-top: 4px;
  color: var(--fw-on-surface-muted);
  font-family: "Fragment Mono", monospace;
  font-size: 11px;
}

.app-test__composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--fw-border);
}

.app-test__composer .fw-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  font-size: 15px;
}

.app-test__composer .fw-btn--icon {
  flex: none;
  width: 44px;
  height: 44px;
}

.app-test__mic:disabled {
  opacity: 0.4;
}

.app-test__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--fw-on-surface-muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .app-knowledge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-knowledge-grid {
    grid-template-columns: 1fr;
  }

  .app-test__setup {
    grid-template-columns: 1fr 1fr;
  }

  .app-test__setup .app-test__field:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .app-test__callbar {
    flex-wrap: wrap;
    padding: 12px 12px;
  }

  .app-test__transcript {
    min-height: 200px;
  }
}

/* Prepaid wallet */

.app-wallet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.app-wallet__head .app-section-description {
  margin-bottom: 0;
}

.app-wallet__balance {
  flex-shrink: 0;
  text-align: right;
}

.app-wallet__balance span,
.app-wallet__balance strong {
  display: block;
}

.app-wallet__balance span {
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-wallet__balance strong {
  margin-top: 4px;
  font-family: "Fragment Mono", monospace;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.app-wallet__warning {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 0;
  padding: 12px 16px;
  border-radius: var(--fw-radius-md);
  background: var(--fw-error-tint);
  color: var(--fw-error);
  font-size: 14px;
}

.app-wallet__packs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.app-wallet__pack {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--fw-border-strong);
  border-radius: var(--fw-radius-md);
  background: var(--fw-surface);
  color: var(--fw-on-surface);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--fw-well-deep);
  transition: border-color 140ms var(--fw-ease), transform 140ms var(--fw-ease),
    box-shadow 140ms var(--fw-ease);
}

.app-wallet__pack:hover {
  border-color: var(--fw-primary);
}

.app-wallet__pack:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--fw-well-deep);
}

.app-wallet__pack strong {
  font-family: "Fragment Mono", monospace;
  font-size: 20px;
  font-weight: 400;
}

.app-wallet__pack span {
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-wallet__custom {
  max-width: 420px;
  margin-top: 24px;
}

.app-wallet__custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-wallet__currency {
  color: var(--fw-on-surface-muted);
  font-family: "Fragment Mono", monospace;
}

.app-wallet__custom-row .fw-input {
  flex: 1;
}

.app-wallet__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 24px 0 0;
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-wallet__block {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--fw-border);
}

.app-wallet__block h3 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 500;
}

.app-wallet__block > .fw-hint {
  margin: 12px 0 0;
}

.app-wallet__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-wallet__row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 0;
  border-top: 1px solid var(--fw-border);
}

.app-wallet__row:first-child {
  border-top: 0;
  padding-top: 0;
}

.app-wallet__row-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--fw-radius-sm);
  background: var(--fw-well);
  color: var(--fw-on-surface);
  font-size: 20px;
}

.app-wallet__row-icon--credit {
  background: var(--fw-tertiary-tint);
  color: var(--fw-tertiary-text);
}

.app-wallet__row-copy {
  min-width: 0;
}

.app-wallet__row-copy strong,
.app-wallet__row-copy > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-wallet__row-copy strong {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.app-wallet__row-copy > span {
  margin-top: 4px;
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-wallet__row-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}

.app-wallet__price,
.app-wallet__amount {
  font-family: "Fragment Mono", monospace;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.app-wallet__amount--credit {
  color: var(--fw-tertiary-text);
}

.app-wallet__amount--debit {
  color: var(--fw-on-surface);
}

.app-pay-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fw-on-surface-muted);
  font-family: "Fragment Mono", monospace;
  font-size: 13px;
}

.app-pay-status--approved {
  color: var(--fw-tertiary-text);
}

.app-pay-status--rejected {
  color: var(--fw-error);
}

.app-topup {
  text-align: center;
}

.app-topup span,
.app-topup strong {
  display: block;
}

.app-topup span {
  color: var(--fw-on-surface-muted);
  font-size: 14px;
}

.app-topup strong {
  margin: 8px 0 16px;
  font-family: "Fragment Mono", monospace;
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.app-topup p {
  max-width: 46ch;
  margin: 0 auto;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .app-wallet__packs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-wallet__head {
    flex-direction: column;
  }

  .app-wallet__balance {
    text-align: left;
  }

  .app-wallet__packs {
    grid-template-columns: 1fr 1fr;
  }
}


/* Toasts raised while a dialog is open render inside the dialog's top layer. */
.app-modal__toasts {
  position: fixed;
}

.app-table-footnote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 16px 16px;
  border-top: 1px solid var(--fw-border);
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-table-panel + .app-table-panel {
  margin-top: 24px;
}

.app-table-panel__title {
  padding: 16px 16px 0;
}

.app-source-option,
.app-confirm-option {
  margin-top: 12px;
  align-items: flex-start;
}

.app-source-url {
  overflow-wrap: anywhere;
}

/* Typing indicator while the agent's reply is on its way. */
.app-test__typing {
  display: inline-flex;
  gap: 4px;
  padding: 16px 16px;
}

.app-test__typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fw-on-surface-muted);
  opacity: 0.35;
  animation: app-typing 1s infinite ease-in-out;
}

.app-test__typing i:nth-child(2) { animation-delay: 0.15s; }
.app-test__typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes app-typing {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .app-test__typing i { animation: none; }
}

/* Elements hidden outside demo workspaces or when sign-in is off. */
.app-demo-badge[hidden],
.app-nav__item[hidden] {
  display: none;
}

.app-test__callbar-actions .fw-btn[hidden] {
  display: none;
}

/* UPI payment */
.app-upi {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
}

.app-upi__qr {
  padding: 8px;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-md);
  background: #fff;
  line-height: 0;
}

.app-upi__qr svg {
  width: 200px;
  height: 200px;
}

.app-upi__details dl {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
}

.app-upi__details dt {
  color: var(--fw-on-surface-muted);
  font-size: 13px;
}

.app-upi__details dd {
  margin: 4px 0 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.app-upi__utr {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.app-upi__utr .fw-hint {
  margin: 0;
}

@media (max-width: 560px) {
  .app-upi {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

/* Onboarding */
.app-welcome {
  max-width: 720px;
}

.app-welcome__card {
  padding: 40px;
}

.app-welcome__step {
  margin: 0 0 8px;
  color: var(--fw-on-surface-muted);
  font-family: "Fragment Mono", monospace;
  font-size: 13px;
}

.app-welcome__fields {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.app-welcome__fields .app-field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.app-welcome__fields .fw-hint {
  margin: 0;
}

.app-welcome__phone,
.app-welcome__fetch {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-welcome__phone span {
  color: var(--fw-on-surface-muted);
}

.app-welcome__phone .fw-input,
.app-welcome__fetch .fw-input {
  flex: 1;
  min-width: 0;
}

.app-welcome__tone {
  margin: 0;
  padding: 0;
  border: 0;
}

.app-welcome__tone legend {
  padding: 0;
  margin-bottom: 8px;
}

.app-welcome__tone .fw-tabs {
  justify-self: start;
}

.app-welcome__tone-option {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.app-welcome__tone-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.app-welcome__tone-option:has(input:checked) {
  background: var(--fw-surface);
  color: var(--fw-on-surface);
  box-shadow: 0 1px 0 var(--fw-border-strong);
}

.app-welcome__tone-option:has(input:focus-visible) {
  outline: 2px solid var(--fw-secondary);
  outline-offset: 2px;
}

.app-welcome__greeting {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-bubble) var(--fw-radius-bubble) var(--fw-radius-bubble) 6px;
  background: var(--fw-surface);
  font-size: 15px;
  line-height: 1.45;
}

.app-welcome__modes {
  justify-self: start;
}

.app-welcome__knowledge {
  min-height: 200px;
}

.app-welcome__error {
  margin: 24px 0 0;
  padding: 12px 16px;
  border-radius: var(--fw-radius-sm);
  background: var(--fw-error-tint);
  color: var(--fw-error);
  font-size: 14px;
}

.app-welcome__error[hidden] {
  display: none;
}

.app-welcome__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}

.app-welcome__skip {
  margin-left: auto;
}

@media (max-width: 640px) {
  .app-welcome__card {
    padding: 24px;
  }

  .app-welcome__fetch {
    flex-direction: column;
    align-items: stretch;
  }
}
