/* Выбранный мобильный сценарий. Стили применяются только в отдельной сборке Android. */
body.mobile-app #auth-screen { display:flex; align-items:stretch; justify-content:center; min-height:100dvh; padding:0; background:#f7f7f4; }
body.mobile-app #auth-screen.hidden { display:none!important; }
body.mobile-app #auth-screen .auth-card { display:flex; flex-direction:column; width:min(100%,480px); max-width:480px; min-height:100dvh; margin:0 auto; padding:calc(34px + env(safe-area-inset-top)) 24px calc(18px + env(safe-area-inset-bottom)); border:0; border-radius:0; box-shadow:none; background:#f7f7f4; box-sizing:border-box; }
body.mobile-app .mobile-auth-brand { display:flex; flex-direction:column; align-items:flex-start; gap:10px; margin:12px 0 28px; color:#52657b; font-size:12px; font-weight:600; line-height:1.3; }
body.mobile-app .mobile-auth-brand img { display:block; width:56px; height:56px; border-radius:15px; }
body.mobile-app .mobile-auth-heading { margin:0 0 8px; color:#25384e; font:700 25px/1.25 Arial,sans-serif; }
body.mobile-app .mobile-auth-subtitle { margin:0 0 18px; color:#65778b; font:400 14px/1.5 Arial,sans-serif; }
body.mobile-app #auth-screen .auth-title, body.mobile-app #auth-screen .auth-tabs { display:none; }
body.mobile-app #auth-screen .auth-form { gap:14px; }
body.mobile-app #auth-screen .auth-form label:not(.auth-consent) { gap:7px; color:#43596f; font-size:13px; font-weight:600; }
body.mobile-app #auth-screen .auth-form input:not([type="checkbox"]) { width:100%; min-width:0; min-height:52px; padding:12px 13px; border:1px solid #cbd6e2; border-radius:12px; background:#fff; color:#24364b; font:400 16px/1.4 Arial,sans-serif; box-sizing:border-box; }
body.mobile-app #auth-screen .auth-form input:focus-visible { outline:2px solid #315579; outline-offset:1px; }
body.mobile-app #auth-screen .auth-form button[type="submit"] { width:100%; min-height:52px; margin:3px 0 0; padding:12px; border-radius:12px; background:#315579; color:#fff; font-size:16px; font-weight:700; }
body.mobile-app #auth-screen .auth-small-action { align-self:flex-start; min-height:42px; width:auto; margin:-8px 0 0!important; padding:4px 0!important; background:none!important; color:#315579!important; font-size:13px; font-weight:600; }
body.mobile-app #auth-screen #btn-forgot { align-self:flex-end; width:auto; min-height:44px; margin:-9px 0 -2px; padding:4px 0; background:none; color:#315579; font-size:14px; font-weight:600; }
body.mobile-app #auth-screen .mobile-auth-switch { display:block; width:100%; min-height:48px; margin:14px 0 0; padding:8px; border:0; border-radius:10px; background:transparent; color:#315579; font:600 15px Arial,sans-serif; cursor:pointer; }
body.mobile-app #auth-screen .mobile-auth-switch.hidden { display:none!important; }
body.mobile-app #auth-screen .auth-note { margin:auto 0 0; padding:24px 0 0; color:#708092; font-size:11px; line-height:1.55; }
body.mobile-app #auth-screen .auth-error { font-size:13px; line-height:1.4; }
body.mobile-app #auth-screen .auth-form button:focus-visible, body.mobile-app #auth-screen .mobile-auth-switch:focus-visible { outline:2px solid #315579; outline-offset:2px; }
body.mobile-app #auth-screen #register-form .auth-consent { display:flex; align-items:flex-start; gap:10px; font-size:13px; line-height:1.5; }
body.mobile-app #auth-screen #register-form .auth-consent input { flex:none; width:20px; height:20px; margin:1px 0 0; }
body.mobile-app #auth-screen #recover-block .link-btn { min-height:46px; border-radius:10px; }
body.mobile-app #auth-screen .registration-pending { padding-top:6px; }
@media(max-width:360px){body.mobile-app #auth-screen .auth-card{padding-left:18px;padding-right:18px}body.mobile-app .mobile-auth-heading{font-size:22px}}
@media(max-height:680px){body.mobile-app .mobile-auth-brand{margin:0 0 18px}body.mobile-app #auth-screen .auth-note{padding-top:16px}}

@media(max-width:720px){
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-workspace-heading { padding-left:10px; padding-right:10px; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-mobile-bar { display:grid; grid-template-columns:44px 44px minmax(0,1fr) 44px; align-items:center; gap:6px; margin:0; min-width:0; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-mobile-title { display:block; min-width:0; width:100%; text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#263b53; font:700 16px/1.35 Arial,sans-serif; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat #btn-ai-chats,
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat #btn-ai-mobile-back,
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat #btn-ai-mobile-new { width:44px; min-width:44px; height:44px; min-height:44px; padding:0; border:0; border-radius:12px; background:transparent; color:#315579; font:600 23px/1 Arial,sans-serif; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat #btn-ai-chats { display:grid; place-items:center; font-size:22px; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat #btn-ai-mobile-new { font-size:27px; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-chat-messages { padding:16px 4px 20px!important; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-chat-bubble { font:400 15px/1.65 Arial,sans-serif!important; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-chat-bubble.user { max-width:min(85%,360px); padding:10px 13px; border-radius:17px 17px 5px 17px; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-chat-bubble.assistant { padding:0; border:0; background:transparent; box-shadow:none; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-chat-bubble-actions { gap:6px; flex-wrap:wrap; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-chat-copy-btn { width:42px; min-width:42px; height:42px; min-height:42px; padding:0; border:0; background:transparent; color:#62748a; font-size:0; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-rate-btn { min-width:42px; min-height:42px; filter:grayscale(1); font-size:17px; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-chat-input-row { padding:8px 12px calc(10px + env(safe-area-inset-bottom)); }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-chat-input-inner { padding:8px 10px!important; border:1px solid #d7e0e9!important; border-radius:18px!important; box-shadow:none!important; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat #ai-chat-input { min-height:48px; max-height:35dvh; padding:8px 4px; font-size:16px; line-height:1.5; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-chat-tools { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center; gap:8px; width:100%; margin-top:3px; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-attach-btn { width:44px; min-width:44px; height:44px; min-height:44px; padding:0; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat #btn-ai-mobile-tools { display:flex; align-items:center; justify-content:center; width:100%; min-width:0; height:44px; min-height:44px; padding:0 10px; border:0; border-radius:10px; background:#edf2f7; color:#315579; font:600 13px Arial,sans-serif; letter-spacing:0; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat #btn-ai-chat-send { width:44px; min-width:44px; height:44px; min-height:44px; margin:0; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-chat-drop-area { position:relative; padding:0; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-chat-drop-area:has(.mobile-ai-settings:not(.hidden))::after { content:''; position:absolute; inset:0; z-index:49; background:#182b3d75; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .mobile-ai-settings:not(.hidden) { display:flex; position:absolute; z-index:50; top:auto; bottom:0; left:0; right:0; width:100%; max-height:min(78dvh,660px); margin:0; padding:16px 18px calc(20px + env(safe-area-inset-bottom)); border:0; border-radius:20px 20px 0 0; box-sizing:border-box; overflow-y:auto; background:#fff; box-shadow:0 -12px 36px #20334b25; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .mobile-ai-settings-head { position:sticky; top:-16px; z-index:2; min-height:48px; margin:-16px -18px 6px; padding:14px 18px 8px; background:#fff; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .mobile-ai-settings .model-picker { flex:none; min-width:0; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .mobile-ai-settings .model-picker-btn { width:100%; overflow:hidden; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .mobile-ai-settings .ai-quick-bar { order:5; }
  body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .mobile-ai-settings .ai-quick-bar::before { content:'Быстрые действия'; display:block; width:100%; margin:4px 0; color:#52657b; font-size:13px; font-weight:700; }
  body.mobile-app.mobile-keyboard-open[data-mobile-screen="ai-chat"] #tab-content-ai-chat { height:min(100dvh,var(--mobile-visible-height,100dvh)); }
}
@media(max-width:360px){body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-mobile-bar{gap:3px}body.mobile-app[data-mobile-screen="ai-chat"] #tab-content-ai-chat .ai-mobile-title{font-size:15px}}

body.mobile-app #auth-screen .mobile-login-links { display:flex; align-items:center; justify-content:space-between; gap:8px; }
body.mobile-app #auth-screen .mobile-login-links .auth-small-action,
body.mobile-app #auth-screen .mobile-login-links #btn-forgot { flex:0 1 auto; align-self:auto; width:auto; min-height:44px; margin:0!important; padding:4px 0!important; font-size:13px; white-space:nowrap; }
body.mobile-app #auth-screen #login-error:empty { display:none; }

/* Геометрия мелких элементов и свободная строка номера дела. */
body.mobile-app #app #bell-badge { top:-3px; right:-3px; width:18px; min-width:18px; height:18px; padding:0; box-sizing:border-box; border:1px solid #fff; border-radius:50%; font:600 10px/1 Arial,sans-serif; font-variant-numeric:tabular-nums; }
body.mobile-app #app #tab-content-tasks .day-cell .num { font-size:16px; line-height:22px; }
body.mobile-app #app #tab-content-tasks .day-cell { min-height:58px; }
body.mobile-app .mobile-month-number { font-size:14px; line-height:20px; }
body.mobile-app .mobile-month-marks { align-items:center; gap:4px; height:8px; }
body.mobile-app .mobile-month-marks i { width:6px; min-width:6px; max-width:6px; height:6px; min-height:6px; flex:0 0 6px; border-radius:50%; box-sizing:border-box; }
body.mobile-app .mobile-month-day.selected .mobile-month-marks i { outline:1px solid #fff; outline-offset:0; }
body.mobile-app #app .mobile-record-header { display:grid!important; grid-template-columns:minmax(0,1fr) auto; gap:6px 10px; align-items:center!important; }
body.mobile-app .mobile-record-type { color:#68798a; font-size:12px; }
body.mobile-app .mobile-record-side { max-width:none; grid-column:2; grid-row:1; }
body.mobile-app .mobile-record-side .status-badge { font-size:10px; }
body.mobile-app #app .mobile-record-header .record-number { display:block; grid-column:1 / -1; font-size:16px; line-height:1.4; min-width:0; margin:1px 0; overflow-wrap:anywhere; }
body.mobile-app .mobile-record-header .mobile-record-sub,
body.mobile-app .mobile-record-header .custody-badge { grid-column:1 / -1; }
body.mobile-app .mobile-record-header .mobile-record-deadline { grid-column:1; font-size:12px; }
body.mobile-app .mobile-record-header .mobile-open-label { grid-column:2; justify-self:end; font-size:11px; }
body.mobile-app .mobile-day-deadline strong { grid-column:1 / -1; }
body.mobile-app .mobile-day-deadline small { grid-row:1; }
body.mobile-app #tab-content-ai-chat .ai-chat-bubble-actions { display:flex; align-items:center; gap:2px; margin-top:8px; }
body.mobile-app #tab-content-ai-chat .ai-chat-bubble-actions .ai-chat-copy-btn,
body.mobile-app #tab-content-ai-chat .ai-chat-bubble-actions .ai-rate-btn { display:inline-flex; align-items:center; justify-content:center; width:44px; min-width:44px; height:44px; min-height:44px; padding:0; border:0; border-radius:10px; background:transparent; color:#687b8c; opacity:1; filter:none; }
body.mobile-app #tab-content-ai-chat .ai-chat-bubble-actions svg { display:block; width:19px; height:19px; flex:none; }
body.mobile-app #tab-content-ai-chat .ai-rate { display:flex; gap:2px; margin-left:0; }
body.mobile-app #tab-content-ai-chat .ai-rate-btn.chosen { background:#eaf0f5; color:#315579; }
body.mobile-app #tab-content-ai-chat .ai-chat-copy-btn.copied { color:#38745b; }
body.mobile-app #tab-content-ai-chat .ai-rate.rated .ai-rate-btn:not(.chosen) { opacity:.45; }
/* Явные строки исключают позиционирование nth-child из таблицы сайта. */
body.mobile-app #app .mobile-record-header > .mobile-record-type { grid-column:1; grid-row:1; }
body.mobile-app #app .mobile-record-header > .mobile-record-side { grid-column:2; grid-row:1; }
body.mobile-app #app .mobile-record-header > .record-number { grid-column:1 / -1; grid-row:2; }
body.mobile-app #app .mobile-record-header > .mobile-record-sub { grid-column:1 / -1; grid-row:3; }
body.mobile-app #app .mobile-record-header > .mobile-record-deadline { grid-column:1; grid-row:4; }
body.mobile-app #app .mobile-record-header > .mobile-open-label { grid-column:2; grid-row:4; }
body.mobile-app #app .mobile-record-header > .custody-badge { grid-column:1 / -1; grid-row:5; }

body.mobile-app #app .mobile-record-header > .mobile-record-footer { grid-column:1 / -1; grid-row:4; display:flex; align-items:center; justify-content:space-between; gap:12px; }
body.mobile-app .mobile-record-footer .mobile-open-label { flex:none; }

/* Значки не зависят от метрик шрифта Android и располагаются по центру кнопок. */
body.mobile-app #tab-content-ai-chat .ai-mobile-bar > button { display:grid!important; place-items:center; line-height:1; box-sizing:border-box; flex:none; }
body.mobile-app #tab-content-ai-chat .ai-mobile-bar > button svg { display:block; width:22px; height:22px; margin:0; padding:0; flex:none; }
body.mobile-app #tab-content-ai-chat .ai-greeting-mark { display:grid; place-items:center; width:52px; min-width:52px; height:52px; min-height:52px; flex:0 0 52px; padding:0; box-sizing:border-box; line-height:1; }
body.mobile-app #tab-content-ai-chat .ai-greeting-mark svg { display:block; width:28px; height:28px; margin:0; padding:0; }
body.mobile-app #tab-content-ai-chat .ai-chat-greeting { width:100%; box-sizing:border-box; }
