#demos-view,
#calendar-view {
  overflow-x: clip;
  max-width: 100%;
}

#demos-view .page-band-sub {
  color: #fff;
  font-size: 15px;
}

.bk-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.bk-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.bk-field-grow {
  flex: 1 1 220px;
}

.bk-field select,
.bk-field input {
  width: 100%;
  min-width: 160px;
  height: 44px;
  margin: 0;
  border-radius: 8px;
}

.bk-field-grow input {
  min-width: 0;
}

.bk-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.bk-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.demos-tabs-row {
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  max-width: 100%;
}

.demos-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
}

.demos-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 500 14px var(--font-body);
  cursor: pointer;
}

.demos-tab.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.demos-tab .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef0f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.demos-tab.active .count {
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--accent);
}

.demos-today {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  min-width: 0;
}

.demos-today-main {
  min-width: 0;
  padding: 4px 0 8px;
}

.demos-today-main h2,
.demos-panel h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.demos-today-main h2 {
  padding: 14px 16px 8px;
}

.demos-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border-left: 1px solid var(--border);
  background: #f6f7f9;
}

.demos-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.demos-panel h2 {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.demos-panel-list {
  display: flex;
  flex-direction: column;
}

.demos-panel-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.demos-panel-row:last-child {
  border-bottom: 0;
}

.demos-panel-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.demos-panel-empty {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.demos-panel-actions,
.demo-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.demos-panel-actions .btn-secondary,
.demos-panel-actions .btn-primary,
.demo-row-actions .btn-secondary,
.demo-row-actions .btn-primary,
.demo-row-actions a.btn-secondary,
#demos-export-btn,
.demos-pager .btn-secondary {
  min-height: 44px;
  height: auto;
}

.demos-list-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.demos-seg {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f6f7f9;
}

.demos-seg button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 600 13px var(--font-body);
  cursor: pointer;
}

.demos-seg button[aria-pressed="true"] {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.demos-range-label,
.demos-list-filters .bk-field span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.demos-range {
  min-width: 168px;
}

.demos-select {
  min-height: 44px;
  margin: 0;
  min-width: 160px;
}

#demos-rows {
  padding: 4px 0 8px;
}

.demo-day {
  margin: 12px 16px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.demo-clash-why {
  color: #b42318;
  font-weight: 600;
}

.demo-request {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.req-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.req-row.is-muted {
  color: var(--muted);
}

.req-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
  flex: 1 1 220px;
}

.req-row-main p {
  flex: 1 1 100%;
  margin: 0;
}

.req-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.req-row-actions .btn-secondary,
.req-row-actions .btn-primary,
.demo-request .btn-secondary {
  min-height: 44px;
}

.req-wait {
  font-weight: 700;
}

.req-cant-run {
  margin: 0;
  color: #b42318;
  font-weight: 700;
}

#req-ask-save[aria-busy="true"]::before,
.req-withdraw[aria-busy="true"]::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: req-spin 0.7s linear infinite;
}

@keyframes req-spin {
  to { transform: rotate(360deg); }
}

.req-muted,
.req-why,
.req-note {
  color: var(--muted);
}

.req-kind,
.req-state {
  font-size: 13px;
  font-weight: 700;
}

.req-asked {
  font-weight: 600;
  color: var(--text);
}

.req-office {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.req-left.is-urgent,
.req-avail.is-clash {
  color: #b42318;
  font-weight: 700;
}

.req-card-list .req-row {
  padding-left: 0;
  padding-right: 0;
}

#req-ask-modal textarea,
#req-decline-modal textarea {
  width: 100%;
}

.demo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.demo-row-main {
  min-width: min(100%, 180px);
  flex: 1 1 180px;
}

.demo-name {
  background: none;
  border: 0;
  padding: 0;
  min-height: 44px;
  font: 600 15px var(--font-body);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.demo-name:hover {
  color: var(--accent);
}

.demo-name.is-static,
.demo-name.is-static:hover {
  cursor: default;
  color: var(--text);
}

.demo-phone {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.demo-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  flex: 2 1 240px;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
}

.demo-meta-bit {
  color: var(--muted);
}

.demo-no-dealer {
  color: #b45309;
  font-weight: 600;
}

.demo-moved {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef0f3;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.demo-row-actions {
  margin-left: auto;
  margin-top: 0;
}

.demos-table th,
.demos-table td {
  white-space: normal;
}

.demos-table .demo-name {
  font-size: 14px;
  min-height: 0;
}

.demos-table.is-roomy td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.demos-table.is-compact td {
  padding-top: 6px;
  padding-bottom: 6px;
}

.demos-table tr.demos-group td {
  background: #f6f7f9;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.demos-group-count {
  color: var(--muted);
  font-weight: 600;
}

.demos-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 16px;
}

.demos-pager p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.demos-pager-controls {
  display: flex;
  gap: 8px;
}

.book-demo-find {
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.book-lead-results {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 320px;
  overflow-x: hidden;
  overflow-y: auto;
}

.book-lead-results:empty {
  display: none;
}

.book-lead-hit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.book-lead-hit:last-child {
  border-bottom: 0;
}

.book-lead-hit:hover,
.book-lead-hit.is-on,
.book-lead-hit:focus-visible {
  background: #f6f7f9;
  outline: none;
}

.book-lead-hit.is-picked {
  background: #eef3f8;
}

.book-lead-hit strong {
  font-size: 15px;
  line-height: 1.3;
}

.book-lead-hit span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}

.book-lead-more {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--border);
  background: #fff;
  color: var(--accent);
  font: 600 14px var(--font-body);
  text-align: left;
  cursor: pointer;
}

.book-lead-more:hover,
.book-lead-more:focus-visible {
  background: #f6f7f9;
}

.book-lead-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.book-lead-add {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 4px;
  padding: 0;
  font-size: 14px;
}

.book-new-person {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbfc;
}

.book-new-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.book-new-grid .full {
  grid-column: 1 / -1;
}

.book-new-grid input,
.book-new-person .source-picker input {
  width: 100%;
  box-sizing: border-box;
}

.book-new-match {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 14px;
}

@media (max-width: 900px) {
  .demos-today {
    grid-template-columns: 1fr;
  }

  .demos-side {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 767px) {
  #demos-view #demos-table-wrap {
    overflow-x: visible;
  }

  .demos-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .demos-table,
  .demos-table tbody,
  .demos-table tr,
  .demos-table td {
    display: block;
    width: 100%;
  }

  .demos-table tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }

  .demos-table tr.demos-group {
    padding: 10px 16px;
    background: #f6f7f9;
  }

  .demos-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border: 0;
    text-align: right;
  }

  .demos-table tr.demos-group td {
    display: block;
    text-align: left;
    background: transparent;
  }

  .demos-table tr.demos-group td::before {
    content: none;
  }

  .demos-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    text-align: left;
  }

  .demos-table td.demos-customer {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}

.demos-office-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 16px;
}

.demos-office-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 14px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}

.demos-office-card-name {
  font-size: 16px;
  font-weight: 700;
}

.demos-office-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.demos-office-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.demos-office-stat strong {
  font-size: 18px;
  line-height: 1.1;
}

.demos-office-stat span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.demos-office-none {
  margin: 0;
  padding: 20px 16px 24px;
  color: var(--text);
}

.demos-office-none .link-btn {
  min-height: 44px;
}

.req-heading {
  margin: 12px 16px 0;
  font-size: 16px;
}

.demos-panel > .req-heading {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.req-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.req-row.is-muted {
  color: var(--muted);
}

.req-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
  flex: 1 1 220px;
}

.req-row-main p,
.req-demo,
.req-note,
.req-left,
.req-avail {
  flex: 1 1 100%;
  margin: 0;
}

.req-row-actions,
.demo-request {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.demo-request {
  margin-top: 10px;
}

.req-row-actions .btn-secondary,
.req-row-actions .btn-primary,
.demo-request .btn-secondary,
.demo-request .btn-primary {
  min-height: 44px;
}

.req-wait,
.req-state {
  font-weight: 700;
}

.req-muted,
.req-why {
  color: var(--muted);
  font-size: 14px;
}

.req-kind {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.req-left.is-urgent,
.req-avail.is-clash {
  color: #b42318;
  font-weight: 700;
}

.req-card-list .req-row {
  padding-left: 0;
  padding-right: 0;
}

.req-card-list .req-row:last-child,
.demos-panel .req-row:last-child {
  border-bottom: 0;
}

.req-count-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fef6e8;
  color: #8a5a12;
  border: 1px solid color-mix(in srgb, var(--st-booked) 45%, #ead7b0);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.req-strip {
  margin-top: 10px;
  background: #fef6e8;
  border: 1px solid #ead7b0;
  border-radius: 10px;
  color: var(--text);
}

.req-strip-row {
  padding: 10px 12px;
}

.req-strip-row + .req-strip-row {
  border-top: 1px solid #ead7b0;
}

.req-strip-title,
.req-strip-note,
.req-strip .req-left,
.req-strip-avail {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.req-strip-title {
  font-weight: 600;
  color: var(--text);
}

.req-strip-note,
.req-strip .req-left,
.req-strip-avail {
  margin-top: 4px;
  color: #6b5424;
  font-size: 13px;
}

.cust-time-btn {
  height: auto;
  min-height: 44px;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  padding: 8px 14px;
}

.modal-cust-time {
  width: min(560px, calc(100vw - 32px));
  max-width: 560px;
  padding: 0;
}

.cust-time-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
}

.cust-time-body label {
  display: block;
  margin-top: 12px;
}

#cust-time-reason {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 44px;
}

#cust-time-modal .choice {
  min-height: 44px;
}

.cust-time-run {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 8px;
}

.cust-time-run.is-single {
  grid-template-columns: 1fr;
}

.cust-time-run button {
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: 600 15px var(--font-body);
  text-align: left;
  cursor: pointer;
}

.cust-time-run button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
  border-color: var(--accent);
}

.cust-time-effect {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.4;
}

.cust-time-foot {
  flex: 0 0 auto;
  padding: 0 20px 16px;
  background: #fff;
  border-top: 1px solid var(--border);
}

.cust-time-passed,
.book-demo-past {
  color: #D97706;
  font-weight: 600;
  margin: 0 0 12px;
}

#cust-time-modal .cust-time-effect {
  margin: 12px 0 0;
}

#cust-time-modal .book-demo-footer {
  margin-top: 8px;
}

@media (max-width: 767px) {
  #cust-time-modal.modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-cust-time {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
  }

  .cust-time-run {
    grid-template-columns: 1fr;
  }

  #cust-time-modal .book-demo-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  #cust-time-modal .book-demo-footer .btn-primary,
  #cust-time-modal .book-demo-footer .btn-ghost {
    width: 100%;
    margin: 0;
    min-height: 44px;
  }
}

.req-fit {
  flex: 1 1 100%;
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

.req-fit.is-ok {
  color: var(--ok);
}

.req-fit.is-warn {
  color: #8a5a12;
}

.req-fit.is-hard {
  color: #b42318;
}

.req-strip-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.req-strip .btn-primary,
.req-strip .btn-secondary,
.req-strip .link-btn,
.demo-booked-ask,
.demo-booked-more,
#demo-booked-menu button {
  min-height: 44px;
}

.req-strip .link-btn {
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
}

.req-wait-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--st-booked);
  color: #fff;
  border: 0;
  font: 600 12px var(--font-body);
  white-space: nowrap;
}

@media (max-width: 700px) {
  .demos-office-cards {
    grid-template-columns: 1fr;
  }
}
