@font-face{font-family:RNGRoboto;src:url('/branding/Roboto-Regular.woff2') format('woff2');font-weight:400;font-display:swap}
@font-face{font-family:RNGRoboto;src:url('/branding/Roboto-Medium.woff2') format('woff2');font-weight:500;font-display:swap}
@font-face{font-family:RNGRoboto;src:url('/branding/Roboto-Bold.woff2') format('woff2');font-weight:700;font-display:swap}
:root{--brand-color:#0ca2e0;--brand-color-hover:#006dab}
body{font-family:RNGRoboto,Roboto,Arial,sans-serif}
button.bg-green-500,button.bg-green-600,.bg-submit{background-color:#006dab!important}
a:focus-visible,button:focus-visible,input:focus-visible{outline-color:#0ca2e0}
/* Минимальный слой бренда; upstream DOM проверяется перед каждым обновлением. */

:root,.dark{--surface-submit:0 109 171;--surface-submit-hover:0 87 140;--accent-primary:12 162 224}

img[src="assets/logo.svg"]{background:#fff;padding:10px;border-radius:8px;}

/* Simplified navigation, including accounts with previously saved permissions. */
[data-testid='nav-panel-skills'],
[data-testid='nav-panel-prompts'],
[data-testid='nav-panel-memories'],
[data-testid='nav-panel-bookmarks'],
[data-testid='nav-panel-mcp-builder'],
#nav-panel-skills, #nav-panel-prompts, #nav-panel-memories,
#nav-panel-bookmarks, #nav-panel-mcp-builder { display: none !important; }

/* Login only. Opaque card stays readable over every frame and in both themes. */
.rng-login {
  --surface-primary: 255 255 255;
  --surface-hover: 237 244 248;
  --text-primary: 23 43 58;
  --text-secondary: 66 85 99;
  --text-secondary-alt: 66 85 99;
  --border-light: 154 175 190;
  color-scheme: light;
  isolation: isolate;
  background: #132f42 !important;
  min-height: 100svh;
}
.rng-login-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #132f42 url('/branding/rng-login-poster.jpg') center / cover no-repeat;
}
.rng-login-background video { width: 100%; height: 100%; object-fit: cover; }
.rng-login-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(8 25 40 / 28%), rgb(8 25 40 / 54%));
}
.rng-login .rng-original-logo { display: none; }
.rng-login main { padding: 56px 24px 100px; }
.rng-login .rng-login-card {
  width: min(100%, 440px);
  max-width: 440px;
  padding: 36px 40px 40px;
  background: #fff !important;
  border: 1px solid rgb(255 255 255 / 90%);
  border-top: 4px solid #006dab;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgb(0 18 34 / 38%);
  overflow: visible;
}
.rng-login-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; }
.rng-login-brand img { width: 214px; height: 90px; object-fit: contain; }
.rng-login-brand p { margin: 16px 0 0; color: #006dab; font-size: 14px; font-weight: 700; letter-spacing: .16em; }
.rng-login-card h1 { color: #172b3a; font-size: 26px; line-height: 1.3; }
.rng-login .rng-login-card input {
  min-height: 52px;
  font-size: 16px;
  background: #f3f8fc !important;
  color: #172b3a !important;
  -webkit-text-fill-color: #172b3a !important;
  /* LibreChat's WebKit dark-mode fix paints an opaque black inset shadow. */
  box-shadow: inset 0 0 0 1000px #f3f8fc !important;
  caret-color: #006dab;
  border-color: #91afc4;
  border-radius: 12px;
}
.rng-login-card label { background: transparent !important; color: #425563; }
.rng-login .rng-login-card input:focus-visible {
  background: #fff !important;
  box-shadow: inset 0 0 0 1000px #fff !important;
  border-color: #006dab;
  outline: 2px solid #006dab;
  outline-offset: 2px;
}
.rng-login-card input:focus + label,
.rng-login-card input:not(:placeholder-shown) + label { background: #fff !important; }
.rng-login-card input:focus + label { color: #006dab; }
.rng-login-card input[aria-invalid='true'] { border-color: #b42318; }
.rng-login-card button[type='button'] { color: #425563; }
.rng-login-card button[type='submit'] { min-height: 52px; border-radius: 12px; background: #006dab; color: #fff; font-size: 16px; font-weight: 700; }
.rng-login-card button[type='submit']:hover { background: #00578c; }
.rng-login > div.absolute { z-index: 1; }
.rng-login > div.absolute button, .rng-login-pause { background: #fff !important; color: #172b3a !important; box-shadow: 0 2px 12px rgb(0 18 34 / 20%); }
.rng-login-pause {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 10px 16px;
  border: 1px solid #9aafbe;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.rng-login-pause[hidden] { display: none; }
.rng-login [role='contentinfo'] { color: #fff; }
@media (max-width: 540px) {
  .rng-login main { padding: 24px 16px 96px; }
  .rng-login .rng-login-card { padding: 28px 24px 32px; border-radius: 20px; }
  .rng-login-brand img { width: 190px; height: 80px; }
  .rng-login-pause { right: 16px; bottom: 20px; }
}

/* Approved workspace: white content, pale blue history, restrained RNG accent. */
.rng-workspace {
  --surface-primary: 255 255 255;
  --surface-primary-alt: 242 247 251;
  --surface-secondary: 242 247 251;
  --surface-tertiary: 228 242 250;
  --surface-chat: 242 247 251;
  --surface-hover: 228 242 250;
  --surface-active-alt: 228 242 250;
  --presentation: 255 255 255;
  --text-primary: 23 52 73;
  --text-secondary: 82 107 123;
  --text-tertiary: 82 107 123;
  --text-muted: 82 107 123;
  --border-light: 219 230 238;
  --border-medium: 174 198 215;
  color: #173449;
  color-scheme: light;
}
.rng-workspace .bg-presentation { background: #fff; }
/* Markdown has its own dark:prose-invert palette, independent of body tokens. */
.rng-workspace .markdown {
  --tw-prose-body: #173449;
  --tw-prose-headings: #173449;
  --tw-prose-lead: #173449;
  --tw-prose-links: #006dab;
  --tw-prose-bold: #173449;
  --tw-prose-counters: #526b7b;
  --tw-prose-bullets: #526b7b;
  --tw-prose-quotes: #173449;
  --tw-prose-captions: #526b7b;
  --tw-prose-code: #173449;
  --tw-prose-pre-code: #173449;
  --tw-prose-pre-bg: #f2f7fb;
  --tw-prose-invert-body: #173449;
  --tw-prose-invert-headings: #173449;
  --tw-prose-invert-lead: #173449;
  --tw-prose-invert-links: #006dab;
  --tw-prose-invert-bold: #173449;
  --tw-prose-invert-counters: #526b7b;
  --tw-prose-invert-bullets: #526b7b;
  --tw-prose-invert-quotes: #173449;
  --tw-prose-invert-captions: #526b7b;
  --tw-prose-invert-code: #173449;
  --tw-prose-invert-pre-code: #173449;
  --tw-prose-invert-pre-bg: #f2f7fb;
  color: #173449;
}
.rng-workspace .markdown a { color: #006dab !important; }
.rng-workspace .rng-sidebar { border-right: 1px solid #dbe6ee; }
.rng-workspace .rng-sidebar[style*='width: 360px'],
.rng-workspace .rng-sidebar:not([style*='width: 52px']):not([style*='width: 0px']) {
  width: 250px !important; min-width: 250px !important; max-width: 40% !important;
}
.rng-sidebar-inner { flex-direction: column; background: #f2f7fb; padding-bottom: 64px; }
.rng-sidebar-rail { position: relative; border-right: 0; padding: 20px 18px 10px; gap: 12px; }
.rng-sidebar-brand { display: flex; align-items: center; gap: 12px; height: 48px; margin-bottom: 12px; }
.rng-sidebar-brand img { width: 90px; height: 40px; object-fit: contain; border-radius: 6px; background: white; padding: 6px; }
.rng-sidebar-brand strong { font-size: 15px; letter-spacing: .04em; }
.rng-sidebar-rail [data-testid='new-chat-button'] { width: 100%; height: 44px; background: #006dab; color: white; gap: 8px; margin-bottom: 8px; }
.rng-sidebar-rail [data-testid='new-chat-button']::after { content: 'Новый чат'; font-size: 14px; font-weight: 700; }
.rng-sidebar-rail [data-testid='nav-panel-conversations'],
.rng-sidebar-rail [data-testid='nav-panel-files'] { width: 100%; justify-content: flex-start; padding: 0 12px; gap: 10px; font-weight: 400; }
.rng-sidebar-rail [data-testid='nav-panel-conversations']::after { content: 'Запросы на анализ'; }
.rng-sidebar-rail [data-testid='nav-panel-files']::after { content: 'Файлы'; }
.rng-sidebar-rail [data-testid='close-sidebar-button'],
.rng-sidebar-rail [data-testid='nav-agents-marketplace-button'],
.rng-sidebar-rail > .border-b { display: none; }
.rng-sidebar-rail > .mt-auto { position: fixed; bottom: 0; left: 18px; width: 214px; padding: 16px 0; border-top: 1px solid #dbe6ee; background: #f2f7fb; z-index: 30; }
.rng-sidebar-rail [data-testid='nav-user'] { width: 100%; justify-content: flex-start; gap: 10px; padding-left: 10px; }
.rng-sidebar-rail [data-testid='nav-user']::after { content: 'Профиль'; font-size: 14px; }
.rng-sidebar [aria-label='Resize sidebar'] { display: none; }
/* Projects are outside the current geological workspace scope. */
.rng-sidebar nav [role='region'] .flex.flex-col.px-3 { display: none; }
.rng-workspace-header { height: 76px !important; padding: 12px 26px !important; border-bottom: 1px solid #dbe6ee; background: #fff !important; }
.rng-workspace-title { display: flex; flex-direction: column; gap: 4px; font-weight: 400; }
.rng-workspace-title strong { font-size: 14px; }
.rng-workspace-title span { font-size: 12px; color: #526b7b; }
.rng-workspace #presets-button,
.rng-workspace [data-testid='header-overflow-menu'],
.rng-workspace [aria-keyshortcuts='Meta+Shift+Y'] { display: none !important; }
.rng-workspace-header > .flex.min-w-0.flex-1 { display: flex; flex: 0 1 auto; order: 2; margin-left: auto; padding-left: 0; }
.rng-workspace-header > .flex.min-w-0.flex-1 > button { display: none; }
.rng-workspace-title { order: 1; min-width: 0; }
.rng-workspace [data-testid='model-selector-button'] { max-width: 260px; color: #173449; background: #f2f7fb; border-color: #dbe6ee; }
.rng-workspace [data-testid='model-selector-button']::before { content: 'Настройки ·'; font-size: 12px; font-weight: 400; white-space: nowrap; }
@media (max-width: 767px) {
  .rng-workspace-title span { display: none; }
  .rng-workspace [data-testid='model-selector-button'] { max-width: 156px; padding-inline: 8px; }
  .rng-workspace [data-testid='model-selector-button']::before { content: '⚙'; font-size: 16px; }
}
.rng-workspace .rng-original-welcome,
.rng-workspace .rng-original-starters { display: none !important; }
.rng-landing-column { justify-content: flex-start !important; align-items: center; padding: 118px 32px 60px; overflow-y: auto; }
.rng-welcome { width: 100%; max-width: 710px; flex-shrink: 0; }
.rng-welcome h2 { margin: 0; font-size: 28px; line-height: 1.3; font-weight: 700; letter-spacing: -.02em; }
.rng-welcome > p { margin: 14px 0 24px; font-size: 14px; color: #526b7b; }
.rng-questions { display: flex; flex-direction: column; gap: 2px; margin: 0 0 24px; }
.rng-question { display: flex; align-items: center; width: 100%; min-height: 42px; gap: 12px; border-radius: 8px; padding: 8px 10px; margin-left: -10px; text-align: left; font-size: 14px; line-height: 1.5; color: #173449; }
.rng-question:hover { background: #e4f2fa; }
.rng-question:focus-visible { outline: 2px solid #006dab; outline-offset: 2px; }
.rng-question-icon { color: #006dab; width: 16px; flex-shrink: 0; font-size: 19px; }
.rng-workspace .rng-composer-band { max-width: 710px !important; flex-shrink: 0; margin-inline: auto; }
.rng-workspace .rng-chat-form { padding: 0; max-width: 710px; margin-bottom: 32px !important; }
.rng-workspace [data-testid='composer-surface'] { border: 1px solid #dbe6ee; border-radius: 12px !important; background: #f2f7fb; box-shadow: none; }
.rng-workspace #prompt-textarea { min-height: 74px; padding: 18px; color: #173449; -webkit-text-fill-color: #173449; font-size: 15px; }
.rng-workspace #send-button { border-radius: 9px; width: auto; min-width: 110px; height: 40px; padding: 8px 14px; gap: 8px; color: white; background: #006dab; }
.rng-workspace #send-button::after { content: 'Отправить'; font-weight: 700; font-size: 14px; }
.rng-workspace #send-button:disabled { opacity: .5; }
.rng-workspace #attach-file-button { width: auto; padding: 8px; gap: 6px; }
.rng-workspace #attach-file-button::after { content: 'Прикрепить файл'; font-size: 14px; }
.rng-workspace #audio-recorder { display: none; }
@media (max-width: 767px) {
  .rng-workspace-header { height: 72px !important; padding: 12px 16px !important; }
  .rng-workspace-title strong { font-size: 13px; }
  .rng-workspace-title span { font-size: 11px; }
  .rng-landing-column { padding: 100px 20px 36px; }
  .rng-welcome h2 { font-size: 24px; }
  .rng-welcome > p { margin-bottom: 18px; }
  .rng-question { min-height: 44px; font-size: 14px; }
  .rng-workspace #prompt-textarea { font-size: 16px; }
  .rng-workspace #attach-file-button::after { content: ''; }
  .rng-workspace #send-button { min-width: 44px; }
  .rng-workspace #send-button::after { content: ''; }
  .rng-workspace .rng-sidebar { max-width: 85vw !important; }
}
.rng-sidebar-rail { height: auto !important; flex-shrink: 0; }
.rng-sidebar-inner > nav { flex: 1; min-height: 0; }
/* Eight examples fit into four rows on wide screens. */
@media (min-width: 1000px) {
  .rng-questions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
  .rng-question { margin-left: 0; align-items: flex-start; min-height: 60px; padding: 10px; }
}
.rng-workspace .rng-mobile-drawer [data-testid='panel-switcher-button'],
.rng-workspace .rng-mobile-drawer [data-testid='nav-agents-marketplace-button'],
.rng-workspace .rng-mobile-drawer [role='region'] .flex.flex-col.px-3 { display: none; }
.rng-mobile-brand { display: flex; flex: 1; align-items: center; gap: 10px; }
.rng-mobile-brand img { width: 72px; height: 32px; object-fit: contain; background: white; padding: 4px; border-radius: 6px; }
.rng-mobile-brand strong { font-size: 14px; }
.rng-workspace [data-testid='nav-new-chat-fab'] { background: #006dab; color: #fff; }
/* Composer tool configuration stays out of the employee flow; the configured
   agent still owns its server-side tools. BadgeRow selector audited on 0.8.8. */
.rng-workspace #tools-dropdown-button,
.rng-workspace [data-testid='composer-surface'] .relative.flex.flex-wrap.items-center.gap-2 { display: none !important; }
.rng-reports-nav { display: flex; gap: 10px; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 8px; text-align: left; font-size: 14px; color: #173449; }
.rng-reports-nav::before { content: '▤'; width: 20px; text-align: center; font-size: 19px; color: #006dab; }
.rng-reports-nav:hover, .rng-reports-mobile-nav:hover { background: #e4f2fa; }
.rng-reports-mobile-nav { padding: 8px; border-radius: 8px; font-size: 13px; color: #173449; }
.rng-reports-dialog { width: min(960px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid #dbe6ee; border-radius: 18px; background: #fff; color: #173449; box-shadow: 0 20px 80px rgb(8 25 40 / 30%); overflow: hidden; }
.rng-reports-dialog[open] { display: flex; flex-direction: column; }
.rng-reports-dialog::backdrop { background: rgb(8 25 40 / 48%); }
.rng-reports-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 24px 28px 18px; border-bottom: 1px solid #dbe6ee; }
.rng-reports-header h2 { margin: 0; font-size: 24px; font-weight: 700; }
.rng-reports-header p { margin: 6px 0 0; color: #526b7b; font-size: 13px; }
.rng-reports-close { width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; background: #f2f7fb; }
.rng-reports-controls { padding: 18px 28px 12px; }
.rng-reports-controls label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; }
.rng-reports-controls input { width: 100%; min-height: 44px; border: 1px solid #aec6d7; border-radius: 9px; padding: 10px 12px; color: #173449; background: #f2f7fb; font-size: 16px; }
.rng-reports-status { font-size: 13px; color: #526b7b; margin: 12px 0 0; }
.rng-reports-list { overflow-y: auto; padding: 0 28px 24px; margin: 0; min-height: 80px; overscroll-behavior: contain; list-style: none; }
.rng-report { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0; border-bottom: 1px solid #dbe6ee; }
.rng-report-description { display: flex; flex-direction: column; min-width: 0; gap: 6px; }
.rng-report-description strong { font-size: 14px; line-height: 1.5; font-weight: 500; overflow-wrap: anywhere; }
.rng-report-description span { font-size: 12px; color: #526b7b; }
.rng-report-open, .rng-reports-retry { padding: 10px 12px; border-radius: 8px; background: #e4f2fa; color: #006dab; font-size: 13px; font-weight: 500; flex-shrink: 0; }
.rng-reports-retry { margin-top: 12px; }
.rng-reports-retry[hidden] { display: none; }
.rng-reports-empty { padding: 20px 0; font-size: 14px; color: #526b7b; }
.rng-reports-dialog :is(button, input, a):focus-visible { outline: 2px solid #006dab; outline-offset: 2px; }
@media (max-width: 600px) {
  .rng-reports-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 14px; }
  .rng-reports-header { padding: 18px 18px 14px; }
  .rng-reports-controls { padding: 14px 18px 10px; }
  .rng-reports-list { padding: 0 18px 18px; }
  .rng-report { flex-direction: column; align-items: flex-start; gap: 10px; }
  .rng-reports-mobile-nav { padding: 6px; font-size: 12px; }
  .rng-mobile-brand { gap: 6px; }
  .rng-mobile-brand img { width: 62px; }
  .rng-mobile-brand strong { font-size: 12px; }
}
/* Respect LibreChat's saved collapsed state without overflowing the icon rail. */
.rng-workspace .rng-sidebar:has(nav[aria-hidden='true']) .rng-sidebar-rail { padding: 8px; gap: 8px; }
.rng-workspace .rng-sidebar:has(nav[aria-hidden='true']) .rng-sidebar-brand { height: 32px; margin: 0; }
.rng-workspace .rng-sidebar:has(nav[aria-hidden='true']) .rng-sidebar-brand img { width: 28px; height: 28px; padding: 2px; }
.rng-workspace .rng-sidebar:has(nav[aria-hidden='true']) .rng-sidebar-brand strong,
.rng-workspace .rng-sidebar:has(nav[aria-hidden='true']) [data-testid='new-chat-button']::after,
.rng-workspace .rng-sidebar:has(nav[aria-hidden='true']) [data-testid='nav-panel-conversations']::after,
.rng-workspace .rng-sidebar:has(nav[aria-hidden='true']) [data-testid='nav-panel-files']::after,
.rng-workspace .rng-sidebar:has(nav[aria-hidden='true']) [data-testid='nav-user']::after { display: none; }
.rng-workspace .rng-sidebar:has(nav[aria-hidden='true']) :is([data-testid='new-chat-button'], [data-testid='nav-panel-conversations'], [data-testid='nav-panel-files'], [data-testid='nav-user']) { width: 36px; height: 36px; padding: 8px; margin: 0; }
.rng-workspace .rng-sidebar:has(nav[aria-hidden='true']) .rng-sidebar-rail > .mt-auto { left: 8px; width: 36px; }
.rng-workspace .rng-sidebar:has(nav[aria-hidden='true']) .rng-reports-nav { font-size: 0; width: 36px; height: 36px; padding: 8px; gap: 0; }

/* PDF page previews inside chat messages. */
.rng-report-image { display:block; max-width:640px; margin:12px 0 20px; padding:12px; border:1px solid #cee0ed; border-radius:12px; background:#f2f7fb; color:#173449; }
.rng-report-image > button { display:block; width:100%; padding:0; cursor:zoom-in; background:white; border-radius:8px; overflow:hidden; }
.rng-report-image img { display:block; width:100%; max-height:380px; object-fit:contain; margin:0!important; }
.rng-report-image > span { display:block; margin-top:8px; font-size:14px; }
.rng-image-dialog { box-sizing:border-box; width:min(1200px,96vw); max-width:96vw; max-height:94dvh; padding:16px; border:1px solid #cee0ed; border-radius:16px; background:#fff; color:#173449; }
.rng-image-dialog::backdrop { background:rgba(13,32,48,.75); }
.rng-image-dialog header { display:flex; gap:16px; align-items:center; justify-content:space-between; flex-wrap:wrap; padding-bottom:12px; }
.rng-image-dialog a { color:#006dab; text-decoration:underline; }
.rng-image-dialog button { padding:8px 16px; border:1px solid #cee0ed; border-radius:8px; color:#173449; background:#f2f7fb; }
.rng-image-viewport { max-height:calc(94dvh - 90px); overflow:auto; }
.rng-image-viewport img { display:block; max-width:none; width:100%; height:auto; }
@media (max-width:600px) { .rng-image-dialog { padding:10px; } .rng-image-dialog header { gap:8px; font-size:14px; } }
.rng-export-dialog { width:min(460px,calc(100vw - 32px)); padding:24px; border:1px solid #c7d7e2; border-radius:16px; background:#fff; color:#243746; box-shadow:0 24px 80px #18334740; }
.rng-export-dialog::backdrop { background:#18334780; }
.rng-export-dialog h2 { color:#243746; font-size:22px; font-weight:700; margin:0 0 16px; }
.rng-export-dialog p { margin:0 0 20px; line-height:1.5; }
.rng-export-download,.rng-export-dialog button { display:inline-block; border-radius:8px; padding:10px 16px; font-size:14px; font-weight:600; }
.rng-export-download { color:white; background:#006dab; margin-right:10px; text-decoration:none; }
.rng-export-dialog button { color:#243746; background:#edf2f6; border:1px solid #c7d7e2; }
.rng-export-dialog :is(button,a):focus-visible { outline:2px solid #006dab; outline-offset:3px; }

/* Viewer.js owns image transforms and gesture handling inside the native dialog. */
.rng-image-viewport { position:relative; height:calc(88dvh - 90px); max-height:none; overflow:hidden; background:#182a38; }
.rng-image-viewport > img { width:auto; max-width:100%; max-height:100%; object-fit:contain; margin:auto; }
.rng-image-viewport .viewer-container { width:100%!important; height:100%!important; }
.rng-image-viewport .viewer-canvas img { width:auto; height:auto; margin:0; }
.rng-image-viewport .viewer-toolbar > ul > li { width:40px; height:40px; margin:0 4px; background:#173449; }
.rng-image-viewport .viewer-toolbar > ul > li::before { margin:10px; }
.rng-image-viewport .viewer-toolbar { padding:10px 0; }
.rng-image-viewport .viewer-toolbar [role=button]:focus-visible { outline:3px solid #fff; outline-offset:2px; }
.rng-modal-status { display:block; padding:24px; color:#fff; }
@media(max-width:600px) { .rng-image-viewport { height:calc(88dvh - 100px); } .rng-image-viewport .viewer-toolbar > ul > li { margin:0 2px; } }

.rng-image-viewport:has(.viewer-container) > img { display:none!important; }
.rng-image-viewport .viewer-container { position:absolute; inset:0; background:#182a38; }

/* Optional Wan enhancement: source selection and two synchronized viewers. */
.rng-ai-image-dialog { width:min(1400px,96vw); max-height:94dvh; overflow:auto; }
.rng-ai-select { text-align:center; }
.rng-ai-select-frame { position:relative; width:fit-content; max-width:100%; margin:auto; touch-action:none; cursor:crosshair; }
.rng-ai-select-frame img { display:block; width:auto; max-width:min(84vw,1100px); max-height:55dvh; user-select:none; }
.rng-ai-selection { position:absolute; border:2px solid #006dab; background:rgba(0,109,171,.12); pointer-events:none; box-sizing:border-box; }
.rng-ai-fields { display:flex; flex-wrap:wrap; gap:10px; margin:12px 0; }
.rng-ai-fields label { display:flex; flex-direction:column; text-align:left; font-size:12px; }
.rng-ai-fields input { width:100px; padding:8px; border:1px solid #cee0ed; border-radius:6px; color:#173449; background:white; }
.rng-ai-tools { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:12px; }
.rng-ai-tools [aria-pressed=true], .rng-ai-image-dialog .rng-ai-submit { background:#006dab; color:white; }
.rng-ai-image-dialog button:disabled { opacity:.5; cursor:wait; }
.rng-ai-image-dialog button:focus-visible, .rng-ai-image-dialog a:focus-visible { outline:3px solid #006dab; outline-offset:2px; }
.rng-ai-panes { display:grid; gap:12px; grid-template-columns:1fr; }
.rng-ai-panes[data-mode=compare] { grid-template-columns:1fr 1fr; }
.rng-ai-panes[data-mode=original] [data-kind=ai], .rng-ai-panes[data-mode=ai] [data-kind=original] { display:none; }
.rng-ai-pane { min-width:0; }
.rng-ai-pane > strong { display:block; margin-bottom:8px; font-size:13px; }
.rng-ai-viewport { height:48dvh; min-height:200px; position:relative; overflow:hidden; background:#182a38; border-radius:8px; }
.rng-ai-viewport > img { display:none; }
.rng-ai-viewport .viewer-container { position:absolute; inset:0; width:100%!important; height:100%!important; }
.rng-ai-viewport .viewer-canvas img { max-width:none; width:auto; }
.rng-ai-status, .rng-ai-notice { margin:12px 0 0; font-size:13px; }
.rng-ai-notice { color:#526b7b; }
@media(max-width:600px) {
  .rng-ai-select-frame img { max-width:87vw; max-height:48dvh; }
  .rng-ai-tools { gap:6px; }
  .rng-ai-image-dialog button { padding:8px 10px; min-height:40px; }
  .rng-ai-viewport { height:40dvh; }
  .rng-ai-panes { gap:6px; }
}

/* Format badges stay inside the actual file link, including wrapped filenames. */
.rng-file-link::before { content:'ФАЙЛ'; display:inline-flex; align-items:center; justify-content:center; width:32px; height:34px; margin-right:8px; border:1px solid currentColor; border-radius:3px 8px 3px 3px; font-size:9px; line-height:1; font-weight:700; color:#526b7b; background:#f2f7fb; vertical-align:middle; text-decoration:none; }
.rng-file-link[data-rng-file-format='pdf']::before { content:'PDF'; color:#c53332; background:#fff3f2; }
.rng-file-link[data-rng-file-format='docx']::before { content:'W'; color:#185abd; background:#eef4ff; font-size:18px; }
.rng-file-link[data-rng-file-format='xlsx']::before { content:'X'; color:#217346; background:#edf8f1; font-size:18px; }
.rng-file-link[data-rng-file-format='pptx']::before { content:'P'; color:#c43e1c; background:#fff3ed; font-size:18px; }
.rng-file-link[aria-busy='true'] { cursor:progress; }
.rng-file-link[aria-busy='true']::before { opacity:.45; }

/* The PDF component retains selectable text and page navigation in its own frame. */
.rng-pdf-dialog { box-sizing:border-box; width:min(1440px,96vw); height:94dvh; max-width:96vw; max-height:94dvh; padding:0; border:1px solid #cee0ed; border-radius:16px; overflow:hidden; background:#f1f4f7; color:#173449; box-shadow:0 24px 80px #10293b40; }
.rng-pdf-dialog[open] { display:flex; flex-direction:column; }
.rng-pdf-dialog::backdrop { background:rgba(13,32,48,.7); }
.rng-pdf-dialog > header { display:flex; align-items:center; justify-content:space-between; flex:none; gap:12px; padding:12px 16px; background:white; border-bottom:1px solid #dce5eb; }
.rng-pdf-dialog h2 { margin:0; font-size:15px; font-weight:600; color:#173449; }
.rng-pdf-dialog .rng-pdf-close { display:grid; place-items:center; width:36px; height:36px; border:1px solid #dce5eb; border-radius:8px; color:#526b7b; background:white; cursor:pointer; }
.rng-pdf-dialog .rng-pdf-close:hover { background:#edf4f8; }
.rng-pdf-dialog .rng-pdf-close:focus-visible { outline:2px solid #006dab; outline-offset:2px; }
.rng-pdf-dialog > iframe { flex:1; min-height:0; width:100%; border:0; }
@media(max-width:600px) { .rng-pdf-dialog { width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; border:0; border-radius:0; } .rng-pdf-dialog > header { padding:8px 12px; } }
