:root {
    --ink: #333; --muted: #828b95; --line: #e6e9ec; --bg: #f5f7f8; --card: #fff;
    --accent: #2fc6f6; --accent-d: #11a9d9; --ok: #1bce7b; --off: #c3c8cd; --warn: #c0392b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.qm { max-width: 860px; margin: 0 auto; padding: 24px 20px 64px; }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.qm-lead { color: var(--muted); margin: 0 0 18px; max-width: 680px; }
.qm-muted { color: var(--muted); }
.qm-warn { color: var(--warn); }
.qm-card { background: var(--card); border-radius: 12px; padding: 18px 20px; margin: 0 0 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }

.qm-status__head { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 4px; }
.qm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--off); }
.qm-status.is-on .qm-dot { background: var(--ok); }
.qm-problems { margin: 10px 0 0; padding-left: 18px; color: var(--warn); }
.qm-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.qm-row { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; padding: 7px 0; border-top: 1px solid var(--line); }
.qm-row:first-of-type { border-top: 0; }
.qm-row__label { padding-top: 7px; }
.qm-row__ctl { display: flex; flex-direction: column; gap: 4px; }
.qm-row__ctl small { font-size: 12px; }
select, input[type=text], input[type=number] { width: 100%; max-width: 420px; height: 34px; padding: 0 10px; border: 1px solid #c6cdd3; border-radius: 6px; background: #fff; font: inherit; color: inherit; }
select:focus, input[type=text]:focus, input[type=number]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,198,246,.18); }

.qm-checks { display: flex; flex-direction: column; gap: 6px; }
.qm-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.qm-check--block { display: flex; flex-wrap: wrap; padding: 6px 0; }
.qm-check--block small { flex-basis: 100%; padding-left: 22px; font-size: 12px; }
.qm-funnel { padding: 10px 0 4px; border-top: 1px solid var(--line); }
.qm-funnel__name { font-weight: 600; margin-bottom: 2px; }
.qm-funnel .qm-row { border-top: 0; padding: 3px 0; }

.qm-btn { height: 36px; padding: 0 18px; border: 0; border-radius: 18px; background: var(--accent); color: #fff; font: 600 13px/36px inherit; font-family: inherit; cursor: pointer; }
.qm-btn:hover { background: var(--accent-d); }
.qm-btn:disabled { opacity: .5; cursor: default; }
.qm-btn--ghost { background: #fff; color: var(--ink); border: 1px solid #c6cdd3; }
.qm-btn--ghost:hover { background: #f1f4f6; }
.qm-btn--sm { height: 30px; padding: 0 14px; font-size: 12px; line-height: 30px; }
.qm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qm-chips:empty { display: none; }
.qm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 14px; background: #e5f7fd; font-size: 13px; }
.qm-chip__x { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); padding: 0 4px; }
.qm-chip__x:hover { color: var(--warn); }
.qm-save { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px;
           background: var(--card); border-radius: 12px; padding: 12px 20px; box-shadow: 0 -2px 10px rgba(0,0,0,.06); }

.qm-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: .25s;
            background: #333; color: #fff; padding: 10px 16px; border-radius: 8px; max-width: 90vw; z-index: 10; }
.qm-toast.show { opacity: 1; transform: translate(-50%, 0); }
.qm-toast--err { background: var(--warn); }

@media (max-width: 640px) {
    .qm-row { grid-template-columns: 1fr; gap: 4px; }
    .qm-row__label { padding-top: 0; }
}
