/* dev.jgrey.ru — общий стиль витрины и стенда */
:root {
  --bg: #14161b;
  --bg2: #1b1e25;
  --line: #2b3038;
  --ink: #e7eaf0;
  --dim: #98a1b0;
  --acc: #4f8cff;
  --ok: #3fbf6a;
  --warn: #e0a33a;
  --bad: #e2564a;
  --r: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acc); text-decoration: none; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ─────────── общие мелочи ─────────── */
.btn {
  background: #262b34; border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 12px; transition: background .12s, border-color .12s;
}
.btn:hover { background: #303643; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.primary:hover { background: #3f7ae8; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.badge {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: 11px; line-height: 18px; border: 1px solid transparent;
}
.badge.live { color: #8ff0b4; background: rgba(63,191,106,.14); border-color: rgba(63,191,106,.35); }
.badge.dev { color: #9dc4ff; background: rgba(79,140,255,.14); border-color: rgba(79,140,255,.35); }
.badge.archived { color: #b6bdc9; background: rgba(160,170,185,.12); border-color: rgba(160,170,185,.3); }
.muted { color: var(--dim); }

/* ─────────── витрина ─────────── */
.top {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: .2px; }
.top .sp { flex: 1; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  display: block; background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; color: var(--ink);
  transition: border-color .12s, transform .12s;
}
.card:hover { border-color: #3c4553; transform: translateY(-1px); }
.card .row { display: flex; align-items: center; gap: 11px; }
.tile {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 18px; color: #10131a;
  background: #5a6474; overflow: hidden;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card .note { color: var(--dim); font-size: 12px; margin-top: 2px; }
.card .foot { margin-top: 11px; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.card .foot .url { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--dim); padding: 40px 0; text-align: center; }

/* админка списка */
.adm { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 18px; }
.adm h2 { font-size: 14px; margin: 0 0 10px; }
.fields { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.fields label { display: block; font-size: 11px; color: var(--dim); margin-bottom: 3px; }
input[type=text], input[type=password], select, textarea {
  width: 100%; background: #10131a; border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 9px;
}
input:focus, select:focus { outline: none; border-color: var(--acc); }
.rowbtns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.admlist { margin-top: 14px; display: grid; gap: 6px; }
.admrow { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 8px; background: #10131a; border: 1px solid var(--line); border-radius: 8px; }
.admrow .nm { width: 150px; flex: none; }
.admrow .u { flex: 1; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─────────── стенд ─────────── */
.stand { display: grid; grid-template-columns: 1fr 336px; height: 100dvh; }
.stage {
  position: relative; overflow: auto; display: grid; place-items: center;
  padding: 46px 24px 24px;
  background: repeating-linear-gradient(45deg, #16191f 0 10px, #171a21 10px 20px);
}
.stagebar {
  position: absolute; top: 0; left: 0; right: 0; height: 42px; display: flex;
  align-items: center; gap: 12px; padding: 0 14px; font-size: 12px; color: var(--dim);
  background: linear-gradient(#14161bee, #14161b00); pointer-events: none; z-index: 5;
}
.stagebar a, .stagebar button { pointer-events: auto; }

/* корпус телефона */
.shell {
  position: relative; background: #0b0d11; padding: 10px;
  border-radius: 46px; box-shadow: 0 24px 60px #0009, 0 0 0 1px #2a2f38 inset;
  transform-origin: center center;
}
.shell.flat { padding: 0; border-radius: 4px; box-shadow: 0 18px 44px #0009; }
.screen { position: relative; overflow: hidden; background: #000; }
.screen iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.gamebox { position: absolute; left: 0; right: 0; overflow: hidden; }

/* системная строка и вырезы */
.sysbar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; font-size: 12px; font-weight: 600; pointer-events: none;
}
.sysbar.dark { color: #fff; }
.sysbar.light { color: #111; }
.cut { position: absolute; top: 0; left: 50%; transform: translateX(-50%); background: #000; z-index: 4; }
.cut.notch { width: 160px; height: 30px; border-radius: 0 0 20px 20px; }
.cut.island { width: 126px; height: 36px; top: 11px; border-radius: 20px; }
.cut.hole { width: 12px; height: 12px; top: 9px; border-radius: 50%; }
.homebar {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 36%; height: 5px; border-radius: 3px; background: #ffffffa8; z-index: 4; pointer-events: none;
}
.homebar.light { background: #00000055; }

/* шапки площадок */
.ph { position: absolute; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 0 12px; font-size: 14px; font-weight: 600; }
.ph .ph-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ph .ph-back { font-size: 22px; line-height: 1; opacity: .8; }
.ph .ph-dots, .ph .ph-close { opacity: .65; }
.ph-vk, .ph-vkweb { background: #fff; color: #000; border-bottom: 1px solid #e3e5e8; }
.ph-vkweb .ph-logo { color: #07f; font-weight: 800; }
.ph-ok { background: #ee8208; color: #fff; }
.ph-my { background: #005ff9; color: #fff; }
.ph-ya { background: #1a1a1a; color: #fff; }
.ph-ya .ph-logo { color: #fc3f1d; font-weight: 800; }
.ph-vkp { background: #16181d; color: #fff; border-bottom: 1px solid #23262d; }
.ph-vkp .ph-logo { color: #4f8cff; font-weight: 800; }
.floatback {
  position: absolute; z-index: 6; left: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: #0009; color: #fff; display: grid; place-items: center; font-size: 20px;
  border: 0; padding: 0;
}
.stickyad {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  background: repeating-linear-gradient(135deg, #2b2f38 0 8px, #333844 8px 16px);
  color: #cfd6e2; display: grid; place-items: center; font-size: 11px; letter-spacing: .3px;
}


/* обвязка мобильного браузера: площадка-сайт открыта не в вебвью, а в браузере */
.browserbar {
  position: absolute; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; font-size: 12px; background: #f2f2f4; color: #3c4043;
  border-bottom: 1px solid #d8d9dd;
}
.browserbar.bottom { bottom: 0; border-bottom: 0; border-top: 1px solid #d8d9dd; }
.browserbar .addr {
  flex: 1; background: #fff; border-radius: 999px; padding: 4px 10px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #202124;
}
.browserbar .lock, .browserbar .tabs { opacity: .55; font-size: 11px; }

/* липкий баннер площадки: снизу (портрет) или справа (альбом и десктоп) */
.stickyad.right { left: auto; top: 0; bottom: 0; width: auto; writing-mode: vertical-rl; }

/* оверлей рекламы */
.adlayer {
  position: absolute; inset: 0; z-index: 20; background: #06080ceb; color: #fff;
  display: grid; place-items: center; text-align: center; padding: 20px;
}
.adlayer .kind { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #8fa3c4; }
.adlayer .big { font-size: 20px; font-weight: 700; margin: 8px 0 12px; }
.adlayer .cnt { font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 700; }
.adlayer .btns { margin-top: 16px; display: flex; gap: 10px; justify-content: center; }

/* панель */
.panel { border-left: 1px solid var(--line); background: var(--bg2); overflow: auto; }
.panel .sec { border-bottom: 1px solid var(--line); padding: 13px 14px; }
.panel .sec h3 { margin: 0 0 9px; font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.panel .line { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.panel .line:last-child { margin-bottom: 0; }
.panel .line > span.lbl { width: 82px; flex: none; color: var(--dim); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 9px; border-radius: 8px; border: 1px solid var(--line); background: #232831; font-size: 12px; }
.chip.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.spec { font-size: 12px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.log { font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 240px; overflow: auto; }
.log div { border-bottom: 1px solid #22262e; padding: 3px 0; white-space: pre-wrap; word-break: break-word; }
.log .t { color: #566072; }
.log .ad { color: #ffd08a; }
.log .ev { color: #9fe8b6; }
.log .err { color: #ff9a90; }
.swrow { display: flex; align-items: center; gap: 8px; font-size: 12px; }
input[type=range] { width: 100%; }
.hint { font-size: 11px; color: var(--dim); margin-top: 6px; }

/* .mobonly — только для телефонного вида; правило стоит ДО медиазапроса,
   иначе оно перебьёт его по порядку и кнопка ⚙ не появится никогда */
.mobonly { display: none; }

/* мобильный: панели нет, стенд на весь экран */
@media (max-width: 900px) {
  .stand { grid-template-columns: 1fr; }
  .panel { display: none; }
  .stage { padding: 0; background: #000; align-items: stretch; justify-items: stretch; overflow: hidden; }
  .stagebar { display: none; }
  .shell { padding: 0; border-radius: 0; box-shadow: none; width: 100%; height: 100dvh; }
  .mobonly { display: block; }
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg2);
  border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 14px 14px 24px;
  transform: translateY(115%); transition: transform .2s; box-shadow: 0 -10px 40px #0007;
}
.sheet.open { transform: none; }
.sheet h4 { margin: 0 0 10px; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .6px; }
