/* Mobile v36: compact opaque content, soft layers and a restrained glass dock. */
[hidden] { display:none!important; }
.mobile-inbox-heading,.editor-tabs,.mobile-message-meta,.mobile-message-facts,.source-avatar,.mobile-count,.search-mobile-chevron,.search-notification-note,.mobile-conditions-options,.mobile-initial-history,.mobile-search-icon,.message-chevron,.tag-hint { display:none; }
.reader-body { min-height:0; overflow:auto; flex:1; }
.reader-body > h2 { margin-bottom:10px; }
.reader .message-actions { flex-shrink:0; }
.settings-row { display:flex; align-items:center; justify-content:space-between; width:100%; min-height:44px; padding:12px 0; gap:12px; background:none; border:0; border-bottom:1px solid var(--line); border-radius:0; text-align:left; text-decoration:none; color:var(--ink); }
.account-help { grid-column:1/-1; }
.account-help h2 { margin-bottom:8px; }
.account-help .field-hint { margin-top:12px; }
.account-actions { display:flex; align-items:center; gap:20px; }
.help-steps h3 { margin:20px 0 6px; }
.help-steps p { color:var(--muted); }
.source-search-input { display:flex; align-items:center; gap:8px; }
.source-search-input input { flex:1; min-width:0; }
.source-search-input > .icon { width:18px; flex-shrink:0; }
.source-picker-meta { display:flex; justify-content:space-between; align-items:center; margin-top:12px; }
@media (min-width:721px) { .account-grid { align-content:start; } .account-help { max-width:none; } }
@media (max-width:720px), (max-width:960px) and (max-height:500px) {
  :root { --ink:#121a28; --muted:#737b8a; --line:#e7eaed; --accent:#08736e; --mint:#e5f2ef; --canvas:#f3f6f6; --surface-shadow:0 2px 8px #162c2710; --primary-fill:linear-gradient(155deg,#148e84,#08736e 75%); --mobile-safe:max(env(safe-area-inset-bottom,0px),var(--radar-inset-bottom,0px)); --mobile-nav:calc(68px + var(--mobile-safe)); }
  html,body { width:100%; max-width:100%; overflow:hidden; }
  #app { display:flex; flex-direction:column; width:100%; height:100dvh; min-width:0; background:var(--canvas); }
  .sidebar,.mobile-top { display:none; }
  .main { width:100%; min-width:0; min-height:0; flex:1; padding:16px 12px 12px; overflow:auto; background:var(--canvas); overscroll-behavior:contain; }
  button,.button { min-height:44px; font-weight:500; }
  button.text { min-height:44px; }
  .icon { width:20px; height:20px; flex-shrink:0; }
  .icon-button { width:44px; height:44px; padding:12px; }
  input,select { min-height:44px; padding:10px 12px; border-radius:12px; background:#fff; }
  input[type=checkbox] { width:22px; height:22px; min-height:22px; }
  .bottom-nav { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); flex:0 0 52px; height:52px; width:calc(100% - 24px); margin:4px 12px calc(12px + var(--mobile-safe)); padding:4px; position:relative; background:rgba(255,255,255,.9); border:1px solid #fff; border-radius:28px; box-shadow:0 4px 20px #172e2912,inset 0 1px 0 #fff; backdrop-filter:blur(18px) saturate(1.2); -webkit-backdrop-filter:blur(18px) saturate(1.2); z-index:3; }
  .bottom-nav::before { content:""; position:absolute; inset:0; border:1px solid #183a3008; border-radius:inherit; pointer-events:none; }
  .primary { background:var(--primary-fill); box-shadow:0 2px 5px #08736e18,inset 0 1px 0 #ffffff24; }
  button,.button { transition:background-color .16s ease,box-shadow .16s ease,transform .16s ease; }
  button:active:not(:disabled),.button:active { transform:translateY(1px); }
  button:focus-visible,a:focus-visible { outline:2px solid var(--accent); outline-offset:3px; box-shadow:none; }
  .bottom-nav button { border:0; background:none; color:var(--muted); border-radius:23px; padding:2px 0; min-height:44px; flex-direction:column; gap:2px; }
  .bottom-nav .icon { width:20px; height:20px; }
  .bottom-nav .active { color:var(--accent); background:linear-gradient(145deg,#e1f1ed,#edf6f3); box-shadow:inset 0 1px 0 #fff; }
  .page-heading { flex-shrink:0; gap:12px; margin:0 0 20px; align-items:center; }
  .page-heading-actions { gap:0; }
  .page-heading p { margin-top:5px; }
  .panel { border:1px solid var(--line); border-radius:12px; }
  .empty { padding:28px 16px; min-height:180px; }
  .empty h2 { margin-top:12px; }
  .empty p { max-width:300px; }

  /* Searches: one compact card and one consistent action strip. */
  .page-searches { background:var(--canvas); padding-top:12px; }
  .page-searches .page-heading { margin-bottom:10px; }
  .page-searches .page-heading p { display:none; }
  .page-searches .page-heading-actions button { width:36px; min-width:36px; height:36px; min-height:36px; padding:8px; border:0; border-radius:50%; background:var(--primary-fill); box-shadow:0 3px 8px #08736e20,inset 0 1px 0 #ffffff45; }
  .page-searches .page-heading-actions button span { display:none; }
  .page-searches .page-heading-actions .icon { width:22px; height:22px; }
  .search-controls { display:flex; gap:0; padding:3px; margin:0 0 10px; width:100%; background:#e9eeee; border:1px solid #e5ebea; border-radius:12px; }
  .search-controls button { flex:1; min-height:30px; padding:4px; border:1px solid transparent; border-radius:8px; background:none; color:#414a59; }
  .search-controls .selected { background:#fff; border-color:#fff; color:var(--accent); box-shadow:0 1px 4px #173a2910; }
  .mobile-count { display:inline; }
  .search-table { border:0; background:none; overflow:visible; }
  .table-head { display:none; }
  .search-row { display:grid; position:relative; grid-template-columns:1fr auto 18px; grid-template-rows:auto auto auto; align-items:start; gap:5px 8px; padding:12px 12px 0; margin:0 0 10px; min-width:0; border:1px solid #e4eae8; border-radius:16px; background:#fff; box-shadow:var(--surface-shadow); }
  .search-row:last-child { border:1px solid var(--line); }
  .search-title { grid-column:1/-1; grid-row:1; display:block; width:100%; min-width:0; min-height:34px; text-align:left; padding:0; border:0; background:none; }
  .search-title > span { display:block; min-width:0; }
  .search-title strong { display:block; padding-right:64px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .search-title small { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:1; margin-top:3px; overflow:hidden; white-space:normal; color:#667081; }
  .search-symbol { display:none!important; }
  .new-count { position:absolute; right:34px; top:13px; min-width:26px; padding:1px 8px; border-radius:18px; background:var(--primary-fill); color:#fff; text-align:center; }
  .new-count small { display:none; }
  .search-mobile-chevron { display:block; position:absolute; right:11px; top:14px; color:#566171; pointer-events:none; }
  .search-mobile-chevron .icon { width:16px; height:16px; }
  .search-source-count { grid-row:2; grid-column:1; display:flex; align-items:center; gap:4px; padding-left:0; color:#596474; }
  .search-source-count::before { display:none; }
  .search-source-count small { display:inline; margin:0; color:inherit; }
  .search-row > .status { grid-row:2; grid-column:2/-1; color:#596474; gap:4px; white-space:nowrap; }
  .search-row > .status .dot { display:inline-block; width:5px; height:5px; }
  .search-actions { grid-column:1/-1; grid-row:3; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; padding:4px 0; margin-top:0; border-top:1px solid var(--line); }
  .search-actions button { min-width:0; min-height:38px; flex-direction:column; gap:3px; padding:0 2px; border:0; border-right:1px solid var(--line); border-radius:0; background:none; color:#465164; }
  .search-actions button:last-child { border-right:0; }
  .search-actions:has(>button:nth-child(3):last-child) { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .search-actions .icon { width:15px; height:15px; color:#172131; }
  .search-actions button:hover { background:#f5f8f7; }
  .search-notification-note { display:flex; align-items:center; gap:10px; width:100%; min-height:44px; padding:8px 10px; border:1px solid #e5edeb; border-radius:14px; color:#596474; background:#edf3f1; text-align:left; }
  .search-notification-note > span:nth-child(2) { flex:1; min-width:0; }
  .search-notification-note > .icon { width:16px; }
  .quiet-note { display:none; }
  .setup-notice { flex-direction:column; align-items:stretch; margin-top:16px; padding:14px; gap:8px; }

  /* Inbox: the entire width belongs to the message, never to a trailing icon. */
  .page-inbox { padding:0; overflow:hidden; display:flex; flex-direction:column; background:#fff; }
  .inbox-heading,.source-panel,.mobile-search-switcher,#mobile-source-label { display:none; }
  .mobile-inbox-heading { display:block; flex:0 0 auto; padding:8px 12px 4px; background:#fff; }
  .inbox-list-heading { display:flex; align-items:center; gap:10px; }
  .mobile-search-title { display:flex; justify-content:flex-start; flex:1; min-width:0; padding:0; min-height:38px; text-align:left; background:none; border:0; }
  .mobile-search-title strong { display:flex; align-items:center; gap:7px; overflow:hidden; max-width:100%; white-space:nowrap; text-overflow:ellipsis; }
  .mobile-search-title .icon { width:16px; }
  .inbox-list-heading > .icon-button { width:36px; height:36px; min-height:36px; padding:8px; border:1px solid #e1e8e5; border-radius:50%; background:linear-gradient(#fff,#f8fbfa); box-shadow:0 2px 5px #173a2908; }
  .mobile-inbox-meta { display:flex; align-items:center; justify-content:space-between; min-width:0; gap:8px; }
  #mobile-health { min-width:0; }
  #mobile-health .text { min-height:28px; max-width:100%; padding:0; gap:4px; white-space:nowrap; color:#596474; }
  #mobile-health .dot { width:7px; height:7px; }
  .period-button { min-height:28px!important; padding:0; flex-shrink:0; gap:5px; color:#697586; }
  .period-button .icon { width:14px; height:14px; }
  .period-button .icon:last-child { width:11px; }
  .inbox-detail-heading { display:none; }
  .inbox-grid { display:flex; flex-direction:column; flex:1; min-height:0; gap:0; overflow:hidden; }
  .message-panel { display:flex; flex-direction:column; flex:1; min-height:0; overflow:hidden; background:#fff; border:0; border-radius:0; }
  .status-tabs { display:flex; flex:0 0 auto; padding:3px; margin:0 12px; gap:2px; background:#f1f4f3; border:0; border-radius:12px; overflow:hidden; }
  .status-tabs > button { flex:1; min-width:0; min-height:32px; padding:5px 2px; gap:3px; background:none; border:1px solid transparent; border-radius:9px; white-space:nowrap; color:#414a59; }
  .status-tabs > button.active { background:#e2f1ed; color:var(--accent); border-color:#d8ebe5; box-shadow:inset 0 1px 0 #ffffff80; }
  .status-tabs span { background:none; padding:0; }
  .inbox-tools { position:relative; display:block; padding:8px 12px; border-bottom:1px solid var(--line); }
  .inbox-tools input { width:100%; min-height:36px; height:36px; padding:7px 12px 7px 36px; border:0; border-radius:12px; background:#f2f5f4; }
  .inbox-tools > button { display:none; }
  .mobile-search-icon { display:block; position:absolute; left:24px; top:16px; width:18px; height:18px; color:#7b8594; }
  .mobile-search-icon .icon { width:18px; height:18px; }
  #mobile-source-label:not(:empty) { display:block; flex-shrink:0; padding:0 12px 8px; }
  .filter-summary { width:100%; padding:6px 10px; min-height:32px; color:var(--accent); background:var(--mint); border:0; }
  .filter-summary span { min-width:0; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:left; }
  .filter-summary .icon { width:14px; }
  .message-list { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:0; background:#fff; }
  .message-row,.message-row.active { margin:0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:#fff; }
  .message-row > .message-summary,.message-row.active > .message-summary { display:grid; grid-template-columns:minmax(0,1fr) 14px; align-items:start; column-gap:10px; width:100%; min-height:0; padding:9px 12px; text-align:left; border:0; border-radius:0; background:#fff; }
  .message-symbol { display:none; }
  .message-summary > .message-copy { display:block; grid-column:1; grid-row:1; min-width:0; width:100%; }
  .message-summary > .desktop-read-label { display:none; }
  .message-summary > .message-chevron { display:block; grid-column:2; grid-row:1; align-self:center; flex:0 0 14px; min-width:0; width:14px; color:#89929e; }
  .message-chevron .icon { width:14px; height:14px; }
  .mobile-message-meta { display:flex; align-items:baseline; gap:8px; color:#626e7e; margin-bottom:2px; }
  .mobile-message-meta > span { flex:1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .mobile-message-meta time { flex-shrink:0; }
  .message-summary strong { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:1; overflow:hidden; margin:0; }
  .message-summary .desktop-message-meta { display:none; }
  .message-summary .excerpt { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; white-space:normal; margin:2px 0; color:#667081; }
  .mobile-message-facts { display:flex; justify-content:space-between; align-items:baseline; gap:8px; color:#748092; }
  .mobile-message-facts > span:first-child { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

  /* Separate reading screen, full message and explicit 2 x 2 status control. */
  .reader { display:none; }
  .has-detail .inbox-list-heading,.has-detail .mobile-inbox-meta,.has-detail .message-panel { display:none; }
  .has-detail .mobile-inbox-heading { padding:8px 16px; border-bottom:0; }
  .has-detail .inbox-detail-heading { display:flex; align-items:center; gap:12px; }
  .inbox-detail-heading .text { color:var(--accent); padding:0; min-height:38px; }
  .message-pager { display:flex; margin-left:auto; gap:6px; }
  .message-pager .icon-button { width:36px; min-height:36px; height:36px; padding:8px; border:1px solid var(--line); border-radius:12px; background:#fff; }
  .has-detail .reader { display:flex; flex-direction:column; flex:1; min-height:0; padding:0; border:0; border-radius:0; overflow:hidden; }
  .reader-body { padding:12px 16px 0; flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
  .reader-source-date { display:flex; align-items:baseline; justify-content:space-between; gap:12px; color:#596474; margin-bottom:12px; }
  .reader-source-date > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .reader-source-date time { flex-shrink:0; }
  .reader h2 { display:block; overflow:visible; margin:0 0 10px; }
  .reader-title { margin:0 0 9px; }
  .reader-title .status { padding:3px 12px; border-radius:20px; background:var(--mint); color:var(--accent); }
  .reader-facts { display:flex; align-items:center; flex-wrap:wrap; gap:7px; color:#566174; margin-bottom:20px; }
  .reader-facts small { color:var(--muted); }
  .reader .message-preview { display:block; max-height:none; overflow:visible; -webkit-line-clamp:unset; white-space:pre-wrap; margin:0 0 20px; }
  .reader-section { border-top:1px solid var(--line); padding:16px 0; }
  .reader-section h3 { font-weight:400; color:#596474; margin:0 0 10px; }
  .keyword-line { display:flex; flex-wrap:wrap; gap:8px; margin:0; }
  .keyword-line span { padding:6px 16px; border-radius:24px; background:var(--mint); color:var(--accent); }
  .reader .contact-line { display:block; max-height:none; overflow:visible; margin:0; }
  .contact-line > div { display:flex; align-items:center; flex-wrap:wrap; gap:6px; min-height:42px; border:1px solid #dfe4e9; border-radius:10px; background:#f8f9fa; padding:2px 10px; }
  .contact-line a { color:#465268; background:none; padding:6px 0; min-width:0; overflow-wrap:anywhere; }
  .contact-line .icon-button { margin-left:auto; width:34px; height:36px; min-height:36px; padding:8px; border:0; background:none; color:#657082; }
  .reader-telegram { display:flex; align-items:center; gap:12px; min-height:48px; padding:10px 0; border-top:1px solid var(--line); text-decoration:none; color:var(--ink); }
  .reader-telegram > span:nth-child(2) { flex:1; }
  .reader-telegram > .icon { width:16px; color:#667081; }
  .reader .message-actions { flex-shrink:0; padding:12px 16px; margin:0; border-top:1px solid var(--line); background:#fff; }
  .message-action-heading { margin:0 0 10px; min-height:0; }
  .message-action-heading .message-telegram { display:none; }
  .lead-status-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .lead-status-options button { padding:8px 4px; min-height:40px; border-radius:12px; background:#fff; }
  .lead-status-options .active { background:linear-gradient(135deg,#e1f1eb,#edf7f3); border-color:#75b6a7; box-shadow:inset 0 1px 0 #fff; color:var(--accent); }

  /* Editor: same form data, compact panes and direct options. */
  .page-edit { padding:0; display:flex; overflow:hidden; }
  #search-form { display:flex; flex:1; flex-direction:column; min-height:0; }
  .editor-heading { display:grid; grid-template-columns:32px minmax(0,1fr) auto; align-items:center; gap:6px; padding:10px 16px; margin:0; background:#fff; }
  .editor-heading .page-heading-copy { display:contents; }
  .editor-heading .back { grid-column:1; width:32px; min-height:36px; padding:0; margin:0; font-size:0; color:var(--accent); }
  .editor-heading .back .icon { width:22px; height:22px; }
  .editor-heading h1 { grid-column:2; text-align:center; }
  .editor-heading .page-heading-actions { grid-column:3; }
  .editor-heading .primary { min-height:36px; border:0; padding:0 0 0 5px; background:none; box-shadow:none; color:var(--accent); }
  .editor-tabs { display:grid; grid-template-columns:repeat(3,1fr); flex-shrink:0; gap:0; margin:0; padding:5px 16px 10px; background:#fff; border-bottom:1px solid var(--line); }
  .editor-tabs button { min-height:36px; padding:6px 3px; border:0; border-radius:0; background:#f3f5f5; gap:7px; }
  .editor-tabs button:first-child { border-radius:8px 0 0 8px; }
  .editor-tabs button:last-child { border-radius:0 8px 8px 0; }
  .editor-tabs button.active { background:#e0f0eb; color:var(--ink); }
  .editor-tabs button span { min-width:22px; padding:0 4px; background:#e1e8e8; border-radius:16px; }
  .editor-grid { display:block; flex:1; min-height:0; overflow:auto; padding:16px; }
  .editor-grid > .panel { display:none; padding:14px; border:1px solid #e9eeec; border-radius:16px; overflow:visible; max-height:none; box-shadow:var(--surface-shadow); }
  #search-form[data-pane=conditions] .editor-conditions,#search-form[data-pane=sources] .editor-sources,#search-form[data-pane=summary] .editor-summary { display:block; }
  #search-form[data-pane=conditions] .mobile-initial-history { display:block; margin-top:14px; }
  .editor-grid label { margin-bottom:18px; gap:8px; }
  .editor-grid label input,.editor-grid label select { margin-top:0; }
  .editor-grid .language-settings > label { margin-bottom:8px; }
  .language-settings { padding:10px; margin:8px 0 14px; }
  #language-preview-form textarea { font-size:16px; line-height:22px; }
  .editor-grid h2 { margin-bottom:12px; }
  .editor-grid .section-title { margin-bottom:10px; }
  .editor-grid .section-title h2 { margin:0; }
  .tag-hint { display:block; color:#79818e; margin-top:-4px; font-weight:400; }
  .desktop-hint { display:none; }
  .tag-field { display:flex; flex-wrap:wrap; padding:0; gap:7px; min-height:0; border:0; background:none; border-radius:0; }
  .tag { padding:0 0 0 12px; min-height:30px; border-radius:18px; color:#173333; background:#dff0eb; }
  .tag button { min-width:30px; min-height:30px; height:30px; padding:0; }
  .tag-field input { width:100%; min-width:100%; min-height:44px; height:44px; margin-top:3px; padding:10px 12px; border:1px solid #dce1e6; border-radius:9px; background:#fff; }
  .mobile-conditions-options { display:block; margin:2px -14px -14px; }
  .mobile-conditions-options .settings-row { border-bottom:0; border-top:1px solid var(--line); padding:12px 14px; min-height:50px; }
  .mobile-conditions-options span { flex:1; }
  .mobile-conditions-options small { max-width:44%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--muted); }
  .mobile-conditions-options .icon:last-child { width:14px; color:#7b8594; }
  .history-segments { display:flex; gap:0; padding:3px; border-radius:9px; background:#f4f6f6; }
  .history-segments button { flex:1; min-width:0; min-height:36px; border:0; padding:6px 2px; border-radius:7px; background:none; white-space:nowrap; }
  .history-segments .active { background:var(--accent); color:#fff; }
  .editor-summary .initial-history { display:none; }
  .chosen-sources { max-height:none; }
  .chosen-source { padding:8px 0; gap:8px; }
  .chosen-source > span { min-width:0; overflow-wrap:anywhere; }
  .chosen-source .icon-button { border:0; }
  .geo-fields { margin-top:18px; padding-top:18px; }
  .toggle { min-height:44px; flex-direction:row; align-items:center; gap:10px; }
  .editor-summary dl { margin-bottom:20px; }
  .mobile-save { display:block; flex-shrink:0; padding:8px 16px; background:#fff; border-top:1px solid var(--line); }
  .mobile-save button { width:100%; min-height:44px; border-radius:12px; }

  /* Account: native grouped rows instead of desktop cards. */
  .page-account { padding-top:0; }
  .page-account .page-heading { margin:0 -12px 12px; padding:12px; background:#fff; border-bottom:1px solid #f0f2f2; }
  .account-profile { display:flex; align-items:center; gap:12px; padding:14px; border:1px solid #e9eeec; border-radius:16px; background:#fff; box-shadow:var(--surface-shadow); }
  .profile-avatar { width:44px; height:44px; border-radius:50%; display:grid; place-items:center; flex-shrink:0; background:#e5f0ff; color:var(--ink); }
  .account-profile > div { flex:1; min-width:0; }
  .account-profile strong,.account-profile small { display:block; }
  .account-profile small { margin-top:4px; color:#7b8290; }
  .account-profile > .icon { width:15px; color:#5e6875; }
  .settings-label { margin:18px 8px 7px; color:#77818e; }
  .settings-group { padding:0 14px; border:1px solid #e9eeec; border-radius:16px; background:#fff; box-shadow:var(--surface-shadow); }
  .settings-group .settings-row { min-height:48px; padding:10px 0; border-bottom:1px solid var(--line); gap:14px; font-weight:400; }
  .settings-group .settings-row:last-child { border-bottom:0; }
  .setting-icon { display:grid; place-items:center; width:24px; height:24px; flex-shrink:0; color:#15202b; }
  .setting-icon .icon { width:22px; height:22px; }
  .setting-icon.telegram { width:24px; height:24px; border-radius:50%; background:#22a5de; color:#fff; }
  .setting-icon.telegram .icon { width:16px; height:16px; }
  .connection-setting > .telegram { width:40px; height:40px; align-self:flex-start; }
  .connection-setting > .telegram .icon { width:27px; height:27px; }
  .setting-copy { flex:1; min-width:0; }
  .setting-copy strong { display:block; font-weight:400; }
  .setting-copy small { display:block; color:#7a8390; margin-top:4px; }
  .connection-setting .setting-copy small { color:#319f5a; }
  .connection-caption { display:block; margin-top:10px; color:#7b8290; }
  .settings-row > .icon { width:14px; color:#5e6875; }
  .setting-switch { width:48px; height:38px; min-width:48px; min-height:38px; border:0; padding:0; background:transparent; position:relative; }
  .setting-switch::before { content:""; width:46px; height:28px; border-radius:20px; position:absolute; background:#d4d9df; }
  .setting-switch > span { position:absolute; width:24px; height:24px; border-radius:50%; left:3px; background:#fff; box-shadow:0 1px 3px #0002; transition:left .15s; }
  .setting-switch[aria-checked=true]::before { background:var(--accent); }
  .setting-switch[aria-checked=true] > span { left:21px; }
  .setting-switch:hover { background:transparent; }
  .settings-logout { width:100%; min-height:54px; margin-top:18px; padding:12px 16px; border:1px solid #e9eeec; border-radius:16px; background:#fff; color:#df2739; justify-content:flex-start; gap:20px; }
  .account-footnote { color:#77818e; margin:12px 8px 0; }
  .mobile-connection { padding:14px 0; }
  .mobile-connection h2 { margin-bottom:12px; }
  .qr-setup { display:flex; flex-direction:column; gap:12px; margin:14px 0; }
  .qr-box { width:180px; height:180px; }
  .qr-setup ol { margin:0 0 12px; padding-left:20px; }
  .settings-error { padding:10px 0; }

  /* Dialogs have bounded width; sources use the whole phone screen. */
  dialog { box-sizing:border-box; width:calc(100vw - 24px); min-width:0; max-width:calc(100vw - 24px); max-height:calc(100dvh - 32px - var(--radar-inset-top,0px) - var(--mobile-safe)); padding:18px; border-radius:16px; margin:auto; overflow:auto; }
  .modal-heading { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
  .modal-heading h2 { min-width:0; flex:1; }
  .modal-heading .icon-button { border:0; background:#f5f7f7; }
  .modal-actions { gap:8px; flex-wrap:wrap; }
  .search-picker-list { max-height:44dvh; }
  .search-picker-item { min-width:0; width:100%; }
  .search-picker-copy { min-width:0; flex:1; }
  .search-picker-copy strong { white-space:normal; overflow-wrap:anywhere; }
  .search-picker-footer { gap:8px; flex-wrap:wrap; }
  .source-picker-modal { position:fixed; inset:0; width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; padding:0; margin:0; border:0; border-radius:0; }
  .source-picker-modal[open] { display:flex; flex-direction:column; overflow:hidden; }
  .source-picker-modal > * { flex-shrink:0; }
  .source-picker-modal .modal-heading { display:grid; grid-template-columns:44px 1fr 64px; margin:0; padding:10px 12px; border-bottom:1px solid var(--line); }
  .source-picker-modal .modal-heading h2 { text-align:center; }
  .source-picker-modal .modal-heading button { padding:0; border:0; background:none; color:var(--accent); }
  .source-search-input { margin:12px 16px 8px; padding:0 12px; background:#f3f4f6; border-radius:12px; gap:8px; }
  .source-search-input input { padding-left:0; border:0; background:none; }
  .source-search-input > .icon { color:#7b8594; }
  .source-picker-meta { padding:0 16px; margin:0; border-bottom:1px solid var(--line); }
  .source-picker-meta .text { color:var(--accent); min-height:38px; }
  .source-picker-modal .chat-list { flex:1; min-height:0; max-height:none; overflow:auto; margin:0; padding:0 16px; }
  .chat-option { display:flex; min-height:58px; padding:8px 0; margin:0; gap:14px; border-bottom:1px solid var(--line); }
  .chat-option > span:last-child { flex:1; min-width:0; }
  .chat-option strong { display:block; font-weight:500; }
  .chat-option small { margin-top:3px; color:#7a8390; }
  .chat-option .source-avatar { display:grid; place-items:center; width:38px; height:38px; min-width:38px; border-radius:50%; background:#dcecff; color:#243c49; }
  .chat-option:nth-child(5n+2) .source-avatar { background:#f8ecd7; }
  .chat-option:nth-child(5n+3) .source-avatar { background:#d8eee5; }
  .chat-option:nth-child(5n+4) .source-avatar { background:#e8e1f5; }
  .chat-option:nth-child(5n) .source-avatar { background:#fbe0e6; }
  .chat-option > input { order:3; position:relative; flex-shrink:0; appearance:none; width:28px; height:28px; min-height:28px; padding:0; margin-left:auto; border:1px solid #b7bfc9; border-radius:50%; background:#fff; }
  .chat-option > input:checked { border-color:var(--accent); background:var(--accent); }
  .chat-option > input:checked::after { content:""; position:absolute; left:8px; top:4px; width:8px; height:14px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
  .source-picker-modal .modal-actions { padding:10px 16px calc(10px + var(--mobile-safe)); margin:0; border-top:1px solid var(--line); }
  .source-picker-modal .modal-actions .primary { width:100%; min-height:44px; }
  .read-label { padding:1px 6px; border-radius:5px; background:#f1f4f4; }
  .read-label.is-unread { background:#e9f5f0; }
  #toast { bottom:calc(var(--mobile-nav) + 12px); left:12px; right:12px; width:auto; max-width:none; transform:none; padding:12px; }
  #toast.show { transform:none; }
  body:has(.has-detail) #toast { bottom:calc(var(--mobile-nav) + 154px); }
  #toast button { min-height:44px; flex-shrink:0; }
  .auth-page { height:100%; overflow:auto; padding:16px; gap:16px; }
  .auth-help summary { min-height:44px; }
  .phone-copy { display:inline; }
  .desktop-copy { display:none; }
}
@media (max-width:360px) {
  .main { padding-left:12px; padding-right:12px; }
  .page-inbox,.page-edit { padding:0; }
  .page-account .page-heading { margin-left:-12px; margin-right:-12px; padding-left:12px; padding-right:12px; }
  .status-tabs { margin:0 8px; }
  .status-tabs button { gap:2px; padding-left:1px; padding-right:1px; }
  .status-tabs button:last-child span { display:none; }
  .message-summary > .message-copy { min-width:0; }
  .search-row { padding-left:12px; padding-right:12px; }
  .search-actions button { font-size:11px; }
}

@media (prefers-reduced-motion:reduce) { .bottom-nav button,button,.button { transition:none; } }
@media (prefers-reduced-transparency:reduce) { .bottom-nav { background:#fff; backdrop-filter:none; -webkit-backdrop-filter:none; } }

@media (max-width:960px) and (max-height:500px) { .lead-status-options { grid-template-columns:repeat(4,minmax(0,1fr)); } .reader .message-actions { padding-top:8px; padding-bottom:8px; } .message-action-heading { margin-bottom:6px; } }
