/* Reality Host — светлая тема, коралловый акцент #FF5A4E, скруглённые карточки и пилюли. */
.access-page { display: grid; gap: 20px; }
.access-heading, .access-section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.access-heading h1 { margin: 0; font-size: 26px; }
.access-heading p { margin: 6px 0 0; }
.access-section-head h2 { margin: 0; font-size: 18px; }
.access-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.access-secret { max-width: 360px; }
.access-secret code { display: block; overflow-wrap: anywhere; margin-bottom: 8px; font-size: 12px; }
.access-form { display: grid; gap: 14px; }
.access-form label:not(.chk) { display: grid; gap: 6px; }
.access-form input, .access-form select { min-width: 0; width: 100%; }
.access-form .chk input { width: auto; }
.access-form p { margin: -6px 0 0; font-size: 12px; }
.access-empty { padding: 32px 12px; color: var(--text-2); }
.access-page th { white-space: nowrap; }
@media (max-width: 640px) { .access-heading .toolbar { width: 100%; } .access-heading .toolbar button { flex: 1; } .access-page .card { padding: 14px; } }
:root {
  --accent: #ff5a4e; --accent-hover: #f0453a; --accent-soft: #ffece9;
  --bg: #f4f6f9; --card: #ffffff; --card-2: #fafbfc; --line: #e7eaf0; --line-strong: #d6dbe6;
  --text: #171c26; --text-2: #525c6b; --muted: #8a94a6;
  --ok: #17b26a; --ok-soft: #e7f7ef; --warn: #f79009; --warn-soft: #fff4e5;
  --fail: #f04438; --fail-soft: #fde8e6; --info: #6e59f2; --info-soft: #eeebff;
  --radius: 16px; --radius-sm: 10px; --pill: 999px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 8px 28px rgba(16,24,40,.12);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { background: var(--accent); color: #fff; border: 0; border-radius: var(--pill); padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; transition: filter .12s, background .12s; }
button:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: #fff; color: var(--text); border: 1px solid var(--line-strong); font-weight: 500; }
button.ghost:hover { background: var(--card-2); border-color: var(--muted); }
button.small { padding: 5px 11px; font-size: 12px; }
button.danger { background: var(--fail); } button.danger:hover { background: #d92d20; }
input, select, textarea { background: #fff; color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.small, input.small { padding: 4px 8px; font-size: 12px; border-radius: 8px; }
label { color: var(--text-2); }

/* ---- шапка ---- */
nav { display: flex; gap: 6px; align-items: center; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
nav a[data-nav] { color: var(--text-2); padding: 7px 12px; border-radius: var(--pill); font-weight: 500; }
nav a[data-nav]:hover { background: var(--card-2); text-decoration: none; }
nav a[data-nav].active { color: var(--accent); background: var(--accent-soft); }
.brand { display: flex; align-items: center; gap: 9px; margin-right: 12px; font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; box-shadow: 0 2px 8px rgba(255,90,78,.35); }
.brand small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; margin-top: -2px; }
.spacer { flex: 1; }
#who { color: var(--text-2); font-size: 13px; }
nav a.apk-link { color: var(--text-2); font-weight: 500; padding: 7px 10px; }

main { padding: 20px; max-width: 1680px; margin: 0 auto; }

/* ---- карточки, таблицы ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat .v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat .k { color: var(--muted); font-size: 12px; margin-top: 2px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
tbody tr:hover { background: var(--card-2); }
.table-wrap { overflow-x: auto; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; font-size: 12px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: var(--pill); font-size: 11px; font-weight: 600; background: var(--card-2); color: var(--text-2); border: 1px solid var(--line); }
.b-ok, .b-OK, .b-ONLINE, .b-RUNNING, .b-true, .b-PASSED, .b-info { background: var(--ok-soft); color: #087443; border-color: transparent; }
.b-warn, .b-WARN, .b-DEGRADED, .b-WAITING_MEMORY, .b-worker_waiting_memory, .b-worker_start_rejected, .b-LOADING, .b-STALE, .b-STARTING, .b-RESTARTING, .b-PENDING_APPROVAL, .b-SKIPPED, .b-QUEUED, .b-console_warn, .b-unchecked { background: var(--warn-soft); color: #b54708; border-color: transparent; }
.b-fail, .b-FAIL, .b-ERROR, .b-worker_shed_low_memory, .b-TIMEOUT, .b-OFFLINE, .b-FAILED, .b-false, .b-crit, .b-console_error, .b-net_error, .b-http_error, .b-hang, .b-render_gone { background: var(--fail-soft); color: #b42318; border-color: transparent; }
.b-CANCELLED { background: var(--card-2); color: var(--muted); }
.b-QUEUED, .b-RUNNING { background: var(--accent-soft); color: var(--accent-hover); border-color: transparent; }
.b-page_metrics { background: var(--info-soft); color: #5b3fd6; border-color: transparent; }
.ok { color: #087443; } .warnc { color: #b54708; } .failc { color: var(--fail); }

/* ---- логин ---- */
.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; background:
  radial-gradient(1200px 500px at 50% -10%, #fff 0%, var(--bg) 60%); }
.login form { display: grid; gap: 14px; width: min(380px, 100%); box-shadow: var(--shadow-lg); }
.login .brand { justify-content: center; margin: 0 0 4px; font-size: 20px; }
.login label { display: grid; gap: 5px; }
.err { color: var(--fail); min-height: 1.2em; font-size: 13px; }

/* ---- панель инструментов ---- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[name="url"], .toolbar input.grow { flex: 1; min-width: 220px; }
.chk { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); font-size: 13px; cursor: pointer; }
.chk.mini { font-size: 11px; }

/* ---- устройство: экраны ---- */
.dev-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.dev-head h2 { margin: 0; font-size: 20px; }
.screens { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 16px; align-items: start; }
.screen { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 9px; box-shadow: var(--shadow); min-width: 0; }
.screen-head { display: flex; align-items: center; gap: 6px; }
.screen-head b { margin-right: auto; font-size: 15px; }
.canvas-wrap { position: relative; background: #0b0d12; border-radius: 12px; overflow: hidden; aspect-ratio: 9 / 16; outline: none; border: 1px solid var(--line); }
.canvas-wrap:focus { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.canvas-wrap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.canvas-wrap .overlay { position: absolute; inset: 0; display: grid; place-items: center; color: #c7cdd9; pointer-events: none; text-align: center; padding: 16px; font-size: 13px; }
.urlbar { display: flex; gap: 6px; } .urlbar input { flex: 1; min-width: 0; }
.btns { display: flex; gap: 5px; flex-wrap: wrap; }
.screen-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-top: 2px; border-top: 1px dashed var(--line); }
.screen-tools select { max-width: 140px; }
.tap-form { display: flex; gap: 6px; } .tap-form input { flex: 1; min-width: 0; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; font-size: 12px; }
.kv > span { overflow-wrap: anywhere; min-width: 0; }
.kv > span:nth-child(odd) { color: var(--muted); }
.events { max-height: 120px; overflow: auto; font-size: 11px; background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px; }
.job, .rec { font-size: 11px; }

/* ---- графики ---- */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin: 18px 0; }
.chart { padding: 12px 14px; }
.chart-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.chart-head b { color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; }
.chart-plot { position: relative; height: 120px; }
.chart-plot canvas { width: 100%; height: 100%; display: block; }
.chart-tip { position: absolute; top: 0; background: var(--text); color: #fff; border-radius: 8px; padding: 3px 9px; font-size: 12px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-lg); }

/* ---- модалка ---- */
.modal { position: fixed; inset: 0; background: rgba(23,28,38,.45); display: grid; place-items: center; z-index: 20; padding: 16px; backdrop-filter: blur(2px); }
.modal-body { background: #fff; border-radius: var(--radius); padding: 16px 18px; max-width: 96vw; max-height: 94vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.modal-head span { font-weight: 700; font-size: 16px; }
.big-screen { height: min(84vh, 1280px); }
.vform { display: grid; gap: 11px; min-width: min(560px, 90vw); }
.vform label:not(.chk) { display: grid; gap: 4px; }
.vform textarea { font-family: ui-monospace, Consolas, monospace; }

/* ---- галерея / журнал ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 14px; }
.gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px; box-shadow: var(--shadow); }
.gallery img, .gallery video { width: 100%; border-radius: 8px; background: #0b0d12; display: block; max-height: 420px; object-fit: contain; }
.gallery figcaption { font-size: 12px; color: var(--muted); margin-top: 7px; word-break: break-all; }
.log-table { max-height: 60vh; overflow: auto; min-width: min(900px, 92vw); }
.log-table td { font-size: 12px; padding: 5px 9px; }

details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: #fff; }
summary { cursor: pointer; font-weight: 500; }
pre { white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; background: var(--card-2); border-radius: 8px; padding: 10px; }
.check-notes { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }
#toast { position: fixed; bottom: 18px; right: 18px; background: var(--text); color: #fff; padding: 11px 16px; border-radius: 12px; z-index: 40; max-width: 440px; box-shadow: var(--shadow-lg); font-size: 13px; }
.pill-group { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--pill); overflow: hidden; }
.pill-group button { background: #fff; color: var(--text-2); border-radius: 0; font-weight: 500; padding: 5px 12px; }
.pill-group button.on { background: var(--accent); color: #fff; }
@media (max-width: 640px) { main { padding: 12px; } nav { gap: 6px; padding: 8px 12px; } .brand small { display: none; } }
