/* Стили, специфичные для статьи «Контекстное окно». Общие компоненты — в shared/css. */

/* ---------- Полоса заполнения окна ---------- */

.cw-bar {
  position: relative;
  display: flex;
  height: 14px;
  border-radius: 8px;
  background: var(--surface-2);
}
.cw-bar--big { height: 22px; border-radius: 10px; }
.cw-bar__seg {
  display: block;
  height: 100%;
  flex: none;
  transition: width .5s var(--ease-out);
}
.cw-bar__seg:first-child { border-radius: 8px 0 0 8px; }
.cw-bar__mark {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 0;
  border-left: 2px dashed var(--danger);
}
.cw-bar__mark::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 2px);
  right: 4px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--danger);
}
.cw-bar__mark[hidden] { display: none; }

.cw-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.cw-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.cw-legend__item i { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ---------- Терминал: моноширинный вывод команд ---------- */

.cw-term { font-family: var(--font-mono); font-size: 13px; line-height: 1.55; }
.cw-term .window__body { display: grid; gap: 4px; padding: 14px 16px; min-width: 0; }
.cw-term__cmd { color: var(--text); }
.cw-term__cmd::before { content: '> '; color: var(--muted); }
.cw-term__out { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.cw-term__out b { color: var(--text); font-weight: 600; }

/* Строка статуса внизу окна */
.cw-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.cw-status[hidden] { display: none; }
.cw-status b { font-weight: 500; color: var(--text); }
.cw-status__meter { letter-spacing: -1px; }
.cw-status--ok .cw-status__meter, .cw-status--ok .cw-status__pct { color: var(--mint-fg); }
.cw-status--mid .cw-status__meter, .cw-status--mid .cw-status__pct { color: var(--signal-fg); }
.cw-status--high .cw-status__meter, .cw-status--high .cw-status__pct { color: var(--danger); }

/* ---------- Метки зон заполнения ---------- */

.cw-zone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  font-family: var(--font-heading);
  font-size: 12.5px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--muted);
}
.cw-zone::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cw-zone--ok { background: var(--mint-soft); color: var(--mint-fg); }
.cw-zone--mid { background: var(--primary-soft); color: var(--primary-fg); }
.cw-zone--warm { background: color-mix(in srgb, var(--signal) 16%, transparent); color: var(--signal-fg); }
.cw-zone--high { background: var(--danger-soft); color: var(--danger); }

/* ---------- Код в тексте ---------- */

.prose pre.code { margin: 8px 0 28px; }

/* ---------- Hero: окно заполняется, потом /compact ---------- */

.hero__visual { display: flex; align-items: center; justify-content: center; }
.hero-cw { width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.hero-cw .window__body { height: 286px; overflow: hidden; align-content: start; }
.hero-cw__lines { display: grid; gap: 4px; align-content: start; min-height: 150px; }
.hero-cw__line { display: flex; justify-content: space-between; gap: 12px; animation: demo-in .3s var(--ease-out) both; }
.hero-cw__line span::before { content: '> '; }
.hero-cw__line span { flex: 1; text-align: left; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hero-cw__line--cmd span { color: var(--text); }
.hero-cw__line em { font-style: normal; color: var(--muted); flex: none; }
.hero-cw__note { color: var(--mint-fg); animation: demo-in .3s var(--ease-out) both; }
.hero-cw .cw-bar { margin-top: 10px; }
@media (max-width: 420px) {
  .hero-cw { font-size: 12px; }
  .hero-cw .window__body { height: 270px; }
}
