/* Мобильный в первую очередь: одна колонка, крупные кнопки (не меньше 44 px) */
[hidden] { display: none !important; }
:root { --bg: #f4f2ee; --card: #fff; --text: #222; --muted: #777; --accent: #1f6f43; --line: #e2ddd5; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { background: var(--accent); color: #fff; padding: 12px 16px; font-size: 18px; }
.scene { height: 60vh; min-height: 280px; background: #e9e4da; }
.scene canvas { width: 100%; height: 100%; display: block; }
/* Фото-комната: настройки стен/мебели/окна не нужны */
.note { margin: 6px 16px 0; font-size: 13px; color: var(--muted); text-align: center; }
main { max-width: 560px; margin: 0 auto; padding: 12px 16px 40px; }
.card { background: var(--card); border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
h2 { margin: 0 0 12px; font-size: 20px; }
.lbl { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.big, .inp { width: 100%; min-height: 48px; font-size: 20px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.room { border-top: 1px solid var(--line); padding: 12px 0; }
.room:first-child { border-top: 0; padding-top: 0; }
.room-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.del { border: 0; background: none; font-size: 20px; color: var(--muted); min-width: 44px; min-height: 44px; }
.row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 10px; flex-wrap: wrap; }
.row label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.x { font-size: 22px; padding-bottom: 10px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 48px; height: 48px; font-size: 24px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.stepper b { min-width: 24px; text-align: center; font-size: 20px; color: var(--text); }
.seg { display: flex; }
.seg button { flex: 1; min-height: 48px; font-size: 15px; border: 1px solid var(--line); background: #fff; }
.seg button:first-child { border-radius: 10px 0 0 10px; }
.seg button:last-child { border-radius: 0 10px 10px 0; }
.seg .on { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn { width: 100%; min-height: 48px; font-size: 18px; border-radius: 10px; }
.ghost { background: none; border: 2px dashed var(--line); color: var(--accent); }
.total { font-size: 44px; font-weight: 700; color: var(--accent); }
.total small { font-size: 22px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lines { list-style: none; padding: 0; margin: 12px 0; }
.lines li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); min-height: 44px; }
.lines li .name { flex: 1; }
.lines li .sum { font-weight: 600; white-space: nowrap; }
.lines input[type=checkbox] { width: 24px; height: 24px; }
.lines .off { opacity: .45; }
.picks { display: grid; gap: 8px; margin-top: 12px; }
.picks label { font-size: 14px; color: #666; }
.picks .big { font-size: 16px; min-height: 44px; margin-top: 2px; }
.err { border-color: #c33; }

/* Переключатель комнат — горизонтальная лента */
.rooms-nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; background: #fff; scrollbar-width: none; }
.rooms-nav button { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; min-height: 56px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 12px; color: var(--text); }
.rooms-nav button span { font-size: 20px; }
.rooms-nav .on { border-color: var(--accent); background: #e8f1ec; }
.rooms-nav .ph { padding: 3px; min-width: 84px; }
.rooms-nav .ph img { width: 76px; height: 40px; object-fit: cover; border-radius: 8px; }
/* Стены и мебель */
.look { max-width: 560px; margin: 8px auto 0; padding: 0 16px; }
.look-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.look-lbl { width: 56px; font-size: 13px; color: var(--muted); flex: 0 0 auto; }
.small-seg { flex: 1; }
.small-seg button { min-height: 40px; font-size: 14px; }

/* ---------- Логотип (долгое нажатие) ---------- */
.logo { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; padding: 6px 2px; }
.viewer-bar { background: #e8f1ec; color: var(--accent); padding: 8px 16px; font-weight: 600; text-align: center; }
.viewer .promo-only { display: none !important; }

/* ---------- «Моя комната» ---------- */
.switch { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 44px; }
.switch input { width: 22px; height: 22px; }

/* ---------- Фишки (фильтры и т. п.) ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.chip { flex: 0 0 auto; min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; font-size: 14px; color: var(--text); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Декоры ---------- */
.decor-box { max-width: 560px; margin: 8px auto 0; padding: 0 16px; }
.decor-now { display: flex; align-items: center; gap: 8px; }
.decor-name { flex: 1; text-align: center; display: flex; flex-direction: column; }
.decor-name b { font-size: 18px; }
.nb { width: 64px; height: 48px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px; font-size: 12px; color: var(--muted); }
.nb:disabled { visibility: hidden; }
.nb .sw { width: 32px; height: 32px; border-radius: 6px; }
.sw { display: block; background-size: cover; background-position: center; }
.ribbon { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px; scrollbar-width: none; }
.tile { position: relative; flex: 0 0 auto; width: 92px; border: 2px solid transparent; border-radius: 12px; background: #fff; padding: 4px; text-align: left; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tile.on { border-color: var(--accent); }
.tile .sw { width: 100%; height: 64px; border-radius: 8px; }
.tile .tn { display: block; font-size: 12px; line-height: 1.2; margin-top: 4px; height: 2.4em; overflow: hidden; color: var(--text); }
.tile .tp { display: block; font-size: 12px; color: var(--muted); }
.badge { position: absolute; top: 6px; left: 6px; font-size: 11px; font-weight: 700; color: #fff; padding: 1px 6px; border-radius: 6px; }
.b-hit { background: #d9534f; } .b-sale { background: #e39b1c; } .b-new { background: #2d7fc1; }
.sliders label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-height: 40px; }
.sliders input, .look input[type=range] { flex: 1; min-width: 0; height: 32px; accent-color: var(--accent); }
.more summary, .look summary { font-size: 14px; color: var(--accent); min-height: 40px; display: flex; align-items: center; cursor: pointer; }
.look input[type=range] { flex: 1; }

/* ---------- Кнопки расчёта ---------- */
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.row2 { display: flex; gap: 8px; margin: 8px 0; }
.row2 .btn { flex: 1; }
.main { background: var(--accent); color: #fff; border: 0; font-weight: 600; }
.contact { margin-top: 12px; padding: 12px; background: #e8f1ec; border-radius: 10px; }
.room-head b { flex: 0 0 auto; }

/* ---------- Окна ---------- */
.dlg { border: 0; border-radius: 16px; padding: 20px; width: min(92vw, 360px); text-align: center; }
.dlg::backdrop { background: rgba(0,0,0,.45); }
#qrBox svg { width: 100%; height: auto; }
.pin { text-align: center; letter-spacing: 12px; font-size: 28px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 24px; background: #222; color: #fff; padding: 12px 16px; border-radius: 10px; text-align: center; z-index: 50; }

/* ---------- Меню промоутера ---------- */
.promo { position: fixed; inset: 0; background: var(--bg); z-index: 40; overflow-y: auto; }
.promo .top { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; z-index: 1; }
.close { background: none; border: 0; color: #fff; font-size: 22px; min-width: 44px; min-height: 44px; }
.promo-body { max-width: 560px; margin: 0 auto; padding: 12px 16px 60px; }
.promo .lbl { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.promo .btn { margin-top: 8px; }
.adm { display: flex; gap: 8px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.adm.off { opacity: .5; }
.adm > input { width: 24px; height: 24px; margin-top: 10px; }
.adm .sw { width: 44px; height: 44px; border-radius: 8px; flex: 0 0 auto; }
.adm-name { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.adm-ctl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.adm-ctl select, .adm-ctl input { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; }
.adm-ctl input { width: 80px; padding: 0 6px; }
.def { min-width: 36px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #ccc; }
.def.is { color: var(--accent); border-color: var(--accent); }
.arrows { display: flex; flex-direction: column; gap: 4px; }
.arrows button { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.kpi { display: flex; gap: 8px; margin: 12px 0; }
.kpi div { flex: 1; background: var(--bg); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; }
.kpi b { font-size: 20px; color: var(--accent); }
.kpi span { font-size: 12px; color: var(--muted); }
.log { list-style: none; padding: 0; font-size: 13px; }
.log li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.log label { white-space: nowrap; display: flex; align-items: center; gap: 4px; }
#statPeriod button { font-size: 13px; }
