    :root {
      --bg: #eef3f6;
      --surface: #ffffff;
      --surface-soft: #f7fafc;
      --line: #d9e2ea;
      --line-strong: #c6d3de;
      --text: #17212b;
      --muted: #657384;
      --muted-2: #8a97a5;
      --blue: #1c6fd1;
      --fb: #1877f2;
      --google: #4285f4;
      --messenger: #0084ff;
      --danger: #d93025;
      --warning: #f4b400;
      --success: #188038;
      --ai1: #6d5dfc;
      --ai2: #9b3fd8;
      --shadow: 0 14px 30px rgba(23, 33, 43, 0.08);
      --shadow-soft: 0 8px 18px rgba(23, 33, 43, 0.06);
      --radius: 8px;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      min-height: 700px;
      margin: 0;
      color: var(--text);
      background: var(--bg);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      font-size: 14px;
      letter-spacing: 0;
    }

    button,
    input,
    textarea {
      font: inherit;
    }

    button {
      cursor: pointer;
    }

    .topbar {
      position: fixed;
      z-index: 50;
      top: 0;
      left: 0;
      right: 0;
      height: 58px;
      display: grid;
      grid-template-columns: 270px 1fr 260px;
      align-items: center;
      gap: 18px;
      padding: 0 20px;
      background: rgba(255, 255, 255, 0.96);
      border-bottom: 1px solid var(--line);
      backdrop-filter: blur(12px);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .logo {
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      border-radius: 7px;
      background: linear-gradient(135deg, #145fc0, #33a1df);
      color: #fff;
      font-weight: 800;
      box-shadow: 0 8px 16px rgba(28, 111, 209, 0.22);
    }

    .brand-title {
      font-size: 17px;
      font-weight: 750;
      white-space: nowrap;
    }

    /* Navigation principale dans le header (Queue · Admin · Test IA) */
    .topnav {
      display: flex;
      align-items: center;
      gap: 4px;
      justify-self: center;
    }

    .topnav-link,
    .topnav-link:link,
    .topnav-link:visited {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 38px;
      padding: 0 14px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      color: #4a5663;
      text-decoration: none !important;
      transition: background 120ms, color 120ms;
    }

    .topnav-link:hover {
      background: #eef4fa;
      color: var(--text);
      text-decoration: none !important;
    }

    .topnav-link.active {
      background: #e3eefc;
      color: #145fc0;
    }

    /* Recherche globale (utilisée localement sur /queue, posée dans queue.html) */
    .global-search {
      max-width: 560px;
      width: 100%;
      position: relative;
    }

    .global-search input {
      width: 100%;
      height: 38px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 0 16px;
      background: #f8fbfd;
      color: var(--text);
      outline: none;
    }

    .global-search input:focus {
      border-color: #94b8da;
      box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.12);
      background: #fff;
    }

    .top-actions {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 12px;
    }

    .notif {
      position: relative;
      width: 36px;
      height: 36px;
      display: grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--surface);
      color: #243140;
    }

    .notif .badge-dot {
      position: absolute;
      top: -5px;
      right: -5px;
      min-width: 18px;
      height: 18px;
      display: grid;
      place-items: center;
      border: 2px solid #fff;
      border-radius: 999px;
      background: var(--danger);
      color: #fff;
      font-size: 11px;
      font-weight: 800;
    }

    .user-chip {
      display: flex;
      align-items: center;
      gap: 8px;
      height: 36px;
      padding: 0 10px 0 5px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #fff;
      font-weight: 650;
    }

    .user-avatar {
      width: 26px;
      height: 26px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      background: #e3f1ff;
      color: #1358a7;
      font-size: 12px;
      font-weight: 800;
    }

    .mockbar {
      position: fixed;
      z-index: 45;
      top: 58px;
      left: 0;
      right: 0;
      height: 42px;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 18px;
      background: #111820;
      color: #fff;
      box-shadow: 0 7px 20px rgba(17, 24, 32, 0.2);
    }

    .mock-label {
      margin-right: 8px;
      color: #b9c6d3;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.08em;
    }

    .mock-switch {
      height: 28px;
      padding: 0 12px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      border-radius: 7px;
      background: rgba(255, 255, 255, 0.08);
      color: #dce7f1;
      font-size: 12px;
      font-weight: 700;
    }

    .mock-switch:hover,
    .mock-switch.active {
      background: #fff;
      color: #111820;
    }

    .app-shell {
      display: grid;
      grid-template-columns: 240px 360px minmax(680px, 1fr);
      min-height: 700px;
      padding-top: 100px;
    }

    .sidebar {
      position: sticky;
      top: 100px;
      height: calc(100vh - 100px);
      min-height: 600px;
      overflow: auto;
      padding: 18px 12px;
      background: #f8fbfd;
      border-right: 1px solid var(--line);
    }

    .nav-section {
      margin-bottom: 24px;
    }

    .section-title {
      margin: 0 0 9px 8px;
      color: #6b7887;
      font-size: 11px;
      font-weight: 850;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }

    .nav-item,
    .client-row {
      width: 100%;
      min-height: 36px;
      display: grid;
      grid-template-columns: 23px 1fr auto;
      align-items: center;
      gap: 7px;
      margin-bottom: 3px;
      padding: 7px 8px;
      border: 0;
      border-radius: 8px;
      background: transparent;
      color: var(--text);
      text-align: left;
    }

    .nav-item:hover,
    .client-row:hover,
    .nav-item.active,
    .client-row.active {
      background: #e9f2fb;
    }

    .nav-item.active,
    .client-row.active {
      color: #123f72;
      font-weight: 750;
    }

    .source-icon {
      width: 23px;
      height: 23px;
      display: grid;
      place-items: center;
      border-radius: 6px;
      color: #fff;
      font-size: 12px;
      font-weight: 800;
    }

    .source-icon.fb {
      background: var(--fb);
    }

    .source-icon.google {
      background: var(--google);
    }

    .source-icon.ig {
      background: linear-gradient(135deg, #f09433, #dc2743 54%, #bc1888);
    }

    .source-icon.msg {
      background: var(--messenger);
    }

    .nav-copy,
    .client-copy {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .count-wrap {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .nav-count,
    .client-count {
      min-width: 24px;
      height: 20px;
      display: inline-grid;
      place-items: center;
      border-radius: 999px;
      background: #e1e8ef;
      color: #526173;
      font-size: 11px;
      font-weight: 800;
    }

    .urgent-chip {
      min-width: 18px;
      height: 18px;
      display: inline-grid;
      place-items: center;
      border-radius: 999px;
      background: var(--danger);
      color: #fff;
      font-size: 10px;
      font-weight: 850;
    }

    .client-filter {
      width: calc(100% - 12px);
      height: 34px;
      margin: 0 6px 9px;
      padding: 0 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      outline: none;
    }

    .status-dot {
      width: 9px;
      height: 9px;
      margin-left: 7px;
      border-radius: 999px;
      background: #9aa7b3;
      box-shadow: 0 0 0 3px rgba(154, 167, 179, 0.16);
    }

    .status-dot.active {
      background: #25a55f;
      box-shadow: 0 0 0 3px rgba(37, 165, 95, 0.16);
    }

    .more-clients {
      margin: 8px 9px 0;
      color: var(--muted);
      font-size: 12px;
      font-weight: 650;
    }

    .list-pane {
      height: calc(100vh - 100px);
      min-height: 600px;
      overflow: hidden;
      background: var(--surface);
      border-right: 1px solid var(--line);
    }

    .pane-scene {
      display: none;
      height: 100%;
    }

    .pane-scene.active {
      display: flex;
      flex-direction: column;
    }

    .list-head {
      min-height: 76px;
      padding: 16px 16px 12px;
      border-bottom: 1px solid var(--line);
      background: #fff;
    }

    .list-eyebrow {
      color: var(--muted);
      font-size: 12px;
      font-weight: 750;
    }

    .list-title-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: 4px;
    }

    .list-title {
      margin: 0;
      font-size: 20px;
      line-height: 1.2;
    }

    .list-head.global-head {
      min-height: 174px;
      flex: 0 0 auto;  /* Empeche le list-head de retrecir et de cacher la filter-bar (bug latent du proto) */
    }

    .queue-summary {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 7px;
      margin-top: 12px;
    }

    .queue-stat {
      min-width: 0;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f8fbfd;
    }

    .queue-stat strong {
      display: block;
      color: #142334;
      font-size: 18px;
      line-height: 1;
    }

    .queue-stat span {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 750;
      white-space: nowrap;
    }

    .filter-bar {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 11px;
    }

    .filter-control {
      min-width: 0;
    }

    .filter-control label {
      display: block;
      margin: 0 0 4px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 850;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .filter-control select {
      width: 100%;
      height: 32px;
      padding: 0 8px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: #fff;
      color: #263545;
      outline: none;
      font-weight: 700;
    }

    .filter-control select:focus {
      border-color: #94b8da;
      box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.12);
    }

    .queue-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 9px 12px;
      border-bottom: 1px solid var(--line);
      background: #fbfdff;
      color: var(--muted);
      font-size: 12px;
      font-weight: 750;
    }

    .queue-toolbar strong {
      color: #263545;
    }

    .no-results {
      display: none;
      margin: 18px 10px;
      padding: 14px;
      border: 1px dashed var(--line-strong);
      border-radius: 8px;
      background: #fbfdff;
      color: var(--muted);
      text-align: center;
      line-height: 1.4;
      font-weight: 700;
    }

    .no-results.visible {
      display: block;
    }

    .mini-filter {
      height: 28px;
      padding: 0 9px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: #f8fbfd;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }

    .item-list {
      overflow: auto;
      padding: 8px;
    }

    .inbox-item {
      position: relative;
      width: 100%;
      display: grid;
      grid-template-columns: 42px 1fr;
      gap: 10px;
      margin-bottom: 6px;
      padding: 12px 10px;
      border: 1px solid transparent;
      border-radius: 8px;
      background: #fff;
      text-align: left;
      color: var(--text);
    }

    .inbox-item:hover {
      border-color: #d8e6f3;
      box-shadow: var(--shadow-soft);
    }

    .inbox-item.selected {
      border-color: #9fc4e9;
      background: #f1f7fd;
      box-shadow: inset 3px 0 0 var(--blue);
    }

    .avatar {
      width: 40px;
      height: 40px;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      border-radius: 999px;
      color: #fff;
      font-weight: 850;
      overflow: hidden;
    }

    .avatar.fb {
      background: var(--fb);
    }

    .avatar.google {
      background: var(--google);
    }

    .avatar.ig {
      background: linear-gradient(135deg, #f09433, #dc2743 54%, #bc1888);
    }

    .avatar.msg {
      background: var(--messenger);
    }

    .avatar.soft {
      background: #dfe8f1;
      color: #334155;
    }

    .avatar.small {
      width: 24px;
      height: 24px;
      font-size: 10px;
    }

    .item-main {
      min-width: 0;
    }

    .item-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .name-line {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-weight: 800;
    }

    .time {
      flex: 0 0 auto;
      color: var(--muted-2);
      font-size: 12px;
      font-weight: 650;
    }

    .client-line {
      margin-top: 2px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 650;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .snippet {
      display: -webkit-box;
      margin-top: 7px;
      color: #334155;
      line-height: 1.35;
      overflow: hidden;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .item-badges {
      display: flex;
      align-items: center;
      gap: 5px;
      flex-wrap: wrap;
      margin-top: 8px;
    }

    .tag {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      min-height: 20px;
      padding: 0 7px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 850;
      letter-spacing: 0.02em;
      text-transform: uppercase;
    }

    .tag.danger {
      background: #fdecea;
      color: #a50e0e;
    }

    .tag.ready {
      background: #fff5d6;
      color: #7a5100;
    }

    .tag.auto {
      background: #e6f4ea;
      color: #137333;
    }

    .tag.done {
      background: #e4f3ff;
      color: #075a9c;
    }

    .tag.draft {
      background: #edf2f7;
      color: #334155;
    }

    .tag.neutral {
      background: #e8eef5;
      color: #526173;
    }

    .tag.platform-fb {
      background: #e8f1ff;
      color: #1559ad;
    }

    .tag.platform-ig {
      background: #fff0f6;
      color: #a31964;
    }

    .tag.platform-google {
      background: #eef4ff;
      color: #245ab5;
    }

    .tag.platform-msg {
      background: #e6f3ff;
      color: #0068c8;
    }

    .unread-dot {
      width: 9px;
      height: 9px;
      margin-left: 5px;
      border-radius: 999px;
      background: #2674e6;
      box-shadow: 0 0 0 4px rgba(38, 116, 230, 0.12);
    }

    .detail-pane {
      height: calc(100vh - 100px);
      min-height: 600px;
      overflow: auto;
      background: linear-gradient(180deg, #f4f8fb 0%, #edf3f7 100%);
    }

    .detail-scene {
      display: none;
      min-height: 100%;
    }

    .detail-scene.active {
      display: block;
    }

    .detail-inner {
      max-width: 940px;
      margin: 0 auto;
      padding: 22px 30px 34px;
    }

    .detail-topline {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 14px;
    }

    .detail-title-block {
      min-width: 0;
    }

    .detail-title-block h1 {
      margin: 0;
      font-size: 20px;
      line-height: 1.2;
    }

    .detail-meta {
      margin-top: 4px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 650;
    }

    .detail-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .ghost-btn {
      height: 34px;
      padding: 0 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      color: #334155;
      font-size: 12px;
      font-weight: 750;
    }

    .ghost-btn:hover {
      border-color: #aebdca;
      box-shadow: var(--shadow-soft);
    }

    .native-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .fb-card {
      max-width: 640px;
      margin: 0 auto 14px;
      font-family: Helvetica, Arial, sans-serif;
    }

    .native-header {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 14px 14px 9px;
    }

    .native-header-copy {
      min-width: 0;
      flex: 1;
    }

    .fb-name {
      color: #050505;
      font-size: 15px;
      font-weight: 700;
    }

    .fb-sub {
      margin-top: 2px;
      color: #65676b;
      font-size: 13px;
    }

    .rating-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 14px 8px 64px;
    }

    .stars {
      color: #f5b400;
      font-size: 18px;
      line-height: 1;
      letter-spacing: 1px;
      text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    }

    .recommend {
      color: #65676b;
      font-weight: 700;
    }

    .native-body {
      padding: 0 14px 14px 64px;
      color: #050505;
      font-size: 15px;
      line-height: 1.42;
    }

    .fb-actions {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      margin: 0 14px;
      border-top: 1px solid #e4e6eb;
      border-bottom: 1px solid #e4e6eb;
    }

    .fb-action {
      height: 38px;
      display: grid;
      place-items: center;
      border: 0;
      background: #fff;
      color: #65676b;
      font-weight: 700;
    }

    .fb-action:hover {
      background: #f2f3f5;
    }

    .comments-thread {
      padding: 12px 14px 14px;
      background: #fff;
    }

    .comment-row {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      margin-bottom: 9px;
    }

    .comment-bubble {
      max-width: 86%;
      padding: 8px 10px;
      border-radius: 14px;
      background: #f0f2f5;
      color: #050505;
      line-height: 1.35;
    }

    .comment-bubble strong {
      display: block;
      margin-bottom: 2px;
      font-size: 13px;
    }

    .comment-foot {
      margin: 3px 0 0 42px;
      color: #65676b;
      font-size: 12px;
      font-weight: 700;
    }

    .ig-card {
      width: 520px;
      margin: 0 auto 14px;
      border-color: #dbdbdb;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    }

    .ig-header {
      display: flex;
      align-items: center;
      gap: 10px;
      height: 58px;
      padding: 0 14px;
      border-bottom: 1px solid #efefef;
    }

    .ig-name {
      font-weight: 800;
    }

    .ig-place {
      color: #777;
      font-size: 12px;
    }

    .ig-image {
      aspect-ratio: 1 / 1;
      background:
        radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.62), transparent 22%),
        linear-gradient(135deg, #f09433 0%, #e85872 42%, #bc1888 100%);
      position: relative;
      display: grid;
      place-items: center;
      color: rgba(255, 255, 255, 0.86);
      font-size: 26px;
      font-weight: 850;
      text-align: center;
    }

    .ig-image::after {
      content: "";
      position: absolute;
      inset: 22%;
      border: 2px solid rgba(255, 255, 255, 0.42);
      border-radius: 999px;
    }

    .ig-actions {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 12px 14px 6px;
      font-size: 23px;
    }

    .ig-actions span:last-child {
      margin-left: auto;
    }

    .ig-copy {
      padding: 0 14px 14px;
      line-height: 1.42;
    }

    .ig-likes {
      margin-bottom: 8px;
      font-weight: 800;
    }

    .ig-caption {
      margin-bottom: 7px;
    }

    .ig-muted {
      color: #8e8e8e;
      margin: 7px 0;
    }

    .ig-comment {
      display: flex;
      gap: 6px;
      margin-top: 5px;
    }

    .ig-comment strong {
      flex: 0 0 auto;
    }

    .messenger-shell {
      max-width: 720px;
      height: calc(100vh - 178px);
      min-height: 520px;
      margin: 0 auto 14px;
      display: flex;
      flex-direction: column;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .messenger-head {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 15px;
      border-bottom: 1px solid #e8edf2;
      background: #fff;
    }

    .messenger-head-title {
      font-weight: 850;
    }

    .messenger-head-sub {
      color: var(--muted);
      font-size: 12px;
    }

    .chat-timeline {
      flex: 1;
      overflow: auto;
      padding: 18px;
      background: #fbfcfd;
    }

    .time-sep {
      margin: 0 0 18px;
      color: #8995a3;
      font-size: 12px;
      font-weight: 700;
      text-align: center;
    }

    .message-row {
      display: flex;
      align-items: flex-end;
      gap: 8px;
      margin-bottom: 10px;
    }

    .message-row.out {
      justify-content: flex-end;
    }

    .message-bubble {
      max-width: 68%;
      padding: 10px 12px;
      border-radius: 18px;
      background: #e9eef4;
      color: #17212b;
      line-height: 1.38;
    }

    .message-row.out .message-bubble {
      background: var(--messenger);
      color: #fff;
      border-bottom-right-radius: 5px;
    }

    .message-row.in .message-bubble {
      border-bottom-left-radius: 5px;
    }

    .chat-composer,
    .response-composer {
      border-top: 1px solid var(--line);
      background: #fff;
    }

    .response-composer {
      max-width: 640px;
      margin: 0 auto 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow-soft);
      overflow: visible;
    }

    .composer-field {
      width: 100%;
      min-height: 96px;
      display: block;
      resize: vertical;
      padding: 13px 14px;
      border: 0;
      outline: none;
      color: var(--text);
      line-height: 1.45;
    }

    .chat-composer .composer-field {
      min-height: 64px;
    }

    .composer-bar {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px;
      border-top: 1px solid #eef2f6;
      background: #fbfdff;
    }

    .composer-left {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      color: var(--muted);
      font-size: 12px;
      font-weight: 650;
    }

    .composer-actions {
      position: relative;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .ai-btn {
      height: 32px;
      padding: 0 10px;
      border: 0;
      border-radius: 7px;
      background: linear-gradient(135deg, var(--ai1), var(--ai2));
      color: #fff;
      font-size: 12px;
      font-weight: 850;
      box-shadow: 0 8px 18px rgba(109, 93, 252, 0.2);
    }

    .primary-btn {
      height: 32px;
      padding: 0 13px;
      border: 0;
      border-radius: 7px;
      background: #1b6ac9;
      color: #fff;
      font-size: 12px;
      font-weight: 850;
    }

    .primary-btn:hover,
    .ai-btn:hover {
      filter: brightness(0.97);
      transform: translateY(-1px);
    }

    .primary-btn:disabled,
    .ai-btn:disabled,
    .ghost-btn:disabled {
      cursor: default;
      opacity: 0.58;
      transform: none;
    }

    .ai-popover {
      position: absolute;
      z-index: 20;
      /* Ouvre vers le HAUT : le composer est en bas de page et un ancêtre
         (.workbench-card) a overflow:hidden — ouvrir vers le bas le coupait
         hors écran. (Fix visuel 2026-06-17.) */
      bottom: calc(100% + 8px);
      top: auto;
      right: 0;
      width: 390px;
      max-height: min(60vh, 420px);
      overflow-y: auto;
      display: none;
      padding: 10px;
      border: 1px solid #d8d9ef;
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 18px 38px rgba(35, 35, 64, 0.16);
    }

    .composer-actions.open .ai-popover {
      display: block;
    }

    .ai-popover h3 {
      margin: 0 0 8px;
      color: #3d316c;
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .ai-suggestion {
      width: 100%;
      display: block;
      margin-top: 7px;
      padding: 9px 10px;
      border: 1px solid #ece8fb;
      border-radius: 7px;
      background: #faf9ff;
      text-align: left;
      color: #2b2540;
      line-height: 1.35;
    }

    .ai-suggestion:hover {
      border-color: #c8bdf8;
      background: #f4f0ff;
    }

    .ai-suggestion strong {
      display: block;
      margin-bottom: 3px;
      color: #5b43bc;
      font-size: 12px;
    }

    .kb-card {
      max-width: 640px;
      margin: 14px auto 0;
      border: 1px solid #d4e1cc;
      border-radius: 8px;
      background: #f9fcf5;
      box-shadow: var(--shadow-soft);
      overflow: hidden;
    }

    .kb-card.wide {
      max-width: 720px;
    }

    .kb-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 11px 13px;
      border-bottom: 1px solid #dce8d2;
      background: #f2f8eb;
      font-weight: 850;
    }

    .kb-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      padding: 13px;
    }

    .kb-item {
      min-width: 0;
    }

    .kb-label {
      margin-bottom: 3px;
      color: #526145;
      font-size: 11px;
      font-weight: 850;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .kb-value {
      color: #24351e;
      line-height: 1.42;
      font-weight: 650;
    }

    .client-hero {
      margin-bottom: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .client-hero-main {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      padding: 18px;
      background:
        linear-gradient(90deg, rgba(24, 119, 242, 0.08), rgba(66, 133, 244, 0.02)),
        #fff;
    }

    .client-identity {
      display: flex;
      align-items: center;
      gap: 13px;
      min-width: 0;
    }

    .clinic-mark {
      width: 48px;
      height: 48px;
      display: grid;
      place-items: center;
      border-radius: 8px;
      background: linear-gradient(135deg, #1c6fd1, #64b5f6);
      color: #fff;
      font-weight: 900;
    }

    .client-hero h1 {
      margin: 0;
      font-size: 22px;
    }

    .client-site {
      margin-top: 4px;
      color: var(--muted);
      font-weight: 650;
    }

    .client-stats {
      display: flex;
      align-items: center;
      gap: 9px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .stat-pill {
      padding: 7px 10px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #fff;
      color: #334155;
      font-size: 12px;
      font-weight: 800;
    }

    .client-tabs {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 0 12px;
      border-top: 1px solid var(--line);
      background: #fbfdff;
      overflow: hidden;
    }

    .client-tab {
      height: 42px;
      padding: 0 10px;
      border: 0;
      border-bottom: 3px solid transparent;
      background: transparent;
      color: var(--muted);
      font-size: 12px;
      font-weight: 850;
    }

    .client-tab:hover,
    .client-tab.active {
      color: #144d87;
      border-bottom-color: var(--blue);
    }

    .client-tab .small-count {
      color: inherit;
      opacity: 0.75;
    }

    .platform-note {
      max-width: 640px;
      margin: 0 auto 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px;
      border: 1px solid #ead8aa;
      border-radius: 8px;
      background: #fff9e6;
      color: #624a00;
      font-weight: 700;
    }

    .google-review-card {
      max-width: 640px;
      margin: 0 auto 14px;
      padding: 16px;
      border: 1px solid #dadce0;
      border-radius: 8px;
      background: #fff;
      box-shadow: var(--shadow);
    }

    .google-top {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 11px;
    }

    .google-g {
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      background: #edf3ff;
      color: var(--google);
      font-size: 21px;
      font-weight: 900;
    }

    .google-name {
      font-weight: 850;
    }

    .google-place {
      color: #5f6368;
      font-size: 12px;
    }

    .google-body {
      color: #202124;
      line-height: 1.45;
    }

    .compact-source {
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }

    .ops-panel {
      max-width: 820px;
      margin: 0 auto 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .ops-panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      padding: 17px 18px;
      border-bottom: 1px solid var(--line);
      background: linear-gradient(180deg, #fff, #f8fbfd);
    }

    .ops-panel-head h2 {
      margin: 0;
      font-size: 19px;
    }

    .ops-panel-head p {
      margin: 5px 0 0;
      color: var(--muted);
      line-height: 1.4;
      font-weight: 650;
    }

    .ops-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      border-bottom: 1px solid var(--line);
    }

    .ops-metric {
      padding: 14px;
      border-right: 1px solid var(--line);
    }

    .ops-metric:last-child {
      border-right: 0;
    }

    .ops-metric strong {
      display: block;
      font-size: 24px;
      line-height: 1;
    }

    .ops-metric span {
      display: block;
      margin-top: 5px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 750;
    }

    .ops-body {
      display: grid;
      grid-template-columns: 1.2fr 0.8fr;
      gap: 0;
    }

    .ops-column {
      padding: 16px;
    }

    .ops-column + .ops-column {
      border-left: 1px solid var(--line);
      background: #fbfdff;
    }

    .ops-column h3 {
      margin: 0 0 10px;
      font-size: 13px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: #526173;
    }

    .priority-stack {
      display: grid;
      gap: 8px;
    }

    .priority-row {
      display: grid;
      grid-template-columns: 32px 1fr auto;
      gap: 10px;
      align-items: center;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }

    .priority-title {
      font-weight: 850;
    }

    .priority-sub {
      margin-top: 2px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 650;
    }

    .workflow-list {
      display: grid;
      gap: 9px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .workflow-list li {
      padding: 10px;
      border: 1px solid #e0e7ef;
      border-radius: 8px;
      background: #fff;
      color: #334155;
      line-height: 1.4;
      font-weight: 650;
    }

    .workbench-card {
      max-width: 820px;
      margin: 0 auto 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .workbench-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 15px 16px;
      border-bottom: 1px solid var(--line);
      background: #fff;
    }

    .workbench-person {
      display: flex;
      align-items: center;
      gap: 11px;
      min-width: 0;
    }

    .workbench-person h2 {
      margin: 0;
      font-size: 18px;
      line-height: 1.2;
    }

    .workbench-sub {
      margin-top: 3px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }

    .workbench-badges {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      flex-wrap: wrap;
    }

    .workbench-grid {
      display: grid;
      /* Side panel retire (KB + Assignation + Actions + Journal) : la grille
         passe en 1 colonne pleine largeur. Pour reactiver, repasser a
         grid-template-columns: minmax(0, 1fr) 260px et restaurer le contenu
         de templates/elements/_workbench_side.html. */
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
    }

    .workbench-main {
      min-width: 0;
      padding: 16px;
    }

    .workbench-side {
      padding: 16px;
      border-left: 1px solid var(--line);
      background: #fbfdff;
    }

    .workbench-side h3 {
      margin: 0 0 9px;
      color: #526173;
      font-size: 12px;
      font-weight: 900;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    .side-note {
      margin-bottom: 12px;
      padding: 10px;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #fff;
      color: #334155;
      line-height: 1.4;
      font-weight: 650;
    }

    .side-note strong {
      display: block;
      margin-bottom: 3px;
      color: #17212b;
    }

    .quick-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .quick-actions .ghost-btn {
      width: 100%;
      height: 32px;
      padding: 0 8px;
      font-size: 11px;
    }

    .global-native-preview {
      min-height: 260px;
    }

    .global-native-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      box-shadow: var(--shadow-soft);
      overflow: hidden;
    }

    .global-native-top {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px;
      border-bottom: 1px solid #eef2f6;
    }

    .global-native-top strong {
      display: block;
    }

    .global-native-top span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 650;
    }

    .global-native-body {
      padding: 14px;
      line-height: 1.45;
      color: #17212b;
    }

    .global-native-photo {
      aspect-ratio: 1 / 0.72;
      display: grid;
      place-items: center;
      background:
        radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.62), transparent 23%),
        linear-gradient(135deg, #f09433 0%, #dc2743 52%, #bc1888 100%);
      color: #fff;
      font-size: 22px;
      font-weight: 900;
      text-align: center;
    }

    .global-chat {
      display: grid;
      gap: 9px;
      padding: 14px;
      background: #fbfcfd;
    }

    .global-chat .message-bubble {
      max-width: 86%;
    }

    .rating-mini {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 14px 12px;
      color: #65676b;
      font-weight: 800;
    }

    .global-composer {
      margin: 14px 0 0;
      max-width: none;
      box-shadow: none;
    }

    .global-composer.draft-saved {
      border-color: #bdd3e8;
    }

    .activity-feed {
      display: grid;
      gap: 8px;
      max-height: 210px;
      overflow: auto;
    }

    .activity-entry {
      padding: 9px 10px;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #fff;
      color: #334155;
      line-height: 1.35;
      font-size: 12px;
      font-weight: 650;
    }

    .activity-entry strong {
      display: block;
      margin-bottom: 2px;
      color: #17212b;
      font-size: 12px;
    }

    .toast {
      position: fixed;
      z-index: 80;
      right: 22px;
      bottom: 22px;
      min-width: 260px;
      max-width: 360px;
      padding: 12px 14px;
      border: 1px solid #cfe0ef;
      border-radius: 8px;
      background: #fff;
      color: #17212b;
      box-shadow: 0 18px 40px rgba(23, 33, 43, 0.18);
      font-weight: 750;
      opacity: 0;
      pointer-events: none;
      transform: translateY(10px);
      transition: opacity 160ms ease, transform 160ms ease;
    }

    .toast.show {
      opacity: 1;
      transform: translateY(0);
    }

    @media (max-height: 760px) {
      .detail-inner {
        padding-top: 16px;
      }

      .native-body {
        font-size: 14px;
      }

      .kb-grid {
        grid-template-columns: 1fr;
      }
    }

    /* ───────────────────────────────────────────────
       A11y — anneau de focus clavier visible (WCAG 2.4.7).
       Placé en fin de fichier : la spécificité :focus-visible
       l'emporte sur les `outline:none` antérieurs (.composer-field, etc.).
       :focus-visible = visible au clavier, pas au clic souris. */
    .composer-field:focus-visible,
    .client-filter:focus-visible,
    #globalSearchInput:focus-visible,
    .nav-item:focus-visible,
    .inbox-item:focus-visible,
    .client-row:focus-visible,
    .ai-suggestion:focus-visible,
    .topnav-link:focus-visible,
    .primary-btn:focus-visible,
    .ghost-btn:focus-visible,
    .ai-btn:focus-visible,
    .fb-action:focus-visible,
    a:focus-visible,
    button:focus-visible {
      outline: 2px solid #4285f4;
      outline-offset: 2px;
      border-radius: 4px;
    }

    /* Le composer remplit sa carte (bord à bord) : offset négatif pour
       que l'anneau reste visible à l'intérieur. */
    .composer-field:focus-visible {
      outline-offset: -2px;
    }

    /* Élément traité après publication (FE-5) : indice discret dans la liste.
       Le design a retiré les tags bruyants → juste un ✓ vert + snippet atténué,
       posé par queue-app.js via data-status="done". */
    .inbox-item[data-status="done"] .name-line::after {
      content: " ✓";
      color: #1a7f37;
      font-weight: 700;
    }
    .inbox-item[data-status="done"] .snippet {
      opacity: 0.6;
    }
