:root {
  --az-accent: #2f6fde;
  --az-accent-soft: #e8f0fd;
  --az-bg: #f4f6fa;
  --az-side: #14213d;
  --az-side-text: #c9d3e6;
  --az-side-muted: #7f8db0;
  --bs-primary: var(--az-accent);
  --bs-link-color: var(--az-accent);
}
body { background: var(--az-bg); font-size: 15px; }
.btn-primary { --bs-btn-bg: var(--az-accent); --bs-btn-border-color: var(--az-accent);
  --bs-btn-hover-bg: #2559b8; --bs-btn-hover-border-color: #2559b8; }

.az-layout { display: flex; min-height: 100vh; }
.az-side { width: 248px; flex-shrink: 0; background: var(--az-side); color: var(--az-side-text);
  display: flex; flex-direction: column; padding: 18px 12px; }
.az-brand { color: #fff; font-weight: 700; font-size: 19px; padding: 4px 10px 18px; letter-spacing: .2px; }
.az-brand span { color: #7fb0ff; }
.az-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--az-side-muted);
  padding: 14px 10px 6px; }
.az-link { display: block; color: var(--az-side-text); text-decoration: none; padding: 8px 10px;
  border-radius: 8px; margin-bottom: 2px; }
.az-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.az-link.active { background: var(--az-accent); color: #fff; }
.az-link .soon { font-size: 10px; color: var(--az-side-muted); margin-left: 4px; }
.az-link.active .soon { color: #dbe7ff; }
.az-side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding: 12px 10px 0; font-size: 13px; }

.az-main { flex: 1; min-width: 0; }
.az-top { background: #fff; border-bottom: 1px solid #e3e7ef; padding: 10px 24px; display: flex;
  align-items: center; gap: 12px; }
.az-content { padding: 24px; max-width: 1280px; }
.az-card { background: #fff; border: 1px solid #e3e7ef; border-radius: 12px; padding: 20px; }
.az-muted { color: #6b7590; }
.az-badge-ok { background: #e3f6ec; color: #1f7a4a; }
.az-badge-error { background: #fdeaea; color: #b42323; }
.az-badge-unknown { background: #eef1f6; color: #59637d; }
.az-badge-off { background: #eef1f6; color: #8a93a8; }
.table > :not(caption) > * > * { padding: .65rem .75rem; }
.secret-row { display: flex; gap: 8px; align-items: center; }
.secret-row code { font-size: 13px; word-break: break-all; }
.az-cell-text { white-space: pre-wrap; word-break: break-word; max-width: 320px; }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

.az-burger { display: none; }
@media (max-width: 900px) {
  .az-side { position: fixed; inset: 0 auto 0 0; z-index: 1040; transform: translateX(-100%); transition: transform .2s; }
  .az-side.open { transform: none; }
  .az-burger { display: inline-flex; }
  .az-content { padding: 16px; }
  .az-top { padding: 10px 16px; }
}
.az-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.az-login .az-card { width: 100%; max-width: 400px; padding: 28px; }

/* Включён / выключен - крупно и сразу видно */
.az-power { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 10px; border: 1px solid; }
.az-power.on { background: #e9f8ef; border-color: #9fdcb5; }
.az-power.off { background: #fdecec; border-color: #f2b3b3; }
.az-power .form-switch { padding-left: 0; }
.az-power .form-switch .form-check-input { width: 3.2em; height: 1.7em; margin: 0; cursor: pointer; }
.az-power.on .form-check-input:checked { background-color: #1f9d55; border-color: #1f9d55; }
.az-power-text { display: flex; flex-direction: column; cursor: pointer; margin: 0; }
.az-power-title { font-weight: 700; font-size: 17px; }
.az-power.on .az-power-title { color: #157a41; }
.az-power.off .az-power-title { color: #b42318; }
.az-power-help { font-size: 13px; color: #4a5568; }
.az-power-hint { font-size: 12px; color: #7f8db0; margin-top: 2px; }

/* Выбор категорий Авито */
.az-catpick { position: relative; }
.az-catpick-results { position: absolute; z-index: 20; left: 0; right: 0; margin-top: 4px; max-height: 340px;
  overflow-y: auto; background: #fff; border: 1px solid #d5dbe7; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20, 33, 61, .12); }
.az-catpick-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  text-align: left; border: 0; border-bottom: 1px solid #eef1f6; background: none; padding: 8px 12px; }
.az-catpick-item:last-child { border-bottom: 0; }
.az-catpick-item:hover, .az-catpick-item:focus { background: var(--az-accent-soft); outline: none; }
.az-catpick-chosen { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.az-catpick-chosen li { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 12px; border: 1px solid #cfe0fb; background: var(--az-accent-soft); border-radius: 8px; }
.az-catpick-chosen li .btn-close { flex-shrink: 0; font-size: 11px; }

/* Кнопки-галки генератора дат */
.az-chips { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid #b9cdf3; border-radius: 8px; overflow: hidden; }
.az-chips-8 { grid-template-columns: repeat(8, 1fr); }
.az-chips label { margin: 0; border-right: 1px solid #dbe5f8; border-bottom: 1px solid #dbe5f8; }
.az-chips input { display: none; }
.az-chips span { display: block; text-align: center; padding: 7px 0; cursor: pointer; color: var(--az-accent); user-select: none; }
.az-chips input:checked + span { background: var(--az-accent); color: #fff; }

.az-howto ol { padding-left: 1.2em; } .az-howto li { margin-bottom: 3px; }

/* Ссылка «?» в шапке - раздел инструкции этой страницы */
.az-help { font-weight: 700; width: 32px; padding-left: 0; padding-right: 0; }

/* Инструкция */
.az-guide { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.az-g-nav { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: #fff; border: 1px solid #e3e7ef; border-radius: 12px; padding: 12px; }
.az-g-search { margin-bottom: 8px; }
.az-g-found { font-size: 12px; color: #6b7590; min-height: 0; margin-top: 4px; }
.az-g-found:empty { display: none; }
.az-g-topics { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.az-g-topics a { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 8px;
  color: #2a3550; text-decoration: none; font-size: 14px; line-height: 1.3; }
.az-g-topics a:hover { background: var(--az-accent-soft); }
.az-g-topics a.active { background: var(--az-accent); color: #fff; }
.az-g-topics a.active .az-g-num, .az-g-topics a.active .az-g-admin { color: #dbe7ff; }
.az-g-topics li[hidden] { display: none; }
.az-g-num { flex: 0 0 18px; font-size: 12px; color: #8a93a8; text-align: right; font-variant-numeric: tabular-nums; }
.az-g-admin { margin-left: auto; font-size: 10px; color: #8a93a8; }
.az-g-body { min-width: 0; }
.az-g-hero { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px;
  padding: 18px 20px; border-radius: 12px; background: linear-gradient(120deg, #14213d, #2f4f8f); color: #fff; }
.az-g-hero-title { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.az-g-hero-text { color: #c9d3e6; font-size: 14px; max-width: 640px; }
.az-g-hero-text .btn-link { color: #9cc2ff; font-size: inherit; }
.az-g-updated { flex-shrink: 0; font-size: 12px; color: #dbe7ff; border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px; padding: 4px 10px; text-decoration: none; white-space: nowrap; }
.az-g-updated:hover { background: rgba(255,255,255,.1); color: #fff; }
.az-g-sec { margin-bottom: 16px; scroll-margin-top: 16px; }
.az-g-sec[hidden] { display: none; }
.az-g-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.az-g-badge { flex: 0 0 34px; height: 34px; border-radius: 10px; background: var(--az-accent-soft); color: var(--az-accent);
  font-weight: 700; display: flex; align-items: center; justify-content: center; }
.az-g-title { font-size: 18px; font-weight: 700; margin: 4px 0 2px; }
.az-g-lead { color: #6b7590; margin: 0; }
.az-g-sec p, .az-g-sec li { line-height: 1.55; }
.az-g-sub { font-size: 15px; font-weight: 700; margin: 18px 0 8px; color: #14213d; }
.az-g-steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 8px; }
.az-g-steps > li { counter-increment: step; position: relative; padding: 2px 0 8px 38px; }
.az-g-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px;
  border-radius: 50%; background: var(--az-accent); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.az-g-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 28px; bottom: 0;
  width: 2px; background: #dbe5f8; }
.az-g-list { padding-left: 1.2em; margin-bottom: 8px; }
.az-g-list li { margin-bottom: 5px; }
.az-g-note { display: flex; gap: 12px; padding: 10px 14px; border-radius: 10px; margin: 12px 0; font-size: 14px; }
.az-g-note-label { flex-shrink: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding-top: 3px; }
.az-g-tip { background: #eef5ff; border-left: 4px solid var(--az-accent); }
.az-g-tip .az-g-note-label { color: var(--az-accent); }
.az-g-warn { background: #fff6e5; border-left: 4px solid #e8a317; }
.az-g-warn .az-g-note-label { color: #a86b00; }
.az-g-qa { border: 1px solid #e3e7ef; border-radius: 10px; overflow: hidden; }
.az-g-qa-item { padding: 10px 14px; }
.az-g-qa-item + .az-g-qa-item { border-top: 1px solid #eef1f6; }
.az-g-q { font-weight: 600; color: #b42318; margin-bottom: 2px; }
.az-g-a { color: #2a3550; }
.az-g-pages { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef1f6; }
.az-g-news .az-g-day { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 10px 0; }
.az-g-news .az-g-day + .az-g-day { border-top: 1px solid #eef1f6; }
.az-g-date { font-weight: 700; color: var(--az-accent); }
.az-g-news ul { padding-left: 1.1em; margin: 0; }
.az-g-news li { margin-bottom: 6px; }
.az-guide mark { background: #ffe58a; padding: 0 1px; border-radius: 3px; }
@media (max-width: 900px) {
  .az-guide { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .az-g-nav { position: sticky; top: 0; z-index: 5; max-height: none; border-radius: 0 0 12px 12px;
    margin: 0; min-width: 0; padding: 10px 12px; }
  .az-g-topics { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .az-g-topics::-webkit-scrollbar { display: none; }
  .az-g-topics a { white-space: nowrap; border: 1px solid #dbe5f8; padding: 5px 10px; font-size: 13px; }
  .az-g-num, .az-g-admin { display: none; }
  .az-g-hero { flex-direction: column; padding: 14px 16px; }
  .az-g-sec { padding: 16px; scroll-margin-top: 110px; }
  .az-g-news .az-g-day { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* Помощник: кнопка справа внизу и выезжающая панель */
.az-ast-fab { position: fixed; right: 20px; bottom: 20px; z-index: 1030; display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 18px; background: #14213d; color: #fff; font-weight: 600;
  box-shadow: 0 8px 24px rgba(20, 33, 61, .28); }
.az-ast-fab:hover { background: var(--az-accent); }
.az-ast-fab[hidden] { display: none; }
.az-ast-fab-icon { color: #7fb0ff; }
.az-ast-fab:hover .az-ast-fab-icon { color: #fff; }
.az-ast { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1045; width: 440px; max-width: 100vw; display: flex;
  flex-direction: column; background: #fff; border-left: 1px solid #e3e7ef; box-shadow: -12px 0 32px rgba(20, 33, 61, .14);
  animation: az-ast-in .18s ease-out; }
.az-ast[hidden] { display: none; }
@keyframes az-ast-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.az-ast-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #e3e7ef; }
.az-ast-head-text { flex: 1; min-width: 0; }
.az-ast-title { font-weight: 700; font-size: 16px; }
.az-ast-title .az-ast-fab-icon { color: var(--az-accent); }
.az-ast-sub { font-size: 12px; color: #6b7590; }
.az-ast-note { margin: 10px 14px 0; padding: 8px 12px; border-radius: 8px; background: #fff6e5; font-size: 13px; color: #6b4a00; }
.az-ast-note[hidden] { display: none; }
.az-ast-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px;
  background: var(--az-bg); overscroll-behavior: contain; }
.az-ast-msg { max-width: 92%; border-radius: 14px; padding: 10px 13px; font-size: 14px; line-height: 1.5;
  word-break: break-word; }
.az-ast-msg p { margin: 0 0 8px; } .az-ast-msg p:last-child { margin-bottom: 0; }
.az-ast-msg ul, .az-ast-msg ol { margin: 0 0 8px; padding-left: 1.2em; }
.az-ast-msg ul:last-child, .az-ast-msg ol:last-child { margin-bottom: 0; }
.az-ast-msg li { margin-bottom: 3px; }
.az-ast-msg code { font-size: 12.5px; background: #eef1f6; color: #14213d; padding: 1px 4px; border-radius: 4px; }
.az-ast-user { align-self: flex-end; background: var(--az-accent); color: #fff; white-space: pre-wrap;
  border-bottom-right-radius: 4px; }
.az-ast-bot { align-self: flex-start; background: #fff; border: 1px solid #e3e7ef; border-bottom-left-radius: 4px; }
.az-ast-err { align-self: stretch; max-width: none; background: #fdeaea; color: #8a1c1c; }
.az-ast-src { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #dde3ee; display: flex; flex-wrap: wrap; gap: 6px; }
.az-ast-src a { font-size: 12px; text-decoration: none; background: #f1f4fa; border-radius: 999px; padding: 2px 9px;
  color: #2a3550; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.az-ast-src a:hover { background: var(--az-accent-soft); color: var(--az-accent); }
.az-ast-wait { display: flex; align-items: center; gap: 10px; color: #4a5568; }
.az-ast-dots { display: inline-flex; gap: 4px; }
.az-ast-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--az-accent); opacity: .3;
  animation: az-ast-dot 1.2s infinite; }
.az-ast-dots i:nth-child(2) { animation-delay: .2s; } .az-ast-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes az-ast-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.az-ast-hello { background: #fff; border: 1px solid #e3e7ef; border-radius: 14px; padding: 14px; font-size: 14px; }
.az-ast-hello b { display: block; margin-bottom: 4px; }
.az-ast-chips { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.az-ast-chips button { text-align: left; border: 1px solid #cfe0fb; background: var(--az-accent-soft); color: #23468f;
  border-radius: 10px; padding: 7px 11px; font-size: 13px; }
.az-ast-chips button:hover { background: #dbe8fd; }
.az-ast-form { border-top: 1px solid #e3e7ef; padding: 10px 14px 12px; background: #fff; }
.az-ast-form textarea { resize: none; font-size: 14px; max-height: 160px; }
.az-ast-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.az-ast-hint { font-size: 11px; color: #8a93a8; }
.az-ast-form { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
@media (max-width: 600px) {
  .az-ast { width: 100vw; border-left: 0; }
  .az-ast-sub { display: none; }
  .az-ast-form textarea { font-size: 16px; }
  .az-ast-fab { right: 14px; bottom: 14px; padding: 10px 15px; }
  .az-ast-hint { display: none; }
  .az-ast-actions { justify-content: flex-end; }
  body.az-ast-open { overflow: hidden; }
}

/* Телефон: лента тем инструкции не раздвигает страницу; плавающая кнопка «Помощник» не закрывает поля */
@media (max-width: 900px) {
  .az-guide { overflow-x: clip; }
  .az-content, main { padding-bottom: 84px; }
}
.az-copyhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; }
