/* Adapted from KESP Outreach BDC UI, commit 918fb18. */

      :root {
        font-family:
          Inter,
          -apple-system,
          BlinkMacSystemFont,
          'Segoe UI',
          sans-serif;
        color: #243c3e;
        background: #f4f6f5;
        font-size: 15px;
        --accent: #08776d;
        --line: #dce5e1;
        --muted: #617773;
      }
      * {
        box-sizing: border-box;
      }
      body {
        margin: 0;
      }
      button,
      input,
      select,
      textarea {
        font: inherit;
      }
      button {
        cursor: pointer;
      }
      button:disabled {
        opacity: 0.5;
        cursor: default;
      }
      button:focus-visible,
      input:focus-visible,
      select:focus-visible,
      textarea:focus-visible,
      a:focus-visible {
        outline: 3px solid #43b7a4;
        outline-offset: 3px;
      }
      button,
      .button {
        border: 1px solid var(--line);
        border-radius: 9px;
        background: white;
        color: #243c3e;
        padding: 0.65rem 0.9rem;
        text-decoration: none;
      }
      input,
      select {
        background: white;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 0.7rem;
        color: inherit;
        max-width: 100%;
      }
      h1,
      h2,
      h3,
      p {
        margin: 0;
      }
      h1 {
        font-size: 1.25rem;
        letter-spacing: -0.025em;
      }
      h2 {
        font-size: 1.1rem;
      }
      h3 {
        font-size: 1rem;
      }
      p {
        line-height: 1.55;
      }
      .top {
        background: #163e3a;
        color: #fff;
        padding: 1.25rem max(24px, calc((100vw - 1440px) / 2));
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
      }
      .eyebrow {
        text-transform: uppercase;
        letter-spacing: 0.12em;
        font-size: 0.68rem;
        font-weight: 700;
      }
      .top .eyebrow {
        color: #acd2c8;
        margin-bottom: 0.35rem;
      }
      .topActions {
        display: flex;
        align-items: center;
        gap: 0.7rem;
      }
      .top select {
        max-width: 280px;
        color: #243c3e;
      }
      .container {
        max-width: 1488px;
        margin: auto;
        padding: 24px;
      }
      .toolbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        margin-bottom: 20px;
      }
      .toolbarLeft {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
      }
      .badge {
        display: inline-block;
        background: #e1f1ea;
        color: #216b59;
        border-radius: 20px;
        padding: 0.35rem 0.65rem;
        font-size: 0.75rem;
      }
      .muted {
        color: var(--muted);
        font-size: 0.84rem;
      }
      .layout {
        display: grid;
        grid-template-columns: 270px minmax(0, 1fr);
        gap: 24px;
        align-items: start;
      }
      .card {
        background: white;
        border: 1px solid var(--line);
        border-radius: 14px;
        overflow: hidden;
      }
      .sidebar {
        position: sticky;
        top: 20px;
        padding: 18px;
      }
      .sidebar h2 {
        margin-bottom: 14px;
      }
      .sidebar input {
        width: 100%;
        font-size: 0.83rem;
      }
      .customer {
        display: block;
        text-align: left;
        width: 100%;
        margin-top: 8px;
        padding: 12px;
        background: white;
        border-color: transparent;
        overflow-wrap: anywhere;
      }
      .customer strong {
        display: block;
        font-size: 0.91rem;
      }
      .customer span {
        display: block;
        margin-top: 4px;
        font-size: 0.85rem;
        color: var(--muted);
      }
      .customer[aria-pressed='true'] {
        background: #eaf5ef;
        border-color: #9bc9ba;
        box-shadow: inset 3px 0 #08776d;
      }
      .customer:hover {
        background: #f3f8f5;
      }
      .pagination {
        display: flex;
        gap: 6px;
        margin-top: 16px;
      }
      .pagination button {
        font-size: 0.75rem;
        padding: 0.55rem;
      }
      .content {
        display: grid;
        gap: 20px;
        min-width: 0;
      }
      .profile {
        padding: 24px;
      }
      .profileHeader {
        display: flex;
        gap: 16px;
        align-items: center;
        margin-bottom: 24px;
      }
      .avatar {
        display: grid;
        place-items: center;
        width: 52px;
        height: 52px;
        border-radius: 14px;
        background: #eaf3ee;
        color: #237564;
        font-weight: 700;
        font-size: 1.1rem;
        flex-shrink: 0;
      }
      .profileName {
        font-size: 1.4rem;
        letter-spacing: -0.02em;
        overflow-wrap: anywhere;
      }
      .profilePhone {
        margin-top: 4px;
        color: var(--muted);
        font-size: 1rem;
      }
      .sectionHeading {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 14px;
        gap: 8px;
      }
      .reservationGrid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
        gap: 14px;
      }
      .reservation {
        border: 1px solid var(--line);
        border-radius: 11px;
        overflow: hidden;
        min-width: 0;
      }
      .reservationHeading {
        padding: 16px;
        background: #f7faf8;
        border-bottom: 1px solid var(--line);
      }
      .reservationHeading .eyebrow {
        color: var(--muted);
        margin-bottom: 6px;
      }
      .reservationHeading p {
        margin-top: 5px;
      }
      .facts {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px 12px;
        padding: 16px;
        margin: 0;
      }
      .fact {
        min-width: 0;
      }
      .fact dt {
        font-size: 0.73rem;
        color: var(--muted);
        margin-bottom: 5px;
      }
      .fact dd {
        margin: 0;
        font-size: 0.85rem;
        line-height: 1.5;
        overflow-wrap: anywhere;
      }
      .missing {
        color: #788a84;
      }
      .cardHeader {
        padding: 20px 24px;
        border-bottom: 1px solid var(--line);
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
      }
      .cardHeader p {
        margin-top: 5px;
      }
      .chatlog {
        height: 520px;
        overflow-y: auto;
        padding: 20px 24px;
        background: #f0f5ef;
        overscroll-behavior: contain;
        overflow-anchor: none;
      }
      .chatStatus {
        padding: 9px 24px;
        border-bottom: 1px solid var(--line);
        font-size: 0.8rem;
        color: var(--muted);
      }
      .olderWrap {
        text-align: center;
        padding: 10px;
        background: #f0f5ef;
      }
      .olderWrap button {
        font-size: 0.8rem;
        border-radius: 20px;
      }
      .dateDivider {
        text-align: center;
        margin: 12px 0 22px;
      }
      .dateDivider span {
        font-size: 0.72rem;
        padding: 5px 10px;
        border: 1px solid #dbe5db;
        border-radius: 6px;
        background: #fff;
        color: #647a6e;
      }
      .messageRow {
        display: flex;
        margin: 9px 0;
      }
      .messageRow.outbound {
        justify-content: flex-end;
      }
      .bubble {
        max-width: 82%;
        border: 1px solid #dce4da;
        border-radius: 0 12px 12px 12px;
        background: white;
        padding: 11px 14px;
        min-width: 110px;
        box-shadow: 0 1px 1px #17382a08;
      }
      .outbound .bubble {
        background: #dff2d6;
        border-color: #cfe6c3;
        border-radius: 12px 0 12px 12px;
      }
      .messageText {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        font-size: 0.91rem;
        line-height: 1.55;
      }
      .messageMeta {
        display: flex;
        justify-content: flex-end;
        gap: 7px;
        flex-wrap: wrap;
        margin-top: 6px;
        font-size: 0.68rem;
        color: #647a6e;
      }
      .messageMeta.failed {
        color: #a6372d;
      }
      .unavailable {
        font-style: italic;
        color: #66766a;
      }
      .empty {
        padding: 22px 0;
        color: var(--muted);
        font-size: 0.88rem;
        line-height: 1.6;
      }
      .chatlog > .empty {
        text-align: center;
        padding: 80px 10px;
      }
      .notice {
        background: #fff3d6;
        border: 1px solid #e9d6a2;
        border-radius: 8px;
        padding: 12px 16px;
        margin-bottom: 16px;
        font-size: 0.85rem;
      }
      .notice.error {
        background: #fff0ed;
        color: #8e332a;
        border-color: #e7b8ae;
      }
      .login {
        max-width: 470px;
        margin: 12vh auto;
        padding: 32px;
        text-align: center;
      }
      .login p {
        margin: 16px 0 26px;
      }
      .login .button {
        display: inline-block;
        background: var(--accent);
        color: white;
      }
      .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
      }
      [hidden] {
        display: none !important;
      }
      @media (max-width: 850px) {
        .layout {
          grid-template-columns: 220px minmax(0, 1fr);
          gap: 14px;
        }
        .container {
          padding: 16px;
        }
        .profile,
        .cardHeader {
          padding: 18px;
        }
        .sidebar {
          padding: 12px;
        }
        .chatlog {
          padding: 16px;
        }
        .profileName {
          font-size: 1.2rem;
        }
      }
      @media (max-width: 620px) {
        .top {
          padding: 16px;
          align-items: flex-start;
          flex-wrap: wrap;
        }
        .topActions {
          width: 100%;
        }
        .top select {
          flex: 1;
          min-width: 0;
        }
        .layout {
          grid-template-columns: 1fr;
        }
        .sidebar {
          position: static;
        }
        .customerList {
          max-height: 190px;
          overflow: auto;
        }
        .container {
          padding: 12px;
        }
        .toolbar {
          align-items: flex-start;
        }
        .toolbarLeft {
          gap: 6px;
        }
        .toolbar #account {
          display: none;
        }
        .reservationGrid {
          grid-template-columns: 1fr;
        }
        .chatlog {
          height: 440px;
          padding: 12px;
        }
        .bubble {
          max-width: 90%;
        }
        .content {
          gap: 14px;
        }
        .profileHeader {
          gap: 10px;
        }
        .avatar {
          width: 42px;
          height: 42px;
        }
        .profileName {
          font-size: 1.15rem;
        }
        .cardHeader {
          align-items: flex-start;
        }
      }
    
.customerList { max-height: 65vh; overflow-y: auto; }
.customer .preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer .stage { font-size: .73rem; color: #216b59; }
.topActions .button { font-size: .85rem; }
.profileHeader { margin-bottom: 0; }
.reservationGrid { padding: 20px 24px; }
.reservation > p { padding: 0 16px 16px; }
.summary { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.summary .facts { padding: 16px 0 0; }
.readOnly { padding: 14px 24px; border-top: 1px solid var(--line); }
.badge.warn { background: #fbf2d9; color: #7f611a; }
@media (max-width: 620px) {
  .customerList { max-height: 220px; }
  .topActions { flex-wrap: wrap; }
  .reservationGrid, .summary { padding: 16px; }
}
