/* Стили статьи «Localhost и деплой: почему у меня работает, а у других нет». Участники, мини-сайт и карта серии — в shared/css/how-web.css. */

.ld-label { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.hw-node--git { --who: var(--text); --who-soft: var(--surface-2); }
.ld-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ld-btns [hidden] { display: none; }
.ld-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Схема: узлы на пунктире и точка-запрос */
.ld-route { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 4px; }
.ld-route--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ld-route__track { position: absolute; left: 16.67%; right: 16.67%; top: 30px; border-top: 2px dashed var(--border-strong); }
.ld-route--4 .ld-route__track { left: 12.5%; right: 12.5%; }
.ld-node__note, .ld-ver { font-family: var(--font-mono); font-size: 11px; line-height: 1.3; color: var(--muted); margin-top: -4px; }
.ld-ver { padding: 2px 7px; border-radius: 99px; background: var(--surface); transition: background var(--transition), color var(--transition); }
.ld-ver--new { background: var(--primary-soft); color: var(--primary-fg); }
.ld-node--hit .hw-node__icon { background: var(--mint-soft); color: var(--mint-fg); border-color: var(--mint-fg); }
.ld-node--err .hw-node__icon { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.ld-node--err .hw-node__name { color: var(--danger); }
.ld-packet {
  position: absolute;
  z-index: 2;
  top: 31px;
  left: 16.67%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--bg);
  opacity: 0;
  transition: left .8s var(--ease-out), opacity .2s ease, background .2s ease;
}
.ld-packet--on { opacity: 1; }
/* Запрос к самому себе: точка не уходит, а расходится кругами на месте */
.ld-packet--self { animation: ld-self .8s ease-out 1; }
@keyframes ld-self {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--text) 45%, transparent); }
  100% { box-shadow: 0 0 0 26px transparent; }
}

/* Страница ошибки Chrome внутри мини-сайта */
.ld-err {
  position: absolute;
  inset: 10px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.4;
  animation: demo-in .3s var(--ease-out) both;
}
.ld-err > b { font-family: var(--font-heading); font-weight: 500; font-size: 16px; line-height: 1.2; }
.ld-err span { color: var(--muted); }
.ld-err span b { color: var(--text); font-weight: 600; }
.ld-err code { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); background: none; padding: 0; }
.ld-err__icon { width: 26px; height: 22px; border: 2px solid var(--muted); border-radius: 4px; position: relative; opacity: .7; }
.ld-err__icon::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--muted); }

/* ---------- 01. Чей это localhost ---------- */

.ld-local { display: grid; gap: 18px; }
.ld-local__view { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.ld-device { min-width: 0; transition: max-width .3s var(--ease-out); }
.ld-device--phone { max-width: 230px; justify-self: center; width: 100%; }
.ld-device--phone .hw-site { border-radius: 20px; }
.ld-result { display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; background: var(--surface); font-size: 14px; line-height: 1.5; animation: demo-in .3s var(--ease-out) both; }
.ld-result b { font-family: var(--font-heading); font-weight: 500; font-size: 16px; }
.ld-result--ok b { color: var(--mint-fg); }
.ld-result--err { background: var(--danger-soft); }
.ld-result--err b { color: var(--danger); }
.ld-result__wait { color: var(--muted); font-size: 13px; }
.ld-local__controls { gap: 10px 18px; }
@media (max-width: 640px) {
  .ld-local__view { grid-template-columns: 1fr; }
  .ld-local__controls .ld-ctl { width: 100%; }
}

/* ---------- 02. Сервер разработки ---------- */

.ld-dev { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.ld-dev__col { display: grid; gap: 6px; min-width: 0; }
.ld-term {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 262px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ld-term__line { animation: demo-in .25s var(--ease-out) both; }
.ld-term__prompt { color: var(--primary-fg); }
.ld-term__ok { color: var(--mint-fg); }
.ld-term__muted { color: var(--muted); }
.ld-term__cursor { display: inline-block; width: 7px; height: 1em; vertical-align: -2px; }
.ld-dev__status { grid-column: 1 / -1; padding: 10px 14px; border-radius: 12px; background: var(--surface); font-size: 13.5px; line-height: 1.5; }
.ld-dev__status--ok { color: var(--text); background: var(--mint-soft); }
.ld-dev__status--err { background: var(--danger-soft); }
.ld-dev__status--warn { background: color-mix(in srgb, var(--signal) 14%, transparent); }
.ld-dev__controls { gap: 10px 18px; }
@media (max-width: 640px) {
  .ld-dev { grid-template-columns: 1fr; }
  .ld-term { min-height: 0; }
  .ld-dev__controls .ld-ctl { width: 100%; }
}

/* ---------- 03. Путь в интернет ---------- */

.ld-deploy { display: grid; gap: 14px; }
.ld-msg { padding: 10px 14px; border-radius: 12px; background: var(--surface); font-size: 14px; line-height: 1.5; }
.ld-msg--warn { background: color-mix(in srgb, var(--signal) 14%, transparent); }
.ld-msg--ok { background: var(--mint-soft); }
.ld-wins { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.ld-win { display: grid; gap: 6px; align-content: start; min-width: 0; }
.ld-winseg { display: none; }
.ld-flash { animation: ld-flash 1.2s ease-out 1; }
@keyframes ld-flash { 0%, 40% { box-shadow: 0 0 0 2px var(--primary-fg); } 100% { box-shadow: 0 0 0 2px transparent; } }
.ld-logbox { display: grid; gap: 6px; }
.ld-log { display: grid; gap: 2px; min-height: 64px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.ld-log__line { animation: demo-in .25s var(--ease-out) both; }
.ld-log__muted { color: var(--muted); }
.ld-log__edit { color: var(--primary-fg); }
.ld-log__ok { color: var(--mint-fg); }
.ld-deploy__controls { gap: 10px 18px; }
@media (max-width: 640px) {
  .ld-winseg { display: flex; }
  .ld-wins { grid-template-columns: 1fr; }
  .ld-wins[data-show='pc'] .ld-win--net, .ld-wins[data-show='net'] .ld-win--pc { display: none; }
  .ld-deploy .hw-node__name { font-size: 12px; }
  .ld-ver { font-size: 10px; padding: 2px 5px; }
}
@media (max-width: 480px) {
  .ld-deploy__controls .ld-btns { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
}

/* ---------- 04. У меня работает ---------- */

.ld-env { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 16px; align-items: start; }
.ld-env__site { display: grid; gap: 10px; min-width: 0; }
.ld-env__site .seg { justify-self: start; }
.ld-env__cases { display: grid; gap: 8px; min-width: 0; }
.ld-case { display: grid; gap: 6px; justify-items: start; padding: 12px 14px; border-radius: 14px; background: var(--surface); transition: background var(--transition); }
.ld-case__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; width: 100%; }
.ld-case__head b { font-family: var(--font-heading); font-weight: 500; font-size: 15px; }
.ld-case__badge { font-family: var(--font-mono); font-size: 11px; color: var(--danger); }
.ld-case__where { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.45; color: var(--danger); overflow-wrap: anywhere; }
.ld-case__why { font-size: 13px; line-height: 1.5; color: var(--muted); }
.ld-case [hidden] { display: none; }
.ld-case--ok { background: var(--mint-soft); }
.ld-case--ok .ld-case__badge { color: var(--mint-fg); }
.ld-case--ok .ld-case__where { color: var(--muted); text-decoration: line-through; }
.ld-score { padding: 10px 14px; border-radius: 12px; background: var(--surface); font-size: 13.5px; line-height: 1.5; }
.ld-score--err { background: var(--danger-soft); }
.ld-score--ok { background: var(--mint-soft); }
/* Поломки на мини-сайте */
.ld-site-err { display: none; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--danger); color: var(--danger); font-size: 11.5px; text-align: center; }
.ld-site-err--form { padding: 3px 8px; font-size: 10.5px; }
.ld-bad-menu .ld-site-err:not(.ld-site-err--form), .ld-bad-form .ld-site-err--form { display: block; }
.ld-bad-menu .hw-site__menu { display: none; }
.ld-bad-photo .hw-site__photo { border: 2px dashed var(--danger); background: var(--danger-soft); color: var(--danger); }
.ld-bad-photo .hw-site__photo svg { display: none; }
.ld-bad-photo .hw-site__photo span { display: block; font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
@media (max-width: 720px) { .ld-env { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */

.hero__visual { display: flex; align-items: center; justify-content: center; }
.hero-ld { width: 100%; max-width: 400px; display: grid; gap: 22px; }
.hero-ld__chain { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 18px 8px 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); }
.hero-ld__track { position: absolute; left: 15%; right: 15%; top: 44px; border-top: 2px dashed var(--border-strong); }
.hero-ld__card { justify-self: end; width: 80%; border-radius: 16px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.hero-ld__bar { display: flex; align-items: center; gap: 5px; padding: 8px 11px; border-bottom: 1px solid var(--border); background: var(--surface); }
.hero-ld__bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex: none; }
.hero-ld__addr { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0; margin-left: 6px; padding: 3px 10px; border-radius: 99px; background: var(--panel); font-family: var(--font-mono); font-size: 11.5px; }
.hero-ld__lock { display: none; width: 8px; height: 7px; margin-top: 3px; border-radius: 2px; background: var(--mint-fg); position: relative; }
.hero-ld__lock::before { content: ''; position: absolute; left: 1.5px; right: 1.5px; bottom: 5px; height: 5px; border: 1.5px solid var(--mint-fg); border-bottom: 0; border-radius: 4px 4px 0 0; }
.is-live .hero-ld__lock { display: block; }
.hero-ld__body { display: grid; gap: 3px; padding: 14px 16px 16px; background: var(--hero-grad); }
.hero-ld__body b { font-family: var(--font-heading); font-weight: 500; font-size: 16px; }
.hero-ld__body span { font-size: 12.5px; color: color-mix(in srgb, var(--text) 72%, transparent); }
.hero-ld__body .hero-ld__tag { justify-self: start; margin-top: 8px; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--panel) 70%, transparent); font-family: var(--font-mono); font-size: 11px; color: var(--muted); transition: color var(--transition); }
.is-live .hero-ld__tag { color: var(--mint-fg); }
@media (max-width: 640px) { .hero-ld__card { width: 90%; } }

/* Переключатели на телефоне во всю ширину */
@media (max-width: 480px) {
  .demo__controls .seg, .ld-winseg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
  .demo__controls .seg__btn, .ld-winseg .seg__btn { padding-left: 4px; padding-right: 4px; }
}
