/* Lilac Pearl — Android WebView workspace.
   Presentation-only layer: existing buttons, forms and native bridge remain live. */
@media (max-width: 760px) {
  html.android-webview {
    --lilac: #6846e8;
    --lilac-strong: #5736d5;
    --lilac-soft: #f1edff;
    --ink: #211545;
    --muted: #766995;
    --line: #e6def7;
    background: #f8f6ff;
  }

  html.android-webview body,
  html.android-webview #app,
  html.android-webview .shell { background: #f8f6ff; color: var(--ink); }

  /* Header mirrors the approved compact Android layout; the real /assets/bulatkin-logo.png remains untouched. */
  html.android-webview .shell .topbar {
    grid-template-columns: 38px minmax(112px, 1fr) 38px;
    grid-template-rows: 42px 40px 58px;
    gap: 7px 8px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    border-bottom: 1px solid #ece7f7;
    background: linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);
    box-shadow: 0 5px 18px rgba(65, 40, 123, .05);
  }
  html.android-webview .topbar .brand { grid-column: 1 / 3; grid-row: 1; width: auto; gap: 9px; }
  html.android-webview .topbar .brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 4px 12px rgba(91, 61, 190, .14); }
  html.android-webview .topbar .brand > div { display: block; min-width: 0; }
  html.android-webview .topbar .brand strong { display: block; color: var(--ink); font-size: 16px; letter-spacing: -.025em; line-height: 1.12; white-space: nowrap; }
  html.android-webview .topbar .brand span { display: none; }
  html.android-webview .topbar .mobile-profile-button { top: max(12px, env(safe-area-inset-top)); right: 14px; width: 38px; height: 38px; border-color: #e7def4; background: #fff; box-shadow: 0 3px 9px rgba(66, 42, 121, .08); }
  html.android-webview .topbar .mobile-profile-button .avatar { width: 30px; height: 30px; }
  html.android-webview .topbar .presence-control { grid-column: 1 / 2; grid-row: 2; min-height: 38px; height: 38px; padding: 0 9px; border: 1px solid #e9e1f5; border-radius: 12px; background: #fff; box-shadow: 0 2px 6px rgba(68, 45, 123, .04); }
  html.android-webview .topbar .presence-control > button { font-size: 13px !important; color: #34235f; }
  html.android-webview .topbar .presence-control .dot { width: 12px; height: 12px; background: #10bd71; box-shadow: 0 0 0 4px #e5f9ef; }
  html.android-webview .topbar .workspace-nav-controls { grid-column: 3; grid-row: 2; width: 38px; }
  html.android-webview .topbar .workspace-nav-controls button:first-child { display: none; }
  html.android-webview .topbar .workspace-nav-controls button { width: 38px; height: 38px; min-height: 38px; border: 1px solid #e8dff5; border-radius: 12px; color: var(--lilac); background: #fff; box-shadow: 0 2px 7px rgba(64, 36, 117, .08); }
  html.android-webview .topbar .tabs { grid-column: 1 / -1; grid-row: 3; height: 58px; min-height: 58px; padding: 4px; border: 1px solid #e8e0f4; border-radius: 15px; background: #f7f4fc; box-shadow: inset 0 1px #fff; }
  html.android-webview .topbar .tabs .tab { height: 48px; min-height: 48px; border-radius: 11px; font-size: 12px; color: #6d5c94; }
  html.android-webview .topbar .tabs .tab .lucide { width: 19px; height: 19px; }
  html.android-webview .topbar .tabs .tab.active { color: #fff; background: linear-gradient(135deg, #805cff 0%, #5f37df 100%); box-shadow: 0 7px 14px rgba(94, 54, 213, .25), inset 0 1px rgba(255,255,255,.3); }
  html.android-webview .topbar .header-search { display: none; }

  html.android-webview .shell .content { padding: 12px 12px calc(86px + env(safe-area-inset-bottom)); }
  html.android-webview .lead-layout { gap: 10px; }
  html.android-webview .card { border: 1px solid #ece6f6; border-radius: 17px; background: rgba(255,255,255,.92); box-shadow: 0 6px 20px rgba(69, 42, 124, .07); }

  /* The campaign remains a real dynamic badge; only its wording is visually compacted. */
  html.android-webview .callbar.card { grid-template-columns: minmax(0, 1fr) 38px; gap: 9px; padding: 12px; }
  html.android-webview .callbar .operator-campaign-badge { grid-column: 1; grid-row: 1; font-size: 13px !important; line-height: 38px !important; color: #3c246d !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.android-webview .callbar .sip-inline-control { grid-column: 2; grid-row: 1; min-height: 38px; }
  html.android-webview .callbar .sip-inline-control .switch { width: 38px; flex-basis: 38px; height: 22px; min-height: 22px; background: #d9d6e2; }
  html.android-webview .callbar .sip-inline-control .switch:after { width: 16px; height: 16px; top: 3px; left: 3px; }
  html.android-webview .callbar .sip-inline-control .switch.on { background: linear-gradient(135deg, #805cff, #6138e0); }
  html.android-webview .callbar .sip-inline-control .switch.on:after { left: 19px; }
  html.android-webview .callbar #sip-settings { display: none; }
  html.android-webview .callbar .callstate { grid-column: 1 / -1; grid-row: 2; padding: 10px 11px; gap: 10px; border: 1px solid #eee8f8; border-radius: 13px; background: linear-gradient(135deg, #fff 0%, #f9f6ff 100%); }
  html.android-webview .callbar .call-icon { width: 28px; height: 28px; min-width: 28px; margin-top: 0; background: #e5f9ee; color: #13b86f; box-shadow: 0 0 0 6px #f4fcf7; }
  html.android-webview .callbar .callstate strong { font-size: 14px; color: #26184c; }
  html.android-webview .callbar .callstate small { display: none; }
  html.android-webview .callbar .dial-field { grid-column: 1 / -1; margin-top: 1px; }
  html.android-webview .callbar .dial-field label { display: none; }
  html.android-webview .callbar input.call-number { height: 52px; min-height: 52px; border: 0; border-radius: 13px; background: #fbfaff; color: #27174d; font-size: 25px; font-weight: 750; letter-spacing: -.035em; box-shadow: inset 0 0 0 1px #eee7f7; }
  html.android-webview .callbar #call-button { min-height: 48px; padding: 12px; border: 0; border-radius: 13px; background: linear-gradient(135deg, #835eff 0%, #6037dd 100%); color: #fff; font-size: 15px; font-weight: 750; box-shadow: 0 8px 16px rgba(91, 52, 207, .25), inset 0 1px rgba(255,255,255,.28); }
  html.android-webview .callbar #call-button:disabled { color: #fff; opacity: .52; background: linear-gradient(135deg, #9c82eb, #765ad7); }

  html.android-webview .lead-card.card-pad, html.android-webview .workflow-card { padding: 14px; border-radius: 17px; }
  html.android-webview .lead-card.card-pad { gap: 14px; }
  html.android-webview .lead-card .dynamic-card-sections { gap: 14px; }
  html.android-webview .lead-card .lead-data-section + .lead-data-section { padding-top: 14px; border-color: #ede7f6; }
  html.android-webview .lead-card .lead-data-section .section-title { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; color: #25164a; font-size: 17px; }
  html.android-webview .lead-card .lead-data-section .section-title:before { content: '●'; color: var(--lilac); font-size: 13px; }
  html.android-webview .lead-card .field label { color: #796b99; font-size: 12px; }
  html.android-webview .lead-card .field input, html.android-webview .lead-card .field select { min-height: 45px; border-color: #e6def2; border-radius: 11px; background: #fcfbff; color: #2a1a50; font-size: 14px; }

  html.android-webview .call-result-panel { padding-top: 2px; }
  html.android-webview .lead-card .result-title { margin: 0; color: #28164f; font-size: 17px; }
  html.android-webview .lead-card .result-title small { display: block; margin-top: 3px; color: #846fab; font-size: 12px; font-weight: 500; }
  html.android-webview .lead-card .results { gap: 8px; margin: 12px 0 15px; }
  html.android-webview .lead-card .result { min-height: 48px; padding: 9px 10px; border: 1px solid #e8e0f4; border-radius: 12px; background: #fcfbff; color: #4b3978; font-size: 13px; }
  html.android-webview .lead-card .result.selected { border-color: #9d7bf1; color: #5b34dd; background: linear-gradient(135deg, #f5f0ff, #eee6ff); box-shadow: inset 0 0 0 1px #9d7bf1, 0 3px 8px rgba(109,68,215,.09); }
  html.android-webview .lead-card .result .radio { width: 20px; height: 20px; border-color: #81719e; }
  html.android-webview .lead-card .result.selected .radio { border-color: #6b40e4; box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 8px #6b40e4; }
  html.android-webview .lead-card textarea { min-height: 96px; border-color: #e6def2; border-radius: 12px; background: #fcfbff; color: #2d1d53; }
  html.android-webview .lead-card #save-result { min-height: 50px; border: 0; border-radius: 13px; background: linear-gradient(135deg, #835eff, #6037dd); font-size: 14px; font-weight: 750; box-shadow: 0 8px 16px rgba(91,52,207,.22), inset 0 1px rgba(255,255,255,.28); }
  html.android-webview .lead-card .next-actions { padding: 12px; border-color: #e9e1f4; border-radius: 14px; background: #fbf9ff; }
  html.android-webview .lead-card .next-actions .actions { gap: 8px; }
  html.android-webview .lead-card .next-actions .secondary { min-height: 43px; border-radius: 11px; color: #5b3fa2; border-color: #e5dcf3; background: #fff; }

  /* Script/history/tasks keep their real buttons and are styled as the approved compact second screen. */
  html.android-webview .workflow-card { padding-bottom: 16px; }
  html.android-webview .workflow-tabs { position: sticky; top: 0; z-index: 2; margin: -2px 0 12px; padding: 4px; border: 1px solid #ebe4f6; border-radius: 13px; background: #f8f5fc; overflow: visible; }
  html.android-webview .workflow-tab { min-height: 42px; padding: 7px 6px; border-radius: 10px; color: #6e5c94; font-size: 12px; }
  html.android-webview .workflow-tab.active { color: #fff; background: linear-gradient(135deg, #805cff, #6038de); box-shadow: 0 5px 11px rgba(91,52,207,.2); }
  html.android-webview .workflow-heading h2 { color: #27164e; font-size: 18px; }
  html.android-webview .workflow-heading .muted { color: #806da4; }
  html.android-webview .workflow-heading-actions .secondary { min-height: 36px; padding: 7px 9px; border-radius: 10px; }
  html.android-webview .workflow-card .script-steps { gap: 10px; }
  html.android-webview .workflow-card .script-steps article { padding: 12px; border-color: #e8e0f4; border-radius: 13px; background: linear-gradient(135deg, #fff, #faf8ff); }
  html.android-webview .workflow-card .script-steps article > span { width: 34px; height: 34px; min-width: 34px; color: #6138df; background: #f0ebff; font-size: 16px; }
  html.android-webview .workflow-card .script-steps b { color: #2a1950; }
  html.android-webview .workflow-card .script-steps p { color: #4d3c75; line-height: 1.45; }
}

@media (max-width: 350px) {
  html.android-webview .topbar .brand strong { font-size: 14px; }
  html.android-webview .callbar input.call-number { font-size: 21px; }
  html.android-webview .lead-card .result { padding: 8px; font-size: 12px; }
}
