/* BL-35, BL-36, BL-45: the looks of the screens that came without styles of their own.
   Hooks it leans on (a rename in the markup needs a rename here): #aiConsentDialog, #nativeUpdateDialog, #nativeUpdateSheet, #nativeNotifyDialog,
   [data-ai-consent-agree|later|block|purpose|recipient], [data-update-screen], .exact-assist__consent, .exact-more--privacy,
   .exact-more__security-row, .exact-more__password, .exact-more__push--off|unconfigured. Tokens: --cdx-* (exact-shell.css), --xm-* (.exact-more). */

/* Privacy section: a document link looks like the rows next to it (dark text, no underline, an arrow at the right). */
.exact-more--privacy a.exact-more__security-row { color: var(--xm-ink); text-decoration: none; }
.exact-more--privacy a.exact-more__security-row::after { content: ""; flex: 0 0 20px; width: 20px; height: 20px; background: var(--xm-muted); -webkit-mask: var(--cdx-chevron) center / 20px no-repeat; mask: var(--cdx-chevron) center / 20px no-repeat; }
.exact-more--privacy a.exact-more__security-row:has(> svg:last-child)::after { content: none; }
:root { --cdx-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9.5 5 7 7-7 7'/%3E%3C/svg%3E"); }
/* "Отозвать" is the quiet action; "Дать согласие" keeps the dark one. */
.exact-more--privacy .exact-more__password > button[data-ai-consent-revoke] { border: 1px solid var(--xm-field); background: #fff; color: var(--xm-ink); }
.exact-more--privacy .exact-more__password > button[data-ai-consent-revoke]:active { background: var(--xm-page); }
/* While the status is read the card has text and no button: a pale bar stands where the button will be, so the card keeps its height. */
.exact-more--privacy .exact-more__password:not(:has(button))::after { content: ""; height: 48px; margin-top: 4px; border-radius: 12px; background: var(--xm-page); animation: cdx-calm 1.6s ease-in-out infinite; }
@keyframes cdx-calm { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .exact-more--privacy .exact-more__password:not(:has(button))::after { animation: none; } }

/* Consent sheet (the website draws it too). The text scrolls inside the sheet, the two buttons stay at its bottom edge: they are sticky inside
   the scrolling <div>, 52 px high with 14 px between them, and a sticky white pad of the same size sits behind them (the ::after) so that no text shows round their corners. */
#aiConsentDialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#aiConsentDialog > div { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#aiConsentDialog > div > * { flex-shrink: 0; }
#aiConsentDialog ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
#aiConsentDialog li { position: relative; padding-left: 16px; font-size: 15px; line-height: 21px; color: var(--cd-color-ink-text2); }
#aiConsentDialog li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--cdx-red); }
#aiConsentDialog li strong { color: var(--cdx-ink); font-weight: 600; }
#aiConsentDialog li[data-ai-consent-purpose] > p { margin: 0; }
#aiConsentDialog li[data-ai-consent-purpose] > p:first-child { color: var(--cdx-ink); font-weight: 600; }
#aiConsentDialog h3 { margin: 10px 0 -6px; font-size: 16px; line-height: 21px; font-weight: 600; color: var(--cdx-ink); }
#aiConsentDialog a { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; margin: -4px 0; color: var(--cdx-ink); font-size: 15px; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
#aiConsentDialog :is([data-ai-consent-agree], [data-ai-consent-later]) { position: sticky; z-index: 1; }
#aiConsentDialog [data-ai-consent-later] { bottom: 0; }
#aiConsentDialog [data-ai-consent-agree] { bottom: 66px; }
#aiConsentDialog > div::after { content: ""; flex: none; position: sticky; bottom: 0; z-index: 0; height: 132px; margin-top: -146px; background: #fff; }

/* Assistant after a refusal: the padding of the chat column (16 px, plus the side strips and the gutter of wide screens),
   room above, and the button clear of the bottom safe area; it is the red main button, as everywhere. */
.cdx-shell-ready #app > .view > .exact-assist__consent { padding: 16px calc(16px + var(--cdx-gutter-r, var(--cdx-safe-right, 0px))) calc(16px + var(--cdx-safe-bottom)) calc(16px + var(--cdx-gutter-l, var(--cdx-safe-left, 0px))); gap: 12px; }
.exact-assist__consent p { margin: 0; font-size: 15px; line-height: 21px; font-weight: 500; color: var(--cdx-ink); }
.exact-assist__consent .button { min-height: 52px; font-weight: 600; }

/* "Нужно обновить приложение" and the old WebView: a whole screen over the app, nothing to go back to. The strips of the header colour
   keep the light icons of the status bar and of the navigation bar legible (a dialog is above the strip that the shell lays at the top). */
#nativeUpdateDialog[open] {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; box-sizing: border-box;
  display: flex; flex-direction: column; overflow-y: auto; text-align: center;
  padding: calc(24px + var(--cdx-safe-top, 0px)) calc(24px + var(--cdx-safe-right, 0px)) calc(24px + var(--cdx-safe-bottom)) calc(24px + var(--cdx-safe-left, 0px));
  background: linear-gradient(var(--cdx-chrome), var(--cdx-chrome)) top / 100% var(--cdx-safe-top, 0px) no-repeat, linear-gradient(var(--cdx-chrome), var(--cdx-chrome)) bottom / 100% var(--cdx-safe-bottom) no-repeat, #fff;
}
#nativeUpdateDialog > div { width: 100%; max-width: 360px; margin: auto; gap: 16px; }
#nativeUpdateDialog h2 { font-size: 24px; line-height: 30px; text-wrap: balance; }
#nativeUpdateDialog p { font-size: 16px; line-height: 22px; text-wrap: pretty; }
#nativeUpdateDialog .button { margin-top: 8px; }

/* Keyboard focus: the ink ring of the app (the chat name field has it). Once the markup gives the title tabindex="-1" autofocus, a screen opened
   by the program puts the focus on the title (no ring) and Tab brings the ring to the button. */
[data-update-screen] h2:focus { outline: 0; }
:is(#aiConsentDialog, #nativeUpdateDialog, #nativeUpdateSheet, #nativeNotifyDialog) :is(button, a):focus-visible,
.exact-assist__consent .button:focus-visible, .exact-more--privacy :is(a, button):focus-visible { outline: 2px solid var(--cdx-ink); outline-offset: 2px; }

/* Reminders card in the app: the neutral states get a plaque for the icon, as the green and the amber ones have (a white one would not show on a white card). */
:is(html[data-platform="android"], html[data-platform="ios"]) .exact-more__push:is(.exact-more__push--off, .exact-more__push--unconfigured) > div > span:first-child { background: var(--xm-page); }
