/* Эмулятор — служебная страница. Снаружи «устройства» — нейтральный
   инструментальный стиль, внутри — упрощённые сайт и приложение
   Холодильник.ру (токены ДС: sky, orange). */
:root {
  --bg: #eceef1;
  --tool: #ffffff;
  --text: #1a1d1f;
  --muted: #6b7178;
  --border: #d9dde2;
  --accent: #00aaff;
  --accent-deep: #0099e5;
  --orange: #ff7120;
  --ok: #02bc53;
  --ok-bg: #e6f9ee;
  --warn-bg: #fff4e0;
  --bad: #f62434;
  --bad-bg: #fde9eb;
  --surface: #f7f8fa;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; }

/* ——— панель управления ——— */
.tool {
  background: var(--tool);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brand b { font-size: 16px; margin-right: 10px; }
.brand span { color: var(--muted); font-size: 13px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.controls label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.controls select, .controls input:not([type]) , .controls input[type="text"] {
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; color: var(--text); background: #fff;
}
.controls .chk { color: var(--text); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--accent); color: #fff; }
.deeplink { display: flex; gap: 6px; }
.deeplink input { border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; }
.deeplink button { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.status { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; }
.status .dot.err { background: var(--bad); }
.status .dot.pulse { animation: pulse 0.6s ease-out; }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(2, 188, 83, 0.6); } to { box-shadow: 0 0 0 8px rgba(2, 188, 83, 0); } }

.layout { flex: 1; min-height: 0; display: flex; gap: 16px; padding: 16px; }
.stage { flex: 1; min-width: 0; display: flex; justify-content: center; align-items: flex-start; overflow: auto; }

/* ——— журнал ——— */
.panel {
  width: 380px; flex: none;
  background: var(--tool); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tabs button { flex: 1; border: 0; background: none; padding: 10px 6px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.panel-body { flex: 1; overflow: auto; padding: 10px 12px; font-size: 12px; }
.panel-body pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 11.5px; }
.panel-body table { width: 100%; border-collapse: collapse; }
.panel-body th, .panel-body td { text-align: left; padding: 5px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.panel-body th { color: var(--muted); font-weight: 600; }
.panel-body .empty { color: var(--muted); padding: 12px 0; }
.panel-body .actions { margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.panel-body .actions button { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.ev { padding: 6px 0; border-bottom: 1px solid var(--border); }
.ev time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
.ev.ok { color: #077a3a; } .ev.warn { color: #9a5b00; } .ev.bad { color: var(--bad); }
.pending { color: #9a5b00; } .sent { color: #077a3a; }

/* ——— телефон ——— */
.phone {
  position: relative;
  width: 390px; height: 800px; max-width: 100%;
  border-radius: 46px;
  background: #111;
  padding: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  flex: none;
}
.screen-wrap {
  position: relative; width: 100%; height: 100%;
  border-radius: 36px; overflow: hidden; background: var(--surface);
  display: flex; flex-direction: column;
}
.sbar { height: 44px; flex: none; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 26px 6px; font-size: 13px; font-weight: 600; background: #fff; }
.screens { position: relative; flex: 1; min-height: 0; }
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--surface); }
.scr-body { flex: 1; overflow-y: auto; }
.navbar { height: 48px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--border); }
.navbar .back { border: 0; background: none; font-size: 22px; color: var(--accent-deep); cursor: pointer; width: 32px; }
.navbar .t { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabbar { height: 56px; flex: none; display: flex; background: #fff; border-top: 1px solid var(--border); }
.tabbar span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); }
.tabbar span b { font-size: 18px; font-weight: 400; }
.tabbar span.on { color: var(--accent-deep); }
.webview { flex: 1; border: 0; width: 100%; background: #fff; }

.app-head { padding: 14px 16px 6px; display: flex; justify-content: space-between; align-items: flex-start; background: #fff; }
.app-head h2 { margin: 0; font-size: 26px; }
.app-head .sub { color: var(--muted); font-size: 13px; }
.chip-btn { border: 0; border-radius: 999px; padding: 6px 12px; background: #fff4e0; color: #8a5a00; font-weight: 600; font-size: 12px; cursor: pointer; white-space: nowrap; }
.chip-btn.login { background: var(--accent); color: #fff; }

.glist { padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.gcard { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); cursor: pointer; border: 0; padding: 0; text-align: left; color: inherit; display: block; width: 100%; }
.gcard img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; display: block; }
.gcard .info { padding: 10px 12px 12px; }
.gcard .title { font-weight: 700; font-size: 16px; }
.gcard .subt { color: var(--muted); font-size: 13px; }
.state { margin-top: 6px; font-size: 13px; font-weight: 600; }
.state.available { color: var(--ok); }
.state.limit_reached { color: var(--muted); }
.state.guest { color: var(--accent-deep); }
.badge { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.badge.test { background: #ede0ff; color: #6a2fb3; }
.ad { font-size: 11px; color: var(--muted); margin-top: 4px; }
.empty-list { text-align: center; color: var(--muted); padding: 40px 20px; }

.gpage { padding-bottom: 24px; }
.gpage img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; display: block; }
.gpage .body { padding: 16px; }
.gpage h3 { margin: 0; font-size: 22px; }
.play { display: block; width: 100%; margin-top: 16px; border: 0; border-radius: 14px; padding: 14px; background: var(--orange); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; text-align: center; text-decoration: none; }
.play.secondary { background: var(--accent); }
.play.ghost { background: #fff; color: var(--accent-deep); border: 1px solid var(--border); }

/* шторка поверх экрана */
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); display: flex; align-items: flex-end; z-index: 10; }
.sheet { width: 100%; background: #fff; border-radius: 20px 20px 0 0; padding: 18px 18px 28px; text-align: center; animation: up 0.2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .icon { font-size: 40px; line-height: 1; }
.sheet h4 { margin: 8px 0 4px; font-size: 18px; }
.sheet p { margin: 0; color: var(--muted); }
.sheet .code { margin-top: 8px; font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); }
.acc-btn { display: block; width: 100%; margin-top: 10px; border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 12px; cursor: pointer; text-align: left; }
.acc-btn small { color: var(--muted); display: block; }

.native { padding: 24px 16px; text-align: center; }
.native .tag { display: inline-block; font-size: 11px; color: var(--muted); border: 1px dashed var(--border); border-radius: 8px; padding: 2px 8px; margin-bottom: 12px; }
.product { background: #fff; border-radius: 16px; padding: 16px; text-align: left; }
.product img { width: 100%; height: 200px; object-fit: contain; }
.product .vendor { color: var(--muted); font-size: 13px; margin-top: 8px; }
.product .price { font-size: 24px; font-weight: 800; margin-top: 6px; }

/* ——— браузер ——— */
.browser {
  width: 100%; max-width: 1100px; height: 800px;
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  display: flex; flex-direction: column;
}
.btabs { display: flex; gap: 2px; background: #dfe3e8; padding: 8px 8px 0; }
.btab { display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 7px 12px; border-radius: 9px 9px 0 0; background: #cfd4da; font-size: 12px; cursor: pointer; border: 0; }
.btab.on { background: #fff; }
.btab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btab i { font-style: normal; color: var(--muted); }
.burl { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.burl button { border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.burl div { flex: 1; background: #f1f3f5; border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bviews { position: relative; flex: 1; min-height: 0; }
.bview { position: absolute; inset: 0; overflow: auto; background: #fff; display: flex; flex-direction: column; }

.site-head { display: flex; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.logo { font-weight: 900; font-size: 20px; color: var(--accent-deep); letter-spacing: -0.5px; }
.logo span { color: var(--orange); }
.search { flex: 1; background: #f1f3f5; border-radius: 10px; padding: 8px 14px; color: var(--muted); font-size: 13px; }
.site-body { padding: 20px 24px 40px; max-width: 1000px; width: 100%; margin: 0 auto; }
.crumbs { color: var(--muted); font-size: 12px; }
.site-body h1 { margin: 6px 0 18px; font-size: 26px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.sgrid .gcard { cursor: default; border: 1px solid var(--border); box-shadow: none; }
.sgrid .play { margin-top: 10px; padding: 10px; font-size: 14px; }
.reward-page { max-width: 460px; margin: 30px auto; text-align: center; }
.reward-page .icon { font-size: 52px; }
.reward-page h2 { margin: 10px 0 6px; }
.reward-page p { color: var(--muted); margin: 0; }
.reward-page .code { margin-top: 10px; font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); }

@media (max-width: 980px) {
  .layout { flex-direction: column; }
  .panel { width: 100%; height: 420px; }
}
