/* Ocelot light product system. Layout primitives live in app.css.
   Shared spacing, typography and surfaces are defined here for every screen. */
:root {
  --ink: #1e1e1e;
  --muted: #66717d;
  --line: #dce2e9;
  --surface: #ffffff;
  --canvas: #e1e5ea;
  --action-orange: #c8430e;
  --surface-canvas: #e1e5ea;
  --surface-panel: #f0f2f5;
  --surface-inset: #e8ecf1;
  --surface-raised: #ffffff;
  --control-border: #c9cfd7;
  --control-border-hover: #929daa;
  --radius-button: 999px;
  --radius-card: 12px;
  --ocelot-neutral-50: #f1efe7;
  --ocelot-butttano-pale: #f9e5d9;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --workspace-gutter: 40px;
  background: var(--canvas);
}
button, button.primary, button.secondary, button.quiet,
.transfer > summary, .ai-options > summary, .company-switch > summary {
  min-height: 44px;
  border-radius: var(--radius-button);
  padding: 11px 20px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  box-shadow: none;
}
button, button.secondary, .transfer > summary, .ai-options > summary {
  border: 1px solid var(--control-border);
  background: transparent;
  color: var(--ink);
}
button:hover:not(:disabled), button.secondary:hover:not(:disabled),
.transfer > summary:hover, .ai-options > summary:hover {
  border-color: #888477;
  background: #eeece3;
}
button.primary { background: var(--action-orange); border-color: var(--action-orange); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: #ad3608; border-color: #ad3608; color: #fff; }
button.quiet { border: 1px solid var(--control-border); background: var(--surface-raised); }
button.quiet:hover:not(:disabled) { border-color: var(--control-border-hover); background: #f1f3f5; }
button:disabled, button.primary:disabled, button.secondary:disabled { color: #737166; background: #eeece5; border-color: #e3e0d6; cursor: not-allowed; opacity: 1; }
input:not([type=checkbox]), textarea, select,
.access-dialog input:not([type=checkbox]), .access-dialog select {
  border-radius: 4px; border-color: #b7b3a5; background: var(--surface); color: var(--ink);
}
input:not([type=checkbox]), select { min-height: 48px; padding: 12px 16px; }
/* Keep native interaction, with space reserved for a single inset chevron. */
select:not([multiple], [size]:not([size="1"])) {
  appearance: none;
  padding-inline-end: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%2356606d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
@media (forced-colors: active) {
  select:not([multiple], [size]:not([size="1"])) {
    appearance: auto;
    padding-inline-end: 16px;
    background-image: none;
  }
}
input[type=checkbox] { accent-color: var(--ocelot-butttano); }
.list-heading h1, .access-heading h1, .access-dialog h2, .qr-dialog h2 {
  font-family: Dragon, 'Instrument Sans', sans-serif;
  font-variation-settings: 'Inkt' 10, 'Angl' 10;
  font-weight: 750; letter-spacing: 0; word-spacing: .04em; line-height: 1.12;
}
.list-heading h1 { font-size: 40px; }
.access-heading h1 { font-size: 48px; }
.access-dialog h2, .qr-dialog h2 { font-size: 36px; }
.shell {
  grid-template-columns: var(--nav-width, 248px) minmax(320px, 360px) minmax(0, 1fr);
  background: var(--surface-canvas);
}
.nav, .access-nav { background: var(--ocelot-beige); color: var(--ink); border-right: 1px solid var(--line); padding: var(--space-4) var(--space-3); gap: var(--space-4); }
.client-brand { display: grid; gap: 12px; align-content: start; }
.client-logo { padding: 12px 24px; border-radius: 8px; background: transparent; }
.client-logo img, .access-nav .client-logo img { display: block; width: 100%; height: 72px; object-fit: contain; margin: 0; }
.client-caption { color: var(--muted); font-size: 12px; text-align: center; }
.client-wordmark { font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.platform-signature { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); margin-bottom: 24px; }
.platform-signature img { display: block; width: 68px; height: 26px; object-fit: contain; }
.nav-title { color: var(--muted); margin: 0 16px 12px; font-size: 12px; }
.nav nav { gap: 8px; }
.nav nav button { color: var(--ink); padding: 12px 16px; border-radius: 4px; min-height: 48px; }
.nav nav button:hover { color: var(--ink); background: #dcd8c1; }
.nav nav button.active { background: #ffffff38; color: var(--ink); border-left: 3px solid var(--ocelot-butttano); font-weight: 650; padding-left: 13px; }
.nav-utilities { display: grid; gap: 8px; margin-top: auto; padding-top: 24px; border-top: 1px solid #c9c4b2; }
.nav .manage-access { border-radius: 4px; margin: 0; color: var(--muted); border-color: transparent; justify-content: flex-start; padding: 12px 16px; background: transparent; font-size: 14px; min-height: 44px; }
.nav .manage-access:hover:not(:disabled) { color: var(--ink); background: #dcd8c1; border-color: transparent; }
.nav-bottom { border: 0; margin-top: 0; padding-top: 0; }
.user-name { color: var(--ink); padding: 0; font-size: 14px; font-weight: 600; }
.nav-bottom button { color: var(--muted); padding-left: 0; border-radius: 0; }
.nav-bottom button:hover { color: var(--ink); background: transparent; text-decoration: underline; }
.company-switch { font-size: 13px; }
.company-switch > summary { padding: 8px 0; text-decoration: underline; }
.company-switch label { display: block; margin: 16px 0 8px; }
.company-switch select { width: 100%; color: var(--ink); background: var(--surface); }
.conversation-avatar { display: none; }
.list, .access-page { background: var(--canvas); }
@font-face {
  font-family: "Navigation Material Symbols";
  src: url("/assets/ocelot/MaterialSymbolsOutlined-navigation-light.ttf") format("truetype");
  font-display: block;
}
.navigation-symbol {
  font: 18px/1 "Navigation Material Symbols";
  letter-spacing: normal;
  white-space: nowrap;
}
@media (min-width: 1025px) {
  .shell {
    --nav-width: 96px;
    --sidebar-outer-radius: 24px;
    --sidebar-inset: 12px;
    --sidebar-inner-radius: max(0px, calc(var(--sidebar-outer-radius) - var(--sidebar-inset)));
    --queue-width: 380px;
    grid-template-columns: var(--nav-width) var(--queue-width) minmax(0, 1fr);
    padding: 24px;
    grid-template-rows: minmax(0, 1fr);
    isolation: isolate;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace))::before {
    content: "";
    grid-area: 1 / 1 / 2 / 3;
    background: #fff;
    border-radius: var(--sidebar-outer-radius);
    box-shadow: 0 4px 20px rgb(0 0 0 / 7%);
    z-index: -1;
  }
  .shell.has-workspace:not(:has(> .voice-workspace))::before {
    content: "";
    grid-area: 1 / 1 / 2 / 2;
    background: #fff;
    border-radius: var(--sidebar-outer-radius);
    box-shadow: 0 4px 20px rgb(0 0 0 / 7%);
    z-index: -1;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list {
    grid-area: 1 / 2 / 2 / 3;
    margin: var(--sidebar-inset) var(--sidebar-inset) var(--sidebar-inset) 0;
    background: var(--surface-panel);
    border-right: 0;
    border-radius: var(--sidebar-inner-radius);
    overflow: hidden;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread {
    grid-area: 1 / 3 / 2 / 4;
    margin-left: 16px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgb(0 0 0 / 4%);
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .list-head {
    padding: 24px 20px 20px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .list-heading h1 {
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: -1px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .search-wrap input {
    border-color: transparent;
    border-radius: 16px;
    background: #fff;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .queue-status {
    border: 0;
    padding: 4px;
    background: #fff;
    border-radius: 16px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .queue-status button {
    border: 0;
    border-radius: 12px;
    min-height: 36px;
    font-size: 12px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .queue-status button[aria-pressed="true"] {
    background: var(--ink);
    color: #fff;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .rows {
    padding: 14px 12px 16px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .row {
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 6px;
    padding: 16px 12px calc(16px + var(--row-expansion, 0px));
    transition: padding-bottom 240ms cubic-bezier(.2,.7,.2,1), border-color 180ms ease, box-shadow 180ms ease;
    border: 1px solid transparent;
    border-radius: 20px;
    background: #fff;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .row:hover {
    background: #eef1f5;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .row.selected {
    background: var(--selected-card-background);
    border-color: var(--ocelot-butttano);
    box-shadow: var(--selected-card-glow);
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .row.selected::before {
    display: none;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .messages {
    background: #f5f6f8;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .message.outgoing:not(.note) {
    background: #eaf0f8;
    border-color: #dce4ee;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .conversation-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5ebf3;
    color: #45556d;
    font-size: 12px;
    font-weight: 600;
    grid-row: 1 / 3;
    align-self: start;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .row:nth-child(3n + 2) .conversation-avatar {
    background: #ede8df;
    color: #6b5943;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .row-top,
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .row-preview {
    grid-column: 2;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .row-top strong {
    font-size: 14px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .row-meta {
    gap: 5px;
    font-size: 10px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .row-preview {
    font-size: 12px;
    line-height: 1.55;
    color: var(--muted);
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .row-bottom {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #f0f1f2;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .list .badge {
    border-radius: 20px;
    background: #f0f3f5;
    font-size: 10px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread {
    --workspace-gutter: 24px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .thread-head {
    min-height: 0;
    padding-block: 12px;
    gap: 8px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .thread-head h2 {
    font-size: 18px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .thread-head small {
    margin-top: 2px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .thread-tools {
    flex-basis: auto;
    gap: 8px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .contact-avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .compose-modes {
    padding-top: 10px;
    gap: 6px;
    border-top: 1px solid #e9ecf0;
    background: #fff;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .compose-modes button {
    min-height: 36px;
    padding: 6px 12px;
    border: 0;
    border-radius: 12px;
    font-size: 12px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread #reply-composer {
    padding-block: 8px 16px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread #reply-form textarea {
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px;
    font-size: 14px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread #reply-form > footer,
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread #reply-form > .composer-tools {
    padding-block: 0 8px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .contact-avatar {
    background: #e5ebf3;
    color: #45556d;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .messages {
    padding-block: 24px;
    gap: 14px;
    background: #f5f6f8;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .message {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.55;
    border-radius: 18px;
    box-shadow: 0 2px 4px rgb(0 0 0 / 2%);
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .message .author {
    font-size: 11px;
    margin-bottom: 5px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .message small {
    font-size: 10px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .control-toolbar {
    gap: 12px;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .control-actions {
    width: auto;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .conversation-control {
    padding-block: 8px;
    border-bottom: 0;
    background: #fafbfc;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .thread-tools {
    min-height: 36px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .thread-tools button,
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .transfer > summary {
    font-size: 12px;
    min-height: 36px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .control-state strong {
    font-size: 12px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .control-actions button {
    font-size: 11px;
    min-height: 36px;
    padding: 8px 12px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread #reply-form {
    border-radius: 22px;
    border-color: #d9dde2;
    box-shadow: 0 3px 10px rgb(0 0 0 / 3%);
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .thread-head {
    background: #fff;
    border-bottom-color: #edf0f3;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .thread-head .badge {
    border-radius: 20px;
    background: #edf3ef;
    color: #46634e;
    font-size: 10px;
    padding: 5px 9px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .transfer > summary {
    background: #fff;
    border-color: #dce1e7;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .control-actions button[data-control="return_ai"] {
    background: #fff;
    color: var(--ink);
    border: 1px solid #dce1e7;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .control-actions button[data-control="return_ai"] .icon {
    color: var(--ink);
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .control-actions button[data-control="resolve"] {
    background: #fff;
    border-color: #dce1e7;
    color: var(--ink);
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .control-actions button:hover:not(:disabled),
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .transfer > summary:hover {
    background: #eef1f5;
    border-color: #b9c3cf;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .messages > .message {
    max-width: 84%;
    border-color: #e6e9ed;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .messages > .message:not(.outgoing):not(.note) {
    border-bottom-left-radius: 5px;
    background: #202124;
    border-color: #202124;
    color: #fff;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .messages > .message.outgoing:not(.note) {
    border-bottom-right-radius: 5px;
    background: var(--action-orange);
    border-color: var(--action-orange);
    color: #fff;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .messages > .message.note {
    align-self: center;
    width: 90%;
    max-width: 90%;
    background: #faf5e7;
    border: 1px dashed #dfd3af;
    box-shadow: none;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .message .author {
    color: #526071;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .messages > .message:not(.outgoing):not(.note) :is(.author, small) {
    color: #d8dadd;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .messages > .message.outgoing:not(.note) :is(.author, small) {
    color: #fff;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .date-separator {
    font-size: 10px;
    color: #75808d;
    margin-block: 0 8px;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread .compose-modes button[aria-pressed="true"] {
    background: #eef1f5;
    color: var(--ink);
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread #reply-composer {
    background: #fff;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread #reply-form {
    border-radius: 18px;
    background: #f7f8fa;
    box-shadow: none;
    border-color: #e4e8ed;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread #reply-form:focus-within {
    border-color: #aebfce;
    box-shadow: 0 0 0 3px rgb(174 191 206 / 12%);
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread #reply-form textarea {
    background: transparent;
    resize: none;
  }
  .shell:is(:not(.has-workspace), :has(> .voice-workspace)) > .thread #reply-form button[type="submit"]:not(:disabled) {
    background: #20252b;
    border-color: #20252b;
    color: #fff;
  }
  .shell > .nav {
    grid-area: 1 / 1 / 2 / 2;
    margin: 12px 8px;
    padding-inline: 2px;
    padding-block: var(--space-2) var(--space-1);
    gap: var(--space-1);
    background: #fff;
    border: 0;
    border-radius: var(--radius-card);
    overflow-y: auto;
  }
  .shell > .nav > .client-brand {
    margin-bottom: 12px;
  }
  .shell > .nav .client-wordmark {
    font-size: 14px;
    text-align: center;
  }
  .shell > .nav .client-logo {
    padding: 0;
  }
  .shell > .nav .client-logo img {
    height: 40px;
  }
  .shell > .nav .nav-utilities {
    margin-top: 0;
    padding-top: var(--space-1);
  }
  .shell > .nav .nav-bottom {
    margin-top: auto;
    padding-top: var(--space-1);
  }
  .shell > .nav .platform-signature {
    flex-direction: column;
    gap: 0;
    font-size: 8px;
    white-space: nowrap;
    margin-bottom: 0;
    text-align: center;
  }
  .shell > .nav .user-name {
    padding-inline: 0;
    overflow-wrap: anywhere;
    text-align: center;
  }
  .shell > .nav :is(nav button, .manage-access, [id="logout"])[data-icon] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 60px;
    padding: 6px 8px;
    border-radius: var(--radius-card);
    background: transparent;
    font-size: 11px;
    text-align: center;
  }
  .shell > .nav :is(nav button, .manage-access, [id="logout"])[data-icon]:hover:not(:disabled) {
    background: var(--ocelot-neutral-50);
  }
  .shell > .nav :is(nav button, .manage-access)[data-icon].active,
  .shell > .nav :is(nav button, .manage-access)[data-icon].active:hover:not(:disabled) {
    background: var(--ink);
    color: #fff;
    box-shadow: none;
    border-left: 0;
  }
  .shell > .nav :is(nav button, .manage-access, [id="logout"])[data-icon] .icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }
  .shell > .nav .navigation-symbol {
    font-size: 24px;
  }
  .shell > .nav :is(button[data-icon], #logout):has(.nav-label) {
    position: relative;
    min-height: 64px;
    height: 64px;
    width: 64px;
    margin-inline: auto;
    border-radius: 32px;
    background: var(--surface-panel);
    justify-content: flex-start;
    padding: 16px 0;
    border: 0;
    gap: 0;
    flex-shrink: 0;
  }
  .shell > .nav :is(button[data-icon], #logout):has(.nav-label):is(:hover, :focus-visible) {
    height: var(--nav-expanded-height, 76px);
    width: 100%;
    border-radius: 24px;
  }
  .shell > .nav :is(button[data-icon], #logout):has(.nav-label).active {
    background: var(--ink);
    color: #fff;
  }
  .shell > .nav :is(button[data-icon], #logout):has(.nav-label) .navigation-symbol {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 32px;
  }
  .shell > .nav .nav-label {
    position: absolute;
    inset: 54px 0 auto;
    height: auto;
    display: grid;
    place-content: center;
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 4px;
    white-space: normal;
    font-size: 10px;
    line-height: 12px;
    opacity: 0;
    pointer-events: none;
  }
  .shell > .nav .nav-utilities button { --nav-expanded-height: 88px; }
  .shell > .nav button:is(:hover, :focus-visible) .nav-label {
    opacity: 1;
  }
  @media (prefers-reduced-motion: no-preference) {
    .shell > .nav .nav-label {
      transition: opacity 160ms ease;
    }
    .shell > .nav :is(button[data-icon], #logout):has(.nav-label) {
      transition: height 160ms ease, width 160ms ease, border-radius 160ms ease;
    }
  }
}
.list-head { padding: 40px 28px 16px; }
.list-heading { display: block; margin-bottom: 32px; }
.list-heading .live { display: block; margin-top: 16px; }
.live[data-state="online"]::before { background: #6b7860; }
.search-wrap input { border-radius: 4px; padding-left: 40px; padding-right: 44px; }
.search-wrap .clear-search { position: absolute; right: 4px; top: 4px; width: 40px; min-height: 40px; padding: 4px; border: 1px solid var(--control-border); background: #fff; font-size: 20px; color: var(--muted); }
.search-wrap input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-help { margin-top: 12px; margin-bottom: 0; font-size: 12px; line-height: 1.6; }
.search-help:empty { display: none; }
.list-meta { padding: 0 28px 16px; }
.list-meta button { padding-inline: 8px; font-size: 13px; }
.rows { padding: 8px 16px; }
/* A conversation row is a list item, with its own layout and reading rhythm. */
button.row { border: 0; border-bottom: 1px solid var(--line); border-radius: 4px; padding: 24px 16px; margin: 0; background: transparent; font-weight: 400; }
button.row:hover { background: #efede4; border-color: var(--line); }
button.row.selected { background: #ece8d8; border-color: var(--line); }
.row.selected::before { top: 24px; bottom: 24px; border-radius: 0; }
.row strong { font-size: 15px; line-height: 1.5; }
.row small { margin-top: 8px; line-height: 1.5; }
.row-bottom { margin-top: 16px; }
.thread, .thread-head, .messages { background: var(--surface); }
/* Every chat section uses one rail, measured against the conversation pane.
   Container units keep the message scrollbar from shifting the content edges. */
.thread {
  container: conversation / inline-size;
  --thread-width: 960px;
  --thread-gutter: max(var(--workspace-gutter), calc((100cqw - var(--thread-width)) / 2));
  --thread-inset: 16px;
  overflow-y: auto;
}
.thread-head { flex-shrink: 0; min-height: 112px; padding: 24px var(--thread-gutter); gap: 20px; border-color: var(--line); }
.thread-heading { gap: 16px; }
.thread-head h2 { font-size: 20px; line-height: 1.35; letter-spacing: -.3px; }
.thread-head small { margin-top: 8px; }
.thread-head .thread-tools { gap: 12px; flex-wrap: wrap; }
.thread-tools .owner { max-width: 180px; }
.contact-avatar { width: 44px; height: 44px; background: #eeece2; border-radius: 50%; }
.status { border-radius: 4px; padding: 5px 8px; background: #eeece2; color: var(--ink); font-weight: 400; }
.status[data-status="open"] { background: #eeece2; color: var(--ink); }
.conversation-control { padding: 16px var(--thread-gutter); background: var(--surface); }
.control-toolbar { gap: 16px; }
.control-toolbar .control-actions { gap: 12px; }
.control-state strong { font-weight: 500; }
.control-confirm { background: #fff; border: 1px solid #202124; border-radius: 8px; padding: 24px; margin-top: 16px; }
.messages {
  display: grid;
  grid-template-columns: minmax(0, calc(100cqw - 2 * var(--thread-gutter)));
  grid-auto-rows: max-content;
  align-content: start;
  justify-content: start;
  padding: 24px 0 24px var(--thread-gutter);
  gap: 24px;
  scrollbar-gutter: auto;
}
.messages > * { min-width: 0; }
.messages > .message { justify-self: start; }
.messages > .outgoing { justify-self: end; }
.messages > .note { justify-self: stretch; width: 100%; }
.messages > .system-event { justify-self: center; }
.thread > .sync-warning { padding: 12px var(--thread-gutter); }
.thread > .environment { padding-inline: var(--thread-gutter); }
.message { max-width: min(82%, 640px); padding: var(--thread-inset); border-radius: 12px; }
.message.outgoing { background: #eeeadc; border-radius: 12px; }
.message.note { background: #f5f0dd; border-color: #e3dcc2; border-radius: 8px; }
.message .author { margin-bottom: 8px; }
.message .text { font-size: 15px; line-height: 1.65; }
.message small { margin-top: 12px; }
.system-event { padding-block: 4px; line-height: 1.6; }
.typing-state { flex-shrink: 0; padding: 12px var(--thread-gutter) 0; text-align: left; }
.compose-modes { border-color: var(--line); background: var(--surface); padding: 16px var(--thread-gutter) 0; gap: 24px; }
.compose-modes button { border-radius: 0; min-height: 48px; padding: 12px 0; margin: 0; border: 0; border-bottom: 2px solid transparent; font-size: 14px; }
.compose-modes button[aria-pressed=true] { background: transparent; border-bottom-color: var(--ocelot-butttano); font-weight: 600; }
.compose-modes button:hover { background: transparent; border-bottom-color: #b3ab91; }
.compose-modes button[aria-pressed=true]:hover { border-bottom-color: var(--ocelot-butttano); }
#reply-composer, .internal-note { padding: 16px var(--thread-gutter) 32px; }
#thread > .internal-note { background-color: rgb(255 255 255 / 50%); }
#reply-composer .composer, .internal-note .composer { border-radius: 8px; border-color: #c8c3b3; overflow: hidden; }
#reply-composer .composer:focus-within, .internal-note .composer:focus-within { border-color: var(--action-orange); }
#reply-reason { padding: var(--thread-inset) var(--thread-inset) 0; line-height: 1.6; }
#reply-form.status-only > #reply-reason {
  padding: 12px var(--thread-inset);
  text-align: center;
}
#reply-form.status-only > :is(.composer-tools, footer) { display: none; }
#reply-composer .composer textarea, .internal-note textarea { padding: var(--thread-inset); min-height: 88px; background: transparent; border-radius: 0; font-size: 15px; line-height: 1.6; }
.composer-tools { gap: 12px; padding: 8px var(--thread-inset) var(--thread-inset); }
#reply-form footer { padding: 8px var(--thread-inset) var(--thread-inset) 0; }
.internal-note .composer footer { padding: 8px var(--thread-inset) var(--thread-inset); }
.composer-tools button { border-color: var(--control-border); padding-inline: 12px; color: var(--muted); }
.internal-note .label, .internal-note .composer { background: #f5f0dd; }
.internal-note .label { padding: var(--thread-inset); }
.transfer-panel, .ai-options-panel { background: var(--surface); border-color: var(--line); border-radius: 8px; padding: 24px; gap: 16px; box-shadow: 0 12px 32px #1e1e1e12; }
.transfer-panel { top: calc(100% + 8px); }
.access-page { grid-template-columns: 248px minmax(0, 1fr); }
.access-nav .quiet { color: var(--ink); justify-content: flex-start; padding-inline: 16px; }
.access-nav-label { background: transparent; border-radius: 0; font-weight: 600; padding: 12px 16px; }
.access-main { padding: 64px 56px; max-width: 1280px; margin: 0 auto; }
.access-heading { padding-bottom: 32px; margin-bottom: 48px; border-bottom: 1px solid var(--line); align-items: flex-start; flex-wrap: wrap; gap: 24px 32px; }
.access-heading h1 { margin-bottom: 16px; }
.access-heading p { max-width: 58ch; line-height: 1.65; }
.access-heading-actions { gap: 12px; padding-top: 4px; }
.access-section { margin-bottom: 48px; }
.access-section h2 { font-size: 20px; margin-bottom: 24px; }
.member-list { gap: 0; border-top: 1px solid var(--line); }
.member-card, .invitation-card { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 32px 0; gap: 32px; }
.member-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(160px, .8fr); align-items: start; }
.member-card h3 { font-size: 16px; line-height: 1.5; }
.member-card p, .invitation-card p { margin: 8px 0 16px; font-size: 14px; line-height: 1.6; }
.member-scope { max-width: none; }
.member-scope strong { font-size: 14px; }
.member-actions { gap: 12px; align-items: flex-start; }
.member-actions button { text-align: left; padding: 8px 12px; margin-left: -12px; }
.member-actions small { max-width: 24ch; line-height: 1.65; }
.invitation-card { margin: 0; }
.notice-card { background: var(--surface); border-color: var(--line); border-radius: var(--radius-card); box-shadow: none; padding: 32px; margin: 24px 0; }
.notice-card header { font-size: 13px; color: var(--muted); }
.notice-card h2 { margin: 24px 0 16px; font-size: 22px; line-height: 1.4; }
.notice-card p + p { margin-top: 12px; }
.notice-card footer { margin-top: 24px; }
#notice-list { margin-top: 32px; }
.access-main > p { color: var(--muted); font-size: 14px; max-width: 72ch; line-height: 1.65; }
.access-dialog, .qr-dialog { background: var(--surface); border-radius: var(--radius-card); padding: 40px; }
.access-dialog { width: min(600px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); }
.access-dialog header { gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.access-dialog p { line-height: 1.65; color: var(--muted); }
.access-dialog label:not(.scope-option) { font-size: 14px; margin: 24px 0 8px; }
.access-dialog input:not([type=checkbox]), .access-dialog select { padding: 12px 16px; }
.access-dialog fieldset { margin: 32px 0; padding: 16px 20px; border-radius: 4px; }
.access-dialog legend { padding-inline: 8px; }
.scope-option { padding-block: 12px; gap: 12px; }
.access-dialog button[type=submit] { margin-top: 24px; }
.dialog-actions { position: static; padding: 20px 0 0; margin: 24px 0 0; background: var(--surface); border-top: 1px solid var(--line); }
#edit-member > .dialog-actions { border-top: 0; }
.access-dialog .dialog-actions button[type=submit] { margin: 0; }
.field-help { margin-top: 8px; }
#notice-form { gap: 16px; }
#notice-form label { margin: 0; gap: 8px; }
#notice-form footer { padding-top: 16px; flex-wrap: wrap; }
.auth-layout {
  display: grid;
  grid-template: 1fr / minmax(0, 1fr);
  place-items: center;
  padding: clamp(16px, 4vw, 56px);
  background: var(--surface-canvas);
}
.auth-frame {
  width: min(100%, 1160px);
  min-height: clamp(560px, 77dvh, 700px);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  padding: clamp(16px, 2vw, 28px);
  border-radius: 36px;
  background: var(--surface-raised);
}
.auth-story {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  justify-content: flex-end;
  padding: clamp(24px, 3.4vw, 48px);
  border: 0;
  border-radius: 24px;
  background: var(--surface-inset) url("/assets/ocelot/conversation-foliage.webp") left center / cover no-repeat;
  color: #fff;
}
.auth-story::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(transparent 30%, rgb(5 16 24 / 90%));
  pointer-events: none;
}
.auth-side {
  display: grid;
  grid-template: 1fr auto / minmax(0, 1fr);
  place-items: center;
  gap: 16px;
  padding: clamp(24px, 4.2vw, 60px);
  padding-bottom: 0;
  border: 0;
  background: transparent;
}
.auth-card { width: 100%; min-width: 0; }
.auth-card #access-title,
.auth-card > .auth-description { text-align: center; }
.auth-card h2 {
  font: 400 clamp(32px, 3.4vw, 52px) / 1.06 "Instrument Serif", Georgia, serif;
  font-variation-settings: normal;
  letter-spacing: -.02em;
  text-transform: none;
}
.auth-story h1 {
  font: 800 clamp(32px, 3.4vw, 52px) / 1.06 "Dragon", Impact, sans-serif;
  font-variation-settings: "Inkt" 10, "Angl" 10;
  letter-spacing: .025em;
  word-spacing: .04em;
}
.auth-card input { border-radius: 14px; border-color: var(--control-border); }
.auth-card #login input {
  padding-inline: 14px;
  border: 1px solid var(--control-border-hover);
  background: var(--surface-panel);
}
.auth-card #login .primary { background: var(--ink); border-color: var(--ink); }
.auth-card #login .primary:hover:not(:disabled) { background: #373a3e; border-color: #373a3e; }
.auth-card #login + .auth-note { border-top: 0; padding-top: 0; }
.auth-card > p { margin: 24px 0 32px; }
.auth-card form { gap: 16px; }
.auth-card form .primary { margin-top: 16px; }
.auth-foot { opacity: .75; }
.empty { padding: 48px 32px; }
.empty p { margin-top: 16px; line-height: 1.65; max-width: 42ch; }
@media (max-width: 1280px) and (min-width: 1025px) {
  :root { --workspace-gutter: 24px; }
  .shell { --queue-width: 360px; grid-template-columns: var(--nav-width, 216px) var(--queue-width) minmax(0, 1fr); }
  .nav, .access-nav { padding: 32px 16px; gap: 24px; }
  .list-head { padding: 32px 24px 16px; }
  .list-meta { padding-inline: 24px; }
  .list-heading h1 { font-size: 36px; }
  .rows { padding-inline: 8px; }
  .access-page { grid-template-columns: 216px minmax(0, 1fr); }
  .access-main { padding: 48px 32px; }
  .messages { min-height: 120px; }
}
@media (max-width: 1024px) {
  :root { --workspace-gutter: 20px; }
  .shell { grid-template-columns: 1fr; }
  .nav { grid-template-columns: minmax(0, 1fr) auto; padding: 16px 20px; gap: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .client-brand { display: flex; align-items: center; gap: 16px; }
  .client-logo { padding: 4px 12px; border-radius: 4px; }
  .client-logo img, .access-nav .client-logo img { width: 88px; height: 44px; }
  .client-caption { text-align: left; font-size: 11px; }
  .nav-bottom { padding: 0; grid-column: 2; }
  .platform-signature { display: none; }
  .nav-bottom button { color: var(--ink); }
  .nav nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: visible; }
  .nav nav button { width: 100%; min-height: 44px; text-align: left; white-space: normal; }
  .nav-utilities { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 0; padding-top: 12px; }
  .nav .manage-access { justify-content: center; padding: 10px 8px; font-size: 13px; }
  .list-head { padding: 24px 20px 16px; }
  .list-heading { margin-bottom: 24px; }
  .list-heading h1 { font-size: 36px; }
  .list-meta { padding-inline: 20px; }
  .rows { padding-inline: 8px; }
  .thread-head h2 { font-size: 18px; }
  .messages { padding-block: 24px; gap: 20px; }
  .compose-modes { gap: 20px; padding-top: 8px; }
  .compose-modes button { flex: initial; font-size: 13px; }
  #reply-composer, .internal-note { padding-top: 12px; padding-bottom: 20px; }
  #reply-composer .composer textarea, .internal-note textarea { padding: 12px 16px; min-height: 72px; }
  .access-page { grid-template-columns: 1fr; }
  .access-nav { padding: 20px; gap: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .access-nav .client-brand { flex-basis: 100%; margin-right: auto; }
  .access-main { padding: 32px 24px; }
  .access-heading { gap: 24px; padding-bottom: 24px; margin-bottom: 32px; }
  .access-heading h1 { font-size: 40px; }
  .access-heading-actions { gap: 12px; }
  .access-section { margin-bottom: 32px; }
  .member-card { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block: 28px; }
  .member-actions { width: auto; flex-wrap: wrap; }
  .member-scope { min-width: 0; }
  .member-actions small { max-width: none; }
  .invitation-card { padding-block: 24px; gap: 16px; }
  .notice-card { padding: 24px; }
  .access-dialog, .qr-dialog { padding: 24px; }
  .dialog-actions { bottom: -24px; }
  .access-dialog h2, .qr-dialog h2 { font-size: 32px; }
  .access-dialog header { gap: 16px; }
  .auth-eyebrow { color: var(--ink); }
  .auth-card h2 { font-size: 36px; }
  .empty { padding: 40px 24px; }
}
/* Reset legacy viewport rules: wrap according to this pane's usable width. */
.thread-head .thread-tools { flex-basis: auto; margin-left: auto; }
.thread-head .contact-avatar { display: grid; }
.control-toolbar { align-items: center; flex-direction: row; }
.control-toolbar .control-actions { flex-wrap: wrap; }
@container conversation (max-width: 740px) {
  .thread-head { min-height: 0; gap: 16px; }
  .thread-head .thread-tools { flex-basis: 100%; margin-left: 0; }
  .thread-head .thread-tools .transfer { margin-left: auto; }
  .control-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .control-toolbar .control-actions { gap: 8px; }
  .composer-tools .file-help { display: none; }
}
@container conversation (max-width: 480px) {
  .thread-head .contact-avatar { display: none; }
  .thread-head { padding-block: 20px; }
  .thread-heading { flex-basis: 160px; }
  .thread-tools .owner { max-width: 120px; }
  .messages > .message { max-width: 92%; }
  .messages > .note { max-width: 100%; }
  #reply-form { grid-template-columns: minmax(0, 1fr); }
  #reply-form > *, #reply-form footer { grid-column: 1; }
  #reply-form footer { padding: 0 var(--thread-inset) var(--thread-inset); }
  #reply-form footer .primary { flex: 1; }
  .composer-tools { gap: 8px; }
  .composer-tools button { padding-inline: 8px; font-size: 13px; }
}

/* Action vocabulary: one stroke, one hit area, labels for consequential actions. */
.icon { width: 18px; height: 18px; flex: 0 0 18px; pointer-events: none; }
button.icon-button { width: 44px; min-width: 44px; min-height: 44px; padding: 12px; flex-shrink: 0; }
.nav .manage-access { gap: 12px; }
.nav #navigation-panel :where(nav, .nav-utilities) > button:not(.active) > .icon,
.nav .manage-access .icon, .nav-bottom .icon { color: var(--muted); }
.nav-bottom button { gap: 10px; }
.list-meta button { gap: 8px; }
.search-wrap .clear-search { min-width: 40px; width: 40px; min-height: 40px; padding: 10px; }
.transfer > summary, .ai-options > summary { gap: 8px; }
.ai-options > summary::after, .transfer > summary::after {
  content: ''; width: 6px; height: 6px; margin: -3px 2px 0 4px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.ai-options[open] > summary::after, .transfer[open] > summary::after { transform: rotate(225deg); margin-top: 3px; }
.thread-tools .owner { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.status[data-status="resolved"] { background: #e9eee4; color: #435336; }
.status[data-status="pending"] { background: #f6ead4; color: #78532f; }
.compose-modes button { gap: 8px; }
.compose-modes button[aria-pressed="false"] .icon { color: var(--muted); }
#reply-form > .attachment-preview, #reply-form > .template-panel { grid-column: 1 / -1; }
.attachment-preview { display: flex; align-items: center; gap: 12px; margin: 0 16px 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--canvas); }
.attachment-preview .attachment-name { flex: 1; min-width: 0; font-size: 13px; }
.template-panel { margin: 0 16px 16px; padding: 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--canvas); }
.template-panel > header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; font-size: 14px; }
.template-options { gap: 16px; font-size: 14px; }
.template-options label { gap: 8px; }
.template-options input, .template-options select { width: 100%; }
.template-options p:empty { display: none; }
.template-options .clear-template { justify-self: start; padding-inline: 0; }
button.danger { color: #8d3028; border-color: #d3b4ae; background: transparent; }
button.danger:hover:not(:disabled) { background: #f8eae6; border-color: #8d3028; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.access-dialog .form-error:empty { display: none; }
.access-dialog .form-error { margin-top: 20px; padding: 12px 16px; background: #f8eae6; border-left: 3px solid #8d3028; color: #8d3028; }
.access-dialog header .icon-button { margin-top: -4px; margin-right: -12px; }
.access-section > .field-help { margin-bottom: 20px; line-height: 1.6; }
.access-section > .muted { padding: 20px 0; border-top: 1px solid var(--line); font-size: 14px; }
#notice button.icon-button { min-width: 44px; min-height: 44px; }
@media (max-width: 1024px) {
  /* The back control restores navigation; the open chat gets the whole screen. */
  .shell.has-thread { grid-template-rows: minmax(0, 1fr); }
  .shell.has-thread .nav { display: none; }
  input:not([type=checkbox]), textarea, select { font-size: 16px; }
  #reply-composer .composer textarea, .internal-note textarea { font-size: 16px; }
  .access-nav .client-brand { flex-basis: auto; }
  .access-nav-label { display: none; }
}
@container conversation (max-width: 480px) {
  .thread-head { padding-block: 16px; gap: 12px; }
  .thread-heading { gap: 12px; }
  .thread-tools .owner { flex: 1; max-width: none; font-size: 13px; }
  .thread-tools > .muted { font-size: 12px; }
  .thread-head .thread-tools { gap: 8px; }
  .thread-head .thread-tools .transfer { margin-left: 4px; }
  .compose-modes { gap: 24px; }
  .compose-modes button { font-size: 14px; }
  #reply-form { grid-template-columns: minmax(0, 1fr) auto; }
  #reply-form > .composer-tools { grid-column: 1; padding: 0 8px 12px; gap: 0; align-self: end; }
  #reply-form > footer { grid-column: 2; padding: 0 12px 12px 0; }
  #reply-form .composer-tools button { width: 44px; min-width: 44px; padding: 12px; }
  #reply-form .tool-label { display: none; }
  #reply-form > footer .primary { padding-inline: 16px; }
  #reply-form > footer:has(#check-reply:not([hidden])) { grid-column: 1 / -1; padding-inline: 16px; flex-wrap: wrap; }
  #reply-composer .composer textarea, .internal-note textarea { min-height: 64px; }
  .internal-note .label { gap: 8px; padding-block: 12px; }
  .internal-note .composer footer { gap: 12px; flex-wrap: wrap; }
}

html:has(dialog[open]) { overflow: hidden; }

/* Access follows the same spacing, controls and restrained color as the inbox. */
.auth-story .auth-intro p { margin: 12px 0 0; color: #fff; }
.auth-card { max-width: 500px; }
.auth-card > .auth-eyebrow { margin: 0 0 16px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.auth-card > .auth-description { margin: 16px 0 32px; color: var(--muted); line-height: 1.65; }
.auth-card > .auth-account { margin: 0 0 24px; background: var(--surface); border: 1px solid var(--line); }
.auth-card .field-help { margin: -8px 0 0; font-size: 13px; font-weight: 400; line-height: 1.5; color: var(--muted); }
.auth-card .auth-note { font-size: 13px; color: var(--muted); line-height: 1.65; }
.auth-card > button, .access-step > button { width: 100%; min-height: 48px; }
.auth-card .secondary { background: var(--surface); border: 1px solid var(--line); margin-top: 16px; }
.auth-card > .quiet, .access-step > .quiet { margin-top: 12px; }
.auth-card #recover { margin-top: 24px; }
.auth-card .auth-error { margin: 0 0 24px; padding: 14px 16px; background: #fff3f0; border: 1px solid #ebc0b6; border-radius: 8px; color: #903c29; font-size: 14px; line-height: 1.5; }
.auth-card #access-title:focus, .access-step h3:focus { outline: none; }
.invitation-summary { padding: 20px; margin: 0 0 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.invitation-summary h3, .access-step h3 { margin: 0 0 12px; font: 600 17px/1.4 "Instrument Sans", sans-serif; }
.invitation-summary p, .access-step > p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--muted); }
.access-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 32px; padding: 0; list-style: none; }
.access-progress li { padding: 0 0 12px; border-bottom: 2px solid var(--line); font-size: 12px; font-weight: 500; color: var(--muted); }
.access-progress li[aria-current="step"] { border-color: var(--ocelot-butttano); color: var(--ink); font-weight: 700; }
.access-progress li.complete { border-color: var(--ink); }
.access-step[hidden] { display: none; }
.access-step .qr { width: min(280px, 100%); margin: 24px auto 0; }
.access-step .qr-step > button { margin: 0 auto 16px; min-height: 44px; }
.access-step .codes { padding: 20px; margin: 24px 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; line-height: 1.8; text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; }
.access-step .backup-saved { display: flex; align-items: flex-start; gap: 12px; margin: 24px 0; line-height: 1.5; cursor: pointer; }
.access-step .backup-saved input { flex: 0 0 20px; width: 20px; min-height: 20px; height: 20px; margin-top: 1px; }
.access-step #copy-feedback { margin-top: 12px; }
.access-step #copy-feedback:empty { display: none; }
.access-step form { margin-top: 24px; }
.auth-card .qr-dialog header h2 { font-size: 28px; }
.auth-card .qr-dialog header button { flex-shrink: 0; }
.row-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.row.unread .row-top strong { font-weight: 750; }
#rows { padding-top: 14px; }
:is(#rows, #voice-list) .row { overflow: visible; isolation: isolate; --status-hover: #eeece2; }
#rows .row:has(.status:is([data-status="open"], [data-status="in_progress"])) { --status-hover: #bfe2cc; }
#rows .row:has(.status[data-status="pending"]) { --status-hover: #f6ead4; }
#rows .row:has(.status[data-status="resolved"]) { --status-hover: #d4dfca; }
#voice-list .row { --status-hover: #dce3ed; }
#voice-list .row:has(.call-state[data-state="ended"]) { --status-hover: #bfe2cc; }
#voice-list .row:has(.call-state:is([data-state="failed"], [data-state="overflow"])) { --status-hover: #ffd9bd; }
:is(#rows, #voice-list) .row::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(to top, var(--status-hover) 0%, color-mix(in srgb, var(--status-hover) 45%, transparent) 30%, transparent 80%);
  opacity: 0;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 380ms cubic-bezier(.2,.7,.2,1), opacity 280ms ease;
}
:is(#rows, #voice-list) .row:is(:hover, :focus-visible) { background-color: var(--surface-raised); }
:is(#rows, #voice-list) .row:is(:hover, :focus-visible)::after { opacity: 1; clip-path: inset(0); }
@media (prefers-reduced-motion: reduce) {
  :is(#rows, #voice-list) .row::after { transition: none; }
}
#rows .row-meta { margin-inline-start: auto; }
#rows .unread-badge { position: absolute; top: -13px; right: 12px; }
.status:is([data-status="open"], [data-status="in_progress"]),
.row.selected .status:is([data-status="open"], [data-status="in_progress"]) { background: #e7f3eb; color: #287346; }
.unread-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--ocelot-butttano); color: #fff; font-size: 12px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 1024px) {
  .auth-card h2 { font-size: 36px; }
}
@media (max-width: 760px) {
  .auth-frame { grid-template-columns: minmax(0, 1fr); min-height: 0; border-radius: 24px; }
  .auth-story { min-height: clamp(110px, 24vw, 165px); border-radius: 16px; padding: 16px; }
  .auth-story .auth-intro { display: none; }
  .auth-side { padding: 24px 8px 12px; }
}
@media (max-width: 420px) {
  .auth-card h2 { font-size: 32px; }
  .auth-card > .auth-description { margin-bottom: 24px; }
  .access-progress { gap: 8px; margin-bottom: 24px; }
  .access-progress li { font-size: 11px; }
  .access-step .qr { width: min(240px, 100%); }
}

.team-checks { margin-top: 12px; padding: 12px; border: 1px solid #c9953f; border-radius: 10px; background: #c9953f0d; }
.team-checks p, .team-checks small { font-size: 12px; line-height: 1.5; }
.team-checks details { margin-top: 10px; }
.team-checks summary { cursor: pointer; overflow-wrap: anywhere; }
.team-checks form { padding-top: 10px; }
.team-checks label { display: block; margin-top: 8px; }
.team-checks textarea { display: block; width: 100%; margin-top: 6px; resize: vertical; }
.team-checks button { margin-right: 8px; }
.team-check-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.team-check-status { color: #87551a; font-weight: 650; }
.team-checks select { width: 100%; margin-top: 6px; }
.pending-team-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 24px; background: #fff0d8; color: #6d4313; border-bottom: 1px solid #e4b369; font-size: 13px; font-weight: 600; }
.pending-team-banner[hidden] { display: none; }
.pending-team-banner button { color: inherit; flex: 0 0 auto; border-color: #c79a5a; background: #ffffff70; }
#root > .shell { height: calc(100dvh - var(--pending-banner-height, 0px) - var(--incident-banner-height, 0px)); }
.pending-team-page { padding: 24px; overflow: auto; min-width: 0; }
.pending-team-page > h1 { font-size: 30px; margin: 0 0 12px; }
.pending-team-page > p { max-width: 70ch; color: var(--muted); line-height: 1.5; }
.pending-team-items { display: grid; gap: 16px; margin: 20px 0; }
.pending-team-card { border: 1px solid var(--line); border-left: 3px solid #c9953f; border-radius: 12px; padding: 20px; background: #fff; }
.pending-team-card h2 { font-size: 18px; margin: 0 0 8px; }
.pending-team-card p { line-height: 1.5; overflow-wrap: anywhere; }
.pending-team-card > p:first-of-type { font-size: 12px; color: var(--muted); }
.pending-team-card .team-checks { border: 0; padding: 0; background: transparent; }
@media (max-width: 700px) { .pending-team-banner { padding: 6px 12px; font-size: 12px; } .pending-team-page { padding: 16px; } .pending-team-card { padding: 16px; } }

/* A compact mobile masthead; navigation takes space only when requested. */
.navigation-panel { display: contents; }
.mobile-menu-toggle { display: none; }
.mobile-nav-dialog { border: 0; }
@media (max-width: 1024px) {
  .shell > .nav { padding: 12px 16px; gap: 12px; min-height: 68px; align-items: center; }
  .nav > .client-brand { min-width: 0; gap: 0; }
  .nav > .client-brand .client-caption { display: none; }
  .nav > .client-brand .client-logo { padding: 4px 8px; }
  .nav > .client-brand .client-logo img { width: 88px; height: 36px; }
  .nav > .client-brand .client-wordmark { font-size: 18px; }
  .mobile-menu-toggle { display: inline-flex; gap: 8px; margin: 0; min-height: 44px; }
  .nav > .navigation-panel { display: none; }
  .mobile-nav-dialog { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 24px; width: min(360px, calc(100vw - 32px)); max-width: none; height: 100dvh; max-height: 100dvh; border-left: 1px solid var(--line); border-radius: 0; color: var(--ink); background: var(--canvas); overflow-y: auto; }
  .mobile-nav-dialog::backdrop { background: #1e1e1e66; }
  .mobile-nav-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
  .mobile-nav-dialog h2 { margin: 0; font: 600 22px/1.3 'Instrument Sans', sans-serif; }
  .mobile-nav-dialog .navigation-panel { display: flex; flex-direction: column; gap: 24px; }
  .mobile-nav-dialog nav { display: flex; flex-direction: column; gap: 8px; overflow: visible; }
  .mobile-nav-dialog .nav-title { display: block; margin: 0 12px 8px; }
  .mobile-nav-dialog nav button { flex: initial; width: 100%; min-height: 48px; justify-content: flex-start; text-align: left; font-size: 14px; padding: 12px 16px; border-bottom: 0; }
  .mobile-nav-dialog nav button.active { border-left: 3px solid var(--ocelot-butttano); border-bottom: 0; padding-left: 13px; background: var(--ocelot-butttano-pale); }
  .mobile-nav-dialog .nav-utilities { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0; padding-top: 24px; }
  .mobile-nav-dialog .manage-access { justify-content: flex-start; padding: 12px 16px; font-size: 14px; }
  .mobile-nav-dialog .nav-bottom { display: flex; flex-direction: column; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
  .mobile-nav-dialog .user-name { display: block; margin: 0; padding-inline: 16px; font-size: 14px; }
  .mobile-nav-dialog .platform-signature { display: flex; margin: 0 0 8px; padding-inline: 16px; }
  .mobile-nav-dialog .nav-bottom button { padding: 12px 16px; width: 100%; min-height: 44px; justify-content: flex-start; font-size: 14px; }
  .list-heading { margin-bottom: 16px; }
  .list-heading h1 { font-size: 32px; }
  .list-head { padding-top: 24px; }
  .access-nav { display: flex; align-items: center; flex-wrap: wrap; padding: 12px 16px; gap: 8px; }
  .access-nav .client-brand { flex-basis: auto; margin-right: auto; }
  .access-nav .client-caption, .access-nav-label { display: none; }
  .access-nav .client-logo { padding: 4px; }
  .access-nav .client-logo img { width: 64px; height: 32px; }
  .access-nav #back-inbox { padding-inline: 12px; font-size: 13px; }
  .access-nav #access-logout { width: 44px; height: 44px; padding: 12px; font-size: 0; gap: 0; }
}
/* Familiar message colors; internal notes retain their own visual treatment. */
.messages { background: #f1f3ee; }
.messages > .message { background: #ffffff; border: 1px solid #e1e5df; border-radius: 4px 14px 14px; color: #202923; }
.messages > .message.outgoing { background: #e0f3d8; border-color: #cfe5c7; border-radius: 14px 4px 14px 14px; }
.messages > .message.note { background: #fff5d6; border-color: #e9dab1; border-radius: 8px; }
.messages .message small { color: #5a695c; }
.messages .message.note small { color: #776642; }

/* Mobile conversations reserve vertical space for the messages. */
@media (max-width: 1024px) {
  .thread-head { padding-block: 8px; min-height: 0; gap: 0 12px; }
  .thread-heading { gap: 8px; min-width: 0; flex: 1; }
  .thread-heading > div { min-width: 0; }
  .thread-head h2 { font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
  .thread-head small { margin-top: 2px; font-size: 11px; }
  .thread-head .contact-avatar { display: none; }
  .thread-head .thread-tools { flex-basis: 100%; min-height: 44px; gap: 8px; }
  .thread-head .thread-tools > .muted { font-size: 12px; }
  .thread-head .thread-tools .owner { flex: 1; font-size: 12px; max-width: none; }
  .thread-head .transfer > summary { min-height: 44px; padding: 8px 12px; font-size: 13px; }
  .conversation-control { padding-block: 6px; }
  .control-toolbar { gap: 4px; }
  .control-state strong, .control-state span { font-size: 12px; line-height: 1.4; }
  .control-toolbar .control-actions { gap: 8px; }
  .control-actions > button, .control-actions .ai-options > summary { min-height: 44px; padding: 8px 12px; font-size: 13px; }
  .messages { min-height: 0; padding-block: 12px; gap: 12px; }
  .messages > .message { padding: 12px 16px; }
  .message .author { margin-bottom: 4px; }
  .message small { margin-top: 6px; }
  .compose-modes { padding-top: 0; gap: 24px; }
  .compose-modes button { min-height: 44px; padding-block: 8px; }
  #reply-composer, .internal-note { padding-top: 4px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  #reply-reason[data-context-only="true"] { display: none; }
  #reply-reason { padding: 8px 12px 0; line-height: 1.4; }
  #reply-composer .composer textarea, .internal-note textarea { min-height: 44px; max-height: 112px; padding: 10px 12px; line-height: 1.4; resize: none; overflow-y: auto; }
  #reply-form { grid-template-columns: minmax(0, 1fr) auto; }
  #reply-form > .composer-tools { grid-column: 1; padding: 0 4px 4px; gap: 0; }
  #reply-form .composer-tools button { width: 44px; min-width: 44px; min-height: 44px; padding: 12px; }
  #reply-form .tool-label, #reply-form .file-help { display: none; }
  #reply-form > footer { grid-column: 2; padding: 0 6px 4px 0; }
  #reply-form > footer .primary { min-height: 44px; padding: 8px 14px; }
  #reply-form > footer:has(#check-reply:not([hidden])) { grid-column: 1 / -1; padding: 4px 12px 8px; }
  .internal-note .label { padding: 6px 12px; font-size: 12px; }
  .internal-note .label strong, .internal-note .composer footer small { display: none; }
  .internal-note .composer footer { padding: 0 6px 4px; }
  .internal-note .composer footer button { min-height: 44px; padding: 8px 14px; }
}

.thread-tools .transfer > summary .owner { flex: initial; max-width: 200px; font-size: inherit; text-align: left; }
@media (max-width: 1024px) {
  .thread-head .thread-tools { justify-content: flex-end; }
  .thread-head .thread-tools .transfer { margin-left: 0; }
}

/* One hierarchy and shared action spacing across the everyday workflows. */
.list-heading h1, .access-heading h1, .access-dialog h2, .qr-dialog h2 {
  font-family: 'Instrument Sans', sans-serif; font-weight: 650;
  font-variation-settings: normal; letter-spacing: -.025em; word-spacing: normal;
}
.list-heading h1, .access-heading h1 { font-size: 32px; line-height: 1.2; }
.access-dialog h2, .qr-dialog h2 { font-size: 26px; line-height: 1.25; }
.access-heading h1 { margin: 0; }
.access-heading p { margin-top: 12px; max-width: 56ch; line-height: 1.55; }
.access-heading { align-items: flex-start; gap: 24px; }
.access-heading-actions { flex-wrap: wrap; justify-content: flex-end; }
.company-switch label { margin: 0 0 8px; color: var(--muted); }
.company-switch select { width: 100%; min-width: 0; }
.scope-fixed { display: block; margin: 8px 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.access-dialog p.scope-fixed { color: var(--ink); }
.invitation-card > div:first-child, .member-card > div { min-width: 0; }
.member-card p, .invitation-card p { overflow-wrap: anywhere; }
.invitation-card .member-actions { flex-shrink: 0; }
.member-actions { gap: 8px; }
.access-dialog .dialog-actions { gap: 8px; padding-block: 16px; }
.auth-card > .auth-description { margin-bottom: 24px; }
.invitation-summary { padding: 0; border: 0; background: none; margin-bottom: 24px; }
#reply-reason[data-context-only="true"] { display: none; }
@media (max-width: 1024px) {
  .list-heading h1, .access-heading h1 { font-size: 28px; }
  .access-dialog h2, .qr-dialog h2 { font-size: 24px; }
  .access-main { padding: 24px 20px; }
  .access-heading { gap: 16px; margin-bottom: 24px; padding-bottom: 24px; }
  .access-heading-actions { justify-content: flex-start; gap: 8px; }
  .member-card { gap: 16px; padding-block: 24px; }
  .member-actions { gap: 8px; }
  .invitation-card { align-items: flex-start; }
  .invitation-card .member-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .auth-card h2 { font-size: 32px; }
}

.access-dialog fieldset { margin: 24px 0; padding: 12px 16px; }
.access-dialog fieldset:has(.scope-fixed) { border: 0; padding: 0; }
.access-dialog fieldset:has(.scope-fixed) legend { padding: 0; }
#notice { top: 24px; right: 24px; bottom: auto; left: auto; transform: none; width: max-content; max-width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); gap: 12px; }
#notice > span { min-width: 0; flex: 1; overflow-wrap: anywhere; line-height: 1.5; }
#notice button { flex-shrink: 0; color: var(--muted); }
#notice button:hover { background: var(--canvas); color: var(--ink); }
#notice[data-error="true"] { border-left: 3px solid #8d3028; }
@media (max-width: 1024px) {
  #notice { top: max(12px, env(safe-area-inset-top)); right: 16px; width: calc(100vw - 32px); }
}

.row-preview { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:400; color:var(--ink); }
.row > small { color:var(--muted); font-size:12px; }
.template-options .field-help { display:block; font-weight:400; overflow-wrap:anywhere; }
@media(max-width:1024px) {
 .member-scope { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; }
 .member-scope p { margin:0; }
 .member-scope small { font-size:13px; }
 .member-card { gap:12px; padding-block:20px; }
}


/* Shared menu interaction, including the footer action. */
.nav nav button:hover:not(:disabled),
.mobile-nav-dialog nav button:hover:not(:disabled),
.nav-bottom #logout:hover:not(:disabled) {
  color: var(--ink);
  background: #dcd8c1;
  border-color: transparent;
  text-decoration: none;
}
.nav nav button.active:hover:not(:disabled),
.mobile-nav-dialog nav button.active:hover:not(:disabled) {
  border-left-color: var(--ocelot-butttano);
}
.nav-bottom #logout {
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  min-height: 44px;
  border-radius: 4px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  justify-content: flex-start;
  font-size: 14px;
  gap: 12px;
}

.nav-bottom .user-name {
  padding-inline: 16px;
  margin-bottom: 12px;
}


/* Highlight only the AI activation action. */
.control-actions > button[data-control="return_ai"] {
  background: var(--action-orange);
  border-color: var(--action-orange);
  color: #fff;
  font-weight: 600;
}
.control-actions > button[data-control="return_ai"]:hover:not(:disabled) {
  background: #ad3608;
  border-color: #ad3608;
  color: #fff;
}
.control-actions > button[data-control="return_ai"] .icon {
  color: inherit;
}

.waiting-label { color:#000; font-size:12px; font-weight:600; }
.review-label { color:var(--muted); font-size:12px; }
#mark-review[aria-pressed="true"] { background:var(--ocelot-butttano-pale); }


.queue-filters { display:flex; flex-wrap:wrap; gap:10px; margin-top:12px; }
.queue-filters[hidden] { display:none; }
.queue-filters label { flex:1 1 110px; min-width:0; display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--muted); }
.queue-filters select {
  width: 100%; min-width: 0; min-height: 48px;
  padding: 12px 16px;
  font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--control-border);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.queue-filters select:hover { border-color: var(--control-border-hover); }
.queue-filters select:focus-visible {
  outline: 2px solid var(--ocelot-butttano);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .queue-filters select { transition: none; }
}
.queue-filters #clear-queue-filters { margin-left:auto; }

.queue-status, .access-tabs { display:flex; flex:1 0 100%; gap:4px; border-bottom:1px solid var(--line, #ddd); }
.queue-status button, .access-tabs button { flex:1; min-width:0; min-height:44px; padding:8px 5px; border-radius:0; border-bottom:2px solid transparent; font-size:13px; }
.queue-status button[aria-pressed="true"], .access-tabs button[aria-pressed="true"] { border-bottom-color:var(--ocelot-butttano, #f56421); font-weight:700; color:var(--ink); background:transparent; }

.notice-unread { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 5px; border-radius:999px; background:#d63e0a; color:white; font-size:11px; font-weight:700; margin-left:auto; }
.notice-unread[hidden] { display:none; }
#navigation-panel :is(#open-notices, #support-access) { position: relative; }
#navigation-panel button > .notice-unread {
  position: absolute;
  inset-block-start: -2px;
  inset-inline-end: -3px;
  margin: 0;
  min-width: 16px;
  height: 16px;
  padding-inline: 4px;
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
}
@media (max-width: 1024px) {
  .mobile-nav-dialog #navigation-panel :is(#open-notices, #support-access) { padding-inline-end: 48px; }
  .mobile-nav-dialog #navigation-panel button > .notice-unread {
    inset-block-start: 50%;
    inset-inline-end: 12px;
    transform: translateY(-50%);
  }
}
.mobile-menu-toggle[data-notice-unread="true"]::after { content:""; width:8px; height:8px; border-radius:50%; background:#d63e0a; }
.row-bottom { flex-wrap:wrap; gap:6px; }
.row-bottom .row-assignee { min-width:0; max-width:50%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:0; font-size:11px; color:#526b86; }
.list-meta { justify-content:flex-end; }

/* Utility sections share the inbox navigation and mobile menu. */
.shell.has-workspace > .list, .shell.has-workspace > .thread { display:none; }
.workspace-section { grid-column:2 / -1; min-width:0; min-height:0; overflow:auto; }
.workspace-section .access-page { display:block; min-height:100%; }
.workspace-section .access-main { width:100%; box-sizing:border-box; }
.nav-utilities > button.active { background:#ffffff38; border-left:3px solid var(--ocelot-butttano); font-weight:650; color:var(--ink); }
@media(max-width:1024px) {
 .workspace-section { grid-column:1; }
 .shell.has-workspace { grid-template-rows:auto minmax(0,1fr); }
 .shell.has-workspace > .nav { display:flex; }
}

/* Telephone history uses the same queue and conversation components. */
.voice-workspace { display:grid; grid-template-columns:minmax(320px,360px) minmax(0,1fr); overflow:hidden; }
.voice-workspace > .list, .voice-workspace > .thread { min-height:0; }

.voice-workspace .voice-record { padding:16px; border:1px solid var(--line); border-radius:8px; background:var(--surface); font-size:13px; }
.voice-record summary { cursor:pointer; font-weight:600; }
.voice-record p, .voice-record ul { margin-top:12px; }
.voice-readonly {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  font-size: 12px;
}
#voice-error { padding:12px 20px; color:var(--danger,#a52a2a); }
@media (max-width:1024px) {
 .voice-workspace { grid-template-columns:minmax(0,1fr); }
 .voice-workspace.voice-has-thread > .list { display:none; }
 .voice-workspace.voice-has-thread > .thread { display:flex; }
}



/* Shared form primitives: used by team editing and conversation assignment. */
.form-stack { display:grid; gap:var(--space-3); min-width:0; }
.form-field { display:grid; gap:var(--space-1); min-width:0; }
.form-field > label, .access-dialog .form-field > label { margin:0; font-size:14px; font-weight:600; }
.form-field input, .form-field select { width:100%; min-width:0; }
.form-stack > .field-help { margin:0; line-height:1.6; }
.inline-controls { display:flex; align-items:center; gap:var(--space-1); min-width:0; }
.inline-controls > input, .inline-controls > select { flex:1; min-width:0; }
.inline-controls > button { flex-shrink:0; }
.access-dialog .inline-controls > button, .access-dialog .row-actions > button { margin:0; }
.form-actions { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:var(--space-1); padding-top:var(--space-2); border-top:1px solid var(--line); }
.form-stack .form-error:empty { display:none; }

/* Management keeps the same page, row, tab and button vocabulary as the inbox. */
.management-page .access-heading { align-items:center; border:0; padding-bottom:0; margin-bottom:var(--space-3); }
.management-page .access-heading-actions { padding:0; align-items:center; gap:var(--space-1); }
.access-tabs { flex:initial; margin-bottom:var(--space-3); }
.access-tabs button { flex:0 0 auto; padding-inline:var(--space-2); gap:var(--space-1); font-size:14px; }
.management-page .access-section > .field-help { margin:0 0 var(--space-3); }
.management-page .member-card { align-items:center; gap:var(--space-3); padding-block:var(--space-3); }
.management-page .member-card p { margin:4px 0 var(--space-1); }
.management-page .member-actions { gap:4px; }
.management-page .member-actions button { margin:0; }
.management-page .team-card { grid-template-columns:minmax(0,1fr) auto; }
.management-page .team-card p { margin-bottom:0; }
.management-page .team-card > button { justify-self:end; }
.access-dialog > header { align-items:center; }
.access-dialog header .icon-button { margin:0; }
.team-members-section { margin-top:var(--space-4); border-top:1px solid var(--line); padding-top:var(--space-3); }
.team-members-section h3 { margin:0; font-size:16px; line-height:1.5; }
.team-member-list { margin:var(--space-2) 0 var(--space-3); }
.team-member-row { display:flex; align-items:center; justify-content:space-between; gap:var(--space-2); padding-block:var(--space-2); border-bottom:1px solid var(--line); }
.team-member-row > div { min-width:0; }
.team-member-row strong { font-size:14px; line-height:1.5; }
.team-member-row small { display:block; color:var(--muted); font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.team-member-row > small { max-width:23ch; }
.team-member-row .row-actions { flex-shrink:0; }
.team-access-note { margin:var(--space-2) 0 0; font-size:12px; }

/* The assignment popover is a form, not the former list of action buttons. */
.transfer > .assignment-form-panel { width:360px; max-width:calc(100vw - 40px); max-height:calc(100dvh - 180px); overflow:auto; padding:var(--space-3); gap:0; }
.assignment-form-panel .form-stack { gap:var(--space-2); }
.assignment-form-panel .form-actions button { justify-content:center; }
@media(max-width:600px) {
 .management-page .access-heading { align-items:flex-start; gap:var(--space-2); }
 .management-page .access-heading-actions { width:100%; justify-content:flex-start; }
 .management-page .member-card { gap:var(--space-2); }
 .management-page .team-card { grid-template-columns:minmax(0,1fr); }
 .management-page .team-card > button { justify-self:start; }
 .inline-controls { flex-wrap:wrap; }
 .inline-controls > input, .inline-controls > select { flex-basis:100%; }
 .inline-controls > button { margin-left:auto; }
 .team-member-row { flex-wrap:wrap; }
 .team-member-row > div { flex:1 1 180px; }
 .team-member-row > small { max-width:none; flex-basis:100%; }
 .team-member-row .row-actions { margin-left:auto; }
 .transfer > .assignment-form-panel { padding:var(--space-2); }
}

/* Shared refinements from the full workspace review. */
body { min-width:0; }
.list-heading { display:grid; grid-template-columns:minmax(0,1fr) 44px; align-items:center; gap:8px; margin-bottom:20px; }
.list-heading h1 { font-size:26px; line-height:1.2; overflow-wrap:normal; }
.list-heading .live { grid-column:1 / -1; margin-top:0; }
.list-heading #refresh-list { justify-self:end; }
.list-head { padding-bottom:16px; }
.search-wrap input { text-overflow:ellipsis; }
.rows .empty { padding:32px 16px; }
.rows .empty h2 { line-height:1.45; }
button.row { padding-block:20px; }
.row.selected::before { top:20px; bottom:20px; }
.thread-heading { min-width:0; }
.thread-heading > div { min-width:0; }
.thread-head h2 { overflow-wrap:anywhere; }
.thread-tools .transfer { min-width:0; max-width:100%; }
.thread-tools .transfer > summary { min-width:0; max-width:100%; }
.thread-tools .transfer > summary .owner { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.access-dialog > header { gap:16px; }
.access-dialog header h2 { min-width:0; overflow-wrap:anywhere; }
.access-dialog header .icon-button { flex-shrink:0; }
.access-dialog .dialog-actions { margin-top:24px; padding-bottom:0; }
.access-dialog > .form-error:empty { display:none; }
.access-dialog .scope-option { display:flex; align-items:flex-start; font-size:14px; line-height:1.5; }
.scope-option input[type=checkbox] { flex-shrink:0; margin-top:3px; width:18px; height:18px; }
.notices-page .access-heading { margin-bottom:24px; padding-bottom:24px; }
.notices-page #notice-list { margin-top:0; }
.notice-card { padding:24px; margin:0 0 16px; overflow-wrap:anywhere; }
.notice-card header { gap:8px 16px; flex-wrap:wrap; align-items:center; }
.notice-card h2 { margin:16px 0 12px; font-size:20px; }
.notice-card p { font-size:14px; line-height:1.6; }
.notice-card footer { display:flex; flex-wrap:wrap; gap:8px; border-top:1px solid var(--line); padding-top:12px; margin-top:20px; }
#notice-form textarea { min-height:88px; resize:vertical; line-height:1.5; }
#notice-form > fieldset { margin-block:8px; }
#notice-form .field-help { margin-top:0; font-size:13px; line-height:1.6; }
#notice-form .scope-option { flex-direction:row; }
.auth-card .field-help { font-size:13px; line-height:1.5; }
.auth-card input { min-width:0; width:100%; }
.auth-card .auth-note { line-height:1.6; }
@media(min-width:1025px) and (max-width:1280px) {
 .nav nav button, .nav .manage-access { padding-inline:12px; font-size:13px; }
 .nav nav button.active { padding-left:9px; }
 .list-heading h1 { font-size:24px; }
}
@media(max-width:600px) {
 .list-head { padding:20px 16px 12px; }
 .list-heading { margin-bottom:16px; }
 .list-heading h1 { font-size:26px; }
 .access-heading-actions { width:100%; }
 .access-heading-actions .primary { margin-left:auto; }
 .notice-card { padding:20px; }
 .notice-card h2 { font-size:18px; }
 .access-dialog .dialog-actions { flex-direction:column-reverse; align-items:stretch; }
 .access-dialog .dialog-actions > button { width:100%; justify-content:center; }
 .access-dialog input[type=datetime-local] { width:100%; min-width:0; max-width:100%; }
 .thread-head .thread-tools { flex-wrap:nowrap; }
 .thread-tools .transfer { flex:0 1 auto; }
}

/* The invited company leads onboarding; Ocelot signs the platform below. */
.auth-client-brand { width: min(176px, 100%); margin: 0 auto; text-align: center; }
.auth-card > .auth-client-brand { margin-bottom: 24px; }
.auth-client-brand .client-logo { padding:0; }
.auth-client-brand .client-logo img { width:100%; height: 60px; object-position: center; }
.auth-platform-signature { display: flex; gap: 6px; margin: 0; justify-content: center; }
.auth-platform-signature img { width: 56px; height: 18px; }
@media(max-width:1024px) {
 .auth-client-brand { width:160px; }
 .auth-client-brand .client-logo img { height:56px; }
}

/* Context shared between an authorized call and an existing WhatsApp chat. */
.related-calls { border-bottom:1px solid #edf0f3; padding:0 24px 10px; background:#fafbfc; }
.related-calls > summary { display:flex; align-items:center; gap:8px; min-height:36px; width:fit-content; cursor:pointer; list-style:none; font-weight:500; font-size:12px; color:#526071; border-radius:8px; }
.related-calls > summary::-webkit-details-marker { display:none; }
.related-calls > summary:focus-visible { outline:2px solid var(--ocelot-butttano); outline-offset:3px; }
.related-call-symbol { display:grid; place-items:center; }
.related-call-symbol .icon { width:16px; height:16px; }
.related-call-count:not(:empty) { min-width:20px; padding:2px 5px; border-radius:6px; background:var(--surface-inset); text-align:center; font-size:10px; }
.related-call-chevron { width:6px; height:6px; border-right:1px solid currentColor; border-bottom:1px solid currentColor; transform:rotate(45deg); margin:0 5px 3px 4px; transition:transform 180ms; }
.related-calls[open] .related-call-chevron { transform:rotate(225deg); margin-bottom:-3px; }
.related-call-content { max-height:240px; overflow:auto; padding-top:4px; }
.related-call-content > .field-help { margin:0 0 10px; font-size:11px; line-height:1.5; }
.related-call-empty { display:flex; align-items:center; gap:12px; padding:14px 16px; border:1px solid #e1e5eb; border-radius:14px; background:var(--surface-raised); }
.related-call-empty-icon { display:grid; place-items:center; flex:0 0 32px; height:32px; border-radius:50%; background:var(--surface-panel); color:#738092; }
.related-call-empty-icon .icon { width:17px; height:17px; }
.related-call-empty strong { display:block; font-size:12px; font-weight:600; color:var(--ink); }
.related-call-empty p { margin:4px 0 0; font-size:12px; line-height:1.4; color:#687588; }
.related-call-loading { margin:8px 0; font-size:12px; color:var(--muted); }
@media(prefers-reduced-motion:reduce){.related-call-chevron{transition:none}}
.related-call-list,.related-chat-list { display:grid; gap:8px; }
.related-call { display:grid; justify-content:stretch; justify-items:start; gap:4px; width:100%; text-align:left; padding:12px; border:1px solid var(--line,#e5e7eb); border-radius:10px; background:var(--surface,#fff); color:inherit; cursor:pointer; overflow-wrap:anywhere; }
.related-call:hover { background:#f8fafc; border-color:#aeb8c6; }
.related-call:focus-visible { outline:2px solid #e56726; outline-offset:2px; }
.related-call span { font-size:13px; }
.call-overview,.call-conversations { width:100%; padding:16px; border:1px solid var(--line,#e5e7eb); border-radius:12px; background:var(--surface,#fff); box-sizing:border-box; margin-bottom:16px; overflow-wrap:anywhere; }
.call-overview h3,.call-conversations h3 { margin:0 0 10px; font-size:15px; }
.voice-history > .call-conversations {
  max-width: 460px;
  margin-inline: auto;
  padding: 12px;
}
.voice-history > .call-conversations h3 { margin-bottom: 6px; }
.voice-history > .call-conversations .field-help { margin: 0 0 10px; }
.voice-history > .call-conversations .related-call { padding: 8px 12px; gap: 2px; }
.call-overview p { white-space:pre-wrap; margin:8px 0; }
.call-overview h4 { font-size:13px; margin:14px 0 6px; }
.related-error { color:#a51d2d; font-size:13px; }
.voice-history > h3 { font-size:14px; align-self:flex-start; }
@media(max-width:700px){.related-calls{padding:10px 12px}.related-call-content{max-height:190px}.call-overview,.call-conversations{padding:12px}.voice-readonly{font-size:12px}}

/* Keep message identity and delivery time on one compact header row. */
.messages > .message > .message-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.messages > .message > .message-meta .author {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.messages > .message > .message-meta small {
  margin: 0 0 0 auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.list-heading #refresh-list .icon { width: 22px; height: 22px; }

@media (min-width: 1025px) and (hover: hover) {
  .nav-bottom .account-menu { position: relative; width: 100%; padding-top: 8px; cursor: default; }
  .nav-bottom .account-menu:focus-visible { outline: 2px solid var(--action-orange); outline-offset: 4px; border-radius: 8px; }
  .nav-bottom .account-actions {
    position: absolute; bottom: 100%; left: 0; width: 100%; padding-bottom: 8px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(4px); transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
  }
  .nav-bottom .account-menu:is(:hover, :focus-within) .account-actions {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
  }
  .shell > .nav .account-actions #logout:has(.nav-label) {
    width: 100%; height: 80px; border-radius: 20px; background: var(--surface-panel);
    box-shadow: none;
  }
  .shell > .nav .account-actions #logout .nav-label { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-bottom .account-actions { transition: none; }
}

/* Calls: the same navigation shell, with a compact queue and readable transcript. */
.voice-workspace { background: transparent; }
.voice-workspace > .list { background: var(--surface-panel); border: 0; overflow: hidden; }
.voice-workspace .list-head { padding: 28px 20px 16px; }
.voice-workspace .list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.voice-workspace .list-heading h1 { font-size: 26px; letter-spacing: -1px; }
.voice-workspace .field-help { margin: 8px 0 20px; font-size: 12px; color: #66717d; }
.voice-workspace .search-wrap input { border: 1px solid #e5e8ec; border-radius: 14px; background: #fff; }
.voice-list-caption { display: flex; justify-content: space-between; padding: 0 20px 4px; font-size: 11px; color: #66717d; }
#voice-list {
  --queue-top-fade: 12px;
  padding: var(--queue-top-fade) 12px 16px;
}
.voice-workspace .row { display: flex; gap: 12px; padding: 16px 12px; margin-bottom: 8px; border: 1px solid transparent; border-radius: 18px; background: #fff; text-align: left; }
.voice-workspace .row[hidden] { display: none; }
.voice-workspace .row:hover { background: #fafbfc; border-color: #d7dde4; }
.voice-workspace .row.selected { border-color: #aebccc; box-shadow: 0 3px 12px #1e1e1e08; background: #fff; }
.voice-workspace .row.selected::before { display: none; }
.call-row-icon, .voice-workspace .contact-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; background: #eef1f4; color: #536273; }
.call-row-content { flex: 1; min-width: 0; }
.voice-workspace .row-top { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.voice-workspace .row-top strong { font-size: 13px; overflow-wrap: anywhere; }
.voice-workspace .row-top time, .call-row-date { font-size: 11px; color: #66717d; }
.call-row-date { display: block; margin: 4px 0 10px; }
.call-state, .call-test { display: inline-flex; padding: 4px 8px; border-radius: 6px; font-size: 11px; background: #eef1f4; color: #4d5968; }
.call-state[data-state="ended"] { background: #edf4ef; color: #3c6550; }
.call-state[data-state="failed"], .call-state[data-state="overflow"] { background: #fff0e8; color: #a23810; }
.call-test { background: transparent; color: #707783; }
.voice-workspace > .thread { background: #fff; overflow: hidden; }
.voice-workspace .thread-head { padding: 20px var(--thread-gutter); gap: 10px; flex-wrap: wrap; border-bottom: 1px solid #edf0f3; }
.voice-workspace .thread-heading { flex: 1; min-width: 0; }
.voice-workspace .thread-head h2 { font-size: 20px; overflow-wrap: anywhere; }
.voice-workspace .thread-head small { font-size: 11px; color: #66717d; }
.voice-workspace .voice-history { padding: 24px 0 24px var(--thread-gutter); gap: 14px; background: var(--surface-panel); }
.voice-transcript-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; width: 100%; margin: 0 0 8px; }
.voice-transcript-heading h3 { font-size: 14px; }
.voice-transcript-heading > span { font-size: 11px; color: #66717d; }
.voice-history .message { max-width: 88%; padding: 12px 16px; border: 1px solid #e1e5eb; border-radius: 18px 18px 18px 5px; }
.voice-history .message.outgoing { border-radius: 18px 18px 5px 18px; }
.voice-history .message .author, .voice-history .message small { font-size: 11px; }
.voice-history .message .text { font-size: 14px; line-height: 1.55; }
.voice-empty-icon { height: 28px; }
.voice-empty-icon .icon { width: 28px; height: 28px; }

@media (min-width: 1025px) {
 .voice-workspace { grid-template-columns: var(--queue-width) minmax(0,1fr); grid-row: 1; }
 .voice-workspace > .list { margin: var(--sidebar-inset) var(--sidebar-inset) var(--sidebar-inset) 0; border-radius: var(--sidebar-inner-radius); }
 .voice-workspace > .thread { margin-left: 16px; border-radius: 24px; box-shadow: 0 4px 20px #0000000a; }
}
@media (max-width: 1024px) {
 .voice-workspace .voice-history { padding: 16px 0 16px var(--thread-gutter); }
 .voice-workspace .thread-head { padding: 16px var(--thread-gutter); }
 .voice-workspace .thread-heading h2 { font-size: 17px; }
 .voice-transcript-heading > span { display: none; }
}
@media (min-width: 1025px) {
 .workspace-section:not(.voice-workspace) { margin-left: 16px; border-radius: 24px; background: var(--surface-panel); box-shadow: 0 4px 20px #0000000a; }
 .workspace-section:not(.voice-workspace) .access-page,
 .workspace-section:not(.voice-workspace) .access-main { background-color: var(--surface-panel); }
 .shell > .nav .manage-access.active .icon { color: #fff; }
}
@media (max-width: 1024px) {
 .shell.has-workspace > .nav { background: #fff; border-bottom: 1px solid #edf0f3; }
 .voice-workspace .thread-heading { flex-basis: 100%; }
 .voice-workspace .thread-head > .call-state { margin-left: 60px; }
}

/* Operational notices and team management share the inbox's quiet surfaces. */
:is(.notices-page, .management-page) .access-main { padding: 32px; max-width: 1280px; }
:is(.notices-page, .management-page) .access-heading { padding: 0; margin-bottom: 28px; border: 0; gap: 20px; align-items: center; }
:is(.notices-page, .management-page) .access-heading h1 { font-size: 28px; letter-spacing: -1px; margin: 0 0 8px; }
:is(.notices-page, .management-page) .access-heading p { font-size: 13px; line-height: 1.6; color: #66717d; margin: 0; max-width: none; }
:is(.notices-page, .management-page) .access-heading-actions { padding: 0; gap: 8px; }
:is(.notices-page, .management-page) .access-heading-actions button { font-size: 12px; }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; background: var(--surface-inset); border-radius: 16px; padding: 16px 20px; margin-bottom: 20px; }
.panel-toolbar strong { display: block; font-size: 14px; }
#notice-count { display: block; margin-top: 4px; color: #66717d; font-size: 12px; }
.panel-filter { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #66717d; }
.panel-filter select {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid #e0e5ea;
  background-color: #fff;
  color: var(--ink);
  font-size: 13px;
}
.panel-filter select, .queue-filters select { padding-block: 8px; }
.notices-page #notice-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; }
.notices-page .notice-card { margin: 0; padding: 24px; border: 1px solid #e4e8ed; border-radius: 20px; background: #fff; }
.notices-page .notice-card[hidden] { display: none; }
.notices-page .notice-card header { font-size: 11px; color: #78818b; }
.notice-state { padding: 5px 9px; border-radius: 6px; background: #edf0f4; color: #526071; font-weight: 500; }
.notice-state[data-state="active"] { background: #edf4ef; color: #38664d; }
.notice-state[data-state="expired"] { background: #fff0e7; color: #a43a12; }
.notices-page .notice-card h2 { font-size: 19px; line-height: 1.35; margin: 18px 0 12px; letter-spacing: -.3px; }
.notice-scope { display: flex; flex-wrap: wrap; gap: 6px; }
 .notice-scope span { font-size: 11px; padding: 4px 8px; background: var(--tag-bg, #eeeae5); border-radius: 6px; color: var(--tag-ink, #655446); }
.notice-scope [data-tint="purple"] { --tag-bg: #eee5f4; --tag-ink: #70458b; }
.notice-scope [data-tint="blue"] { --tag-bg: #e0edf8; --tag-ink: #32648a; }
.notice-scope [data-tint="pink"] { --tag-bg: #f5e2eb; --tag-ink: #914b6b; }
.notice-scope [data-tint="brown"] { --tag-bg: #eee5dc; --tag-ink: #79583c; }
.notice-scope [data-tint="green"] { --tag-bg: #e1eee6; --tag-ink: #386b50; }
.notice-scope [data-tint="orange"] { --tag-bg: #fae8d7; --tag-ink: #945a25; }
.notice-scope [data-tint="red"] { --tag-bg: #f8e2e0; --tag-ink: #984c45; }
.notices-page .notice-coverage { color: #66717d; font-size: 12px; margin-top: 12px; }
.notice-protocol { background: #f6f7f9; padding: 16px; border-radius: 12px; margin: 18px 0; }
.notice-label { font-size: 11px; font-weight: 600; color: #66717d; }
.notices-page .notice-protocol p { margin-top: 6px; font-size: 13px; line-height: 1.6; }
.notice-details { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0; }
.notice-details > div:last-child { grid-column: 1 / -1; }
.notice-details dt { font-size: 11px; color: #78818b; margin-bottom: 4px; }
.notice-details dd { font-size: 12px; margin: 0; }
.notices-page .notice-card footer { border-color: #edf0f3; margin-top: 18px; padding-top: 12px; }
.notices-page .notice-card footer button { min-height: 40px; padding: 8px 12px; font-size: 12px; background: var(--surface-panel); }
.notices-page .empty { grid-column: 1 / -1; background: #f6f7f9; border-radius: 20px; margin: 0; padding: 64px 24px; }
.panel-empty { background: #f6f7f9; padding: 32px; border-radius: 18px; text-align: center; color: #66717d; }
.panel-empty h2 { font-size: 20px; color: var(--ink); margin-bottom: 8px; }
:is(.management-page,.notices-page) .access-tabs { display: inline-flex; gap: 4px; background: var(--surface-inset); padding: 4px; border: 0; border-radius: 14px; }
:is(.management-page,.notices-page) .access-tabs button { border: 0; border-radius: 11px; min-height: 40px; font-size: 13px; padding: 8px 20px; }
:is(.management-page,.notices-page) .access-tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
:is(.management-page,.notices-page) .access-tabs button[aria-pressed="true"] .icon { color: #fff; }
.management-page .access-section { border: 0; padding: 0; margin-bottom: 24px; }
.management-page .member-list { display: grid; gap: 12px; }
.management-page .member-card { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr) minmax(150px,.8fr); gap: 24px; padding: 20px; border: 1px solid #e4e8ed; border-radius: 18px; background: #fff; }
.person-identity { position: relative; padding-left: 52px; min-width: 0; }
.person-avatar { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #e9edf3; color: #4e6179; font-size: 13px; font-weight: 600; }
.management-page .member-card h3 { font-size: 15px; }
.management-page .member-card p { font-size: 12px; color: #66717d; overflow-wrap: anywhere; }
.management-page .member-card .status { display: inline-flex; background: #f1f3f5; color: #526071; border-radius: 6px; padding: 4px 7px; font-size: 10px; }
.management-page .member-scope strong { font-size: 12px; font-weight: 600; }
.management-page .member-scope small { color: #66717d; font-size: 12px; }
.management-page .member-actions { align-items: flex-end; }
.management-page .member-actions button { min-height: 36px; padding: 6px 10px; font-size: 11px; }
.management-page .member-actions [data-edit] { background: #f1f3f5; }
.management-page .member-actions [data-revoke] { color: var(--action-orange); border-color: var(--action-orange); background: var(--surface-raised); }
.management-page .member-actions [data-revoke]:hover:not(:disabled) { color: var(--action-orange); border-color: var(--action-orange); background: #fff3ec; }
.management-page .member-actions small { max-width: 22ch; color: #78818b; font-size: 11px; line-height: 1.5; }
.management-page #teams-pane .member-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
.management-page .team-card { display: flex; align-items: stretch; flex-direction: column; gap: 20px; background: var(--surface-raised); border: 1px solid #e4e8ed; padding: 24px; }
.team-emblem { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface-panel); margin-bottom: 20px; }
.team-count { float: right; font-size: 11px; color: #66717d; padding-top: 12px; }
.management-page .team-card > button { align-self: flex-start; background: #fff; border: 1px solid #e1e5ea; font-size: 12px; }
.management-page .environment { border: 0; background: transparent; padding-top: 16px; color: #89919b; font-size: 10px; }
@media (max-width: 1100px) {
 .notices-page #notice-list { grid-template-columns: minmax(0,1fr); }
 .management-page .member-card:not(.team-card) { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
 .management-page .member-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
}
@media (max-width: 600px) {
 :is(.notices-page,.management-page) .access-main { padding: 20px 16px; }
 :is(.notices-page,.management-page) .access-heading h1 { font-size: 24px; }
 .management-page #teams-pane .member-list, .management-page .member-card:not(.team-card) { grid-template-columns: minmax(0,1fr); }
 .management-page .member-scope { padding-left: 52px; }
 .management-page .member-actions { flex-wrap: wrap; }
 .notices-page .notice-card { padding: 20px; }
 .panel-filter { width: 100%; justify-content: space-between; }
}
.management-page .member-list { border: 0; }
:is(.notices-page,.management-page), :is(.notices-page,.management-page) > .access-main { background: var(--surface-panel); }

/* Subtle texture on workspace canvases; cards remain solid surfaces. */
.workspace-section :is(.notices-page, .management-page) {
  background-image: radial-gradient(circle, rgb(82 107 134 / 12%) 0.8px, transparent 1px);
  background-size: 20px 20px;
}
.workspace-section :is(.notices-page, .management-page) > .access-main { background: transparent; }


/* Editorial titles for the conversation inbox. */
.shell > .list #list-title,
.shell > #thread > .empty h2,
.voice-workspace .list-heading h1,
.notices-page .access-heading h1,
.management-page .access-heading h1,
.voice-workspace .empty-thread h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -.4px;
}

/* Quiet dotted texture around the empty conversation prompt. */
#thread:has(> .empty), #voice-detail:has(> .empty-thread) { position: relative; isolation: isolate; background: var(--surface-panel); }
#thread:has(> .empty)::before,
#voice-detail:has(> .empty-thread)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image: radial-gradient(circle, rgb(82 107 134 / 22%) 1px, transparent 1.2px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse at center, transparent 18%, rgb(0 0 0 / 25%) 45%, #000 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 18%, rgb(0 0 0 / 25%) 45%, #000 85%);
}

/* Photo treatment is confined to the empty conversation panel. */
:is(#thread, #voice-detail):has(> .empty) { overflow: hidden; }
:is(#thread, #voice-detail):has(> .empty)::after {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: -2;
  pointer-events: none;
  background: url("/assets/ocelot/conversation-foliage.webp") center / cover no-repeat;
  filter: blur(12px);
}
:is(#thread, #voice-detail):has(> .empty)::before {
  background-image: radial-gradient(circle, rgb(255 255 255 / 32%) 1px, transparent 1.2px);
}
:is(#thread, #voice-detail) > .empty {
  position: relative;
  width: calc(100% - 48px);
  max-width: 440px;
  padding: 44px 32px;
  background: var(--surface-raised, #fff);
  border: 1px solid rgb(255 255 255 / 80%);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgb(0 25 28 / 12%);
}

/* Uniform dotted texture behind conversation messages. */
:is(#thread > #messages, #voice-detail > .voice-history) {
  background-color: #f5f6f8;
  background-image: radial-gradient(circle, rgb(82 107 134 / 22%) 1px, transparent 1.2px);
  background-size: 20px 20px;
}

:is(#thread, #voice-detail):has(> .messages) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.notices-page .notice-card h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -.2px;
}

.nav-bottom .user-name.account-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  padding: 0;
  border: 1px solid #d8e0e9;
  border-radius: 50%;
  background: #e5ebf3;
  color: #45556d;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}

/* Keep status labels distinct from the contextual hover gradient. */
:is(#rows, #voice-list) .row :is(.status, .call-state) {
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 180ms ease;
}
:is(#rows, #voice-list) .row:is(:hover, :focus-visible) :is(.status, .call-state) {
  box-shadow: inset 0 0 0 1px currentColor;
}
@media (prefers-reduced-motion: reduce) {
  :is(#rows, #voice-list) .row :is(.status, .call-state) { transition: none; }
}

/* Soften the scroll boundary underneath the conversation filters. */
.shell > .list > .list-head { position: relative; z-index: 2; }
.shell > .list > .list-head::after {
  content: "";
  position: absolute;
  inset: 100% 10px auto 0;
  height: 20px;
  background: linear-gradient(to bottom, var(--surface-panel), transparent);
  pointer-events: none;
}

/* Shared inset scroll rail and edge fades for chat and call queues. */
:is(#rows, #voice-list) {
  margin-bottom: 12px;
  scrollbar-gutter: stable;
  padding-bottom: 25px;
  /* Fade cards into the panel rather than cutting them at the scroll edge. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--queue-top-fade, 0px), #000 calc(100% - 25px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--queue-top-fade, 0px), #000 calc(100% - 25px), transparent 100%);
}
:is(#rows, #voice-list, #messages, .voice-history)::-webkit-scrollbar { width: 8px; }
:is(#rows, #voice-list, #messages, .voice-history)::-webkit-scrollbar-track { background: transparent; margin-block: 20px 12px; }
:is(#rows, #voice-list, #messages, .voice-history)::-webkit-scrollbar-thumb {
  background: #b5bdc7;
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
:is(#rows, #voice-list, #messages, .voice-history)::-webkit-scrollbar-thumb:hover { background: #8793a2; }
:is(#rows, #voice-list, #messages, .voice-history)::-webkit-scrollbar-button { display: none; }
@supports not selector(::-webkit-scrollbar) {
  :is(#rows, #voice-list, #messages, .voice-history) { scrollbar-width: thin; scrollbar-color: #b5bdc7 transparent; }
}

/* Brand accent on the selected navigation icon. */
.shell > .nav #navigation-panel button.active .icon,
.mobile-nav-dialog #navigation-panel button.active .icon {
  color: var(--ocelot-butttano);
  filter: drop-shadow(0 0 3px rgb(255 85 15 / 70%)) drop-shadow(0 0 8px rgb(255 85 15 / 40%));
}

/* Chat bubbles: customer on white, our replies on black, on every viewport. */
:is(#thread, #voice-detail) .messages > .message:not(.outgoing):not(.note) {
  background: #fff;
  border-color: #e1e5eb;
  color: #202124;
}
:is(#thread, #voice-detail) .messages > .message.outgoing:not(.note) {
  background: #202124;
  border-color: #202124;
  color: #fff;
}
:is(#thread, #voice-detail) .messages > .message:not(.outgoing):not(.note) :is(.author, small) { color: #526071; }
:is(#thread, #voice-detail) .messages > .message.outgoing:not(.note) :is(.author, small) { color: #e1e4e8; }

#thread .messages > .message.note {
  background: var(--ocelot-kino);
  border: 0;
  color: #292019;
  justify-self: center;
  align-self: center;
  width: fit-content;
  max-width: min(70%, 640px);
  margin-inline: auto;
}
.list-heading #refresh-list {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
@media (max-width: 640px) {
  #thread .messages > .message.note { max-width: 90%; }
}


/* One compact context row, with expanded content below it. */
.thread-contextbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 0 16px;
  padding: 6px var(--thread-gutter);
  background: #fafbfc;
  border-bottom: 1px solid #edf0f3;
}
#thread .thread-contextbar :is(.conversation-control, .control-toolbar, #related-calls-host, .related-calls) { display: contents; }
.thread-contextbar .control-state { grid-column: 1; grid-row: 1; min-width: 0; }
.thread-contextbar .control-actions { grid-column: 3; grid-row: 1; justify-self: end; }
.thread-contextbar .related-calls > summary {
  grid-column: 2; grid-row: 1;
  min-height: 36px;
  border-left: 1px solid #dce1e7;
  border-radius: 0;
  padding-left: 16px;
  white-space: nowrap;
}
.thread-contextbar .related-calls::details-content { display: contents; }
.thread-contextbar .related-calls:not([open]) > .related-call-content { display: none; }
.thread-contextbar .related-call-content { grid-column: 1 / -1; grid-row: 2; padding: 6px 0; }
.thread-contextbar :is(.control-explanation, #control-confirm) { grid-column: 1 / -1; }
.thread-contextbar #control-confirm:empty { display: none; }
@media (max-width: 1250px) {
  .thread-contextbar { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .thread-contextbar .control-actions { grid-column: 1 / -1; grid-row: 2; justify-self: end; }
  .thread-contextbar .related-call-content { grid-row: 3; }
}
@media (max-width: 600px) {
  .thread-contextbar { column-gap: 8px; }
  .thread-contextbar .related-calls > summary { padding-left: 8px; font-size: 11px; gap: 5px; }
}

/* Grow in normal flow so the following conversation cards move with it. */
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  #rows .row:hover { --row-expansion: 8px; }
}
@media (min-width: 1025px) {
  #rows .row:focus-visible { --row-expansion: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  #rows .row { transition: none; }
}


:is(#thread > #messages, #voice-detail > .voice-history) { position: relative; isolation: isolate; }
:is(#messages, .voice-history)::before {
  content: "";
  position: absolute;
  top: var(--dot-scroll, 0px);
  left: 0;
  width: 100%;
  height: var(--dot-height, 0px);
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle, #fff 1px, transparent 1.2px) 0 0 / 20px 20px;
  -webkit-mask-image: radial-gradient(circle 125px at var(--dot-x, -250px) var(--dot-y, -250px), #000 0%, rgb(0 0 0 / 85%) 25%, transparent 100%);
  mask-image: radial-gradient(circle 125px at var(--dot-x, -250px) var(--dot-y, -250px), #000 0%, rgb(0 0 0 / 85%) 25%, transparent 100%);
  opacity: 0;
  transition: opacity 180ms ease;
}
@media (hover: hover) and (pointer: fine) {
  :is(#messages, .voice-history).dots-hovered::before { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  :is(#messages, .voice-history)::before { transition: none; }
}

/* Selection stays visible above the contextual hover and in the scroll deck. */
:is(#rows, #voice-list) > .row.selected {
  --selected-card-background: var(--ocelot-butttano);
  --selected-card-glow: 0 0 0 1px rgb(255 85 15 / 40%), 0 0 16px rgb(255 85 15 / 55%), 0 0 30px rgb(255 85 15 / 30%);
  background: var(--selected-card-background);
  border-color: var(--ocelot-butttano);
  box-shadow: var(--selected-card-glow);
}
:is(#rows, #voice-list) > .row.selected :is(.row-top strong, .row-preview, .row-meta, time, .row-assignee, .row-bottom > small, .ref, .call-row-date) { color: #fff; }
#rows > .row.selected .row-bottom { border-color: transparent; }
#rows > .row.selected .row-bottom :is(.row-assignee, .ref) { color: #1f2023; }
#rows > .row.selected .status { background: #1f2023; color: #fff; border-color: #1f2023; }
:is(#rows, #voice-list) > .row.selected::after { display: none; }

/* The empty-state invitation softly points toward the conversation column. */
:is(.shell, .voice-workspace) > .list { position: relative; }
:is(.shell, .voice-workspace) > .list::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(to left, rgb(255 85 15 / 18%), rgb(255 85 15 / 5%) 24%, transparent 55%);
  opacity: 0;
  transition: opacity 320ms ease;
}
@media (hover: hover) and (pointer: fine) {
  :is(.shell, .voice-workspace):has(> .thread > .empty:hover) > .list::after { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.shell, .voice-workspace) > .list::after { transition: none; }
}

/* Scroll deck: newer conversations cover earlier cards, with two visible rims. */
@media (min-width: 1025px) and (prefers-reduced-motion: no-preference) {
  :is(#rows, #voice-list).stacked-queue { position: relative; isolation: isolate; overflow-anchor: none; }
  :is(#rows, #voice-list).stacked-queue > .row {
    position: sticky;
    top: var(--stack-top, 0px);
    z-index: var(--stack-layer, 1);
    transform: translateY(var(--stack-shift, 0px)) scale(var(--stack-scale, 1));
    transform-origin: center top;
    opacity: var(--stack-opacity, 1);
    box-shadow: var(--selected-card-glow, 0 -1px 0 rgb(255 255 255 / 90%), 0 3px 10px rgb(26 39 53 / 5%));
  }
  :is(#rows, #voice-list).stacked-queue > .stack-buried { pointer-events: none; }
}

/* Keep contact status beside its conversation reference. */
#thread .thread-contact-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 3px; }
#thread .thread-contact-meta small { margin: 0; }
#thread .thread-contact-meta .status { padding: 3px 7px; font-size: 11px; line-height: 16px; }

/* Pointer spotlight above the photo and quiet dots, below the empty-state card. */
:is(#thread, #voice-detail) > .empty-dot-light {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle, #fff 1px, transparent 1.2px) 0 0 / 20px 20px;
  -webkit-mask-image: radial-gradient(circle 125px at var(--dot-x, -250px) var(--dot-y, -250px), #000 0%, rgb(0 0 0 / 85%) 25%, transparent 100%);
  mask-image: radial-gradient(circle 125px at var(--dot-x, -250px) var(--dot-y, -250px), #000 0%, rgb(0 0 0 / 85%) 25%, transparent 100%);
  opacity: 0;
  transition: opacity 180ms ease;
}
@media (hover: hover) and (pointer: fine) {
  :is(#thread, #voice-detail).dots-hovered > .empty-dot-light { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  :is(#thread, #voice-detail) > .empty-dot-light { transition: none; }
}

#voice-detail .voice-history > .system-event {
  padding: 6px 12px;
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--ink);
}

/* Soften bubbles only at the two edges of the chat's scrolling viewport. */
#thread > .chat-edge-blur {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 25px, transparent calc(100% - 25px), #000);
  mask-image: linear-gradient(to bottom, #000, transparent 25px, transparent calc(100% - 25px), #000);
}

/* Access modal: editorial heading and an external corner close control. */
#access-dialog { overflow: visible; }
#access-dialog-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 34px;
  letter-spacing: -.025em;
}
#access-dialog #close-access-dialog {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #cbd3dd;
}
@media (max-height: 800px), (max-width: 640px) {
  #access-dialog { overflow-y: auto; }
  #access-dialog #close-access-dialog { top: 12px; right: 12px; }
  #access-dialog > header { padding-right: 32px; }
}

/* Decorative Ocelot foliage film; the existing photo remains its fallback. */
.conversation-background-video {
  position: absolute;
  inset: -24px;
  width: calc(100% + 48px);
  height: calc(100% + 48px);
  object-fit: cover;
  filter: blur(12px);
  z-index: -2;
  pointer-events: none;
}
.auth-story > .conversation-background-video {
  inset: 0;
  width: 100%;
  height: 100%;
  object-position: left center;
  filter: blur(4px);
}
:is(#thread, #voice-detail):has(> .conversation-background-video)::after { z-index: -3; }

/* Mark II across secondary flows and touch layouts. Keep semantic warning,
   note and status colors; share the inbox's neutral surfaces everywhere else. */
input:not([type=checkbox]), textarea, select,
.access-dialog input:not([type=checkbox]), .access-dialog select {
  border-radius: 14px;
  border-color: var(--control-border);
}
button:hover:not(:disabled), button.secondary:hover:not(:disabled),
.transfer > summary:hover, .ai-options > summary:hover {
  background-color: var(--surface-inset);
  border-color: var(--control-border-hover);
}
button.primary:hover:not(:disabled) { background: #ad3608; border-color: #ad3608; }
button:disabled, button.primary:disabled, button.secondary:disabled {
  color: #657180; background: var(--surface-panel); border-color: var(--line);
}
.access-page { background: var(--surface-panel); }
.access-nav { background: var(--surface-raised); }
.access-heading h1, .access-dialog h2, .qr-dialog h2,
.mobile-nav-dialog h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400; letter-spacing: -.025em; line-height: 1.15;
}
.access-dialog, .qr-dialog { border: 1px solid var(--line); border-radius: 24px; }
.access-dialog fieldset, .transfer-panel, .ai-options-panel {
  border-color: var(--line); border-radius: 16px; background: var(--surface-raised);
}
.access-main > .access-section > .invitation-card {
  padding: 20px; margin-bottom: 12px; border: 1px solid var(--line);
  border-radius: 20px; background: var(--surface-raised);
}
.access-main, .access-heading > div, .member-card > *, .invitation-card > * { min-width: 0; }
.member-card p, .invitation-card p, .access-main > p { overflow-wrap: anywhere; }
.transfer-panel, .ai-options-panel { max-width: calc(100vw - 32px); }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, a:focus-visible { outline: 2px solid #b53d0e; outline-offset: 3px; }

@media (max-width: 1024px) {
  .shell:not(.has-thread) > .nav { display: grid; grid-template-columns: minmax(0, 1fr) auto; background: var(--surface-raised); border-color: var(--line); }
  .shell > .list, .voice-workspace > .list { background: var(--surface-panel); }
  .shell > .list .list-head { padding: 20px 16px 16px; }
  .shell > .list .search-wrap input { background: #fff; border-color: transparent; border-radius: 16px; }
  .shell > .list .queue-status { padding: 4px; background: #fff; border: 0; border-radius: 16px; }
  .shell > .list .queue-status button { border: 0; border-radius: 12px; min-height: 44px; }
  .shell > .list .queue-status button[aria-pressed="true"] { background: var(--ink); color: #fff; }
  #rows { padding: 12px; }
  #rows > .row {
    display: grid; grid-template-columns: 36px minmax(0, 1fr);
    gap: 6px 10px; padding: 16px 12px; margin-bottom: 8px;
    border: 1px solid transparent; border-radius: 20px; background: #fff;
  }
  #rows > .row .conversation-avatar {
    display: grid; place-items: center; grid-row: 1 / 3;
    width: 36px; height: 36px; border-radius: 50%;
    background: #e5ebf3; color: #45556d; font-size: 12px; font-weight: 600;
  }
  #rows > .row :is(.row-top, .row-preview) { grid-column: 2; min-width: 0; }
  #rows > .row .row-top strong { font-size: 14px; }
  #rows > .row .row-preview { font-size: 12px; line-height: 1.55; }
  #rows > .row .row-bottom { grid-column: 1 / -1; margin-top: 8px; padding-top: 10px; }
  #rows > .row.selected { background: var(--selected-card-background); border-color: var(--ocelot-butttano); box-shadow: var(--selected-card-glow); }
  #rows > .row.selected::before { display: none; }
  #thread > .messages { background: #f5f6f8; }
  #thread .message.outgoing:not(.note) { background: #eaf0f8; border-color: #dce4ee; }
  .mobile-nav-dialog { background: #fff; border-radius: 24px 0 0 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .mobile-nav-dialog :is(nav button, .manage-access) { border-radius: 14px; }
  .mobile-nav-dialog nav button.active, .mobile-nav-dialog .manage-access.active {
    background: var(--ink); color: #fff; border-color: transparent; padding-left: 16px;
  }
  .mobile-nav-dialog :is(nav button, .manage-access):hover:not(:disabled) { background: var(--surface-inset); color: var(--ink); }
  .mobile-nav-dialog :is(nav button, .manage-access).active .icon { color: #fff; }
  .workspace-section:not(.voice-workspace) { background: var(--surface-panel); }
  .access-heading h1 { font-size: 32px; }
  .access-dialog h2, .qr-dialog h2 { font-size: 30px; }
  .access-heading-actions, .dialog-actions { flex-wrap: wrap; }
  .panel-filter select { font-size: 16px; }
}
@media (max-width: 600px) {
  :is(.notices-page, .management-page) .access-main, .access-main { padding: 24px 16px; }
  .access-dialog, .qr-dialog { padding: 24px 20px; max-height: calc(100dvh - 32px); }
  .dialog-actions { bottom: -24px; }
  .access-heading { gap: 16px; margin-bottom: 24px; }
}

/* Long channel notices must not size the compact state/actions row. */
.thread-contextbar .window-notice {
  grid-column: 1 / -1;
  max-width: none;
  min-width: 0;
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-panel);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#thread .control-actions > button:is([data-control="take"], [data-control="resolve"], [data-control="return_ai"]) {
  background: #fff;
  border: 1px solid #dce1e7;
  color: var(--ink);
  font-weight: 500;
}
#thread .control-actions > button:is([data-control="take"], [data-control="resolve"], [data-control="return_ai"]) .icon { color: inherit; }
#thread .control-actions > button:is([data-control="take"], [data-control="resolve"], [data-control="return_ai"]):hover:not(:disabled) {
  background: #eef1f5; border-color: #b9c3cf;
}
#thread .control-actions > button:disabled { color: #657180; background: var(--surface-panel); border-color: var(--line); }
/* Use the actual pane width, including when the sidebar takes desktop space. */
@container conversation (max-width: 820px) {
  .thread-contextbar { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .thread-contextbar .control-actions { grid-column: 1 / -1; grid-row: 2; justify-self: end; max-width: 100%; flex-wrap: wrap; }
  .thread-contextbar .related-call-content { grid-row: 3; }
}

/* Calls use the same centered 960px conversation rail as WhatsApp. */
#voice-detail { --workspace-gutter: 24px; }
@media (max-width: 1024px) {
  #voice-detail { --workspace-gutter: 16px; }
}

/* Support reuses the notices/team workspace surfaces and components. */
.support-page .support-caption { display: block; margin-top: 4px; color: #66717d; font-size: 12px; line-height: 1.5; }
.support-page .support-control { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.support-control-copy { display: flex; align-items: flex-start; gap: 20px; flex: 1 1 380px; min-width: 0; }
.support-control-copy > .team-emblem { flex: 0 0 44px; margin: 0; }
.support-page .support-control h2 { margin: 12px 0 8px; }
.support-page .notice-card p, .support-guide p, .support-details p { font-size: 13px; line-height: 1.65; color: #66717d; margin: 0; }
.support-page .support-control > button { font-size: 12px; flex-shrink: 0; }
.support-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0 16px; }
.support-page .support-section-heading h2, .support-page .support-history > h2, .support-guide > h2 { font: 600 16px/1.4 'Instrument Sans', sans-serif; margin: 0; }
.support-channel-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.support-page .support-channel header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.support-page .support-channel .team-emblem { margin: 0; }
.support-page .support-channel h3 { font-size: 15px; margin: 20px 0 8px; }
.support-details { margin: 20px 0 32px; border-radius: 14px; padding: 16px 20px; background: var(--surface-inset); }
.support-details summary { cursor: pointer; font-size: 12px; font-weight: 600; }
.support-details[open] summary { margin-bottom: 12px; }
.support-page .support-history > h2 { margin-bottom: 16px; }
.support-activity { border: 1px solid #e4e8ed; border-radius: 18px; background: var(--surface-raised); padding: 0 20px; }
.support-activity article { display: flex; gap: 16px; align-items: center; padding: 16px 0; }
.support-activity article + article { border-top: 1px solid #edf0f3; }
.support-activity .team-emblem { width: 36px; height: 36px; margin: 0; flex-shrink: 0; }
.support-activity strong { font-size: 13px; font-weight: 600; }
.support-activity p, .support-activity time { color: #66717d; font-size: 12px; margin: 4px 0 0; }
.support-activity time { margin-left: auto; text-align: right; }
.support-page .support-empty { padding: 40px 24px; background: var(--surface-raised); border: 1px solid #e4e8ed; }
.support-empty .team-emblem { margin: 0 auto 12px; color: #38664d; background: #edf4ef; }
.support-empty p, .support-history .panel-empty p { font-size: 13px; line-height: 1.7; margin: 0; }
.support-guide { margin-top: 32px; }
.support-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; margin-top: 20px; }
.support-steps h3 { font-size: 13px; margin: 14px 0 8px; }
.support-steps .notice-state { font-variant-numeric: tabular-nums; }
.support-page .recovery-card > .notice-state { justify-self: start; }
@media(max-width:700px) {
 .support-channel-grid,.support-steps { grid-template-columns: minmax(0,1fr); }
 .support-page .access-tabs { display: flex; width: 100%; }
 .support-page .access-tabs button { flex: 1; white-space: normal; padding-inline: 12px; }
 .support-page .support-control-copy { gap: 12px; flex-basis: 100%; }
 .support-page .support-control > button { width: 100%; }
 .support-page .access-heading > .notice-scope { display: none; }
 .support-activity article { flex-wrap: wrap; }
 .support-activity time { flex-basis: 100%; text-align: left; margin: -8px 0 0 52px; }
 .support-page .recovery-card > .notice-state { margin-left: 52px; }
}

/* Channel switches use the same action color and quiet card footer. */
.support-global-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.support-page .support-global-actions button { font-size:12px; }
.support-page .notice-card .support-channel-toggle { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.support-channel-toggle > span { font-size:12px; font-weight:600; color:var(--ink); }
.support-page .notice-card footer .channel-ai-switch { position:relative; display:inline-flex; align-items:center; justify-content:flex-start; box-sizing:border-box; width:44px; height:28px; min-height:28px; flex:0 0 44px; padding:3px; border:1px solid #c5cdd6; border-radius:999px; background:#dce2e8; box-shadow:none; }
.support-page .notice-card footer .channel-ai-switch > span { display:block; width:20px; height:20px; flex:0 0 20px; border-radius:50%; background:#fff; box-shadow:0 1px 3px #0002; transform:translateX(0); transition:transform 150ms ease; pointer-events:none; }
.support-page .notice-card footer .channel-ai-switch[aria-checked="true"] { background:var(--action-orange); border-color:var(--action-orange); }
.support-page .notice-card footer .channel-ai-switch[aria-checked="true"] > span { transform:translateX(16px); }
.support-page .notice-card footer .channel-ai-switch:disabled { opacity:.5; cursor:wait; }
@media(max-width:700px) { .support-global-actions { width:100%; } .support-global-actions > button { flex:1 1 100%; } }
@media(prefers-reduced-motion:reduce) { .support-page .notice-card footer .channel-ai-switch > span { transition:none; } }

.support-manual-form{margin:20px 0}.support-manual-form label{display:block;margin-bottom:8px}.support-manual-entry{display:flex;gap:12px;max-width:540px}.support-manual-entry input{min-width:0;flex:1}.support-manual-list{display:grid;gap:8px;margin:16px 0}.support-manual-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px}.support-manual-row strong{font-variant-numeric:tabular-nums}@media(max-width:600px){.support-manual-entry{flex-direction:column}}

.queue-options {margin-top:8px}
.queue-options summary {cursor:pointer;width:fit-content;font-size:13px}
.queue-options[open] summary {color:var(--ink)}
#thread-order {justify-self:start;margin-inline:var(--thread-gutter,16px);font-size:12px;min-height:28px}
.feedback-tag {color:var(--muted);border:1px solid var(--line);border-radius:99px;padding:2px 7px}
.access-dialog [data-history] {white-space:pre-line}
.quick-options .template-options {display:flex;flex-wrap:wrap;gap:6px}

.list-heading:has(.queue-actions) { grid-template-columns:minmax(0,1fr) auto; }
.queue-actions { display:flex; align-items:center; gap:4px; }
.list-heading .queue-actions > button.icon-button {
  flex:0 0 36px; width:36px; min-width:36px; height:36px; min-height:36px; box-sizing:border-box;
  display:grid; place-items:center; padding:0; border-radius:50%; background:white; color:var(--ink);
}
.queue-actions .icon { width:18px; height:18px; }
.queue-actions #queue-order.oldest svg { transform:scaleY(-1); }
.queue-actions #filter-toggle.has-filter { box-shadow:inset 0 0 0 1px var(--ink); }
.chip-panel,.thread-labels,.active-tags,.catalog-list { display:flex; flex-wrap:wrap; align-items:center; gap:5px; }
.chip-panel { padding:10px; background:white; border:1px solid var(--line); border-radius:12px; }
#tag-filter { margin-block:8px; }
.thread-labels { padding:4px var(--thread-gutter); flex:none; }
.thread-labels .chip-panel { flex-basis:100%; }
.thread-labels .active-tags:empty { display:none; }
.thread-labels .tags-toggle { width:30px; height:30px; min-height:30px; padding:0; border-radius:50%; display:grid; place-items:center; }
.tag-chip,button.tag-chip,.row .row-bottom .tag-chip {
  display:inline-flex; align-items:center; gap:3px; border:0; color:var(--chip-ink);
  border-radius:999px; background:color-mix(in srgb,var(--chip-ink) 12%,white); padding:2px 7px; min-height:0;
  font-family:inherit; font-size:11px; line-height:1.3; font-weight:550;
}
button.tag-chip:hover { background:color-mix(in srgb,var(--chip-ink) 20%,white); color:var(--chip-ink); box-shadow:none; }
button.tag-chip:focus-visible { outline:2px solid var(--chip-ink); outline-offset:2px; }
.tag-chip[aria-pressed=true]::before { content:"✓"; }
.catalog-list .quiet { min-height:30px; }
.file-list { display:grid; gap:6px; }
.file-list button { overflow-wrap:anywhere; justify-content:flex-start; }
.access-dialog textarea { width:100%; padding:12px; font:inherit; border:1px solid var(--line); border-radius:12px; resize:vertical; }
.chip-panel[hidden],.access-dialog [hidden] { display:none; }
.list-heading .queue-actions #refresh-list { width:36px; min-width:36px; height:36px; min-height:36px; }

#thread #contact-tools {
  display:grid; place-items:center; padding:0; border:0; border-radius:50%; cursor:pointer;
}
@media (max-width:1024px) {
  #thread #contact-tools { width:40px; height:40px; flex:0 0 40px; min-height:40px; }
}
#thread .thread-labels { padding:0; flex:0 1 auto; min-width:0; }
#thread .tags-toggle {
  flex:0 0 30px; width:30px; min-width:30px; height:30px; min-height:30px;
  padding:0; box-sizing:border-box; border-radius:50%; background:#fff; border:1px solid var(--line);
}
#thread .tags-toggle .icon { width:16px; height:16px; }
#thread .tags-toggle[aria-expanded=true] { border-color:var(--ink); }
#thread .active-tags { flex:1 1 0; min-width:0; }
#reply-form .quick-options {
  background:#fff; border:1px solid var(--line); border-radius:16px;
  padding:12px; box-shadow:0 4px 16px rgb(0 0 0 / 6%);
}
#reply-form .quick-options .template-options { gap:4px; }
#reply-form .quick-options [data-snippet] { border-radius:10px; padding:6px 10px; text-align:left; }
#conversation-tag-picker {
  position:fixed; inset:auto; margin:0; width:min(300px,calc(100vw - 16px)); max-height:60dvh;
  overflow:auto; box-sizing:border-box; box-shadow:0 6px 22px rgb(0 0 0 / 12%);
}
#conversation-tag-picker:not(:popover-open) { display:none; }
#thread #contact-tools { position:relative; }
#contact-tools .avatar-edit { display:none; }
#thread #contact-tools:is(:hover,:focus-visible) {
  background:var(--ink); color:white; outline:2px solid var(--ink); outline-offset:2px;
}
#contact-tools:is(:hover,:focus-visible) .avatar-initials { visibility:hidden; }
#contact-tools:is(:hover,:focus-visible) .avatar-edit { position:absolute; inset:0; display:grid; place-items:center; }
@media (min-width:1025px) {
  .shell > .nav {
    --rail-circle:clamp(28px,calc((100dvh - 306px) / 10),58px);
    overflow:visible;
  }
  .shell > .nav #navigation-panel :is(nav,.nav-utilities) { gap:clamp(2px,.5vh,6px); }
  .shell > .nav #navigation-panel :is(nav,.nav-utilities) > button[data-icon]:has(.nav-label) {
    width:var(--rail-circle); height:var(--rail-circle); min-height:var(--rail-circle);
    padding:0; align-items:center; justify-content:center; border-radius:50%;
  }
  .shell > .nav #navigation-panel :is(nav,.nav-utilities) .navigation-symbol {
    width:50%; height:50%; flex:0 0 auto;
  }
  .shell > .nav #navigation-panel :is(nav,.nav-utilities) > button[data-icon]:has(.nav-label):is(:hover,:focus-visible) {
    width:100%; height:calc(var(--rail-circle) + 20px); border-radius:20px;
    justify-content:flex-start; padding-top:calc(var(--rail-circle) * .23);
  }
  .shell > .nav #navigation-panel :is(nav,.nav-utilities) button .nav-label {
    inset:calc(var(--rail-circle) - 5px) 0 auto;
  }
  .shell > .nav { z-index:3; }
}
@media (min-width:1025px) and (max-height:760px) {
  .shell > .nav { gap:4px; }
  .shell > .nav > .client-brand { margin-bottom:2px; }
  .shell > .nav #navigation-panel .nav-bottom { gap:3px; padding-top:0; }
  .shell > .nav #navigation-panel .account-menu { padding-top:0; }
  .shell > .nav #navigation-panel .platform-signature img { height:16px; }
}
@media (min-width:1025px) and (max-height:640px) {
  .shell > .nav #navigation-panel .nav-utilities {
    --rail-circle:28px;
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 0;
  }
}
.catalog-list button.add-tag {
  display:inline-grid; place-items:center; box-sizing:border-box; padding:0; width:19px; height:19px;
  min-height:0; flex:0 0 19px; border:1px solid var(--line); border-radius:50%; background:white;
}
.catalog-list button.add-tag .icon { width:12px; height:12px; }
#thread #contact-tools[data-tag-color]:not([data-tag-color=""]),.row .conversation-avatar[data-tag-color]:not([data-tag-color=""]) { box-shadow:inset 0 0 0 2px var(--chip-ink); }
.clients-page .search-wrap { flex:1 1 240px; }
.row .row-bottom .row-tags { display:flex; flex:1 0 100%; flex-wrap:wrap; justify-content:flex-start; align-items:center; gap:4px; }
.row .row-tags .tag-chip { margin:0; }
/* The agenda lives on the workspace canvas; only records and controls are surfaces. */
.clients-page .access-heading { margin-bottom:20px; }
.clients-page .access-heading h1 { margin:0; }
.clients-page .access-heading-actions { align-items:center; }
.crm-views,.crm-toolbar,.crm-foot { display:flex; align-items:center; flex-wrap:wrap; }
.crm-views { gap:4px; border-bottom:1px solid var(--line); padding-bottom:12px; }
.crm-views button { display:inline-flex; align-items:center; gap:7px; min-height:34px; border:0; border-radius:20px; padding:6px 12px; font-size:13px; font-weight:600; }
.crm-views button span { font-size:11px; font-variant-numeric:tabular-nums; opacity:.8; }
.crm-views button[aria-pressed=true],.crm-views button[aria-pressed=true]:hover { background:var(--ink); color:white; }
.crm-toolbar { gap:10px; align-items:end; padding:16px 0 6px; }
.crm-toolbar > label { display:grid; gap:4px; font-size:12px; color:var(--muted); }
.crm-toolbar :is(input[type=search],select),.crm-columns summary { box-sizing:border-box; height:40px; min-height:40px; border:1px solid var(--control-border); border-radius:12px; background-color:white; color:var(--ink); font-size:13px; }
.crm-toolbar input[type=search] { width:100%; padding:0 12px 0 38px; }
.crm-toolbar select { padding:0 30px 0 12px; background-position:right 8px center; background-size:16px; }
.crm-columns { position:relative; }
.crm-columns summary { display:flex; align-items:center; justify-content:center; gap:6px; padding-inline:12px; cursor:pointer; list-style:none; }
.crm-columns summary::-webkit-details-marker { display:none; }

.crm-columns summary:hover,.crm-columns[open] summary { background-color:var(--surface-inset); border-color:var(--control-border-hover); }
.crm-column-menu { position:absolute; top:calc(100% + 6px); right:0; z-index:5; width:192px; box-sizing:border-box; padding:8px; background:white; border:1px solid var(--line); border-radius:14px; box-shadow:0 8px 24px #18212c1a; }
.crm-column-menu strong { display:block; margin:6px 8px; font-size:12px; color:var(--muted); }
.crm-column-menu label { display:flex; align-items:center; gap:9px; min-height:32px; padding-inline:8px; border-radius:7px; cursor:pointer; font-size:13px; }
.crm-column-menu label:hover { background:var(--surface-inset); }
.crm-column-menu input { margin:0; }
.crm-scroll { overflow:auto; }
.crm-table { width:100%; border-collapse:separate; border-spacing:0 6px; font-size:13px; text-align:left; }
.crm-table thead th { padding:0 6px; }
.crm-table thead th:first-child { padding-left:14px; }
.crm-table [data-sort] { display:inline-flex; align-items:center; gap:4px; min-height:28px; padding:3px 7px; border:0; border-radius:6px; font-size:12px; font-weight:600; color:var(--muted); }
.crm-table th[aria-sort]:not([aria-sort=none]) button { color:var(--ink); }
.crm-table tbody :is(th,td) { background:white; padding:8px 6px; border-block:1px solid var(--line); }
.crm-table tbody th { position:sticky; left:0; z-index:1; padding-left:12px; min-width:168px; border-left:1px solid var(--line); border-radius:12px 0 0 12px; }
.crm-table tbody tr > :last-child { border-right:1px solid var(--line); border-top-right-radius:12px; border-bottom-right-radius:12px; padding-right:12px; }
.crm-table tbody tr:is(:hover,:focus-within) > * { background-color:#fafbfd; border-color:#cad1d8; }
.crm-identity { display:flex; align-items:center; gap:10px; min-height:38px; text-align:left; border:0; border-radius:8px; padding:2px 6px; }
.crm-table .crm-identity:hover { background:transparent; }
.crm-identity:hover strong { text-decoration:underline; text-underline-offset:3px; }
.crm-identity strong,.crm-identity small { display:block; }
.crm-identity small { margin-top:2px; font-size:11px; color:var(--muted); font-weight:400; }
.crm-avatar { display:grid; place-items:center; flex:none; width:32px; height:32px; border-radius:50%; font-weight:600; font-size:12px; }
.crm-table .crm-value { box-sizing:border-box; height:32px; min-height:32px; max-width:100%; padding:4px 7px; background-color:transparent; border:1px solid transparent; border-radius:7px; color:inherit; font:inherit; font-size:12px; }
.crm-table select.crm-value { field-sizing:content; padding-inline:8px 25px; background-position:right 6px center; background-size:14px; cursor:pointer; }
.crm-table .crm-value:hover { background-color:#f0f3f5; border-color:#d0d7dd; }
.crm-table select[data-cell=stage] { border-radius:20px; font-weight:600; }
:is(.crm-table,.crm-form-grid) .sage { --fill:#e4efe3; --text:#315c3c; }
:is(.crm-table,.crm-form-grid) .blue { --fill:#e4edf8; --text:#345983; }
:is(.crm-table,.crm-form-grid) .violet { --fill:#efe7f5; --text:#705087; }
:is(.crm-table,.crm-form-grid) .sand { --fill:#f4edd6; --text:#705723; }
:is(.crm-table,.crm-form-grid) .rose { --fill:#f6e4e4; --text:#854548; }
 :is(.crm-table,.crm-form-grid) .teal { --fill:#dcf0ef; --text:#225e62; }
 :is(.crm-table,.crm-form-grid) .amber { --fill:#ffe8c8; --text:#845012; }
 :is(.crm-table,.crm-form-grid) .indigo { --fill:#e5e8ff; --text:#454f8d; }
 :is(.crm-table,.crm-form-grid) .slate { --fill:#e9ebee; --text:#505b66; }
 :is(.crm-table,.crm-form-grid) :is(.crm-avatar,select.crm-value):is(.sage,.blue,.violet,.sand,.rose,.teal,.amber,.indigo,.slate) { color:var(--text); background-color:var(--fill); }
.crm-table .crm-date { min-height:32px; padding:4px 8px; border:1px solid transparent; font-size:12px; white-space:nowrap; }
.crm-table .crm-date:hover { border-color:var(--control-border); }
.crm-table .crm-date.crm-due { color:#904820; background-color:#fff2e5; }
.crm-table select[data-cell=stage]:hover { border-color:currentColor; }
.crm-table select.crm-value:has(option[value=""]:checked) { color:var(--muted); }
.crm-table input.crm-due { color:#904820; background-color:#fff2e5; }
.crm-table input[type=number] { width:60px; }
.clients-page :is(button,summary,.crm-value):focus-visible { outline:2px solid var(--ink); outline-offset:1px; }
.crm-foot { justify-content:space-between; padding:8px 0; font-size:12px; color:var(--muted); }
.crm-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.crm-form-grid .crm-value { width:100%; min-width:0; }
@media(max-width:640px){
 .crm-toolbar .search-wrap { flex-basis:100%; }
 .crm-toolbar { gap:8px; }
 .crm-toolbar > label { flex:1; min-width:0; }
 .crm-toolbar select { width:100%; }
 .crm-views { gap:2px; }
 .crm-views button { font-size:12px; padding-inline:8px; }
 .crm-table tbody th { min-width:144px; padding-left:6px; }
}
/* Options uses the same workspace frame as Notices. */
.resources-page .access-main { container-type:inline-size; }
.resources-page .resource-layout { display:grid; grid-template-columns:minmax(0,1fr); align-items:start; gap:24px; }
@container(min-width:850px){
 .resources-page .resource-layout { grid-template-columns:minmax(0,1fr) minmax(0,2fr); }
}
.resources-page .resource-section { min-width:0; background:white; border:1px solid var(--line); border-radius:20px; }
.resource-header { display:flex; align-items:center; gap:10px; padding:18px 20px; }
.resource-header h2 { margin:0; font-size:17px; letter-spacing:-.025em; }
.resource-header .resource-symbol { display:grid; place-items:center; flex:none; width:32px; height:32px; border-radius:10px; background:var(--surface-panel); }
.resource-symbol .icon,.reply-edit .icon { width:16px; height:16px; }
.resource-header [data-new-reply] { margin-left:auto; min-height:36px; padding:7px 12px; font-size:13px; }
.resource-section .catalog-list { gap:8px; padding:0 20px 20px; }
.resource-section .reply-directory { margin:0 20px 8px; }
.reply-entry { box-sizing:border-box; display:grid; grid-template-columns:minmax(135px,.7fr) minmax(0,2fr) 30px; align-items:center; gap:16px; width:100%; padding:15px 6px; text-align:left; border:0; border-radius:0; border-top:1px solid var(--line); background:transparent; }
.reply-entry strong { color:var(--ink); font-size:14px; overflow-wrap:anywhere; }
.reply-copy { color:var(--muted); font-size:13px; line-height:1.55; overflow-wrap:anywhere; white-space:pre-line; }
.reply-variable { font-weight:700; color:#6d28d9; background:#ede9fe; border-radius:4px; padding:1px 4px; }
.reply-edit { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; color:var(--muted); }
.resources-page .reply-entry:is(:hover,:focus-visible) { background-color:var(--surface-panel); border-color:var(--line); }
.reply-entry:is(:hover,:focus-visible) .reply-edit { background:white; color:var(--ink); }
.resource-insert { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.resource-insert button { padding:4px 10px; min-height:30px; font-size:12px; }
@media(max-width:680px){
 .resources-page .resource-layout { gap:16px; }
 .resource-header { padding:14px; gap:8px; flex-wrap:wrap; }
 .resource-header h2 { font-size:16px; }
 .resource-header [data-new-reply] { margin-left:0; }
 .resource-section .catalog-list { padding:0 14px 16px; }
 .resource-section .reply-directory { margin-inline:14px; }
 .reply-entry { grid-template-columns:minmax(0,1fr) 30px; gap:3px 8px; padding:12px 4px; }
 .reply-copy { grid-column:1; }
 .reply-edit { grid-column:2; grid-row:1/3; }
}
.crm-history { border-top:1px solid var(--line); padding-top:12px; }
.crm-history h3 { margin:0 0 8px; font-size:14px; }
.crm-history [data-client-history] { display:flex; flex-wrap:wrap; align-items:center; gap:6px; font-size:13px; color:var(--muted); }
.crm-history button { min-height:34px; padding:6px 12px; font-size:12px; }

/* Shared rhythm for the workspace panels and their local editors. */
:is(.clients-page,.resources-page) .access-heading { align-items:flex-start; }
:is(.clients-page,.resources-page) .access-heading h1:focus { outline:0; }
.crm-mobile-sort,.crm-expand { display:none; }
.crm-editor .crm-fieldset { margin:0; padding:12px 0 0; border:0; border-top:1px solid var(--line); min-width:0; }
.crm-fieldset legend { padding-right:8px; font-weight:650; color:var(--ink); }
.crm-editor[open] { padding:0; overflow:hidden; }
.crm-editor > form { display:flex; flex-direction:column; max-height:calc(100dvh - 54px); }
.crm-editor form > header,.crm-editor form > .dialog-actions { flex:none; padding:14px 22px; margin:0; align-items:center; }
.crm-editor form > header { border-bottom:1px solid var(--line); }
.crm-editor form > header h2 { margin:0; }
.crm-editor form > .form-stack { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:18px 22px; gap:14px; }
.crm-editor form .form-field { margin:0; gap:5px; }
.crm-editor .form-field input,.crm-editor .form-field select { font-weight:400; margin:0; }
.crm-editor input[type=date] { padding-inline:8px; }
.crm-editor .form-error { margin:0 22px; }
.crm-editor .form-error:empty { display:none; }
.file-empty { display:grid; justify-items:center; text-align:center; gap:8px; padding:22px 12px; background:var(--surface-panel); border-radius:14px; }
.file-empty small { color:var(--muted); }
#reply-form .quick-options .template-options { display:grid; gap:0; max-height:min(240px,32dvh); overflow-y:auto; }
#reply-form .quick-options [data-snippet] { display:grid; justify-items:start; gap:3px; background:transparent; border:0; padding:9px 10px; width:100%; min-width:0; }
#reply-form .quick-options [data-snippet]:hover { background:var(--surface-panel); }
.quick-options [data-snippet] > span { display:block; width:100%; color:var(--muted); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.resources-page .resource-section { overflow:hidden; }
.resource-header { gap:10px; }
.resource-section .reply-directory { margin:0; }
.resource-section .reply-entry { padding-inline:20px; }
.resource-section .reply-entry:focus-visible { outline-offset:-3px; }
.resources-page .catalog-list { column-gap:9px; row-gap:12px; }
@media(prefers-reduced-motion:no-preference){
 .crm-editor[open],.feedback-editor[open],.resources-page + dialog[open],.crm-columns[open] .crm-column-menu,#tag-filter:not([hidden]),#conversation-tag-picker:popover-open,#reply-form .quick-options:not([hidden]) { animation:panel-appear 150ms ease-out; }
 @keyframes panel-appear { from { opacity:.2; transform:translateY(4px); } }
 .crm-expand svg { transition:transform 150ms ease; }
}
@media(max-width:680px){
 .clients-page .access-heading,.resources-page .access-heading { align-items:flex-start; gap:12px; margin-bottom:18px; }
 .clients-page .access-heading-actions { justify-content:flex-start; gap:8px; }
 .crm-views { flex-wrap:wrap; gap:2px; padding-bottom:8px; }
 .crm-views button { white-space:nowrap; min-height:38px; flex:none; }
 .crm-toolbar { padding-top:12px; }
 .crm-mobile-sort { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; color:var(--muted); padding:6px 0; }
 .crm-mobile-sort select { min-height:34px; background-color:transparent; border-color:transparent; padding:4px 28px 4px 8px; background-position:right 4px center; }
 .crm-scroll { overflow:visible; }
 .crm-table,.crm-table tbody { display:block; }
 .crm-table thead { display:none; }
 .crm-table tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:10px 12px; gap:6px 10px; background:white; border:1px solid var(--line); border-radius:16px; margin-bottom:8px; }
 .crm-table tbody tr > :is(th,td,th:first-child,td:last-child) { position:static; border:0; border-radius:0; min-width:0; padding:0; background:transparent; }
 .crm-table tbody tr th { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; }
 .crm-identity { padding-inline:0; }
 .crm-table .crm-expand { display:grid; place-items:center; flex:none; width:36px; min-height:36px; padding:0; border-radius:50%; }
 .crm-expand[aria-expanded=true] svg { transform:rotate(180deg); }
 .crm-table tbody td { display:none; }
 .crm-table tbody td[data-key=stage],.crm-table tbody .crm-expanded td { display:grid; justify-items:start; gap:2px; }
 .crm-table tbody td[data-key=stage] { grid-column:1/-1; }
 .crm-table tbody .crm-expanded td::before { content:attr(data-label); font-size:11px; font-weight:600; color:var(--muted); }
 .crm-table .crm-value,.crm-table .crm-date { height:36px; min-height:36px; max-width:100%; }
 .crm-editor form > header,.crm-editor form > .form-stack,.crm-editor form > .dialog-actions { padding-inline:16px; }
 .resource-header { padding:14px; }
 .resource-header h2 { flex:1; }
 .resource-header [data-new-reply] { width:36px; height:36px; padding:0; min-width:36px; font-size:0; display:grid; place-items:center; border-radius:50%; }
 .resource-header [data-new-reply] .icon { margin:0; width:16px; }
 .resource-section .reply-entry { padding:12px 14px; }
 .resources-page .catalog-list,.chip-panel { gap:12px 9px; }
 :is(.catalog-list,.chip-panel) button { position:relative; }
 :is(.catalog-list,.chip-panel) button::after { content:""; position:absolute; inset:-5px -3px; }
}

#reply-form .quick-options[popover] { position:fixed; margin:0; inset:auto; width:min(360px,calc(100vw - 16px)); box-sizing:border-box; }
#reply-form .quick-options[popover]:not(:popover-open) { display:none; }
.feedback-editor .form-error:empty { display:none; }
.feedback-editor .form-stack > .dialog-actions { margin:0; }
@media(max-width:680px) {
 .clients-page .access-heading .access-heading-actions { width:auto; align-self:flex-start; justify-content:flex-start; }
 .resource-header [data-new-reply]:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
}
/* The local review banner shares viewport height with the application. */
body:has(> div:first-child > a[href="/demo"]) { height:100dvh; display:flex; flex-direction:column; }
body:has(> div:first-child > a[href="/demo"]) > #root { flex:1; min-height:0; }
body:has(> div:first-child > a[href="/demo"]) .shell { height:100%; min-height:0; }

.tag-color-field { border:0; padding:0; margin:0; min-width:0; }
.tag-color-field legend { padding:0; margin-bottom:8px; font-size:13px; font-weight:600; }
.tag-color-options { display:flex; flex-wrap:wrap; gap:8px; }
.tag-color-option { position:relative; display:grid; place-items:center; width:32px; height:32px; cursor:pointer; }
.tag-color-option input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }
.tag-color-option span { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:color-mix(in srgb,var(--chip-ink) 16%,white); color:var(--chip-ink); pointer-events:none; }
.tag-color-option input:checked + span::after { content:"✓"; font-weight:700; }
.tag-color-option input:checked + span { box-shadow:0 0 0 2px var(--chip-ink); }
.tag-color-option input:focus-visible + span { outline:2px solid var(--ink); outline-offset:4px; }

/* Form review: shared field rhythm, quiet sections and an unclipped corner close. */
dialog.form-popup[open],
#access-dialog.form-popup {
  padding: 0;
  overflow: visible;
  max-width: calc(100vw - 56px);
  max-height: calc(100dvh - 64px);
}
.form-popup > .popup-content {
  padding: 28px;
  max-height: calc(100dvh - 66px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
}
dialog.form-popup > .popup-close,
#access-dialog.form-popup > #close-access-dialog {
  position: absolute;
  inset: -18px -18px auto auto;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface, #fff);
  color: var(--ink);
  box-shadow: 0 4px 14px #20212414;
}
.form-popup > .popup-close:hover { background: var(--surface-inset, #f3f3ef); }
.form-popup > .popup-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.form-popup .popup-close .icon { margin: 0; width: 18px; height: 18px; }
.form-popup .popup-content > header,
.form-popup .popup-content > form > header {
  padding: 0;
  margin: 0 0 20px;
  border: 0;
}
.form-popup .popup-content > form > header { margin-bottom: 0; }
.form-popup header h2 { margin: 0; padding-right: 8px; }
.form-popup .popup-content > p { margin: 0 0 20px; }
.form-popup form:not(.row-actions), .form-popup .form-stack { display: grid; gap: 16px; min-width: 0; }
.form-popup .form-field, .form-popup label:not(.scope-option) { display: grid; gap: 6px; min-width: 0; margin: 0; }
.form-popup :is(input:not([type=checkbox]), select, textarea) { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; margin: 0; }
.form-popup :is(input:not([type=checkbox]), select) { min-height: 44px; padding: 10px 12px; }
.form-popup textarea { padding: 12px; line-height: 1.5; }
.form-popup :is(.field-help, .form-error) { margin: 0; }
.form-popup .form-error:empty { display: none; }
.form-popup :is(fieldset, .crm-fieldset) { min-width: 0; margin: 4px 0 0; padding: 0; border: 0; }
.form-popup legend { padding: 0; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.form-popup fieldset > .field-help { margin: 8px 0; }
.form-popup .scope-option { padding-block: 6px; gap: 10px; }
.form-popup .scope-option input { flex-shrink: 0; margin-top: 3px; }
.form-popup .form-pair, .form-popup .crm-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-popup .dialog-actions,
.form-popup form > .dialog-actions,
.form-popup .form-stack > .dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 4px 0 0; padding: 0; border: 0; position: static; }
.form-popup .dialog-actions button, .form-popup button[type=submit] { margin: 0; }
.form-popup .popup-content > .dialog-actions { margin-top: 20px; }
.form-popup.crm-editor .popup-content > form { display: grid; max-height: none; }
.form-popup.crm-editor form > .form-stack { overflow: visible; padding: 0; gap: 16px; }
.form-popup .crm-history, .form-popup .team-members-section { border: 0; margin-top: 4px; padding-top: 0; }
.form-popup .team-members-section { margin-top: 24px; }
.form-popup #scope-selection { display: grid; gap: 16px; margin-top: 16px; }
@media (max-width: 600px) {
  .form-popup > .popup-content { padding: 24px 18px; }
  .form-popup .form-pair, .form-popup .crm-form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-popup .dialog-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-popup .dialog-actions > button { width: 100%; justify-content: center; }
  dialog.mobile-nav-dialog.form-popup { inset: 32px 28px 32px auto; width: min(360px, calc(100vw - 56px)); height: auto; border-radius: 24px; }
}

/* Client views share a persistent sliding pill, including wrapped mobile tabs. */
.crm-views { position:relative; isolation:isolate; }
.crm-view-highlight { position:absolute; top:0; left:0; z-index:-1; border-radius:22px; background:var(--ink); pointer-events:none; }
.crm-tabs-ready .crm-view-highlight { transition:transform 420ms cubic-bezier(.22,1,.36,1),width 420ms cubic-bezier(.22,1,.36,1),height 300ms ease; }
.crm-views button { transition:color 180ms ease,background-color 180ms ease; }
.crm-views button[aria-pressed=true],.crm-views button[aria-pressed=true]:hover { background:transparent; color:white; }
.clients-page .crm-scroll { max-height:none; overflow:visible; position:relative; isolation:isolate; overflow-anchor:none; scroll-padding-block:48px; }
.crm-table thead { position:sticky; top:0; z-index:110; background:var(--canvas); }
.crm-stacking tbody tr { position:sticky; top:calc(var(--crm-header-inset,48px) + var(--crm-top,0px)); z-index:var(--crm-layer,1); transform:translateY(var(--crm-shift,0px)) scale(var(--crm-scale,1)); transform-origin:50% 0; opacity:var(--crm-opacity,1); }
.crm-stacking tbody tr.crm-buried { pointer-events:none; }
@media(max-width:680px){
 .crm-stacking tbody tr { top:calc(8px + var(--crm-top,0px)); }
 .clients-page .crm-scroll { padding:2px; }
 .crm-foot { gap:8px; }
}
@media(prefers-reduced-motion:reduce){
 .crm-tabs-ready .crm-view-highlight,.crm-views button { transition:none; }
}
@media(max-width:680px){
 .crm-toolbar > label { flex:1 1 calc(50% - 8px); }
 .crm-toolbar > label:has([data-page-size]) { flex:1 1 150px; }
 .crm-toolbar .crm-columns { flex:0 0 auto; }
}
.form-popup #notice-form footer { padding: 0; }
.form-popup #notice-form label:not(.scope-option) { gap: 6px; }
.form-popup [hidden] { display: none !important; }

/* The workspace owns scrolling; the table header is a quiet, sticky toolbar. */
.clients-page .crm-table thead { top:12px; background:transparent; }
.clients-page .crm-table thead th { height:44px; padding:5px 4px; box-sizing:border-box; border-block:1px solid #d5dce3; background:#e6ebf0; }
.clients-page .crm-table thead th:first-child { border-left:1px solid #d5dce3; padding-left:5px; border-radius:14px 0 0 14px; }
.clients-page .crm-table thead th:last-child { border-right:1px solid #d5dce3; padding-right:5px; border-radius:0 14px 14px 0; }
.clients-page .crm-table [data-sort] { width:100%; justify-content:space-between; gap:12px; min-height:32px; height:32px; box-sizing:border-box; border-radius:9px; padding:6px 10px; color:#596777; font-size:11px; letter-spacing:.025em; white-space:nowrap; }
.clients-page .crm-table [data-sort]:hover { background:#d9e1e9; color:var(--ink); }
.clients-page .crm-table th[aria-sort]:not([aria-sort=none]) button { background:white; color:var(--ink); box-shadow:0 1px 3px #23324414; }
.clients-page .crm-table [data-sort] span { min-width:12px; font-size:13px; opacity:.65; }
/* Native selects retain keyboard and mobile picker behavior inside the avatar. */
.crm-owner-picker { position:relative; display:inline-grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#f1f4f7; border:1px dashed #b9c5d0; color:#627387; box-sizing:border-box; }
.crm-owner-picker.is-assigned { background:#e4eaf6; color:#40577e; border-style:solid; border-color:#d5deee; }
.crm-owner-picker > span { display:grid; place-items:center; font-size:11px; font-weight:650; pointer-events:none; }
.clients-page .crm-owner-picker select[data-cell=owner] { position:absolute; inset:0; width:100%; height:100%; min-width:0; min-height:0; padding:0; opacity:0; cursor:pointer; }
.crm-owner-picker:hover { box-shadow:0 0 0 3px #64789515; }
.crm-owner-picker:focus-within { outline:2px solid var(--ink); outline-offset:3px; }
.crm-table input[type=date] { width:136px; cursor:pointer; font-variant-numeric:tabular-nums; }
.crm-toolbar .crm-filter-toggle { display:grid; place-items:center; width:40px; height:40px; min-width:40px; min-height:40px; padding:0; flex:none; border-radius:50%; border:1px solid var(--control-border); background:white; }
.crm-filter-toggle[aria-expanded=true],.crm-filter-toggle.has-filters { background:var(--ink); color:white; border-color:var(--ink); }
.crm-filter-toggle.has-filters::after { content:""; position:absolute; width:6px; height:6px; border-radius:50%; background:#e9773b; transform:translate(14px,-14px); border:2px solid var(--surface-panel); }
.crm-filter-bar { display:flex; flex-wrap:wrap; align-items:end; gap:12px; padding:16px; margin:10px 0; background:#e9eef3; border:1px solid #d8e0e8; border-radius:16px; animation:crm-filters-in 200ms ease-out; }
.crm-filter-bar[hidden] { display:none; }
.crm-filter-bar label { display:grid; gap:6px; flex:1 1 130px; min-width:0; color:var(--muted); font-size:11px; font-weight:600; }
.crm-filter-bar :is(select,input) { box-sizing:border-box; width:100%; min-width:0; height:36px; min-height:36px; border:1px solid #d5dee7; border-radius:9px; background-color:white; padding:6px 10px; font-size:12px; color:var(--ink); }
.crm-filter-bar select { padding-right:28px; background-position:right 7px center; }
.crm-filter-bar [data-clear-filters] { min-height:36px; font-size:12px; }
.clients-page .crm-table [data-sort] span:empty { display:none; }
@keyframes crm-filters-in { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
@media(prefers-reduced-motion:reduce){ .crm-filter-bar { animation:none; } }
@media(max-width:680px){
 .crm-table tbody td[data-key=owner] { display:grid; grid-column:1/-1; justify-items:start; gap:4px; }
 .crm-table tbody td[data-key=owner]::before { content:attr(data-label); font-size:11px; font-weight:600; color:var(--muted); }
 .crm-filter-bar { gap:10px; padding:12px; }
 .crm-filter-bar label { flex-basis:calc(50% - 10px); }
 .crm-toolbar .crm-filter-toggle { order:2; }
 .crm-toolbar .crm-columns { order:3; }
}

/* Skill level: a compact three-step meter with discrete editing controls. */
.crm-level { display:inline-flex; align-items:center; gap:5px; min-height:34px; --level-color:#aeb8c4; }
.crm-level[data-level="1"] { --level-color:#479d68; }
.crm-level[data-level="2"] { --level-color:#d5a92b; }
.crm-level[data-level="3"] { --level-color:#d66361; }
.crm-level-bars { display:flex; align-items:flex-end; gap:4px; height:23px; padding:2px 0; }
.crm-level-bars i { display:block; width:6px; height:8px; border-radius:2px; background:#dce2e8; transition:background-color 180ms ease; }
.crm-level-bars i:nth-child(2) { height:14px; }
.crm-level-bars i:nth-child(3) { height:21px; }
.crm-level-bars i.filled { background:var(--level-color); }
.crm-level button { display:grid; place-items:center; padding:0; width:23px; height:28px; min-height:28px; border:0; border-radius:7px; font-size:21px; line-height:1; color:#657589; opacity:0; transition:opacity 140ms ease,background-color 140ms ease; }
.crm-level:is(:hover,:focus-within) button { opacity:1; }
.crm-level button:hover:not(:disabled) { background:#e8edf2; color:var(--ink); }
.crm-level:is(:hover,:focus-within) button:disabled { opacity:.25; }
.crm-table input[type=date] { width:102px; padding-inline:6px 3px; font-size:11px; }
.crm-table input[type=date]::-webkit-calendar-picker-indicator { margin-left:2px; padding:2px; width:13px; height:13px; opacity:.6; }
.crm-stage-chip { display:inline-flex; align-items:center; gap:8px; min-height:30px; padding:5px 10px; border:1px solid transparent; border-radius:18px; color:var(--text,#505b66); background:var(--fill,#e9ebee); font-size:11px; font-weight:600; line-height:1.3; white-space:nowrap; }
button.crm-stage-chip:hover,button.crm-stage-chip[aria-expanded=true] { border-color:currentColor; background:var(--fill,#e9ebee); }
.crm-stage-chip.sage { --fill:#e4efe3; --text:#315c3c; }
.crm-stage-chip.blue { --fill:#e4edf8; --text:#345983; }
.crm-stage-chip.violet { --fill:#efe7f5; --text:#705087; }
.crm-stage-chip.amber { --fill:#ffe8c8; --text:#845012; }
.crm-stage-chip.indigo { --fill:#e5e8ff; --text:#454f8d; }
.crm-stage-chip.rose { --fill:#f6e4e4; --text:#854548; }
.crm-stage-chip.teal { --fill:#dcf0ef; --text:#225e62; }
.crm-stage-chip.sand { --fill:#f4edd6; --text:#705723; }
.crm-stage-chip.slate { --fill:#e9ebee; --text:#505b66; }
.crm-stage-menu { position:fixed; inset:auto; margin:0; padding:7px; box-sizing:border-box; max-height:calc(100dvh - 24px); overflow:auto; border:1px solid #dce3eb; border-radius:17px; background:#fff; color:var(--ink); box-shadow:0 12px 36px #25354924,0 2px 6px #2535490d; }
.crm-stage-menu:popover-open { display:grid; gap:2px; animation:crm-filters-in 140ms ease-out; }
.crm-stage-menu > button { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:39px; padding:5px 7px; border:0; border-radius:10px; background:transparent; }
.crm-stage-menu > button:is(:hover,:focus-visible),.crm-stage-menu > button[aria-selected=true] { background:#f0f4f7; }
.crm-stage-menu > button:focus-visible { outline:2px solid #9baec3; outline-offset:-2px; }
.crm-stage-menu .crm-stage-chip { min-height:26px; padding:4px 9px; }
.crm-stage-menu > button > span:last-child { color:#60758b; font-size:13px; }
@media(hover:none){
 .crm-level button { opacity:1; width:28px; height:34px; }
 .crm-level button:disabled { opacity:.25; }
}
@media(prefers-reduced-motion:reduce){
 .crm-level button,.crm-level-bars i { transition:none; }
 .crm-stage-menu:popover-open { animation:none; }
}

/* Shared picker for native form controls, filters and inline client fields. */
.form-select-menu .form-select-option-content { display:flex; align-items:center; gap:9px; min-width:0; text-align:left; }
.form-select-menu .crm-stage-chip { white-space:normal; overflow-wrap:anywhere; text-align:left; }
.form-select-menu .form-select-neutral { background:#f0f3f6; color:#46576a; }
.form-select-menu .form-select-avatar { display:grid; place-items:center; flex:none; width:29px; height:29px; border:1px solid #d5deee; border-radius:50%; background:#e4eaf6; color:#40577e; font-size:10px; font-weight:650; }
.form-select-menu .form-select-avatar + .crm-stage-chip { background:transparent; padding:0; }
.form-select-menu .form-select-check { flex:none; min-width:14px; }
.form-select-menu .form-select-group { padding:10px 10px 5px; font-size:10px; font-weight:650; letter-spacing:.04em; color:#7a8797; }
.form-select-menu > button:disabled { opacity:.4; cursor:not-allowed; }
.form-select-menu > button:disabled:hover { background:transparent; }
select[aria-expanded=true] { outline:2px solid #9baec3; outline-offset:1px; }

/* Operational notice editor: explicit field and checkbox layout. */
dialog.notice-editor { width:min(760px,calc(100vw - 40px)); }
.notice-editor #notice-form { gap:20px; }
.notice-editor .notice-unified-help { color:var(--muted); font-size:13px; }
.notice-editor #notice-form textarea { min-height:80px; }
.notice-editor #notice-form > .notice-scope-fields { min-width:0; margin:0; padding:0; border:0; background:transparent; }
.notice-editor #scope-selection { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin:20px 0; }
.notice-editor #notice-form .notice-target-group { margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.notice-editor #notice-form .notice-target-group legend { margin-bottom:4px; font-size:13px; }
.notice-editor .notice-checkboxes { display:grid; gap:6px; margin-top:10px; }
.notice-editor #notice-form label.scope-option { display:flex; flex-direction:row; align-items:flex-start; gap:10px; padding:10px 12px; margin:0; min-width:0; border:1px solid #dce3e9; border-radius:10px; background:white; cursor:pointer; font-size:13px; font-weight:400; line-height:1.5; }
.notice-editor #notice-form label.scope-option:has(input:checked) { border-color:#83988c; background:#eef4f0; }
.notice-editor #notice-form label.scope-option input[type=checkbox] { appearance:auto; flex:0 0 18px; width:18px; height:18px; min-height:18px; margin:1px 0 0; padding:0; accent-color:var(--ink); }
.notice-editor #notice-form label.scope-option span { min-width:0; overflow-wrap:anywhere; }
.notice-editor #notice-form label.scope-option:focus-within { outline:2px solid #83988c; outline-offset:2px; }
.notice-editor #notice-form > .field-help { margin-top:-10px; }
.notice-editor #notice-form .dialog-actions { padding-top:4px; }
@media(max-width:600px){
 .notice-editor #scope-selection { grid-template-columns:minmax(0,1fr); gap:20px; }
}

.notice-editor .notice-text-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.notice-editor .notice-text-fields label { align-content:start; }
@media(max-width:600px){ .notice-editor .notice-text-fields { grid-template-columns:minmax(0,1fr); } }

/* Palette in the stylesheet: compatible with the production CSP. */
[data-tag-color="#25753a"] { --chip-ink:#25753a; }
[data-tag-color="#2859b7"] { --chip-ink:#2859b7; }
[data-tag-color="#896300"] { --chip-ink:#896300; }
[data-tag-color="#8139a2"] { --chip-ink:#8139a2; }
[data-tag-color="#c51d28"] { --chip-ink:#c51d28; }
[data-tag-color="#a54b08"] { --chip-ink:#a54b08; }
[data-tag-color="#077777"] { --chip-ink:#077777; }
[data-tag-color="#a12e70"] { --chip-ink:#a12e70; }
[data-tag-color="#4f46a5"] { --chip-ink:#4f46a5; }
[data-tag-color="#526b26"] { --chip-ink:#526b26; }
[data-tag-color="#865441"] { --chip-ink:#865441; }
[data-tag-color="#526173"] { --chip-ink:#526173; }

/* Persistent inbox pill: same easing and travel as the client view tabs. */
.shell .queue-status { position:relative; isolation:isolate; padding:4px; border:0; border-radius:16px; background:#fff; }
.queue-view-highlight { position:absolute; inset:0 auto auto 0; z-index:0; border-radius:12px; background:var(--ink); pointer-events:none; }
.motion-tabs-ready .queue-view-highlight { transition:transform 420ms cubic-bezier(.22,1,.36,1),width 420ms cubic-bezier(.22,1,.36,1),height 300ms ease; }
.shell .queue-status button { position:relative; z-index:1; border:0; border-radius:12px; transition:color 180ms ease; }
/* Only the sliding marker paints a tab background, including hover/press. */
.shell .queue-status.motion-tabs-ready button.quiet,
.shell .queue-status.motion-tabs-ready button.quiet:is(:hover,:active,:focus-visible) { background:transparent; box-shadow:none; }
.shell .queue-status.motion-tabs-ready button[aria-pressed=true],
.shell:is(:not(.has-workspace),:has(> .voice-workspace)) > .list .queue-status.motion-tabs-ready button[aria-pressed=true] { background:transparent; color:white; }
@media(prefers-reduced-motion:no-preference) {
 @keyframes interface-reveal { from { opacity:0; translate:0 14px; } to { opacity:1; translate:0 0; } }
 @keyframes dialog-reveal { from { opacity:0; translate:0 20px; scale:.97; } to { opacity:1; translate:0 0; scale:1; } }
 @keyframes backdrop-reveal { from { opacity:0; } to { opacity:1; } }
 dialog.form-popup[open],dialog[open] { animation:dialog-reveal 360ms cubic-bezier(.22,1,.36,1); }
 dialog[open]::backdrop { animation:backdrop-reveal 240ms ease-out; }
 dialog[open] :is(.form-stack,.form-pair,.crm-form-grid,#notice-form) > :not(dialog),
 dialog[open] .dialog-actions { animation:interface-reveal 420ms cubic-bezier(.22,1,.36,1) backwards; animation-delay:60ms; }
 dialog[open] :is(.form-stack,.form-pair,.crm-form-grid,#notice-form) > :nth-child(2) { animation-delay:100ms; }
 dialog[open] :is(.form-stack,.form-pair,.crm-form-grid,#notice-form) > :nth-child(3) { animation-delay:140ms; }
 dialog[open] :is(.form-stack,.form-pair,.crm-form-grid,#notice-form) > :nth-child(4) { animation-delay:180ms; }
 dialog[open] :is(.form-stack,.form-pair,.crm-form-grid,#notice-form) > :nth-child(n+5) { animation-delay:220ms; }
 .nav button { transition:background-color 180ms ease,color 180ms ease,scale 220ms cubic-bezier(.22,1,.36,1); }
 .nav button:active { scale:.94; }
 .tag-chip { transition:background-color 180ms ease,scale 200ms ease; }
 .tag-chip:hover { scale:1.045; }
 .tag-chip:active { scale:.96; }
 :is(.form-field,.form-popup) :is(input,textarea,select) { transition:border-color 180ms ease,box-shadow 180ms ease; }
 :is(#tag-filter,#reply-form .quick-options):not([hidden]),#conversation-tag-picker:popover-open,
 details[open] > :not(summary) { animation:interface-reveal 260ms cubic-bezier(.22,1,.36,1); }
}
@media(prefers-reduced-motion:reduce) {
 .motion-tabs-ready .queue-view-highlight,.shell .queue-status button { transition:none; }
}

/* Bot settings follows Options cards and the shared client editor. */
.bot-settings-host{margin:0 0 24px}.bot-settings{width:100%}.bot-settings .resource-header{padding:22px 24px;gap:12px}.bot-heading{flex:1;min-width:0}.bot-heading p{margin:5px 0 0;font-size:13px;color:var(--muted)}.bot-status{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);background:#f3f4f5;padding:6px 10px;border-radius:20px}.bot-status>span{width:6px;height:6px;background:#93979d;border-radius:50%}.bot-status.is-active{background:#edf6ef;color:#376749}.bot-status.is-active>span{background:#48885b}
.bot-current{padding:4px 24px 0}.bot-eyebrow{font-size:10px;font-weight:700;letter-spacing:.09em;color:var(--muted);margin:10px 0 12px}.bot-instruction{font-size:16px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;max-width:84ch;margin:0 0 14px}.bot-meta{font-size:12px;color:var(--muted);margin:0;line-height:1.6}.bot-current h3{font-size:17px;margin:12px 0 8px}.bot-empty{font-size:14px;color:var(--muted);line-height:1.65;max-width:65ch;margin:0 0 24px}.bot-current-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-top:24px;padding:16px 0;border-top:1px solid var(--line)}.bot-scope{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}.bot-scope .icon{width:15px;height:15px}.bot-actions{display:flex;gap:8px;align-items:center}.bot-actions button{font-size:13px;min-height:38px}.bot-current>.form-error:empty{display:none}.bot-settings .primary,.bot-editor .primary{background:#171717;border-color:#171717;color:white}.bot-settings .primary:hover,.bot-editor .primary:hover{background:#333}
.bot-history{padding:20px 24px;border-top:1px solid var(--line);background:#fafbfc}.bot-history-heading{display:flex;gap:12px;align-items:center;margin-bottom:8px}.bot-history-heading h3{font-size:13px;margin:0}.bot-history-heading>span{font-size:11px;color:var(--muted)}.bot-history ol{padding:0;margin:0;list-style:none}.bot-history li+li{border-top:1px solid var(--line)}.bot-history summary{display:flex;align-items:center;gap:12px;padding:13px 0;cursor:pointer;list-style:none}.bot-history summary::-webkit-details-marker{display:none}.bot-history-dot{width:7px;height:7px;background:#64866c;border-radius:50%;flex:none}.bot-history-dot.is-off{background:#a4a7ae}.bot-history-info{flex:1;display:flex;align-items:baseline;gap:16px;min-width:0}.bot-history-info strong{font-size:12px;font-weight:600;min-width:78px}.bot-history-info>span,.bot-history-peek{font-size:12px;color:var(--muted)}.bot-history-peek{white-space:nowrap}.bot-history-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.6;padding:14px 16px;background:white;border:1px solid var(--line);border-radius:12px;margin:0 0 14px 19px}.bot-history-more>summary{font-size:12px;text-decoration:underline;color:var(--muted)}
.bot-editor{width:min(580px,calc(100vw - 40px))}.bot-editor-intro{font-size:14px;color:var(--muted);margin:0 0 24px;line-height:1.6}.bot-editor textarea{width:100%;min-height:170px;resize:vertical;line-height:1.6}.bot-editor-caption{display:flex;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted);margin-top:8px}.bot-editor-note{display:flex;gap:10px;align-items:flex-start;padding:14px 16px;background:var(--surface-panel);border-radius:12px;margin-top:20px}.bot-editor-note .icon{width:16px;height:16px;flex:none;margin-top:2px}.bot-editor-note p{font-size:12px;color:var(--muted);line-height:1.6;margin:0}.bot-editor .dialog-actions{justify-content:flex-end;gap:10px}.bot-editor button:disabled{opacity:.4;cursor:not-allowed}
@media(max-width:680px){.bot-settings .resource-header{padding:18px 16px}.bot-heading p{font-size:12px}.bot-current{padding-inline:16px}.bot-current-footer{flex-direction:column;align-items:flex-start;gap:14px}.bot-actions{width:100%;justify-content:flex-end}.bot-history{padding:18px 16px}.bot-history-info{flex-direction:column;gap:4px}.bot-history-peek{font-size:11px}.bot-instruction{font-size:15px}.bot-editor-caption{font-size:11px}.bot-status{margin-left:44px}.bot-editor .dialog-actions button{flex:1}}

/* Compact conversation queue: two lines per card and on-demand search. */
.shell > .list:has(#rows) .list-head { padding: 12px 12px 8px; }
.shell > .list:has(#rows) .list-heading { gap: 4px 8px; margin-bottom: 6px; }
.shell > .list #list-title { font-size: 25px; line-height: 1.1; }
.shell > .list:has(#rows) .live { font-size: 10px; line-height: 1.2; }
.shell > .list:has(#rows) .inbox-switch { margin: 6px 0 0; padding: 3px; border-radius: 10px; }
.shell > .list:has(#rows) .inbox-switch button { min-height: 30px; padding: 4px 10px; font-size: 12px; line-height: 1.3; border-radius: 8px; }
#conversation-search { margin-top: 8px; }
#conversation-search[hidden] { display: none; }
#search-toggle.has-search { box-shadow: inset 0 0 0 2px var(--ocelot-butttano); }
.shell > .list #rows { padding: 6px 10px 25px; }
.shell > .list #rows > .row {
  grid-template-columns: 32px minmax(0, 1fr); gap: 2px 9px;
  padding: 9px 10px; margin-bottom: 4px; min-height: 60px; border-radius: 13px;
}
.shell > .list #rows > .row .conversation-avatar { width: 32px; height: 32px; font-size: 11px; align-self: center; }
.shell > .list #rows > .row .row-top { min-width: 0; align-items: center; }
.shell > .list #rows > .row .row-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.shell > .list #rows > .row .row-preview { min-width: 0; font-size: 12px; line-height: 1.4; }

.shell > .list #rows .unread-badge { position: static; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; }
.shell > .list:has(#rows) .queue-status button { min-height: 32px; padding: 5px; font-size: 12px; }

/* Quiet progress indicator for automatic conversation pagination. */
.conversation-loading { display: flex; align-items: center; justify-content: center; flex: 0 0 24px; height: 24px; color: var(--muted); }
.conversation-loading[hidden] { display: none; }
.loading-dots { display: flex; align-items: center; gap: 4px; }
.loading-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .35; animation: conversation-loading-pulse 1.2s ease-in-out infinite; }
.loading-dots i:nth-child(2) { animation-delay: .15s; }
.loading-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes conversation-loading-pulse { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: .8; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .loading-dots i { animation: none; opacity: .55; } }

/* Keep connection feedback beside the heading, without a separate text row. */
.shell > .list:has(#rows) .list-heading { grid-template-columns: minmax(0,1fr) 6px auto; column-gap: 8px; }
.shell > .list:has(#rows) .list-heading h1 { grid-column: 1; grid-row: 1; }
.shell > .list:has(#rows) .queue-actions { grid-column: 3; grid-row: 1; }
.shell > .list:has(#rows) #live { grid-column: 2; grid-row: 1; width: 6px; height: 6px; margin: 0; padding: 0; line-height: 0; }
.shell > .list:has(#rows) #live::before { display: block; margin: 0; }
.shell > .list:has(#rows) #live[data-state="offline"]::before { background: #b87a39; }

/* Keep queue labels and counts on one line with proportional tab widths. */
.shell > .list:has(#rows) .queue-status button { flex: 1 1 auto; white-space: nowrap; }

/* Clear calendar boundaries in conversation history, including compact layouts. */
.shell > .thread #messages > .date-separator {
  align-self: center;
  flex: 0 0 auto;
  max-width: 100%;
  gap: 12px;
  margin: 16px 0 12px;
  color: #526071;
  font-size: 11px;
  font-weight: 600;
}
.shell > .thread #messages > .date-separator time {
  padding: 5px 12px;
  border: 1px solid #dce1e7;
  border-radius: 999px;
  background: #f4f6f8;
  text-align: center;
}
.shell > .thread #messages > .date-separator::before,
.shell > .thread #messages > .date-separator::after {
  width: 28px;
  background: #dce1e7;
}

/* Small, static clock in the unread-badge position for answered manual chats. */
.shell > .list #rows .waiting-indicator { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; flex:0 0 18px; color:var(--ocelot-butttano, #f56421); }
.shell > .list #rows .waiting-indicator svg { display:block; width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }

/* Virtual list: fixed slots and spacer blocks; no sticky stacking on this view. */
.shell > .list #rows.virtual-conversations > .row {height:68px;min-height:68px;max-height:68px;margin:0 0 4px;position:relative;top:auto;transform:none;opacity:1;overflow:hidden;}
#rows.virtual-conversations .row-preview {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#rows.virtual-conversations > .virtual-spacer {display:block;flex:none;width:1px;pointer-events:none;}

#rows.virtual-conversations {overflow-anchor:none;}

/* Mobile chat: identity and tags first; secondary contact tools on demand. */
#thread-details-toggle, #mobile-contact-edit, .control-label-mobile { display: none; }
#thread #related-calls-host[hidden] { display: none; }
@media (max-width: 1024px) {
  #thread { --thread-gutter: 12px; }
  #thread .thread-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 0 6px; padding: 6px 10px; }
  #thread .thread-heading { display: contents; }
  #thread .thread-head #contact-tools { display: none; }
  #thread .thread-heading > div { display: contents; }
  #thread #back-list { grid-column: 1; grid-row: 1 / 3; width: 44px; min-width: 44px; height: 44px; padding: 12px; margin: 0; }
  #thread #contact-title { grid-column: 2; grid-row: 1; align-self: end; font-size: 16px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #thread .sender-number { grid-column: 2; grid-row: 2; font-size: 11px; line-height: 16px; margin: 1px 0 0; }
  #thread-details-toggle { grid-column: 3; grid-row: 1 / 3; display: inline-flex; align-self: start; min-height: 44px; padding: 8px; font-size: 12px; }
  #thread-details-toggle[aria-expanded="true"] { background: #edf0f3; }
  #thread .thread-contact-meta { grid-column: 1 / -1; grid-row: 3; min-width: 0; flex-wrap: nowrap; gap: 6px; margin-top: 4px; overflow-x: auto; scrollbar-width: none; }
  #thread .thread-contact-meta::-webkit-scrollbar { display: none; }
  #thread #thread-status { display: none; }
  #thread .thread-labels, #thread .active-tags { display: flex; flex-wrap: nowrap; flex: 0 0 auto; gap: 4px; }
  #thread .thread-labels .tag-chip { white-space: nowrap; font-size: 10px; }
  #thread .tags-toggle { min-width: 44px; width: 44px; min-height: 44px; padding: 12px; }
  #thread .thread-head .thread-tools { display: none; }
  #thread .mobile-details-open .thread-tools { display: flex; grid-column: 1 / -1; width: 100%; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
  #thread .mobile-details-open #contact-title { white-space: normal; }
  #thread .mobile-details-open #mobile-contact-edit { display: inline-flex; min-height: 44px; align-items: center; }
  #thread .thread-tools .transfer { margin-left: auto; min-width: 0; max-width: 100%; }
  #thread .thread-contextbar { max-height: 40dvh; overflow-y: auto; flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 4px 12px 8px; }
  #thread .thread-contextbar .control-state { flex: 1 1 auto; }
  #thread .thread-contextbar .control-state strong { font-size: 11px; line-height: 18px; }
  #thread .thread-contextbar .control-actions { display: flex; flex: 1 0 100%; width: 100%; gap: 6px; order: 2; }
  #thread .control-actions > button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 8px 6px; font-size: 12px; justify-content: center; white-space: nowrap; }
  #thread .control-label-wide { display: none; }
  #thread .control-label-mobile { display: inline; }
  #thread .thread-contextbar .related-calls > summary { border: 0; min-height: 44px; padding: 4px 0; font-size: 11px; }
  #thread .thread-contextbar .related-call-content { flex: 1 0 100%; order: 3; }
  #thread .thread-contextbar :is(.control-explanation, #control-confirm) { flex: 1 0 100%; order: 4; margin: 2px 0; font-size: 11px; line-height: 1.4; }
  #thread .thread-contextbar .window-notice { padding: 6px 8px; }
  #thread .messages { padding: 10px 12px; gap: 10px; }
  #thread .messages > .message { max-width: 88%; padding: 10px 12px; }
  #thread .compose-modes { padding: 0 12px; gap: 8px; }
  #thread .compose-modes button { min-height: 44px; padding: 6px 8px; font-size: 12px; }
  #thread #reply-composer, #thread .internal-note { padding: 4px 10px max(6px, env(safe-area-inset-bottom)); }
  #thread #reply-form { grid-template-columns: minmax(0, 1fr) auto; }
  #thread #reply-form > textarea { grid-column: 1 / -1; min-height: 44px; max-height: 96px; font-size: 16px; }
  #thread #reply-form > .composer-tools { grid-column: 1; padding: 0 4px 4px; }
  #thread #reply-form > footer { grid-column: 2; padding: 0 4px 4px 0; }
  #thread #reply-form > footer:has(#check-reply:not([hidden])) { grid-column: 1 / -1; }
}
@media (max-width: 1024px) and (max-height: 520px) {
  #thread .thread-head { padding-block: 2px; }
  #thread .thread-contextbar { padding-block: 2px; }
  #thread .messages { min-height: 80px; }
}

/* Direct contact editing and persistent, compact assignment controls. */
#thread .contact-name { display: block; padding: 0; margin: 0; min-height: 32px; max-width: 100%; border: 0; border-radius: 4px; background: transparent; text-align: left; color: var(--ink); font: 600 20px/1.3 'Instrument Sans', sans-serif; overflow: hidden; text-overflow: ellipsis; }
#thread .contact-name:hover { text-decoration: underline; text-underline-offset: 3px; }
#thread .thread-tools .agent-avatar { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #eef1f5; border: 1px solid #cbd2dc; }
#thread .thread-tools .agent-avatar::after { display: none; }
#thread .thread-tools .agent-avatar .owner { flex: none; max-width: none; font-size: 13px; font-weight: 600; }
#thread #messages { overflow-anchor: none; }
#thread .history-loading { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); border-radius: 12px; background: #fff; box-shadow: 0 2px 8px #0001; margin: 0; padding: 5px 12px; font-size: 11px; text-align: center; color: var(--muted); }
#thread .history-loading[hidden] { display: none; }
@media (max-width: 1024px) {
  #thread .thread-head { grid-template-columns: 36px 36px minmax(0, 1fr) 88px; gap: 0 4px; padding: 6px 8px; }
  #thread #back-list { grid-column: 1; grid-row: 1 / 3; width: 36px; min-width: 36px; padding: 8px; }
  #thread .thread-head #contact-tools { display: inline-flex; align-items: center; justify-content: center; grid-column: 2; grid-row: 1 / 3; align-self: center; width: 36px; height: 36px; min-height: 36px; min-width: 36px; padding: 0; border-radius: 50%; font-size: 12px; }
  #thread #contact-title { grid-column: 3; grid-row: 1; font-size: 14px; line-height: 20px; min-height: 26px; align-self: end; white-space: nowrap; }
  #thread .sender-number { grid-column: 3; grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
  #thread .thread-head .thread-tools { display: flex; grid-column: 4; grid-row: 1 / 3; align-self: start; flex-wrap: nowrap; gap: 0; width: 88px; min-height: 44px; margin: 0; padding: 0; border: 0; }
  #thread .thread-tools .transfer { margin: 0; flex: 0 0 44px; }
  #thread .thread-contact-meta { grid-row: 3; }
}

/* The contact preference uses the same switch in the chat and client editors. */
.contact-promotions {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.contact-promotions .promotion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.contact-promotions .promotion-toggle:hover:not([aria-disabled="true"]) {
  border-color: var(--muted);
}
.promotion-toggle-copy {
  display: grid;
  gap: 2px;
}
.promotion-toggle-copy strong { font-size: 14px; }
.promotion-toggle-copy small { font-size: 12px; color: var(--muted); }
.promotion-toggle-track {
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  height: 24px;
  padding: 3px;
  border-radius: 999px;
  background: #66717d;
  box-sizing: border-box;
}
.promotion-toggle-track::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms ease;
}
.promotion-toggle[aria-checked="true"] .promotion-toggle-track { background: #246b50; }
.promotion-toggle[aria-checked="true"] .promotion-toggle-track::before { transform: translateX(18px); }
.promotion-toggle[aria-disabled="true"] { cursor: default; }
.promotion-toggle[aria-busy="true"] .promotion-toggle-track { opacity: .65; }
.promotion-toggle-error { color: var(--danger, #a52a2a); }
.promotion-toggle-error:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .promotion-toggle-track::before { transition: none; }
}
#reply-form > .reply-channel-actions:not([hidden]) {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px var(--thread-inset);
}
#reply-form .reply-channel-actions [hidden] { display: none; }

#reply-template-dialog {
  width: min(480px, calc(100vw - 56px));
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 12px 36px #18212c24;
}
#reply-template-dialog::backdrop { background: rgb(25 29 34 / 28%); }
#reply-template-dialog .reply-template-form { gap: 16px; }
#reply-template-dialog h2 { font-size: 18px; line-height: 1.35; }
.reply-template-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.reply-template-choices:empty, .reply-template-fields:empty { display: none; }
.reply-template-choices button { min-height: 44px; padding-inline: 14px; }
.reply-template-choices button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface-panel);
  border-color: var(--ink);
}
#reply-template-dialog .reply-template-preview[hidden],
#reply-template-dialog .reply-template-actions[hidden] { display: none; }
.reply-template-body {
  margin: 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--surface-panel);
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#reply-template-dialog .reply-template-actions { margin-top: 0; }
#reply-template-dialog .reply-template-status { line-height: 1.45; }

@media (max-width: 480px) {
  #reply-template-dialog .popup-content { padding: 22px 16px 16px; }
  .reply-template-choices button { flex: 1 1 auto; justify-content: center; }
  #reply-form .reply-channel-actions .secondary { width: 100%; justify-content: center; }
}


/* Conversation layout: identity, current actions and one composer dock. */
#thread { --chat-edge: clamp(16px, 2vw, 28px); --chat-pad: 8px; --thread-gutter: var(--chat-edge); }
#thread > .thread-head {
  display: grid; grid-template-columns: fit-content(36%) minmax(0, 1fr) auto;
  align-items: center; padding: var(--chat-pad) var(--chat-edge); gap: 4px 16px; min-height: 0;
}
#thread .thread-heading { display: flex; flex: 1 1 0; min-width: 0; align-items: center; gap: 8px; }
#thread .thread-heading > div { display: block; min-width: 0; }
#thread .thread-heading .contact-name { min-height: 0; font-size: 16px; line-height: 1.35; }
#thread .thread-heading .sender-number { margin: 0; line-height: 1.4; font-size: 12px; }
#thread .thread-heading #contact-tools { width: 36px; height: 36px; min-width: 36px; min-height: 36px; flex: none; }
#thread .thread-head .thread-tools { display: flex; flex: none; width: auto; align-items: center; gap: 8px; margin: 0; }
#thread .thread-head > .thread-contact-meta {
  grid-column: 2; grid-row: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
  min-width: 0; min-height: 0; margin: 0; overflow: visible;
}
#thread .thread-head .commercial-context {
  align-items: center; gap: 4px 8px; border: 0; padding: 0; background: transparent;
  flex: 0 1 auto; min-width: 0; max-width: 100%; overflow-wrap: anywhere;
}
#thread .thread-head .commercial-context:has(details[open]) { flex-basis: 100%; }
#thread .thread-head .thread-labels, #thread .thread-head .active-tags {
  display: flex; align-items: center; flex: 0 1 auto; min-width: 0; max-width: 100%;
  flex-wrap: wrap; gap: 4px; padding: 0;
}
#thread .thread-head .active-tags:empty { display: none; }
#thread .thread-head .tag-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
#thread .thread-head #thread-status { display: inline-flex; }
#thread .thread-head > .thread-tools { grid-column: -2; grid-row: 1; align-self: center; }
#thread .thread-tools .icon-button { min-height: 44px; }
@container conversation (max-width: 680px) {
  #thread .thread-head .thread-labels, #thread .thread-head .active-tags { display: contents; }
  #thread > .thread-head { grid-template-columns: minmax(0, 1fr) auto; }
  #thread .thread-head > .thread-contact-meta { grid-column: 1 / -1; grid-row: 2; }
  #thread .thread-head > .thread-tools { grid-column: 2; grid-row: 1; }
}
#thread > .thread-contextbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start;
  padding: var(--chat-pad) var(--chat-edge); gap: 4px 12px;
}
#thread .thread-contextbar .control-state { flex: none; order: 0; }
#thread .thread-contextbar .control-actions { width: auto; flex: 0 1 auto; margin-left: auto; order: 2; }
#thread .thread-contextbar :is(.control-actions button, .mobile-actions-toggle) { width: auto; flex: none; min-height: 34px; padding: 4px 10px; }
#thread .thread-contextbar .window-notice { order: 1; flex: 0 1 auto; border: 0; background: transparent; padding: 0; margin: 0; color: var(--muted); font-size: 12px; }
#thread .thread-contextbar :is(#control-confirm:not(:empty), .related-call-content, .commercial-next, .control-explanation:not(.window-notice)) { order: 3; flex-basis: 100%; }
#thread #conversation-control .control-actions { justify-content: flex-end; }
#thread #conversation-control .control-explanation:not(.window-notice) { max-width: none; }
#thread .thread-contextbar .commercial-next { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
#thread .thread-contextbar:empty, #thread .environment:empty { display: none; }
#thread #messages { min-height: 0; padding: 16px var(--chat-edge); grid-template-columns: minmax(0,1fr); row-gap: 8px; }
#thread .thread-compose { padding: var(--chat-pad) var(--chat-edge) max(8px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
#thread .thread-compose .compose-modes { padding: 0; gap: 4px; margin: 0; border: 0; }
#thread .thread-compose .compose-modes button { padding: 4px 8px; min-height: 32px; margin: 0; }
#thread .thread-compose :is(#reply-composer,.internal-note) { padding: 2px 0 0; min-width: 0; }
#thread .thread-compose:has(#reply-composer:not([hidden]) .status-only) { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
#thread .thread-compose #reply-composer:has(.status-only):not([hidden]) { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 8px; }
#thread #reply-form.status-only { width: auto; max-width: 100%; border: 0; background: transparent; box-shadow: none; }
#thread #reply-form.status-only > #reply-reason { margin: 0; padding: 2px 0; }
@media (max-width: 1024px) {
  #thread .thread-head .thread-heading { gap: 8px; }
  #thread .thread-heading #back-list { flex: none; width: 36px; }
  #thread .thread-head .thread-tools { gap: 8px; }
  #thread .thread-compose .compose-modes button { min-height: 44px; }
  #thread .thread-contextbar .control-actions { flex-wrap: wrap; }
  #thread .thread-contextbar .window-notice { font-size: 11px; }
  #thread .thread-compose #reply-form > .reply-channel-actions:not([hidden]) { padding: 4px 0; gap: 4px 8px; }
}
@media (max-width: 480px) {
  #thread .thread-heading #contact-tools { display: none; }
  #thread .thread-compose #reply-composer:has(.status-only):not([hidden]) { justify-content: flex-start; }
}
/* Keep the field and its tools together when the message pane itself is wide. */
@container (min-width: 640px) {
  #thread #reply-form:has(> textarea:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }
  #thread #reply-form > textarea:not([hidden]) { grid-column: 1; min-height: 44px; padding: 10px 12px; }
  #thread #reply-form:has(> textarea:not([hidden])) > .composer-tools { grid-column: 2; padding: 2px 4px; gap: 4px; }
  #thread #reply-form:has(> textarea:not([hidden])) > footer { grid-column: 3; align-self: center; padding: 2px 6px 2px 0; }
  #thread #reply-form .file-help { display: none; }
  #thread #reply-form .attachment-preview { grid-column: 1 / -1; }
}

/* Short phone viewports: keep attention and the stage in view while writing. */
#thread .mobile-actions-toggle { display: none; }
@media (max-width: 760px), (max-width: 950px) and (max-height: 520px) {
  #thread { --chat-edge: 12px; --chat-pad: 4px; }
  #thread > .thread-head { gap: 0 8px; }
  #thread .thread-head > .thread-contact-meta {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: thin; align-items: center; gap: 6px;
  }
  #thread .thread-head .thread-labels, #thread .thread-head .active-tags { display: contents; }
  #thread .thread-head .thread-contact-meta > *, #thread .thread-head .tag-chip { flex-shrink: 0; }
  #thread .thread-head .tag-chip { white-space: nowrap; }
  #thread > .thread-contextbar { gap: 2px 8px; }
  #thread .thread-contextbar .mobile-actions-toggle {
    display: inline-flex; margin-inline-start: auto;
    order: 2; font-size: 12px;
  }
  #thread .mobile-actions-toggle[aria-expanded="false"] + .control-actions { display: none; }
  #thread .mobile-actions-toggle[aria-expanded="true"] + .control-actions {
    order: 3; flex-basis: 100%; margin: 0; justify-content: flex-start;
  }
  #thread #messages { padding-block: 8px; row-gap: 6px; }
  #thread .thread-compose { padding-top: 2px; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  #thread #reply-form:has(> textarea:not([hidden])) {
    display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: end;
    gap: 0;
  }
  #thread #reply-form:has(> textarea:not([hidden])) > :is(.attachment-preview,#reply-reason,.reply-channel-actions) { grid-column: 1 / -1; }
  #thread #reply-form > textarea:not([hidden]) {
    grid-column: 1; min-width: 0; width: 100%; min-height: 44px;
    padding: 10px 8px; font-size: 16px;
  }
  #thread #reply-form:has(> textarea:not([hidden])) > .composer-tools { grid-column: 2; flex-wrap: nowrap; gap: 0; padding: 0; }
  #thread #reply-form .composer-tools button { width: 44px; min-height: 44px; padding: 10px; }
  #thread #reply-form:has(> textarea:not([hidden])) > footer { grid-column: 3; padding: 0; }
  #thread #reply-form:has(> textarea:not([hidden])) > footer:has(#check-reply:not([hidden])) { grid-column: 1 / -1; }
  #thread #reply-form button[type="submit"]:has(.icon) {
    width: 44px; min-width: 44px; min-height: 44px; padding: 10px; gap: 0; font-size: 0;
  }
  #thread #reply-form button[type="submit"] .icon { width: 20px; height: 20px; }
  #thread .internal-note .composer { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; }
  #thread #note-warning { grid-column: 1 / -1; }
  #thread .internal-note textarea { min-width: 0; min-height: 44px; padding: 10px 8px; }
  #thread .internal-note footer { padding: 0; }
  #thread .internal-note footer small { display: none; }
}

.support-incident-actions {display:flex; flex-wrap:wrap; gap:8px; align-items:center}
.support-incident-banner .commercial-pending-message {min-width:0; overflow-wrap:anywhere}


/* Operational notices use the same navigation and form controls as management. */
.notices-page .notice-views { margin: 0 0 20px; max-width: 100%; flex-wrap: wrap; }
.notice-views button span { font-variant-numeric: tabular-nums; opacity: .75; }
.notices-page #notice-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.notices-page .notice-card .notice-message { margin: 16px 0 0; max-width: 84ch; white-space: pre-wrap; font-size: 16px; color: var(--ink); }
.notices-page .notice-card .notice-end { font-size: 12px; color: var(--muted); }
.notices-page #notice-empty { border: 1px solid var(--line); background: var(--surface); padding: 48px 20px; }
.notices-page #notice-empty h2 { margin: 0 0 8px; }
.notices-page #notice-empty p { margin: 0; }
.notices-page .notice-views button[hidden], .notices-page #notice-empty[hidden] { display: none; }
.notice-editor .notice-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) {
  .notice-editor .notice-settings { grid-template-columns: minmax(0,1fr); }
  .notices-page .notice-views button { padding-inline: 10px; }
}

/* Team requests share the notice cards and controls used elsewhere in the workspace. */
.pending-team-page .access-heading { align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 16px; }
.pending-team-page .access-heading p { margin: 6px 0 0; color: var(--muted); }
.pending-team-page .pending-team-items { grid-template-columns: minmax(0, 1fr); margin: 12px 0; }
.pending-team-page .pending-team-card {
  margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-raised);
}
.pending-team-page .pending-team-card h2 { margin: 0; color: var(--ink); }
.pending-team-page .notice-state { font-size: 12px; }
.pending-team-page .notice-scope { margin-top: 8px; }
.pending-team-page .pending-team-card > .pending-request {
  margin: 16px 0 8px; max-width: 84ch; font-size: 16px; color: var(--ink); white-space: pre-wrap;
}
.pending-team-page .pending-meta { margin: 0; font-size: 12px; color: var(--muted); }
.pending-team-page .pending-team-card footer { margin-top: 14px; }
.pending-team-page .form-error { color: #983b2d; }

@media (max-width: 700px) {
  .pending-team-page .pending-team-card footer button { min-height: 40px; }
}
