/* === ОТО Ассистент — стили === */
:root {
  /* Брендовая палитра: глубокий тёмно-синий фон + оранжевый акцент (как в логотипе) */
  --bg: #0a1628;            /* основной фон — глубокий ночной синий */
  --secondary: #122544;     /* header, nav, блоки */
  --card: #163057;          /* карточки, формы, поля ввода */
  --card-hover: #1a3a6b;
  --accent: #F5A623;        /* оранжевый — кнопки, ссылки, активные элементы */
  --accent-soft: rgba(245, 166, 35, 0.14);
  --border: rgba(30, 58, 95, 0.5);  /* рамки в тон логотипа */
  --border-strong: rgba(30, 58, 95, 0.8);
  --text: #eaf0fa;
  --hint: #8da0bd;          /* холодный серо-голубой, в гамме */
  --muted: #6b7e9c;
  --button: #1e3a5f;        /* тёмно-синий как в щите */
  --button-text: #ffffff;
  --danger: #ff6b6b;
  --ok: #2ecc71;
  --warn: #f5a623;
  --radius: 12px;
  --pad: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 15px; }
body { min-height: 100vh; padding-bottom: 70px; }

#app { max-width: 600px; margin: 0 auto; }

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px var(--pad); background: var(--secondary);
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--border);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px;
  min-width: 0;
}
.logo-icon { width: 36px; height: 36px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.logo-title { color: var(--text); font-size: 16px; font-weight: 700; white-space: nowrap; }
.logo-sub { color: var(--accent); font-size: 11px; font-weight: 500; white-space: nowrap; }
.user { font-size: 12px; color: var(--hint); }

nav#bottom-nav {
  position: sticky; top: 50px; left: 0; right: 0; max-width: 600px; margin: 0 auto;
  display: flex; background: var(--secondary);
  border-bottom: 1px solid var(--border-strong); z-index: 15;
  scrollbar-width: none;
}
nav#bottom-nav::-webkit-scrollbar { display: none; }
nav#bottom-nav button {
  flex: 1 1 0; background: transparent; color: var(--hint);
  border: none; padding: 8px 2px; font-size: 18px; line-height: 1.15; cursor: pointer;
  text-align: center; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
nav#bottom-nav button span { font-size: 10px; line-height: 1.1; }
nav#bottom-nav button.active { color: var(--accent); }

header { gap: 8px; }
header .user { max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { padding: var(--pad); }

.tab { display: none; }
.tab.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h1 { font-size: 22px; margin: 0 0 12px; }
.lead { color: var(--hint); margin: 0 0 20px; line-height: 1.5; }

.back { background: transparent; color: var(--accent); border: none; font-size: 14px; padding: 0; margin-bottom: 12px; cursor: pointer; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.card {
  background: var(--secondary); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: 6px; min-height: 110px;
}
.card:hover { border-color: var(--accent); background: linear-gradient(135deg, var(--secondary) 0%, rgba(245,166,35,0.06) 100%); }
.card:active { transform: scale(.98); }
.card-icon { font-size: 28px; margin-bottom: 4px; }
.card-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; line-height: 1.3; }
.card-desc { font-size: 12px; color: var(--hint); line-height: 1.4; }

/* Hero-блок главной */
.home-hero {
  background: linear-gradient(135deg, rgba(245,166,35,0.12) 0%, rgba(245,166,35,0.04) 100%);
  border: 1px solid rgba(245,166,35,0.18);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  margin-bottom: 18px;
}
.home-hero-top {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.hero-shield { width: 48px; height: 48px; flex-shrink: 0; }
.home-hero-titles { min-width: 0; }
.home-hero h1 { margin: 0 0 2px; font-size: 22px; line-height: 1.1; }
.hero-tagline {
  font-size: 12px; color: var(--accent); font-weight: 500;
  letter-spacing: 0.3px; line-height: 1.2;
}
.hero-lead { font-size: 14px; line-height: 1.5; color: var(--hint); margin: 0 0 14px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero-stat {
  text-align: center; padding: 10px 4px;
  background: rgba(10,22,40,0.5); border-radius: 10px;
  border: 1px solid var(--border);
}
.hero-stat .num { font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.hero-stat .lbl { font-size: 11px; color: var(--hint); margin-top: 4px; line-height: 1.2; }

/* Заголовки секций на главной */
.section-title {
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); margin: 18px 0 10px;
  padding-left: 4px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  display: inline-block; width: 4px; height: 16px;
  background: var(--accent); border-radius: 2px;
}

/* Партнёры / официальные источники */
.partners { margin-top: 18px; }
.partners-note { font-size: 12px; color: var(--hint); line-height: 1.45; margin: 0 0 12px; padding: 0 4px; }
.partners-grid { display: flex; flex-direction: column; gap: 8px; }
.partner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .1s;
}
.partner:hover { border-color: var(--accent); transform: translateY(-1px); }
.partner:active { transform: translateY(0); }
.partner-logo {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-weight: 800; font-size: 14px;
  color: #fff; letter-spacing: 0.5px;
}
.partner-logo-rsa { background: linear-gradient(135deg, #003a70, #0066cc); }
.partner-logo-mintrans { background: linear-gradient(135deg, #1e3a5f, #2a5fa8); }
.partner-logo-ats { background: linear-gradient(135deg, #163057, #1e4a8a); }
.partner-body { flex: 1; min-width: 0; }
.partner-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.partner-url { font-size: 11px; color: var(--hint); margin-top: 2px; }
.partner-arrow { color: var(--hint); font-size: 16px; }
.partner:hover .partner-arrow { color: var(--accent); }

@media (min-width: 600px) {
  .partners-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .partner { padding: 12px 14px; }
  .partner-logo { width: 48px; height: 48px; font-size: 16px; }
  .partner-name { font-size: 14px; }
  .partner-url { font-size: 12px; }
}

/* Каналы и сообщества */
.community { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.community-note { font-size: 12px; color: var(--hint); line-height: 1.45; margin: 0 0 12px; padding: 0 4px; }
.community-list { display: flex; flex-direction: column; gap: 8px; }
.community-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .1s;
}
.community-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.community-link:active { transform: translateY(0); }
.community-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-weight: 800; font-size: 13px; color: #fff; letter-spacing: 0.5px;
}
.community-icon-tg { background: linear-gradient(135deg, #229ED9, #0088cc); }
.community-icon-max { background: linear-gradient(135deg, #6c47ff, #a366ff); font-size: 12px; }
.community-icon-tg-bot { background: linear-gradient(135deg, #163057, #1e3a5f); font-size: 22px; }
.community-body { flex: 1; min-width: 0; }
.community-name { font-size: 14px; font-weight: 600; line-height: 1.25; }
.community-url { font-size: 11px; color: var(--accent); margin-top: 2px; font-weight: 500; }
.community-desc { font-size: 11px; color: var(--hint); margin-top: 4px; line-height: 1.3; }
.community-arrow { color: var(--hint); font-size: 16px; }
.community-link:hover .community-arrow { color: var(--accent); }
.community-link[data-need-max="true"], .community-placeholder { opacity: 0.55; cursor: default; }
.community-placeholder:hover { border-color: var(--border); transform: none; }

/* Планшет: 3 колонки */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .home-hero { padding: 24px 24px 18px; }
  .home-hero h1 { font-size: 28px; }
  .hero-shield { width: 64px; height: 64px; }
  .hero-tagline { font-size: 14px; }
  .hero-stat .num { font-size: 26px; }
}
/* Десктоп: 4 колонки + шире контейнер */
@media (min-width: 960px) {
  #app { max-width: 1100px; margin: 0 auto; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  main { padding: 24px 32px 100px; }
  .home-hero { padding: 28px 32px 20px; }
  .home-hero h1 { font-size: 32px; }
  .hero-shield { width: 72px; height: 72px; }
  .home-hero-top { gap: 16px; }
  .hero-lead { font-size: 15px; max-width: 720px; }
  .hero-stats { max-width: 480px; }
  .card { min-height: 130px; padding: 18px; }
  .card-icon { font-size: 32px; }
  .card-title { font-size: 16px; }
  .card-desc { font-size: 13px; }
  .section-title { font-size: 14px; margin: 24px 0 12px; }
  /* На десктопе нижняя навигация не нужна — все блоки видно на главной */
  nav#bottom-nav { display: none; }
  header { padding: 16px 32px; }
  .status-card { max-width: 480px; }
}

button.primary {
  background: var(--button); color: var(--button-text);
  border: none; border-radius: var(--radius);
  padding: 14px; width: 100%; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 12px;
}
button.primary:disabled { opacity: .5; cursor: not-allowed; }

.status-card {
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-top: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.status-label { font-size: 13px; color: var(--hint); }
.status-value { font-weight: 600; }
.status-value.ok { color: var(--ok); }
.status-value.warn { color: var(--warn); }
.status-value.danger { color: var(--danger); }

.upload-area {
  background: var(--secondary); border: 2px dashed var(--border-strong);
  border-radius: var(--radius); padding: 32px 16px; text-align: center;
  margin: 16px 0; cursor: pointer;
}
.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-text { font-weight: 600; }
.upload-hint { font-size: 12px; color: var(--hint); margin-top: 4px; }

.file-info {
  background: var(--secondary); border-radius: var(--radius);
  padding: 12px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center;
}
.file-info .name { font-size: 13px; word-break: break-all; }
.file-info .size { font-size: 12px; color: var(--hint); margin-top: 2px; }
.file-info .remove { background: transparent; color: var(--danger); border: none; font-size: 18px; cursor: pointer; }

.result {
  background: var(--secondary); border-radius: var(--radius);
  padding: 16px; margin-top: 16px; white-space: pre-wrap; line-height: 1.5;
  max-height: 60vh; overflow-y: auto; font-size: 14px;
}
.result h3 { margin: 0 0 8px; font-size: 16px; }
.result .ok { color: var(--ok); }
.result .err { color: var(--danger); }
.result .warn { color: var(--warn); }

.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--hint); }
.form input, .form textarea, .form select {
  background: var(--secondary); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 10px 12px; font-size: 15px; font-family: inherit;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--accent); border-color: transparent; }

.templates { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.template { cursor: pointer; }
.template input { display: none; }
.tpl-card {
  background: var(--secondary); border: 2px solid transparent;
  border-radius: var(--radius); padding: 12px; display: flex; align-items: center; gap: 12px;
}
.template input:checked + .tpl-card { border-color: var(--accent); }
.tpl-icon { font-size: 22px; }
.tpl-name { font-weight: 500; }

.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px;
  border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .25s;
  z-index: 100; pointer-events: none; max-width: 80%;
}
.toast.show { opacity: .95; }

/* === Проверка документов: чек-лист === */
.form-group { margin-bottom: 16px; }
.form-label {
  font-size: 13px; color: var(--hint); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .5px;
}
.check-list { margin-top: 12px; }
.check-list h3 { margin-bottom: 8px; font-size: 14px; }
.check-list ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.check-list li {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px 10px; border-radius: 8px;
  background: var(--bg); border-left: 3px solid transparent;
  font-size: 13px; line-height: 1.4;
}
.check-list li.ok      { border-left-color: var(--ok); }
.check-list li.warn    { border-left-color: var(--warn); }
.check-list li.err     { border-left-color: var(--danger); }
.check-list li span { flex: 0 0 18px; }
.check-list li b { font-weight: 600; }

.loader {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border-strong);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* === ИИ-консультант: чат === */
.suggestions {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px;
}
.chip {
  background: var(--secondary); color: var(--text);
  border: 1px solid var(--border); border-radius: 18px;
  padding: 8px 14px; font-size: 13px; cursor: pointer;
  transition: all .2s; font-family: inherit;
}
.chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.chat-history {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 200px; max-height: 50vh; overflow-y: auto;
  padding: 8px 4px; margin-bottom: 12px;
}
.chat-empty {
  color: var(--muted); text-align: center; padding: 30px 10px;
  font-size: 14px;
}
.msg { display: flex; width: 100%; }
.msg-user { justify-content: flex-end; }
.msg-bot { justify-content: flex-start; }
.msg-bubble {
  max-width: 88%; padding: 10px 14px; border-radius: 14px;
  font-size: 14px; line-height: 1.45;
  word-wrap: break-word; overflow-wrap: break-word;
}
.msg-bubble-user {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bubble-bot {
  background: var(--secondary); color: var(--text);
  border-bottom-left-radius: 4px;
}
.msg-conf {
  display: inline-block; font-size: 10px; text-transform: uppercase;
  letter-spacing: .5px; padding: 2px 7px; border-radius: 8px;
  margin-bottom: 6px; font-weight: 700;
}
.conf-high { background: #2ecc71; color: #fff; }
.conf-medium { background: #f39c12; color: #fff; }
.conf-low { background: #e67e22; color: #fff; }
.conf-very_low { background: #95a5a6; color: #fff; }
.msg-text { white-space: pre-wrap; }
.msg-cites { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.cites-title { font-size: 11px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; letter-spacing: .5px; }
.cite {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 4px;
  font-size: 12px; cursor: pointer;
}
.cite summary { font-weight: 500; outline: none; }
.cite[open] summary { margin-bottom: 6px; }
.cite-snippet {
  color: var(--muted); font-size: 12px;
  white-space: pre-wrap; max-height: 200px; overflow-y: auto;
}

.chat-input-row {
  display: flex; gap: 8px; align-items: flex-end;
  position: sticky; bottom: 0; background: var(--bg);
  padding: 8px 0; border-top: 1px solid var(--border);
}
#consult-input {
  flex: 1; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--secondary);
  color: var(--text); font-size: 14px; font-family: inherit;
  resize: none; min-height: 42px; max-height: 120px;
}
#consult-input:focus { outline: none; border-color: var(--accent); }
#consult-send {
  width: 44px; height: 42px; padding: 0;
  font-size: 20px; line-height: 1; border-radius: 12px;
}

/* === ИИ-консультант: уточняющие вопросы === */
.opt-list {
  display: flex; flex-direction: column; gap: 6px; margin-top: 8px;
}
.opt-btn {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px; border-radius: 10px;
  text-align: left; font-size: 14px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.opt-btn:hover { border-color: var(--accent); background: var(--secondary); }
.opt-btn:active { transform: scale(.98); }
.msg-intent {
  display: inline-block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; padding: 3px 8px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 600;
  margin-bottom: 8px;
}
.text-input {
  flex: 1; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--secondary);
  color: var(--text); font-size: 14px; font-family: inherit;
  resize: none; min-height: 36px; max-height: 100px;
}
.text-input:focus { outline: none; border-color: var(--accent); }
.text-send { width: 38px; height: 36px; padding: 0; font-size: 18px; }

/* === ИИ-консультант: чек-лист === */
.msg-checklist {
  max-width: 95% !important;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--bg) 100%);
  border: 1px solid var(--accent);
}
.checklist-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px; margin-bottom: 10px;
}
.checklist-title-main {
  font-size: 16px; font-weight: 700; margin-bottom: 4px;
}
.checklist-summary {
  font-size: 13px; color: var(--muted);
  background: var(--bg); padding: 6px 10px; border-radius: 8px;
  font-family: monospace;
}
.checklist-list { margin: 8px 0; }
.checklist-item {
  display: flex; gap: 10px; margin-bottom: 10px;
  align-items: flex-start;
}
.checklist-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; display: flex;
  align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; margin-top: 2px;
}
.checklist-body { flex: 1; }
.checklist-title { font-size: 14px; font-weight: 500; line-height: 1.35; }
.checklist-note {
  font-size: 12px; color: var(--muted); margin-top: 3px;
  line-height: 1.4;
}
.checklist-meta {
  font-size: 13px; padding: 6px 10px; margin-top: 6px;
  background: var(--bg); border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.checklist-restart { width: 100%; }

/* Telegram-баннер для гостей */
.tg-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 0 16px 12px; padding: 12px 14px;
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
  color: #fff; border-radius: 12px;
  box-shadow: 0 2px 12px rgba(42, 171, 238, 0.3);
  transition: all 0.2s ease;
}
.tg-banner.hidden { display: none; }
.tg-banner-icon { font-size: 28px; flex-shrink: 0; }
.tg-banner-text { flex: 1; min-width: 0; }
.tg-banner-title { font-size: 14px; font-weight: 600; line-height: 1.2; }
.tg-banner-desc { font-size: 12px; opacity: 0.9; margin-top: 2px; line-height: 1.3; }
.tg-banner-btn {
  flex-shrink: 0; padding: 8px 14px; background: #fff;
  color: #229ED9 !important; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-decoration: none !important;
  white-space: nowrap;
}
.tg-banner-btn:hover { background: #f0f8ff; }

.user-tg-link {
  color: #229ED9; text-decoration: none; font-weight: 500;
  font-size: 13px; padding: 4px 10px; border-radius: 6px;
  background: rgba(42, 171, 238, 0.1);
}
.user-tg-link:hover { background: rgba(42, 171, 238, 0.2); }
/* Длинный тост для подробных сообщений об ошибках */
#toast.toast-long {
  max-width: 90vw; white-space: normal; line-height: 1.4;
  text-align: left; font-size: 13px; padding: 14px 18px;
  bottom: 80px;
}

/* Фотофиксация */

/* Результат ФРДО (вставляется пользователем для парсинга) */
.frdo-summary { font-weight: 600; margin: 10px 0; padding: 8px 12px; border-radius: 8px; }
.frdo-summary.ok { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.frdo-summary.warn { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.frdo-summary.err { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.frdo-verdict { font-size: 15px; font-weight: 700; margin-top: 10px; padding: 10px; border-radius: 8px; }
.frdo-verdict.ok { background: rgba(34, 197, 94, 0.2); color: #16a34a; }
.frdo-verdict.warn { background: rgba(245, 158, 11, 0.2); color: #d97706; }
.frdo-verdict.err { background: rgba(239, 68, 68, 0.2); color: #dc2626; }
.frdo-check-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.frdo-check-icon { font-size: 16px; flex-shrink: 0; }
.frdo-check-body { flex: 1; }
.frdo-check-name { font-weight: 600; }
.frdo-check-detail { color: var(--muted); font-size: 12px; margin-top: 2px; }
.photo-block {
  margin-top: 18px; padding: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px;
}
.photo-block h2 { margin: 0 0 8px; font-size: 15px; }
.photo-block .muted { color: var(--muted); font-size: 12px; line-height: 1.4; }
.photo-block .form-group { margin: 8px 0; }
.photo-block input[type="text"] {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 14px; box-sizing: border-box;
}
.photo-block .primary,
.photo-block .secondary {
  width: 100%; padding: 11px 14px;
  border-radius: 8px; border: none; font-size: 14px;
  cursor: pointer; font-weight: 500;
}
.photo-block .primary { background: var(--accent); color: #fff; }
.photo-block .secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); margin-top: 8px; }
.photo-block ul { padding-left: 18px; }

/* Рекомендации к фотофиксации */
.photo-block h3 {
  color: var(--text);
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.photo-block .photo-rang {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 13px;
}
.photo-block .photo-rang .rang-label {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--accent);
}
.photo-block .photo-rang ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}
.photo-block .photo-rang li {
  margin: 2px 0;
}

/* Ручная проверка документов */
#manual-client-view, #manual-admin-view { margin-top: 8px; }
.manual-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  font-size: 14px;
}
.manual-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.manual-card .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.manual-card .reply {
  margin-top: 8px;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  white-space: pre-wrap;
}
.manual-card.pending { border-left: 3px solid #f5a623; }
.manual-card.done { border-left: 3px solid #4caf50; }
.manual-reply-form textarea { width: 100%; min-height: 90px; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; }
.manual-reply-form button { margin-top: 6px; }

/* Пакеты на РСА */
.pkg-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  font-size: 14px;
}
.pkg-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pkg-card .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.pkg-doc-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; margin: 4px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.pkg-doc-row.missing { opacity: 0.6; }
.pkg-doc-row.ok { border-left: 3px solid #4caf50; }
.pkg-doc-row.warning { border-left: 3px solid #f5a623; }
.pkg-doc-row.error { border-left: 3px solid #e74c3c; }
.pkg-doc-status { font-size: 20px; }
.pkg-doc-title { flex: 1; font-size: 13px; }
.pkg-doc-upload { font-size: 12px; padding: 4px 8px; background: var(--accent); color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.pkg-progress {
  height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 6px 0;
}
.pkg-progress-bar { height: 100%; background: #4caf50; transition: width 0.3s; }
.pkg-stats { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.pkg-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 12px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.pkg-section-title .muted {
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}

.sales-pitch {
  margin-top: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #FFF7E6 0%, #FFE5B4 100%);
  border-left: 4px solid #F5A623;
  border-radius: 8px;
}
.sales-pitch-text {
  font-size: 14px;
  line-height: 1.5;
  color: #4A3412;
  margin-bottom: 10px;
}
.sales-cta {
  width: 100%;
  background: #F5A623 !important;
  color: white !important;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.sales-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,166,35,0.4);
}
.sales-cta:active { transform: translateY(0); }


.pkg-rca-send, .pkg-rca-sent {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid #4caf50;
}
.pkg-rca-sent {
  border-left-color: var(--accent);
  background: rgba(76, 175, 80, 0.08);
}
.pkg-rca-email {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg, var(--bg));
  color: var(--text);
  font-size: 14px;
}

.pkg-rca-meta {
  font-size: 12px;
  background: var(--bg);
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 2px solid var(--accent);
}

.file-list { display:flex; flex-direction:column; gap:6px; margin-bottom:6px; }
.file-row { display:flex; align-items:center; gap:8px; padding:6px 8px; background:var(--card); border:1px solid var(--border); border-radius:8px; }
.file-row .file-row-main { flex:1; min-width:0; }
.file-row .name { font-size:13px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-row .size { font-size:11px; opacity:0.6; }
.file-row .remove { background:transparent; border:none; color:var(--danger, #e74c3c); font-size:18px; cursor:pointer; padding:0 6px; line-height:1; }
.file-add { background:transparent; border:1px dashed var(--border); color:var(--accent, #F5A623); padding:8px; border-radius:8px; cursor:pointer; width:100%; font-size:13px; margin-top:4px; }
.file-add:hover { background:rgba(245,166,35,0.08); }
.file-total { font-size:12px; opacity:0.7; padding:4px 0; }
.upload-tips { background:rgba(245,166,35,0.08); border-left:3px solid #F5A623; padding:10px 12px; border-radius:6px; margin:10px 0; font-size:12px; }
.upload-tips ul { margin:6px 0 0 0; padding-left:18px; }
.upload-tips li { margin-bottom:3px; }
.upload-tips strong { color:#F5A623; }

.form-card { background:var(--card); border:1px solid var(--border); border-radius:10px; padding:14px; margin-bottom:14px; }
.form-card h3 { margin-top:0; }
.form-row { display:flex; gap:10px; flex-wrap:wrap; }
.form-row .form-group { flex:1; min-width:160px; }

.arshin-card { background:var(--card); border:1px solid var(--border); border-radius:10px; padding:12px; margin-bottom:10px; }
.arshin-card.ok { border-left:3px solid #4caf50; }
.arshin-card.warn { border-left:3px solid #F5A623; background:rgba(245,166,35,0.08); }
.arshin-card.bad { border-left:3px solid #e74c3c; background:rgba(231,76,60,0.10); }
.arshin-card.bad .arshin-name { color:#ff6b6b; }
.arshin-name { font-weight:600; margin-bottom:4px; }
.arshin-grid { display:grid; grid-template-columns:auto 1fr; gap:4px 12px; font-size:13px; line-height:1.5; }
.arshin-grid b { color:var(--muted); font-weight:500; }
.arshin-actions { display:flex; gap:6px; margin-top:8px; }
.arshin-actions button { padding:6px 10px; font-size:12px; }

/* === QR-заявки === */
.qr-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--hint);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.qr-card.ok { border-left-color: #3ec46d; }
.qr-card.warn { border-left-color: var(--accent); }
.qr-card.bad { border-left-color: #e35d6a; }
.qr-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}
.qr-card-head b { color: var(--text); }
.qr-status {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  white-space: nowrap;
}
.qr-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--hint);
}

/* AUTH */
.user-btn {
  background: var(--accent);
  color: #1a1d24;
  border: 0;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.user-btn:hover { filter: brightness(1.1); }
.user-name { color: #fff; font-size: 13px; }

.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  max-width: 480px;
  width: 100%;
  position: relative;
  color: var(--text);
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
}
.modal-card h2 { color: var(--text); }
.modal-card .muted { color: var(--hint); }
.modal-card a { color: var(--accent); text-decoration: none; }
.modal-card a:hover { text-decoration: underline; }
.modal-close {
  position: absolute; top: 10px; right: 10px;
  background: transparent; color: var(--hint);
  border: 0; font-size: 22px; cursor: pointer; padding: 4px 8px;
}
.modal-close:hover { color: var(--text); }
.modal-card label { color: var(--hint); }
.modal-card input { background: var(--secondary); color: var(--text); border-color: var(--border); }
.modal-card input:focus { border-color: var(--accent); }

/* ACCOUNT */
.acc-section { margin-top: 16px; }
.acc-section h3 { color: var(--text); margin: 0 0 10px; }
.acc-stat { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; margin-right: 6px; }
.acc-stat.ok { background: rgba(40, 200, 110, .15); color: #28c86e; }
.acc-stat.warn { background: rgba(245, 166, 35, .15); color: var(--accent); }
.acc-row { padding: 10px 0; border-top: 1px solid var(--border); display: flex; gap: 12px; align-items: center; }
.acc-row .acc-meta { flex: 1; }
.acc-row .acc-meta b { display: block; color: var(--text); font-size: 14px; }
.acc-row .acc-meta .muted { color: var(--hint); font-size: 12px; }
.acc-empty { color: var(--hint); text-align: center; padding: 20px; }

.link-btn {
  background: none; border: 0; padding: 0; margin: 0;
  color: var(--accent); cursor: pointer; font: inherit;
  text-decoration: underline;
}
.link-btn:hover { color: #fff; }

/* По умолчанию (мобилка): label сверху, input под ним */
.form-card label,
.acc-section label,
.form-card > label,
#site-form label,
#qr-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

/* На десктопе: label слева, поле справа */
@media (min-width: 540px) {
  .form-card label,
  .acc-section label,
  .form-card > label,
  #site-form label,
  #qr-form label {
    display: grid !important;
    grid-template-columns: max-content 1fr;
    align-items: center;
    column-gap: 14px;
    margin-bottom: 12px;
  }
  .form-card label > input,
  .form-card label > select,
  .form-card label > textarea,
  .acc-section label > input,
  .acc-section label > select,
  .acc-section label > textarea,
  #site-form label > input,
  #site-form label > select,
  #qr-form label > input,
  #qr-form label > select,
  #qr-form label > textarea {
    margin: 0;
  }
}
