/* Chat sits beside the quick business metrics, then expands from that same point. */
.unread-badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-left: 5px; padding: 0 4px; border-radius: 9px; background: #e6404f; color: #fff; font-size: 10px; line-height: 1; }

/* A single, calm compact-card language across the top bar. */
@media (min-width: 1200px) {
  .topbar { gap: 8px; }
  .topbar .search { flex: 0 0 300px; min-width: 300px; height: 40px; font-family: inherit; font-size: 13px; font-weight: 500; }
  .topbar .search > span { font-size: 17px; font-weight: 600; }
  .topbar .search input { font-family: inherit; font-size: 13px; font-weight: 500; letter-spacing: 0; }
  .topbar .search kbd { font-size: 11px; font-weight: 500; }
  .topbar .quick-metrics { height: 40px; padding: 0 8px; font-family: inherit; font-size: 13px; font-weight: 500; }
  .topbar .quick-metrics strong { font-weight: 600; }
  .topbar .quick-metrics button { font-size: 17px; font-weight: 400; }
  .topbar .rates { gap: 6px; margin-right: 10px; }
  .topbar .rates span,
  .topbar > .top-chat { height: 40px; min-height: 40px; font-family: inherit; font-size: 13px; font-weight: 500; }
  .topbar .rates span { display: inline-flex; align-items: center; justify-content: center; width: 88px; min-width: 88px; padding: 0 6px; }
  .topbar .rates b { font-weight: 600; }
}
@media (min-width: 1200px) {
  .topbar > .top-chat {
    position: relative;
    flex: 0 0 66px;
    width: 66px;
    min-width: 66px;
    height: 40px;
    min-height: 40px;
    margin-left: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .18s ease, transform .18s ease;
  }
  .topbar > .top-chat::before {
    display: none;
  }
  .topbar > .top-chat::after { content: "Mesajlar"; position: absolute; z-index: 2; top: 12px; left: 0; color: #50617b; font-size: 12px; font-weight: 500; }
  .topbar > .top-chat:hover { box-shadow: none; transform: none; color: #173864; }
  .topbar > .top-chat .card-head,
  .topbar > .top-chat .conversation,
  .topbar > .top-chat .attachment,
  .topbar > .top-chat .composer { display: none; }
  .topbar > .top-chat .contact-tabs {
    position: absolute;
    z-index: 3;
    top: 2px;
    right: -1px;
    display: block;
    padding: 0;
    pointer-events: none;
  }
  .topbar > .top-chat .contact-tabs button { display: none; }
  .topbar > .top-chat .contact-tabs button[data-contact="Mehmet Demir"] { display: block; width: 20px; height: 20px; padding: 0; border: 0; background: transparent; font-size: 0; }
  .topbar > .top-chat .contact-tabs button[data-contact="Mehmet Demir"] .unread-badge { position: absolute; inset: 0; margin: 0; min-width: 20px; height: 20px; border: 2px solid #fff; font-size: 10px; }
  .topbar > .top-chat.open {
    position: fixed;
    z-index: 100;
    top: 8px;
    right: 16px;
    left: auto;
    width: min(390px, calc(100vw - 32px));
    height: min(510px, calc(100vh - 24px));
    padding-bottom: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #cbd9ec;
    background: #fff;
    cursor: default;
    border-radius: 13px;
    box-shadow: 0 16px 42px #102a4b36;
    transform: none;
  }
  .topbar > .top-chat.open::before,
  .topbar > .top-chat.open::after { display: none; }
  .topbar > .top-chat.open .card-head,
  .topbar > .top-chat.open .conversation,
  .topbar > .top-chat.open .attachment,
  .topbar > .top-chat.open .composer { display: flex; }
  .topbar > .top-chat.open .conversation { display: block; overflow-y: auto; flex: 1; }
  .topbar > .top-chat.open .card-head { display: flex; }
  .topbar > .top-chat.open .contact-tabs { position: static; display: flex; padding: 8px 10px; pointer-events: auto; }
  .topbar > .top-chat.open .contact-tabs button { display: inline-flex; align-items: center; height: 30px; line-height: 1; }
  .topbar > .top-chat.open .contact-tabs button[data-contact="Mehmet Demir"] { width: auto; height: 30px; padding: 4px 8px; border: 1px solid #cedaf0; font-size: 12px; }
  .topbar > .top-chat.open .contact-tabs button[data-contact="Mehmet Demir"] .unread-badge { position: static; margin-left: 5px; min-width: 16px; height: 16px; border: 0; }
  .topbar > .top-chat.open .card-head { height: 50px; padding: 0 14px; }
  .topbar > .top-chat.open .card-head h2 { font-size: 17px; font-weight: 500; letter-spacing: 0; }
  .topbar > .top-chat.open .card-head .panel-action { min-width: 91px; font-size: 11px !important; font-weight: 500; }
  .topbar > .top-chat.open .contact-tabs { gap: 5px; padding: 7px 10px; border-bottom: 1px solid #e8eef6; }
  .topbar > .top-chat.open .contact-tabs button,
  .topbar > .top-chat.open .contact-tabs button[data-contact="Mehmet Demir"] { border: 1px solid #dce5f1; border-radius: 7px; background: #f8faff; color: #50617b; font-size: 11px; font-weight: 500; }
  .topbar > .top-chat.open .contact-tabs button span { opacity: .82; }
  .topbar > .top-chat.open .contact-tabs button[data-contact="Ayşe Kaya"] { color: #2b7d65; background: #eef8f4; border-color: #cce9dc; }
  .topbar > .top-chat.open .contact-tabs button[data-contact="Mehmet Demir"] { color: #5769a6; background: #f0f3ff; border-color: #d8def7; }
  .topbar > .top-chat.open .contact-tabs button[data-contact="Ortak Kanal"] { color: #6b648e; background: #f6f4fb; border-color: #e2def0; }
  .topbar > .top-chat.open .contact-tabs .selected { padding: 4px 8px; border-width: 1px; box-shadow: inset 0 0 0 1px #75b49e; }
  .topbar > .top-chat.open .contact-tabs button span { width: 19px; height: 19px; margin-right: 4px; line-height: 1; }
  .topbar > .top-chat.open .bubble p { font-weight: 400; }
  .topbar > .top-chat.open .bubble b { font-weight: 500; color: #386e60; }
  .topbar > .top-chat.open .composer { border-color: #d9e3f0; }
  .topbar > .top-chat.open .composer input { font-weight: 400; }
  .topbar > .top-chat.open .composer input::placeholder { color: #77859a; font-weight: 400; }
  .message-sent { color: #94a0b0; font-weight: 500; }
  .message-read { color: #36a166; font-weight: 600; }
}
