/* ===== Страница /android: как устроено приложение и фабрика, которая его делает ===== */

/* ---------- Переключатель «технические детали» ---------- */
.ax-bar {
  position: sticky; top: 54px; z-index: 40;
  background: rgba(10, 14, 22, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}
.ax-bar-inner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ax-bar-hint { font-size: 12.5px; color: var(--muted); }
.ax-switch {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 12px 17px 12px 13px; min-height: 44px;
  font-family: var(--font); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.ax-switch:hover { color: var(--text); border-color: #33415f; }
.ax-switch .knob {
  width: 30px; height: 17px; border-radius: 999px;
  background: var(--line); position: relative; transition: background 0.18s;
}
.ax-switch .knob::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--faint); transition: transform 0.18s, background 0.18s;
}
body.tech-on .ax-switch { color: var(--text); border-color: var(--blue); }
body.tech-on .ax-switch .knob { background: rgba(96, 165, 250, 0.35); }
body.tech-on .ax-switch .knob::after { transform: translateX(13px); background: var(--blue); }

/* Технический слой: спрятан, пока не включат */
.tech { display: none; }
body.tech-on .tech { display: block; }
.tech-inline { display: none; }
body.tech-on .tech-inline { display: inline; }
.tech-box {
  margin-top: 9px; padding: 9px 12px;
  background: #0b101b; border: 1px solid var(--line); border-left: 2px solid var(--blue);
  border-radius: 8px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.75; color: #a9b6cd;
  overflow-x: auto;
}
.tech-box b { color: var(--blue); font-weight: 700; }
.tech-box .t-k { color: #8fa0bd; }

/* ---------- Общие мелочи ---------- */
/* Подсказка «схему можно прокрутить вбок»: объявлена ДО адаптива, иначе медиазапрос её не перебьёт */
.ax-scrollhint { display: none; font-size: 12px; color: var(--muted); margin-top: 8px; }

.ax-panel {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; overflow-x: auto;
}
.ax-cap { font-size: 12.5px; color: var(--muted); margin-top: 12px; line-height: 1.6; max-width: 84ch; }
.ax-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12.5px; color: var(--muted); }
.ax-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 7px; }
.ax-legend .dash { width: 22px; height: 0; border-top: 2px dashed var(--red); display: inline-block; margin-right: 7px; vertical-align: middle; }
.ax-note {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: 10px; padding: 14px 17px; font-size: 13.5px; color: var(--muted); line-height: 1.65;
  margin-top: 16px; max-width: 82ch;
}
.ax-note b { color: var(--text); }

/* ---------- Анатомия приложения: слои ---------- */
.ax-anat { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ax-anat > .ax-panel { position: sticky; top: 114px; }
.ax-layers { display: flex; flex-direction: column; gap: 9px; }
.ax-layer {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: baseline;
}
.ax-layer:hover { border-color: #33415f; background: var(--panel-2); }
.ax-layer.on { border-color: var(--blue); background: rgba(96, 165, 250, 0.07); }
.ax-layer-ico { font-size: 16px; line-height: 1.3; }
.ax-layer-name { font-size: 14.5px; font-weight: 700; color: var(--text); }
.ax-layer-plain { font-size: 13px; color: var(--muted); line-height: 1.55; margin-top: 3px; }
.ax-layer-tech { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.ax-gen {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.ax-gen.tpl { background: rgba(96, 165, 250, 0.14); color: var(--blue); }
.ax-gen.gen { background: rgba(251, 191, 36, 0.14); color: var(--amber); }
.ax-gen.mix { background: rgba(167, 139, 250, 0.14); color: var(--violet); }
.ax-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ax-file {
  font-family: var(--mono); font-size: 11px; color: #9fb0cc;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px;
}

/* ---------- Сквозной путь: шаги ---------- */
.ax-flow { display: flex; flex-direction: column; }
.ax-step { display: grid; grid-template-columns: 46px 1fr; gap: 16px; position: relative; padding-bottom: 20px; }
.ax-step::before {
  content: ''; position: absolute; left: 23px; top: 40px; bottom: 0;
  width: 2px; background: linear-gradient(180deg, var(--line), rgba(36, 48, 74, 0.25));
}
.ax-step:last-child::before { display: none; }
.ax-step-n {
  width: 46px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 15px; font-weight: 800; color: var(--muted); z-index: 1;
}
.ax-step.llm .ax-step-n { border-color: #4c3f76; color: var(--violet); background: rgba(167, 139, 250, 0.1); }
.ax-step.human .ax-step-n { border-color: #6b5518; color: var(--amber); background: rgba(251, 191, 36, 0.1); }
.ax-step.emu .ax-step-n { border-color: #2e4a3f; color: var(--green); background: rgba(52, 211, 153, 0.1); }
.ax-step.ext .ax-step-n { border-color: #2c3f61; color: var(--blue); background: rgba(96, 165, 250, 0.1); }
.ax-step-body { padding-top: 1px; min-width: 0; }
.ax-step-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ax-step-title { font-size: 15.5px; font-weight: 700; color: var(--text); }
.ax-actor {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 8px; border-radius: 999px; background: var(--panel-2); color: var(--faint);
  border: 1px solid var(--line);
}
.ax-step.llm .ax-actor { color: var(--violet); border-color: #4c3f76; }
.ax-step.human .ax-actor { color: var(--amber); border-color: #6b5518; }
.ax-step.emu .ax-actor { color: var(--green); border-color: #2e4a3f; }
.ax-step.ext .ax-actor { color: var(--blue); border-color: #2c3f61; }
.ax-mins { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ax-step-plain { font-size: 14px; color: var(--muted); line-height: 1.65; margin-top: 5px; max-width: 74ch; }
.ax-step-out {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 9px;
  font-family: var(--mono); font-size: 11.5px; color: var(--green);
  background: rgba(52, 211, 153, 0.08); border: 1px solid #234437; border-radius: 7px; padding: 3px 9px;
}
.ax-step-fail {
  margin-top: 7px; font-size: 12.5px; color: #d09a9a; line-height: 1.6;
  display: flex; gap: 7px;
}
.ax-step-fail span:first-child { color: var(--red); }

/* ---------- Ворота качества ---------- */
.ax-gates { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.ax-gate {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px;
  border-top: 2px solid var(--green);
}
.ax-gate-n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ax-gate-name { font-size: 14.5px; font-weight: 700; color: var(--text); margin: 3px 0 7px; }
.ax-gate-what { font-size: 13px; color: var(--muted); line-height: 1.6; }
.ax-gate-tool { font-family: var(--mono); font-size: 11.5px; color: var(--blue); margin-top: 9px; }
.ax-gate-fail { font-size: 12.5px; color: #cf9d9d; margin-top: 7px; line-height: 1.55; }

/* ---------- Стек ---------- */
.ax-stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 10px; }
.ax-tech {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px;
}
.ax-tech-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ax-tech-name { font-size: 14px; font-weight: 700; color: var(--text); }
.ax-tech-ver { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--amber); }
.ax-tech-role { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-top: 5px; }

/* ---------- Две реальные апки ---------- */
.ax-apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.ax-app { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px 21px; }
.ax-app-name { font-size: 17px; font-weight: 800; color: var(--text); }
.ax-app-sub { font-size: 12.5px; color: var(--muted); font-family: var(--mono); margin-top: 3px; }
.ax-app-brief { font-size: 13.5px; color: var(--muted); line-height: 1.65; margin: 11px 0 13px; }
.ax-app-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 9px; }
.ax-app-num { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
.ax-app-num b { display: block; font-family: var(--mono); font-size: 14px; font-weight: 800; color: var(--text); }
.ax-app-num span { font-size: 11.5px; color: var(--muted); }
.ax-app-screens { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ---------- Честные границы ---------- */
.ax-limits { display: flex; flex-direction: column; gap: 10px; }
.ax-limit {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--red);
  border-radius: 11px; padding: 14px 17px;
}
.ax-limit-t { font-size: 14px; font-weight: 700; color: var(--text); }
.ax-limit-w { font-size: 13px; color: var(--muted); line-height: 1.65; margin-top: 5px; max-width: 76ch; }

/* ---------- Словарь ---------- */
.ax-gloss { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.ax-term { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 15px; }
.ax-term b { font-family: var(--mono); font-size: 12.5px; color: var(--amber); }
.ax-term span { display: block; font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 4px; }

/* ---------- Числа в шапке ---------- */
.ax-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 26px; }
.ax-kpi { background: rgba(19, 26, 42, 0.7); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ax-kpi b { display: block; font-family: var(--mono); font-size: 20px; font-weight: 800; color: var(--amber); line-height: 1.2; letter-spacing: -0.01em; }
.ax-kpi span { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.ax-kpi i { font-family: var(--mono); font-style: normal; font-size: 11px; color: var(--muted); margin-top: 6px; }
body.tech-on .ax-kpi i { display: block; }

/* ---------- Выходы на соседние страницы ---------- */
.ax-exit { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.ax-exit a {
  display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; text-decoration: none; transition: border-color 0.15s, transform 0.15s;
}
.ax-exit a:hover { border-color: var(--blue); transform: translateY(-2px); }
.ax-exit .e-t { font-size: 15px; font-weight: 700; color: var(--text); }
.ax-exit .e-d { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 6px; }

/* ---------- Адаптив ---------- */
/* Широкие схемы нарисованы под 1020 единиц viewBox; сжимать их до нечитаемого текста
   хуже, чем дать прокрутить вбок. Порог — ширина, на которой шрифт 11 падает ниже ~9px. */
@media (max-width: 1150px) {
  .ax-panel svg { min-width: 1000px; }
  #ax-cut { min-width: 600px; }
  .ax-scrollhint { display: block; }
}

@media (max-width: 900px) {
  .ax-anat { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ax-panel { padding: 14px; }
  .ax-step { grid-template-columns: 36px 1fr; gap: 12px; }
  .ax-step::before { left: 18px; }
  .ax-step-n { width: 36px; height: 36px; font-size: 13px; }
  .ax-layer { grid-template-columns: 24px 1fr; }
  .ax-layer .ax-gen { grid-column: 2; justify-self: start; margin-top: 8px; }
}

/* Синий вариант заголовка секции — в базовой теме его не было */
.sec-kicker.blue { color: var(--blue); }

