/* Пульт Milo на control.milo-work.ru (20261129e). Без внешних шрифтов и скриптов; размеры в rem —
   страница переносится при масштабе 50–400 % и на узких экранах без горизонтальной прокрутки. */
:root {
  --bg: #f5f6f8; --panel: #ffffff; --text: #1c2330; --muted: #5d6675; --line: #d9dde4;
  --accent: #2f5bd3; --danger: #b42318; --danger-bg: #fdecea; --ok: #1f7a4d; --radius: 0.5rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --panel: #1d2128; --text: #e7eaf0; --muted: #a2aab7; --line: #333a45;
          --accent: #7ea1ff; --danger: #ff8a80; --danger-bg: #3a1f1d; --ok: #6fd49f; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
       overflow-wrap: anywhere; min-width: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 0.45rem 0.9rem;
         cursor: pointer; min-height: 2.5rem; max-width: 100%; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.6; cursor: default; }
button.danger { border-color: var(--danger); color: var(--danger); }
button.danger.armed { background: var(--danger); color: #fff; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input, select, textarea { width: 100%; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius);
                          background: var(--panel); padding: 0.5rem 0.65rem; min-height: 2.5rem; }
textarea { min-height: 16rem; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 0.9rem; }

.top { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between;
       padding: 0.6rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }
.host, .meta, .lead, .hint { color: var(--muted); }
.host { font-size: 0.85rem; }
.who { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.layout { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); min-height: calc(100vh - 3.5rem); }
.rail { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.75rem; border-right: 1px solid var(--line); }
.rail a { color: var(--text); text-decoration: none; padding: 0.45rem 0.65rem; border-radius: var(--radius); }
.rail a:hover { background: var(--bg); }
.rail a.on { background: var(--accent); color: #fff; }
main { padding: 1rem; min-width: 0; }
.view .head h2 { margin: 0 0 0.25rem; font-size: 1.35rem; }
.lead { margin: 0 0 1rem; }
.stack { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0.75rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 0.9rem; min-width: 0; }
.card h3 { margin: 0 0 0.3rem; font-size: 1.02rem; }
.card.error { border-color: var(--danger); background: var(--danger-bg); }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; align-items: center; }
.actions input, .actions select { width: auto; flex: 1 1 12rem; }
details { margin-top: 0.4rem; }
details ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
pre.log { white-space: pre-wrap; word-break: break-word; max-height: 24rem; overflow: auto; background: var(--bg);
          padding: 0.6rem; border-radius: var(--radius); font-size: 0.85rem; }
.tablewrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.cell-label { display: none; }
#toast { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); max-width: calc(100% - 2rem);
         background: var(--text); color: var(--bg); padding: 0.6rem 1rem; border-radius: var(--radius);
         opacity: 0; pointer-events: none; transition: opacity 0.2s; }
#toast.show { opacity: 1; }

dialog.stepup { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text);
                width: min(26rem, calc(100% - 2rem)); padding: 1rem; }
dialog.stepup::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog.stepup h3 { margin: 0 0 0.4rem; }
dialog.stepup input { font-size: 1.3rem; letter-spacing: 0.15em; text-align: center; margin-top: 0.5rem; }

.login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 1rem; }
.login { width: min(24rem, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
         padding: 1.25rem; }
.login h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.login form { display: flex; flex-direction: column; gap: 0.35rem; }
.login label { margin-top: 0.5rem; font-weight: 600; }
.login button { margin-top: 0.9rem; }
.hint { font-size: 0.85rem; margin: 0.2rem 0 0; }
.error-text { color: var(--danger); min-height: 1.4em; margin: 0.4rem 0 0; }

/* Узкий экран или крупный масштаб: меню — строкой с переносом над содержимым, таблицы — карточками. */
@media (max-width: 48rem) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 0.5rem; }
  .rail a { padding: 0.35rem 0.55rem; }
  main { padding: 0.75rem; }
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 0.3rem 0; }
  td { border: 0; padding: 0.15rem 0; }
  .cell-label { display: block; font-size: 0.8rem; color: var(--muted); }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
