/* Desktop proportions follow the supplied WhatsApp reference. Mobile keeps its
   existing touch targets and viewport/keyboard behavior. */
.empty-card {
  display: contents;
}
.empty-card > .primary {
  font-size: 12px;
  padding: 12px 18px;
  background: #346b4e;
}

@media (min-width: 721px) {
  body:has(#workspace:not(.hidden)) {
    overflow: hidden;
  }
  #workspace {
    --ink: #f1f1f2;
    --text: #e9edef;
    --muted: #a9adaf;
    --line: #303234;
    --soft: #2e3031;
    --selection: #2d2f30;
    --selection-edge: #72e1b5;
    --conversation-row-height: 64px;
    grid-template-columns: 76px clamp(300px, calc(36.5vw - 76px), 660px) minmax(
        0,
        1fr
      );
    width: 100%;
    height: 100dvh;
    min-height: 0;
    font-family: var(--font-ui);
  }
  #workspace .rail {
    padding: 8px 0 10px;
    gap: 8px;
    background: #202223;
    border-right: 1px solid #2b2d2e;
    min-height: 0;
  }
  #workspace .rail > .brand-icon {
    width: 30px;
    height: 30px;
    margin: 0 0 2px;
    border-radius: 50%;
    font-size: 18px;
    letter-spacing: -2px;
    background: #303533;
    color: #c6e8d8;
  }
  #workspace .rail-button {
    width: 64px;
    height: 58px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    color: #b8bcbe;
    flex-shrink: 0;
  }
  #workspace .rail-button svg {
    width: 20px;
    height: 20px;
  }
  #workspace .rail-button.active,
  #workspace .rail-button:hover {
    background: #353738;
    color: #f1f1f2;
    box-shadow: none;
  }
  #workspace .user-avatar {
    width: 28px;
    height: 28px;
    margin: 0;
    flex-shrink: 0;
  }
  #workspace .inbox {
    background: #161717;
    min-height: 0;
  }
  #workspace .inbox-top {
    padding: 8px 16px 0;
    gap: 4px;
  }
  #workspace .inbox-header {
    min-height: 40px;
  }
  #workspace .inbox-header h1 {
    font-size: 20px;
    font-weight: 650;
    letter-spacing: 0;
  }
  #workspace .inbox-header .icon-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
  }
  #workspace .new-chat {
    background: #e9edef;
    color: #202223;
    font-size: 23px;
  }
  #workspace .account-filter {
    gap: 8px;
    min-height: 30px;
  }
  #workspace #account-filter-button {
    min-height: 30px;
    padding: 3px 8px;
    gap: 7px;
    border: 0;
    border-radius: 6px;
    background: #222424;
  }
  #workspace #account-filter-button .account-avatar {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    font-size: 14px;
    background: #333b38;
    color: #c6e8d8;
  }
  #workspace #account-filter-button .account-option-info strong {
    font-size: 12px;
    font-weight: 500;
  }
  #workspace #account-filter-button .account-option-info small {
    font-size: 10px;
  }
  #workspace .account-chevron {
    color: var(--muted);
  }
  #workspace .account-presence {
    flex-direction: row;
    gap: 8px;
    font-size: 10px;
  }
  #workspace .account-menu {
    background: #242626;
    border-color: #3a3c3d;
  }
  #workspace .account-menu button:hover {
    background: #343737;
  }
  #account-menu-options .account-option-state {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
    margin-left: auto;
    font-size: 11px;
    white-space: nowrap;
  }
  #account-menu-options .account-option-state > span:last-child::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: currentColor;
  }
  #workspace .search {
    height: 34px;
    padding: 0 12px;
    gap: 10px;
    border-radius: 18px;
    background: #2b2d2e;
  }
  #workspace .search input {
    padding: 5px 0;
    font-size: 13px;
    line-height: 24px;
  }
  #workspace .filter-tabs {
    gap: 6px;
    padding: 8px 16px;
    border-bottom: 0;
  }
  #workspace .chat-filter-scroll {
    gap: 6px;
    padding: 0;
    scrollbar-width: none;
  }
  #workspace .filter-tabs button {
    min-height: 28px;
    padding: 3px 10px;
    font-size: 12px;
    gap: 4px;
    background: transparent;
    border-color: #343637;
  }
  #workspace .filter-tabs button.selected {
    background: #233b32;
    color: #a8edcd;
    border-color: transparent;
  }
  #workspace .filter-tabs span:not(.list-dot) {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 10px;
  }
  #workspace .filter-tabs .chat-list-add {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 20px;
  }
  #workspace .list-dot {
    width: 8px;
    height: 8px;
    flex-basis: 8px;
    padding: 0;
  }
  #workspace .conversation-window .conversation-item {
    left: 8px;
    width: calc(100% - 16px);
    padding: 6px 8px;
    gap: 12px;
    border: 0;
    border-radius: 7px;
  }
  #workspace .conversation-item:hover {
    background: #232525;
  }
  #workspace .conversation-item.selected {
    background: var(--selection);
    box-shadow: inset 2px 0 var(--selection-edge);
  }
  #workspace .conversation-item .contact-avatar {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  #workspace .conversation-line strong {
    font-size: 14px;
    line-height: 18px;
    font-weight: 500;
  }
  #workspace .conversation-item:is(.selected, .unread) strong {
    font-weight: 700;
  }
  #workspace .conversation-line time {
    font-size: 10px;
  }
  #workspace .conversation-preview {
    margin-top: 1px;
    font-size: 12px;
    line-height: 17px;
    color: #b5b8ba;
  }
  #workspace .conversation-account {
    margin-top: 0;
    min-height: 14px;
    line-height: 14px;
    font-size: 10px;
    color: #a9adaf;
  }
  #workspace .current-conversation {
    background: #36443d;
    border-color: #637b6f;
    color: #e5f3eb;
  }
  #workspace .conversation-item.selected :is(.conversation-preview, time) {
    color: #d0d3d4;
  }
  #workspace .conversation-item.unread time {
    color: var(--green);
  }
  #workspace .badge {
    background: #25d366;
    color: #102b1d;
    font-size: 10px;
  }
  #workspace .inbox-footer {
    padding: 3px 16px;
    min-height: 22px;
  }
  #workspace .chat-area {
    background: #1d1f1f;
    min-height: 0;
  }
  #workspace .empty-chat {
    padding: 24px 24px 64px;
  }
  #workspace .empty-card {
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 300px;
    max-width: 100%;
    padding: 28px 20px 22px;
    border-radius: 16px;
    background: #161818;
  }
  #workspace .empty-symbol {
    width: 80px;
    height: 70px;
    margin-bottom: 16px;
    border-radius: 18px;
    background: #223c30;
    color: #8ee5b3;
    transform: none;
  }
  #workspace .empty-symbol svg {
    width: 54px;
    height: 54px;
    transform: none;
  }
  #workspace .empty-card :is(.eyebrow, .tiny-dot) {
    display: none;
  }
  #workspace .empty-chat h2 {
    font-size: 18px;
    font-weight: 500;
    line-height: 26px;
    letter-spacing: 0;
    margin: 0 0 6px;
  }
  #workspace .empty-chat p {
    margin: 0 0 18px;
    font-size: 12px;
    line-height: 19px;
    color: #b3b7b9;
  }
  #workspace .empty-card > .primary {
    min-height: 30px;
    padding: 6px 14px;
    background: #303332;
    color: #e9edef;
    border-radius: 18px;
    font-size: 11px;
    gap: 8px;
    font-weight: 500;
  }
  #workspace .empty-features {
    gap: 20px;
    margin-top: 24px;
    color: #b5b8ba;
    font-size: 11px;
  }
  #workspace .empty-chat small {
    bottom: 22px;
    font-size: 10px;
    letter-spacing: 0;
    color: #a9adaf;
  }
  #workspace .chat-header {
    height: auto;
    min-height: 60px;
    flex-shrink: 0;
    padding: 6px 20px;
    gap: 12px;
    background: #202323;
  }
  #workspace .chat-contact {
    min-height: 46px;
    padding: 0;
  }
  #workspace .chat-header .contact-avatar {
    width: 40px;
    height: 40px;
  }
  #workspace .chat-name {
    font-size: 15px;
    line-height: 20px;
    margin-bottom: 2px;
    font-weight: 600;
  }
  #workspace .chat-header .secondary {
    min-height: 32px;
    padding: 6px 10px;
    background: #2b2e2e;
    border-color: #414545;
    font-size: 12px;
  }
  #workspace .messages {
    padding: 18px clamp(24px, 6%, 96px);
    background-color: #171a19;
    background-image: radial-gradient(#a0b5a609 1px, transparent 1px);
  }
  #workspace .bubble {
    background: #2b3030;
    border-color: transparent;
    border-radius: 0 8px 8px 8px;
    padding: 6px 9px;
  }
  #workspace .out .bubble {
    background: #174c42;
    border-radius: 8px 0 8px 8px;
  }
  #workspace .composer {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
    background: #202323;
    box-shadow: none;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    flex-shrink: 0;
  }
  #workspace .composer-toolbar {
    grid-column: 1;
    grid-row: 1;
    gap: 0;
    height: 44px;
    padding: 0;
  }
  #workspace .composer .tool {
    width: 32px;
    min-width: 32px;
    min-height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    color: #c1c5c7;
  }
  #workspace .composer .tool svg {
    width: 20px;
    height: 20px;
  }
  #workspace .composer .tool:hover {
    background: #373b3a;
  }
  #workspace .composer .ai-tool {
    color: #d0b8ff;
  }
  #workspace .composer .tool span,
  #workspace .composer .toolbar-spacer,
  #workspace #composer-hint:not(.important-hint) {
    display: none;
  }
  #workspace .send-mode-status {
    position: absolute;
    bottom: calc(100% + 4px);
    right: 12px;
    padding: 2px 7px;
    border-radius: 10px;
    background: #202323;
    font-size: 10px;
  }
  #workspace .composer textarea {
    grid-column: 2;
    grid-row: 1;
    background: #2d3131;
    border-radius: 23px;
    padding: 10px 46px 10px 16px;
    font-size: 15px;
  }
  #workspace #expression-toggle {
    grid-column: 2;
    grid-row: 1;
  }
  #workspace .composer .send {
    grid-column: 3;
    grid-row: 1;
    padding: 10px 12px;
    gap: 6px;
    background: #72e1b5;
    color: #09271d;
  }
  #workspace .composer #composer-hint.important-hint {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  #workspace .attachment-bar {
    margin: 0;
    border-radius: 0;
    padding: 10px 16px;
    border-color: #414545;
    background: #242a28;
  }
  #workspace .expression-panel {
    max-width: none;
    background: #202323;
  }
  #workspace .quick-reply-picker {
    left: 12px;
    right: 12px;
    background: #242828;
  }
  #workspace .quick-reply-picker header {
    background: #202323;
  }
}

@media (min-width: 721px) and (max-width: 1100px) {
  #workspace .chat-header {
    padding-inline: 10px;
  }
  #workspace .chat-header .header-actions {
    gap: 4px;
  }
  #workspace .chat-header .secondary {
    padding-inline: 6px;
    font-size: 11px;
  }
  #workspace #composer-more {
    display: inline-grid;
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    width: 36px;
    min-width: 36px;
    height: 44px;
  }
  #workspace .composer-toolbar {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 12px;
    height: auto;
    padding: 8px;
    gap: 4px;
    background: #242828;
    border: 1px solid #414545;
    border-radius: 12px;
    z-index: 15;
  }
  #workspace .tools-open .composer-toolbar {
    display: flex;
  }
  #workspace .composer .tool {
    min-width: 40px;
    min-height: 40px;
  }
  #workspace .send-mode-status {
    bottom: calc(100% + 4px);
    white-space: nowrap;
  }
  #workspace .composer {
    padding-inline: 8px;
    gap: 6px;
  }
}

@media (min-width: 721px) {
  .rail-label {
    font-size: 11px;
    line-height: 15px;
    white-space: nowrap;
    font-weight: 500;
  }
}
