:root {
  --v20-canvas: #f2f2f7;
  --v20-surface: #fff;
  --v20-surface-2: #f7f7fa;
  --v20-text: #171719;
  --v20-muted: #74747a;
  --v20-line: #dedee3;
  --v20-blue: #087cff;
  --v20-blue-soft: #e9f3ff;
  --v20-green: #34c759;
  --v20-bubble: #dff4e8;
  --v20-nav: #1c2930;
  --v20-shadow: 0 20px 55px rgba(0, 0, 0, .13);
}

body { background: var(--v20-canvas); color: var(--v20-text); }
button, input, select, textarea { color: var(--v20-text); }
.app { grid-template-columns: 190px minmax(0, 1fr); background: var(--v20-canvas); }
.sidebar { padding: 18px 12px 14px; background: var(--v20-nav); }
.brand { padding: 4px 8px 24px; }
.brand .logo { width: 38px; height: 38px; border-radius: 12px; }
.brand strong { font-size: 15px; }
.brand small { font-size: 11px; }
.sidebar nav { gap: 4px; }
.sidebar nav button { min-height: 44px; padding: 0 10px; border-radius: 11px; grid-template-columns: 20px 1fr auto; font-size: 14px; }
.sidebar nav button > span { width: 20px; height: 20px; font-size: 17px; }
.sidebar nav button.secondary-nav { margin-top: -3px; padding-left: 39px; grid-template-columns: 0 1fr; color: #b7c6c6; font-size: 12px; }
.sidebar nav button.secondary-nav > span { display: none; }
.profile { padding: 14px 7px 0; }
.mobile-nav .mobile-secondary-nav { display: none; }

.topbar { min-height: 92px; padding: 20px 26px 15px; background: rgba(242,242,247,.9); border-color: var(--v20-line); }
.topbar h1 { color: var(--v20-text); font-size: clamp(30px, 3vw, 40px); font-weight: 550; }
.topbar small { color: var(--v20-muted); }
.search { border-color: var(--v20-line); background: var(--v20-surface); }
.content { max-width: 1500px; padding: 26px 28px 96px; }
.primary { background: var(--v20-nav); }
.primary:hover { background: #111d22; }

/* Approved compact inbox: sidebar, 320px list, conversation. */
@media (min-width: 901px) {
  body[data-v20-view="today"] .app { grid-template-columns: 190px 320px minmax(0, 1fr); }
  body[data-v20-view="today"] .app > main { grid-column: 2; min-width: 0; border-right: 1px solid var(--v20-line); background: var(--v20-surface); }
  body[data-v20-view="today"] .topbar { min-height: 96px; padding: 21px 18px 12px; background: var(--v20-surface); align-items: end; }
  body[data-v20-view="today"] .topbar h1 { font-size: 31px; }
  body[data-v20-view="today"] .top-actions { position: absolute; left: 0; right: 14px; bottom: 15px; justify-content: flex-end; }
  body[data-v20-view="today"] .top-actions .scope,
  body[data-v20-view="today"] .top-actions #new-client { display: none !important; }
  body[data-v20-view="today"] .top-actions .search { width: 38px; min-width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; justify-content: center; background: var(--v20-surface-2); overflow: hidden; }
  body[data-v20-view="today"] .top-actions .search > span { font-size: 20px; }
  body[data-v20-view="today"] .top-actions .search input { position: absolute; width: 1px; opacity: 0; pointer-events: none; }
  body[data-v20-view="today"] .top-actions .search.v20-search-open { position: absolute; left: 12px; right: auto; bottom: 0; width: calc(100% - 12px); min-width: calc(100% - 12px); height: 40px; padding: 0 12px; overflow: visible; border: 1px solid var(--v20-line); border-radius: 13px; justify-content: flex-start; background: var(--v20-surface); z-index: 3; }
  body[data-v20-view="today"] .top-actions .search.v20-search-open input { position: static; width: 100%; opacity: 1; pointer-events: auto; }
  body[data-v20-view="today"] .content { padding: 0 8px 80px; }
  body[data-v20-view="today"] .app::after { content: "Выберите диалог"; grid-column: 3; display: grid; place-items: center; color: var(--v20-muted); background: var(--v20-canvas); }
  body[data-v20-view="today"].detail-open .app::after { content: ""; }
  body[data-v20-view="today"].detail-open .app > main { margin-right: 0; }
  body[data-v20-view="today"] .detail-dialog { inset: 0 0 0 510px; width: calc(100vw - 510px); border-left: 0; }
  body:not([data-v20-view="today"]) .detail-dialog { inset: 0 0 0 190px; width: calc(100vw - 190px); }
  body.detail-open .app > main { margin-right: 0; }
}

.v20-segments { display: flex; gap: 3px; margin: 7px 6px 10px; padding: 3px; border-radius: 10px; background: var(--v20-surface-2); }
.v20-segments button { min-width: 0; flex: 1; min-height: 34px; padding: 6px 5px; border: 0; border-radius: 8px; background: transparent; color: var(--v20-muted); font-size: 12px; white-space: nowrap; }
.v20-segments button.active { background: var(--v20-surface); color: var(--v20-text); box-shadow: 0 1px 5px rgba(0,0,0,.1); }
.v20-segments b { display: inline-grid; min-width: 18px; margin-left: 3px; font-size: 11px; font-weight: 600; }
.v20-inbox-list { display: grid; padding: 0 2px; }
.v20-inbox-row { width: 100%; min-width: 0; min-height: 76px; padding: 10px 9px; border-bottom: 1px solid var(--v20-line); display: grid; grid-template-columns: 40px minmax(0, 1fr) 18px; align-items: center; gap: 9px; background: transparent; cursor: pointer; }
.v20-inbox-row:hover { border-bottom-color: transparent; border-radius: 13px; background: var(--v20-blue-soft); }
.v20-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--v20-surface-2); color: var(--v20-text); font-size: 13px; font-weight: 550; }
.v20-inbox-copy { min-width: 0; }
.v20-inbox-copy strong, .v20-inbox-copy small, .v20-inbox-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v20-inbox-copy strong { font-size: 14px; font-weight: 600; }
.v20-inbox-copy small { margin-top: 3px; color: var(--v20-muted); font-size: 13px; }
.v20-inbox-copy em { margin-top: 4px; color: var(--v20-muted); font-size: 11px; font-style: normal; }
.v20-unread { width: 9px; height: 9px; border-radius: 50%; background: var(--v20-blue); }
.v20-row-icon { color: var(--v20-blue); }
.v20-row-icon.muted { color: var(--v20-muted); }

/* Full-width databases and orders. */
.v20-page-head { min-height: 56px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.v20-page-head h2 { margin: 0; font-size: 25px; font-weight: 560; letter-spacing: -.025em; }
.v20-page-head p { margin: 4px 0 0; color: var(--v20-muted); }
.v20-page-head > span { min-width: 34px; padding: 5px 9px; border-radius: 999px; background: var(--v20-blue-soft); color: var(--v20-blue); text-align: center; font-size: 12px; }
.v20-client-switch { display: flex; width: max-content; margin: -8px 0 16px; padding: 3px; border-radius: 11px; background: #e7e7eb; }
.v20-client-switch button { min-height: 34px; padding: 6px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--v20-muted); }
.v20-client-switch button.active { background: #fff; color: var(--v20-text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.v20-wide-list { overflow: hidden; border: 1px solid var(--v20-line); border-radius: 18px; background: var(--v20-surface); }
.v20-wide-row { min-height: 96px; padding: 13px 16px; border-bottom: 1px solid var(--v20-line); display: grid; grid-template-columns: 42px minmax(220px, 1.35fr) minmax(200px, 1fr) auto; align-items: center; gap: 14px; cursor: pointer; }
.v20-wide-row:last-child { border-bottom: 0; }
.v20-wide-row:hover { background: #f8faf9; }
.v20-wide-primary, .v20-wide-context { min-width: 0; display: grid; gap: 4px; }
.v20-wide-primary > strong, .v20-wide-primary > small, .v20-wide-context > strong, .v20-wide-context > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v20-wide-primary > strong, .v20-wide-context > strong { font-weight: 560; }
.v20-wide-primary > small, .v20-wide-context > small { color: var(--v20-muted); }
.v20-tags { display: flex; gap: 5px; margin-top: 3px; }
.v20-tags > span, .v20-tags .pill { padding: 3px 7px; border-radius: 999px; background: #edf1ef; font-size: 11px; }
.v20-wide-side { min-width: 110px; display: grid; justify-items: end; gap: 8px; color: var(--v20-muted); text-align: right; }
.v20-wide-side > div { display: flex; gap: 5px; }
.v20-wide-side button { min-height: 34px; padding: 6px 10px; border: 0; border-radius: 10px; background: #edf1ef; }
.v20-order-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #e5f1ff; color: #27689c; font-size: 20px; }

/* Plans: direct transcription of the approved planned view. */
.schedule-toolbar { margin: 0 0 28px; }
.schedule-tabs { background: #e7e7eb; }
.schedule-tabs button.active { box-shadow: 0 1px 5px rgba(0,0,0,.08); }
.v20-task-groups { display: grid; gap: 28px; }
.v20-task-group > header { min-height: 54px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.v20-task-group header > span:last-child { display: grid; gap: 2px; }
.v20-task-group h3 { margin: 0; font-size: 19px; font-weight: 560; }
.v20-task-group header small { color: var(--v20-muted); }
.v20-date-tile { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: #0d6b68; color: #fff; font-size: 18px; font-weight: 560; }
.v20-date-tile.muted { border: 1px solid var(--v20-line); background: var(--v20-surface); color: var(--v20-text); }
.v20-task-list { overflow: hidden; border: 1px solid var(--v20-line); border-radius: 18px; background: var(--v20-surface); }
.v20-task-row { min-height: 92px; padding: 12px 13px; border-bottom: 1px solid var(--v20-line); display: grid; grid-template-columns: 32px minmax(0, 1fr) 128px 34px; align-items: center; gap: 10px; }
.v20-task-row:last-child { border-bottom: 0; }
.v20-task-row:hover { background: #f8faf9; }
.v20-task-check { width: 28px; height: 28px; padding: 0; border: 1.5px solid var(--v20-line); border-radius: 50%; background: transparent; color: transparent; display: grid; place-items: center; }
.v20-task-check:hover { border-color: #0d6b68; color: #0d6b68; }
.v20-task-main { min-width: 0; padding: 0; border: 0; background: transparent; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 12px; text-align: left; }
.v20-task-main > span:last-child { min-width: 0; display: grid; gap: 3px; }
.v20-task-main strong, .v20-task-main small, .v20-task-main em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v20-task-main strong { font-weight: 560; }
.v20-task-main small { color: var(--v20-text); opacity: .76; }
.v20-task-main em { color: var(--v20-muted); font-size: 11px; font-style: normal; }
.v20-task-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #e4f3ef; color: #0d6b68; }
.v20-task-icon.call { background: #e5f1ff; color: #27689c; }
.v20-task-icon.return { background: #eee9ff; color: #715cb5; }
.v20-task-row > time { display: grid; justify-items: end; gap: 3px; text-align: right; }
.v20-task-row > time strong { font-weight: 560; }
.v20-task-row > time small { color: var(--v20-muted); font-size: 11px; }
.v20-more { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--v20-muted); display: grid; place-items: center; }
.v20-more:hover { background: #edf1ef; }

/* Master/detail conversation. */
.detail-dialog, .detail-dialog > div { background: var(--v20-surface); }
.detail-dialog::backdrop { background: rgba(0,0,0,.18); backdrop-filter: blur(2px); }
.v20-chat-head { min-height: 84px; padding: 15px 20px; border-color: var(--v20-line); background: rgba(255,255,255,.94); }
.v20-chat-head h2 { color: var(--v20-text); font-size: 24px; font-weight: 560; }
.v20-chat-head .pills { margin-top: 5px; }
.v20-chat-head .close { position: static; order: 3; background: var(--v20-surface-2); }
.v20-head-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.v20-head-actions button { min-height: 38px; padding: 8px 11px; border: 0; border-radius: 11px; background: var(--v20-surface-2); display: flex; align-items: center; gap: 7px; }
.v20-head-actions button:last-child { width: 38px; padding: 0; justify-content: center; border-radius: 50%; }
.v20-context { min-height: 54px; padding: 9px 18px; border-bottom: 1px solid #dbe8f4; background: var(--v20-blue-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.v20-context > span { display: flex; align-items: center; gap: 9px; }
.v20-context > span > span { display: grid; gap: 2px; }
.v20-context strong { font-size: 14px; font-weight: 600; }
.v20-context small { color: var(--v20-muted); font-size: 12px; }
.v20-context button { min-height: 36px; padding: 7px 9px; border: 0; background: transparent; color: var(--v20-blue); display: flex; align-items: center; gap: 6px; }
.v20-mobile-no-reply { display: none !important; }
.v20-client-grid { position: relative; height: calc(100dvh - 138px); padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) 0; gap: 0; overflow: hidden; }
.v20-chat-column { min-width: 0; min-height: 0; }
.v20-chat-panel { height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--v20-canvas); }
.v20-chat-panel > .section-head { display: none; }
.v20-chat-panel .messages { max-height: none; min-height: 0; padding: 22px 22px 18px; gap: 10px; align-content: start; grid-auto-rows: max-content; }
.v20-chat-panel .message { max-width: 72%; border-color: var(--v20-line); border-radius: 17px 17px 17px 5px; background: var(--v20-surface); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.v20-chat-panel .message.out { border-color: #b8ddcb; border-radius: 17px 17px 5px 17px; background: var(--v20-bubble); }
.v20-chat-panel .message.system { max-width: 100%; border: 0; box-shadow: none; background: transparent; text-align: center; }
.v20-compose { position: relative; bottom: auto; margin: 0; padding: 10px 14px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--v20-line); background: rgba(255,255,255,.96); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.v20-compose textarea { grid-column: 1; grid-row: 1; min-height: 42px; max-height: 110px; padding: 10px 14px; border-color: var(--v20-line); border-radius: 20px; background: var(--v20-surface-2); resize: none; }
.v20-compose .compose-controls { grid-column: 2; grid-row: 1; margin: 0; display: flex; align-items: center; gap: 5px; }
.v20-compose .compose-controls > .ghost { order: 1; width: 38px; height: 38px; min-height: 38px; padding: 0; border: 0; border-radius: 50%; background: var(--v20-surface-2); display: grid; place-items: center; }
.v20-compose .compose-controls > .ghost span { display: none; }
.v20-compose .compose-controls > button.primary { order: 3; width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 50%; background: var(--v20-blue); display: grid; place-items: center; transform: rotate(-90deg); }
.v20-compose .compose-controls > button.primary span { display: none; }
.v20-compose .compose-controls > button.primary.is-sending { transform: none; }
.v20-compose .compose-controls > button.primary.is-sending svg { display: none; }
.v20-compose .compose-controls > button.primary.is-sending::after { width: 16px; height: 16px; margin: 0; }
.v20-compose-settings { order: 2; position: relative; }
.v20-compose-settings summary { width: 38px; height: 38px; border-radius: 50%; background: var(--v20-surface-2); list-style: none; display: grid; place-items: center; cursor: pointer; }
.v20-compose-settings summary::-webkit-details-marker { display: none; }
.v20-compose-settings > div { position: absolute; right: 0; bottom: 46px; width: min(330px, calc(100vw - 30px)); padding: 12px; border: 1px solid var(--v20-line); border-radius: 16px; background: var(--v20-surface); box-shadow: var(--v20-shadow); display: grid; gap: 9px; }
.v20-compose-settings label { color: var(--v20-muted); font-size: 11px; display: grid; gap: 4px; }
.v20-compose-settings .toggle { display: flex; color: var(--v20-text); }
.v20-drawer { position: absolute; z-index: 4; top: 0; right: 0; bottom: 0; width: min(360px, 92vw); padding: 0 14px 24px; overflow: auto; border-left: 1px solid var(--v20-line); background: var(--v20-surface-2); box-shadow: -16px 0 36px rgba(0,0,0,.08); transform: none; transition: none; }
.v20-drawer[hidden] { display: none !important; }
.v20-drawer-head { position: sticky; top: 0; z-index: 2; min-height: 58px; padding: 10px 2px; background: rgba(247,247,250,.94); backdrop-filter: blur(18px); display: flex; align-items: center; justify-content: space-between; }
.v20-drawer-head strong { font-weight: 600; }
.v20-drawer-head button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: #e8e8ed; display: grid; place-items: center; }
.v20-drawer .panel { border-color: var(--v20-line); box-shadow: none; }
.v20-drawer .action-grid { grid-template-columns: 1fr 1fr; }

/* Forms use a centered iOS-like sheet. */
.form-dialog { border-radius: 22px; background: var(--v20-surface); }
.form-dialog::backdrop { background: rgba(0,0,0,.28); backdrop-filter: blur(8px); }
.form-body { padding: 24px; }
.form-body h2 { color: var(--v20-text); font-size: 26px; font-weight: 600; }
.form-body input, .form-body select, .form-body textarea { border-color: var(--v20-line); border-radius: 13px; background: var(--v20-surface-2); }

@media (max-width: 900px) {
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { min-height: 84px; padding: 18px 18px 10px; align-items: end; flex-wrap: nowrap; }
  .topbar h1 { font-size: 32px; }
  .topbar .scope, .topbar #new-client { display: none !important; }
  .top-actions { width: auto; flex: 0 0 auto; }
  .top-actions .search { width: 40px; min-width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; justify-content: center; background: var(--v20-surface); overflow: hidden; }
  .top-actions .search input { position: absolute; width: 1px; opacity: 0; pointer-events: none; }
  .top-actions .search.v20-search-open { position: absolute; left: 12px; right: 12px; bottom: 8px; width: auto; padding: 0 12px; border: 1px solid var(--v20-line); border-radius: 13px; justify-content: flex-start; z-index: 4; }
  .top-actions .search.v20-search-open input { position: static; width: 100%; opacity: 1; pointer-events: auto; }
  .content { padding: 0 12px 84px; }
  .mobile-nav { min-height: 70px; padding: 7px 6px max(10px, env(safe-area-inset-bottom)); grid-template-columns: repeat(4, 1fr); border-color: var(--v20-line); background: rgba(255,255,255,.94); }
  .mobile-nav button { color: var(--v20-muted); }
  .mobile-nav button.active { color: var(--v20-blue); }
  .v20-segments { margin: 4px 0 10px; }
  .v20-segments button { min-height: 38px; font-size: 13px; }
  .v20-inbox-list { overflow: hidden; border: 1px solid var(--v20-line); border-radius: 16px; background: var(--v20-surface); }
  .v20-inbox-row { min-height: 78px; padding: 11px 12px; }
  .v20-page-head { margin: 10px 4px 16px; }
  .v20-page-head h2 { font-size: 22px; }
  .v20-page-head p { font-size: 13px; }
  .v20-client-switch { margin-left: 2px; }
  .filters { margin: 0 0 12px; }
  .v20-wide-list { border-radius: 16px; }
  .v20-wide-row { min-height: 80px; padding: 11px; grid-template-columns: 40px minmax(0, 1fr) 20px; gap: 10px; }
  .v20-wide-context { grid-column: 2 / -1; }
  .v20-wide-side { grid-column: 3; grid-row: 1; min-width: 0; }
  .v20-wide-side time, .v20-wide-side strong, .v20-wide-side > div { display: none; }
  .schedule-toolbar { margin: 4px 0 18px; }
  .schedule-toolbar .filters { display: none; }
  .schedule-tabs { width: 100%; }
  .schedule-tabs button { flex: 1 0 auto; }
  .v20-task-groups { gap: 22px; }
  .v20-task-group > header { min-height: 46px; margin-bottom: 7px; }
  .v20-date-tile { width: 40px; height: 40px; }
  .v20-task-row { min-height: 78px; padding: 8px 7px; grid-template-columns: 30px minmax(0, 1fr) 24px; gap: 7px; }
  .v20-task-main { grid-template-columns: 38px minmax(0, 1fr); gap: 9px; }
  .v20-task-icon { width: 38px; height: 38px; }
  .v20-task-row > time { grid-column: 2; justify-items: start; display: flex; gap: 5px; }
  .v20-task-row > time strong { color: var(--v20-muted); font-size: 11px; }
  .v20-task-row > time small { display: none; }
  .v20-more { grid-column: 3; grid-row: 1 / span 2; }
  .detail-dialog { inset: 0; width: 100vw; height: 100dvh; }
  .detail-dialog::backdrop { background: transparent; backdrop-filter: none; }
  .v20-chat-head { min-height: 68px; padding: max(10px, env(safe-area-inset-top)) 10px 9px; }
  .v20-chat-head h2 { max-width: 54vw; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
  .v20-chat-head .pills { max-width: 58vw; overflow: hidden; flex-wrap: nowrap; justify-content: center; }
  .v20-chat-head > div:first-child { order: 2; flex: 1; text-align: center; }
  .v20-chat-head .close { order: 1; transform: rotate(0); }
  .v20-chat-head .close svg { display: none; }
  .v20-chat-head .close::before { content: "‹"; font-size: 31px; line-height: 1; color: var(--v20-blue); }
  .v20-head-actions { order: 3; margin-left: 0; }
  .v20-head-actions .v20-no-reply { display: none; }
  .v20-context { min-height: 46px; padding: 7px 12px; }
  .v20-context small { display: none; }
  .v20-context button { font-size: 12px; }
  .v20-context .v20-mobile-no-reply { display: flex !important; margin-left: auto; }
  .v20-context .v20-schedule { display: none; }
  .v20-client-grid { height: calc(100dvh - 114px); display: block; }
  .v20-chat-column, .v20-chat-panel { height: 100%; }
  .v20-chat-panel .messages { padding: 16px 12px; }
  .v20-chat-panel .message { max-width: 86%; }
  .v20-compose { padding: 8px 9px max(9px, env(safe-area-inset-bottom)); }
  .v20-compose-settings { display: none; }
  .v20-drawer { top: 0; width: 100%; }
  .v20-drawer .action-grid { grid-template-columns: 1fr; }
  .form-dialog { width: calc(100vw - 18px); max-height: calc(100dvh - 18px); border-radius: 22px; }
  .form-body { max-height: calc(100dvh - 18px); overflow: auto; padding: 20px; }
}

@media (max-width: 430px) {
  .topbar { padding-inline: 16px; }
  .topbar h1 { font-size: 30px; }
  .content { padding-inline: 10px; }
  .v20-segments button { padding-inline: 3px; font-size: 12px; }
  .v20-inbox-row { padding-inline: 10px; }
  .v20-head-actions button:last-child { width: 36px; height: 36px; }
}

/* V55.31: keep every mobile conversation inside the viewport. */
@media (max-width: 900px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .detail-dialog, .detail-dialog > div, #detail,
  .v20-client-grid, .v20-chat-column, .v20-chat-panel {
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
  }
  .v20-chat-head {
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: start;
    gap: 6px;
    overflow: hidden;
  }
  .v20-chat-head > div:first-child {
    grid-column: 2;
    grid-row: 1;
    order: initial;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .v20-chat-head h2 { width: 100%; max-width: 100%; }
  .v20-chat-head .pills {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .v20-chat-head .pills::-webkit-scrollbar { display: none; }
  .v20-chat-head .close { grid-column: 1; grid-row: 1; order: initial; }
  .v20-head-actions { grid-column: 3; grid-row: 1; order: initial; min-width: 0; margin: 0; }
  .v20-context { box-sizing: border-box; width: 100%; max-width: 100vw; overflow: hidden; }
  .v20-chat-panel { grid-template-rows: auto minmax(0, 1fr) auto; }
  .v20-chat-panel .timeline-filter {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .v20-chat-panel .messages {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
  }
  .v20-chat-panel .message {
    box-sizing: border-box;
    width: fit-content;
    min-width: 0;
    max-width: calc(100% - 18px);
    margin-left: 0;
    margin-right: auto;
    justify-self: start;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .v20-chat-panel .message.out {
    margin-left: auto;
    margin-right: 0;
    justify-self: end;
  }
  .v20-chat-panel .message.system { width: 100%; max-width: 100%; justify-self: stretch; }
  .v20-chat-panel .message > *, .v20-chat-panel .message a { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
  .v20-chat-panel .timeline-older {
    width: auto;
    max-width: calc(100% - 24px);
    margin: 2px auto 8px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.25;
    white-space: normal;
    justify-self: center;
  }
  .v20-compose { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; }
  .v20-compose textarea { min-width: 0; }
}
.danger-toggle{display:grid!important;gap:8px;padding:14px 16px;border:1px solid #ffd4cf;border-radius:16px;background:#fff7f6}.danger-toggle span{display:flex;align-items:center;gap:10px;font-weight:700;color:#9f2f28}.danger-toggle small{color:#746e6d;line-height:1.35}.danger-toggle input{width:20px;height:20px;margin:0}
.timeline-older{display:block;margin:10px auto}

/* V55.32: keep the conversation canvas stable on desktop and mobile. */
.v20-client-grid,
.v20-chat-column,
.v20-chat-panel,
.v20-chat-panel .messages {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}
.v20-chat-panel .messages {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  overflow-x: hidden;
  overscroll-behavior-x: none;
}
.v20-chat-panel .message {
  box-sizing: border-box;
  width: fit-content;
  min-width: 0;
  max-width: min(72%, 760px);
  margin-left: 0;
  margin-right: auto;
  justify-self: start;
  transform: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.v20-chat-panel .message.out {
  margin-left: auto;
  margin-right: 0;
  justify-self: end;
}
.v20-chat-panel .message.system {
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
}
.v20-chat-panel .message > *,
.v20-chat-panel .message a {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 900px) {
  .v20-chat-panel .message { max-width: calc(100% - 18px); }
}
