/* "Подреди своя дом" — стилове на уеб прототипа. Просто и четимо. */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --line: #d9e0e8;
  --ink: #233040;
  --muted: #6b7886;
  --accent: #3b6ea5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
}
header h1 { margin: 0; font-size: 20px; }
header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  padding: 18px;
  align-items: start;
}
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.panel h2 { margin: 0 0 12px; font-size: 15px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field select, .field input[type="range"] { width: 100%; }
.field .val { float: right; color: var(--ink); font-weight: 600; }

.colors { display: flex; gap: 10px; }
.colors .field { flex: 1; margin-bottom: 0; }
.colors input[type="color"] { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: none; }

.checks { display: flex; gap: 16px; flex-wrap: wrap; }
.checks label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }

.actions { display: flex; gap: 10px; margin-top: 6px; }
button {
  flex: 1;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
button.ghost { background: #fff; color: var(--accent); }
button:hover { filter: brightness(1.05); }

#preview { width: 100%; max-width: 460px; margin: 0 auto; }
#preview svg { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }

.allSides-title { margin: 18px 0 10px; font-size: 14px; color: var(--muted); }
#allSides { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
#allSides .thumb { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
#allSides .thumb svg { width: 100%; height: auto; display: block; }

.future {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  background: #fff8e6;
  border: 1px solid #f0e3b8;
  border-radius: 8px;
  padding: 10px 12px;
}

/* ── Навигация ─────────────────────────────────────────────── */
.hlb-nav {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--accent); color: #fff; padding: 8px 16px; gap: 12px;
}
.hlb-nav .nav-left, .hlb-nav .nav-right { display: flex; align-items: center; gap: 6px; }
.hlb-nav .nav-link {
  color: #fff; text-decoration: none; font-size: 14px;
  padding: 6px 10px; border-radius: 6px;
}
.hlb-nav .nav-link:hover { background: rgba(255,255,255,.15); }
.hlb-nav .nav-link.on { background: rgba(255,255,255,.25); font-weight: 600; }
.hlb-nav .nav-user { font-size: 13px; opacity: .9; }
.hlb-nav .hlb-lang {
  background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35);
  border-radius: 6px; padding: 5px 8px; font-size: 13px; cursor: pointer; margin-right: 4px;
}
.hlb-nav .hlb-lang option { color: #222; }
.hlb-nav .nav-user { font-weight: 600; }

/* Профил — действия по картите */
.profile-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.btn-sm {
  display: inline-block; font-size: 13px; padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--accent, #3b6ea5); background: #fff; color: var(--accent, #3b6ea5);
  text-decoration: none; cursor: pointer; font-family: inherit;
}
.btn-sm:hover { background: var(--accent, #3b6ea5); color: #fff; }
.btn-sm.submit { border-color: #2e8b57; color: #2e8b57; }
.btn-sm.submit:hover { background: #2e8b57; color: #fff; }
.btn-sm.danger { border-color: #c0392b; color: #c0392b; }
.btn-sm.danger:hover { background: #c0392b; color: #fff; }

/* Стаи по етажи (редактор) */
.rooms-by-floor { display: flex; flex-direction: column; gap: 8px; }
.floor-block { border: 1px solid #e3e8ee; border-radius: 8px; padding: 8px; background: #fafbfc; }
.floor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 14px; }
.add-room { font-size: 12px; padding: 3px 8px; border: 1px solid var(--accent, #3b6ea5); color: var(--accent, #3b6ea5); background: #fff; border-radius: 6px; cursor: pointer; font-family: inherit; }
.add-room:hover { background: var(--accent, #3b6ea5); color: #fff; }
.room-row { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.room-row select { flex: 1; padding: 5px 8px; border: 1px solid #cdd7e1; border-radius: 6px; font-family: inherit; }
.del-room { border: 1px solid #c0392b; color: #c0392b; background: #fff; border-radius: 6px; padding: 4px 8px; cursor: pointer; font-family: inherit; }
.del-room:hover { background: #c0392b; color: #fff; }
.room-empty { font-size: 13px; color: #889; }
/* Детайли на стая (стени, мебели, план) */
.r-details { font-size: 12px; padding: 3px 8px; border: 1px solid #9ab; color: #567; background: #fff; border-radius: 6px; cursor: pointer; font-family: inherit; }
.r-details.on { background: #e8eef5; }
.room-details { border: 1px dashed #cdd7e1; border-radius: 8px; padding: 8px; margin: 4px 0 8px; background: #fbfcfd; }
.rd-walls { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.wall-row { display: flex; align-items: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.wall-row .wlabel { min-width: 56px; font-weight: 600; color: #567; }
.wall-row input { width: 46px; padding: 3px 5px; border: 1px solid #cdd7e1; border-radius: 5px; }
.rd-items { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.item-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.item-row .iname { flex: 1; }
.item-row select { padding: 3px 6px; border: 1px solid #cdd7e1; border-radius: 5px; font-family: inherit; }
.item-row .del-item { border: 1px solid #c0392b; color: #c0392b; background: #fff; border-radius: 5px; padding: 2px 7px; cursor: pointer; }
/* Собствена снимка на мебел: качване / миниатюра / размер / премахване */
.item-row .i-img-btn { border: 1px solid var(--accent,#3b6ea5); border-radius: 5px; padding: 2px 6px; cursor: pointer; background: #fff; line-height: 1; }
.item-row .i-thumb { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; border: 1px solid #9ab; }
.item-row .i-scale { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #557; }
.item-row .i-scale-r { width: 64px; }
.item-row .i-img-del { border: 1px solid #c98; background: #fff; border-radius: 5px; padding: 2px 5px; cursor: pointer; line-height: 1; }
.add-item-row select { width: 100%; padding: 5px; border: 1px solid var(--accent,#3b6ea5); border-radius: 6px; font-family: inherit; color: var(--accent,#3b6ea5); }
.rd-preview svg { width: 100%; height: auto; border: 1px solid #e3e8ee; border-radius: 6px; margin-top: 4px; }
.rd-wviews { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 6px; }
.rd-wviews svg { width: 100%; height: auto; border: 1px solid #e3e8ee; border-radius: 6px; }

/* ── Съобщения ─────────────────────────────────────────────── */
.msg { font-size: 13px; padding: 9px 11px; border-radius: 8px; }
.msg.ok { background: #e7f6ec; border: 1px solid #b7e0c4; color: #1d6b39; }
.msg.err { background: #fdeaea; border: 1px solid #f2c3c3; color: #9b2c2c; }

/* ── Auth екран ────────────────────────────────────────────── */
.auth-wrap { max-width: 420px; margin: 28px auto; padding: 0 16px; }
.auth-card .tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; background: #eef2f7; color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px; cursor: pointer; font-size: 14px;
}
.tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.auth-card .field input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }

/* ── Галерия (карти) ───────────────────────────────────────── */
.gallery-wrap { max-width: 1000px; margin: 0 auto; padding: 18px; }
.notice { margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.house-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.house-card-svg { background: #eaf3fb; }
.house-card-svg svg { width: 100%; height: auto; display: block; }
.no-svg { padding: 40px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.house-card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.house-card-title { font-weight: 600; font-size: 14px; }
.house-card-meta { font-size: 12px; color: var(--muted); }
.like-btn {
  margin-top: 6px; align-self: flex-start; flex: 0 0 auto;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 20px; padding: 5px 12px; font-size: 14px; cursor: pointer;
}
.like-btn.on { border-color: #e0708a; }
.load-more { text-align: center; margin: 20px 0; }
.load-more button { flex: 0 0 auto; padding: 10px 24px; }

/* ── Класация ──────────────────────────────────────────────── */
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-row {
  display: grid; grid-template-columns: 50px 110px 1fr auto; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px;
}
.rank-num { font-size: 18px; font-weight: 700; color: var(--accent); text-align: center; }
.rank-svg { background: #eaf3fb; border-radius: 8px; overflow: hidden; }
.rank-svg svg { width: 100%; height: auto; display: block; }
.rank-likes { font-size: 15px; font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) {
  .rank-row { grid-template-columns: 40px 80px 1fr auto; }
}
